From forge
Generate CLAUDE.md and a complete `.claude/` ecosystem by scanning the user's codebase.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge:setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate CLAUDE.md and a complete `.claude/` ecosystem by scanning the user's codebase.
Generate CLAUDE.md and a complete .claude/ ecosystem by scanning the user's codebase.
Run these 9 phases in order. Do NOT skip phases. Do NOT ask unnecessary questions — scan silently and confirm once.
CLAUDE.md already exists in the project root..claude/ folder exists, warn: "Existing .claude/ folder found. Existing files will be preserved unless you choose overwrite."Scan the project WITHOUT asking the user anything. Read these files silently:
Package Detection:
package.json — dependencies, devDependencies, scripts*.csproj — .NET projects, NuGet packages, target frameworkcomposer.json, Cargo.toml, go.mod — other ecosystemsFramework Detection:
next.config.* — Next.js (check version in package.json)remix.config.* or vite.config.* with @remix-run — Remixvite.config.* — Vite (check for React plugin)angular.json — AngularStyling:
tailwind.config.* or @tailwind in CSS files — Tailwind (check v3 vs v4)app.css or globals.css — look for @theme (Tailwind v4) or @applyDesign Tokens:
@theme block in CSS — extract custom properties (--color-*, --spacing-*, --font-*)tailwind.config.js theme.extend — extract token definitions:rootBackend:
*.csproj with Microsoft.AspNetCore — ASP.NET CoreProgram.cs, Startup.cs — .NET entry pointsappsettings.json — connection strings, JWT configDatabase:
Microsoft.EntityFrameworkCore in csproj — EF CoreDapper in csproj — DapperDbContext files — database modelsInfrastructure:
Dockerfile, docker-compose.yml.github/workflows/ — CI/CDfly.toml, vercel.json, render.yamlLinter:
biome.json or biome.jsonc — Biome.eslintrc* — ESLint.prettierrc* — Prettieri18n:
next-intl, react-intl, i18next in dependenciesmessages/ or locales/ folders[locale] in Next.js app router pathsCMS:
sanity.config.* or @sanity in dependencies — Sanitycontentful in dependencies — Contentfulstrapi — StrapiAuth:
firebase or firebase-admin in dependencies — Firebase Authnext-auth or @auth/core — NextAuthJwtBearer, AddAuthentication)Use the detection rules from ${CLAUDE_PLUGIN_ROOT}/references/scan-patterns.md for complete patterns.
Build an internal ScanResult object:
{
frontend: { framework, version, styling, designTokens, linter, i18n, cms, auth },
backend: { framework, version, database, orm, auth },
infrastructure: { docker, ci, deploy },
projectType: "portfolio" | "marketplace" | "saas" | "ecommerce" | "api-only" | "unknown"
}
Present the scan results to the user in a compact table:
## Detected Stack
| Layer | Technology | Version |
|-------|-----------|---------|
| Frontend | Next.js | 16.x |
| Styling | Tailwind CSS | v4 |
| Language | TypeScript | strict |
| Linter | Biome | 1.x |
| Backend | ASP.NET Core | .NET 10 |
| Database | MSSQL | EF Core + Dapper |
| Auth | JWT | Bearer |
| Deploy | Docker | Fly.io |
**Detected project type:** Portfolio
Is this correct? (yes / edit)
If the user says "edit", let them correct any values. Otherwise proceed.
${CLAUDE_PLUGIN_ROOT}/references/archetypes/{projectType}.mdprojectType is "unknown", ask the user to pick from: Portfolio, Marketplace, SaaS, E-Commerce, API-OnlyPresent three selection lists. Each item has a checkbox. Pre-select the recommended items based on scan results.
Primitives (from ${CLAUDE_PLUGIN_ROOT}/references/primitives/frontend.md and backend.md):
Agents (from ${CLAUDE_PLUGIN_ROOT}/references/agents/frontend.md and backend.md):
Skills (from ${CLAUDE_PLUGIN_ROOT}/references/skills/catalog.md):
Format:
## Select Primitives
- [x] TAILWIND_FIRST — Utility-first CSS, no @apply in components
- [x] TYPESCRIPT_STRICT — Strict mode, no any, explicit return types
- [ ] DESIGN_TOKENS — CSS custom properties from @theme
- [x] GIT_RULES — Conventional commits, branch naming
...
Add or remove? (proceed / edit)
Generate all files using the templates and selections:
1. CLAUDE.md (project root)
${CLAUDE_PLUGIN_ROOT}/templates/claude-md.md{{PLACEHOLDER}} values from scan results2. .claude/primitives/ (one file per selected primitive)
.md with the primitive's rules and examples3. .claude/agents/ (one file per selected agent)
.md with the agent's role, capabilities, and constraints4. .claude/skills/ (one file per selected skill)
SKILL.md in each skill's folder5. .claude/prompts/ (standard prompts based on stack)
new-component.md — if React detectednew-page.md — if React + router detectednew-hook.md — if React detectednew-api-endpoint.md — if backend detectednew-migration.md — if database detectedAfter generating, show a tree of created files:
Created:
CLAUDE.md
.claude/
├── primitives/
│ ├── TAILWIND_FIRST.md
│ ├── TYPESCRIPT_STRICT.md
│ └── GIT_RULES.md
├── agents/
│ ├── ui-developer.md
│ └── code-reviewer.md
├── skills/
│ ├── tailwind-v4/SKILL.md
│ └── explain-code/SKILL.md
└── prompts/
├── new-component.md
└── new-page.md
Based on the project type, recommend companion plugins from ${CLAUDE_PLUGIN_ROOT}/references/plugins.md:
Format:
## Recommended Plugins
Based on your project type (Portfolio), these plugins complement Forge:
1. **market-lens** — Audit your product through Kotler's 4 marketing lenses.
Helps you think about your portfolio as a product, not just a website.
Install: `/plugin marketplace add shavidze/market-lens`
2. **cross-lens** — Cross-discipline analysis for deeper insights.
Install: `/plugin marketplace add shavidze/cross-lens`
Install any? (yes, list numbers / skip)
If the project has any personal configuration or unique patterns not covered by the standard primitives:
package.json.env.example to understand environment variablesworkspaces, turbo.json, nx.json)Add a ## Project-Specific Notes section to CLAUDE.md with any findings.
Print a final summary:
## Forge Setup Complete
- Generated: CLAUDE.md + {N} primitives, {N} agents, {N} skills, {N} prompts
- Project type: {archetype}
- Stack: {frontend} + {backend}
- Plugins recommended: {list}
Your Claude Code ecosystem is ready. Run `/forge:plan` to generate development plans.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub shavidze/forge --plugin forge