fireact-builder
Helps customize and extend Fireact SaaS apps after installation. Auto-detects Fireact projects by checking for @fireact.dev/app in package.json. Invoke when the user wants to add features, pages, custom components, navigation, branding, Cloud Functions, or i18n.
git clone https://github.com/fireact-dev/main
T=$(mktemp -d) && git clone --depth=1 https://github.com/fireact-dev/main "$T" && mkdir -p ~/.claude/skills && cp -r "$T/create-fireact-app/templates/.claude/skills/fireact-builder" ~/.claude/skills/fireact-dev-main-fireact-builder && rm -rf "$T"
create-fireact-app/templates/.claude/skills/fireact-builder/SKILL.mdFireact Builder — Post-Installation Customization Skill
You help developers customize and extend their Fireact SaaS apps via natural language. This skill covers adding pages, replacing components, customizing navigation, branding, Cloud Functions, Firestore collections, and i18n.
1. Project Detection
Before doing anything, confirm this is a Fireact project:
- Check
forpackage.json
in dependencies@fireact.dev/app - Check
existssrc/config/app.config.json - Check
imports fromsrc/App.tsx@fireact.dev/app
If any check fails, tell the user this doesn't appear to be a Fireact project and suggest running
npx create-fireact-app first.
2. State Reading Protocol
MUST read these files before making any changes to understand the current project state:
| File | What to learn |
|---|---|
| Current routing, imports, which components are local vs from |
| Route paths, permissions, settings |
| Subscription plans |
| Existing translation keys |
(list files) | Existing custom components |
| Existing Cloud Functions |
| Existing security rules |
3. Customization Playbooks
A. Add New Subscription Page
Use when the user wants a page scoped to a subscription (e.g., "add a reports page", "add an analytics page").
Steps:
-
Create component at
:src/components/<PageName>.tsx- Import
,useSubscription
,useConfig
fromuseTranslation@fireact.dev/app - Handle loading state (spinner) and error state (redirect to home)
- Use TailwindCSS for styling — no inline styles
- See
for templatereferences/component-patterns.md
- Import
-
Add route key to
undersrc/config/app.config.json
:pages"<pageName>": "/subscription/:id/<slug>" -
Add route in
inside thesrc/App.tsx
route block:SubscriptionProvider > SubscriptionLayout<Route path={appConfig.pages.<pageName>} element={ <ProtectedSubscriptionRoute requiredPermissions={['access']}> <PageName /> </ProtectedSubscriptionRoute> } /> -
Add import at top of
:src/App.tsximport PageName from './components/PageName'; -
Add i18n keys to
(and other language files)src/i18n/en.ts -
Optionally add to navigation menu (see Playbook E)
B. Add New Authenticated Page
Use when the user wants a page that requires login but is not scoped to a subscription (e.g., "add an API keys page", "add a settings page").
Steps:
-
Create component at
:src/components/<PageName>.tsx- Import
,useAuth
fromuseConfig@fireact.dev/app - See
for templatereferences/component-patterns.md
- Import
-
Add route key to
undersrc/config/app.config.json
:pages"<pageName>": "/<slug>" -
Add route inside
block inAuthenticatedLayout
:src/App.tsx<Route path={appConfig.pages.<pageName>} element={<PageName />} /> -
Add import and translations
C. Add New Public Page
Use when the user wants a page that doesn't require login (e.g., "add a landing page", "add a pricing page").
Steps:
-
Create component at
src/components/<PageName>.tsx -
Add route inside
block inPublicLayout
:src/App.tsx<Route path="/<slug>" element={<PageName />} /> -
Add translations
D. Replace/Customize Existing Component
Use when the user wants to change an existing component from
@fireact.dev/app (e.g., "customize the sign-in page", "change the dashboard").
Steps:
-
Identify which
component to replace (see@fireact.dev/app
for the full export list)references/component-patterns.md -
Create local version at
maintaining the same hook/context contract as the originalsrc/components/<ComponentName>.tsx -
Change import in
:src/App.tsx- Remove the component from the
destructured import@fireact.dev/app - Add a local import:
import ComponentName from './components/ComponentName';
- Remove the component from the
-
Reference
for the expected patterns of each component typereferences/component-patterns.md
E. Customize Navigation
Use when the user wants to add, remove, or reorder navigation items.
Steps:
-
Create custom menu components (e.g.,
andsrc/components/CustomSubscriptionDesktopMenu.tsx
)CustomSubscriptionMobileMenu.tsx -
Follow the pattern:
,useLocation
,useTranslation
,useSubscription
,useConfighasPermission() -
Path replacement: use
for subscription paths.replace(':id', subscription?.id || '') -
Sidebar width classes:
— hide text when sidebar collapsed[.w-20_&]:hidden
— add margin for icon when sidebar expanded[.w-64_&]:mr-4
— center icon when sidebar collapsed[.w-20_&]:mx-auto
-
Swap imports in
layout props:src/App.tsx- Remove
/SubscriptionDesktopMenu
fromSubscriptionMobileMenu
import@fireact.dev/app - Import custom versions
- Pass to
SubscriptionLayout
anddesktopMenu
propsmobileMenu
- Remove
See
references/navigation-customization.md for full reference.
F. Customize Branding & Theme
Use when the user wants to change colors, fonts, or logo.
Steps:
-
Modify
for custom colors/fonts:tailwind.config.jstheme: { extend: { colors: { primary: { /* custom palette */ } } } } -
Modify
for global stylessrc/index.css -
Create custom Logo component at
and import locally insrc/components/Logo.tsxApp.tsx -
SubscriptionLayout supports these props for nav theming:
— CSS class for nav background (e.g.,navBackgroundColor
)"bg-blue-900"
— CSS class for nav text (e.g.,navTextColor
)"text-blue-100"
G. Add Custom Cloud Functions
Use when the user wants to add backend logic.
Steps:
-
Create
:functions/src/<functionName>.tsimport { onCall } from 'firebase-functions/v2/https'; export const myFunction = onCall(async (request) => { // Access global config const config = global.saasConfig; // Your logic here return { success: true }; }); -
Access
for permissions, plans, Stripe keysglobal.saasConfig -
Export from
:functions/src/index.tsexport { myFunction } from './<functionName>'; -
Call from frontend:
import { httpsCallable } from 'firebase/functions'; const config = useConfig(); const myFunction = httpsCallable(config.functions, 'myFunction'); const result = await myFunction({ /* data */ }); -
Build:
cd functions && npm run build
See
references/cloud-functions-patterns.md for detailed patterns.
H. Add Firestore Collections & Custom Data
Use when the user wants to store and retrieve custom data.
Steps:
-
Use Firestore SDK with
fromconfig.db
:useConfig()import { collection, doc, getDocs, addDoc } from 'firebase/firestore'; const config = useConfig(); // Read const snapshot = await getDocs(collection(config.db, 'subscriptions', subscriptionId, 'myCollection')); // Write await addDoc(collection(config.db, 'subscriptions', subscriptionId, 'myCollection'), { ... }); -
Add security rules to
following existing patterns:firestore.rulesmatch /subscriptions/{docId}/myCollection/{docId2} { allow read: if request.auth != null && get(/databases/$(database)/documents/subscriptions/$(docId)).data.permissions.access.hasAny([request.auth.uid]); allow write: if request.auth != null && get(/databases/$(database)/documents/subscriptions/$(docId)).data.permissions.admin.hasAny([request.auth.uid]); } -
Build components that read/write data using the patterns in
references/component-patterns.md
4. Key Conventions (Always Follow)
- i18n: Use
withuseTranslation()
for ALL user-facing strings. Never hardcode display text.t('key') - Loading/error states: Always handle in subscription components — show spinner while loading, redirect on error.
- TailwindCSS only: No inline styles. Use Tailwind utility classes.
- Route config: Always add route key to
when adding a page.src/config/app.config.json - Subscription route protection: Always wrap subscription routes in
.<ProtectedSubscriptionRoute requiredPermissions={[...]}> - Subscription URL pattern: Paths follow
./subscription/:id/<slug> - Verify after changes: Run
andnpm run build
to confirm no errors.cd functions && npm run build
5. References
For detailed API documentation and code templates, see:
- Hooks & Contexts API — All hooks, their return types, and exported TypeScript types
- Routing Patterns — Three route groups, ProtectedSubscriptionRoute, config mapping
- Component Patterns — Templates for subscription, authenticated, and public pages
- Navigation Customization — Menu component patterns, SubscriptionLayout props
- Cloud Functions Patterns — Backend function templates, global config, frontend calling