TypeScript stack scaffolding & enforcement CLI for TanStack Start + Convex
npm install ai-forge-cliTypeScript stack scaffolding & enforcement CLI for TanStack Start + Convex + Tailwind.
The key insight: Claude Code reads CLAUDE.md automatically. Forge uses this as a hook — imperative instructions that tell Claude it MUST use the forge CLI commands. No more AI drift.
``bash`
npm install -g forge-cli
Or use with npx:
`bash`
npx forge-cli init my-app
Creates a complete project with:
- TanStack Start (file-based routing, SSR-ready)
- Convex (real-time database)
- Tailwind CSS + shadcn/ui ready
- Biome (linting/formatting)
- TypeScript strict mode
- CLAUDE.md — the AI hook
`bash`
forge init my-app
cd my-app
pnpm install
npx convex dev --once --configure=new
pnpm dlx shadcn@latest init
pnpm dev
Creates a full vertical slice:
`
convex/features/
├── schema.ts # Table definition (exports
├── queries.ts # All queries
├── mutations.ts # All mutations
└── index.ts # Barrel export
src/features/
├── components/
│ └── index.ts # Component exports
├── hooks.ts # Feature hooks
└── index.ts # Barrel export
app/routes/
├── index.tsx # List view
└── $id.tsx # Detail view
`
Also auto-registers the schema in convex/schema.ts.
`bash
forge add:feature projects
$3
Validates project structure. Fails if rules are broken. Use in CI/pre-commit.
`bash
forge checkOutput:
✓ Feature structure valid
✓ Component locations valid
✓ Hook locations valid
✓ Thin routes valid
✓ Cross-feature imports valid
✓ Feature parity validAll checks passed!
`Validation Rules
1. Feature structure — Every feature has required files
2. Component location — Components only in
src/features/*/components/ or src/components/
3. Hook location — Hooks only in src/features/*/hooks.ts or src/hooks/
4. Thin routes — Route files can only import from features/components, no business logic
5. No cross-feature imports — src/features/X/ cannot import from src/features/Y/
6. Feature parity — Every src/features/X has matching convex/features/XThe CLAUDE.md Hook
When you run
forge init, it generates a CLAUDE.md file that instructs Claude Code to:1. Always run
forge add:feature before building any feature
2. Never create feature files manually
3. Always run forge check before completing any taskThis eliminates AI drift and enforces consistent architecture.
`markdown
From generated CLAUDE.md
YOU MUST USE FORGE CLI
When the user asks you to build ANY feature, you MUST:
1. FIRST run
forge add:feature
2. THEN fill in the generated files
3. NEVER create feature files manually
`Project Structure
`
app/routes/ → Thin route files (import from features, no logic)
src/features/ → All feature code (components, hooks, types)
src/components/ → Shared UI only (used across features)
src/lib/ → Pure utilities
convex/features/ → Backend mirrors frontend features
``- Frontend: TanStack Start
- Backend: Convex
- Styling: Tailwind CSS + shadcn/ui
- Linting: Biome
- Language: TypeScript (strict)
MIT