Initialize a SpecForge project with tech stack selection
Initialize a new SpecForge project by selecting your backend framework, database, and codegen pipeline. This interactive setup creates the complete project structure, installs compatible plugins, and configures Docker for local development.
/plugin marketplace add claude-market/marketplace/plugin install claude-market-specforge-specforge@claude-market/marketplaceInitialize a new SpecForge project by selecting your tech stack and configuring the development environment.
SpecForge uses a three-plugin architecture:
This initialization command will guide you through selecting compatible plugins for your stack.
Search the Claude Market marketplace for available SpecForge plugins:
curl -s https://api.github.com/repos/claude-market/marketplace/contents/ | jq -r '.[] | select(.type == "dir" and (.name | startswith("specforge-"))) | .name'
Parse the results to categorize plugins:
specforge-backend-* - Backend framework pluginsspecforge-db-* - Database pluginsspecforge-generate-* - Codegen pipeline pluginsspecforge-frontend-* - Frontend plugins (optional)Look for existing OpenAPI specification in common locations:
# Check for OpenAPI spec
find . -maxdepth 3 -name "openapi.yaml" -o -name "openapi.json" -o -name "api.yaml"
Common locations:
spec/openapi.yamlspec/openapi.jsonapi/openapi.yamlopenapi.yamlIf not found, offer to:
Use the AskUserQuestion tool to present available stacks in an interactive way.
Present available backend plugins discovered in Step 1. For each option, show:
Example options:
Filter database plugins based on backend selection compatibility. Show:
Example options:
Filter codegen plugins compatible with both backend and database selections. Show:
Example options:
Present frontend plugins if user wants full-stack:
Create the standard SpecForge directory structure:
mkdir -p spec backend frontend docker tests migrations
Directory structure:
project/
├── spec/
│ └── openapi.yaml # OpenAPI specification
├── migrations/ # Database migrations
│ └── 001_initial.sql
├── backend/ # Backend code
├── frontend/ # Frontend code (if selected)
├── docker/ # Docker configs
│ └── docker-compose.yml
├── tests/ # Integration tests
├── CLAUDE.md # SpecForge configuration
└── README.md
For each selected plugin, use the /plugin install command:
# Install the three required plugins
/plugin install specforge-backend-{technology}-{framework}
/plugin install specforge-db-{database}
/plugin install specforge-generate-{technology}-{database}
# Optional: Install frontend plugin
/plugin install specforge-frontend-{framework}-{variant}
Note: These commands should be executed by Claude Code, not in bash.
Delegate to each plugin's setup skill to initialize project files:
Invoke the backend plugin's initialization skill:
Use the {backend-plugin}/setup skill to:
- Generate project scaffold (Cargo.toml, package.json, etc.)
- Create main application entry point
- Set up basic routing structure
- Configure build tools
- Create Dockerfile template
Invoke the database plugin's initialization skill:
Use the {database-plugin}/setup skill to:
- Create initial migration file
- Set up migration tooling
- Configure database connection
- Add to docker-compose.yml
- Create health check scripts
Invoke the codegen plugin's initialization skill:
Use the {codegen-plugin}/setup skill to:
- Create codegen configuration (sql-gen.toml, prisma.schema, etc.)
- Set up build integration
- Configure output directories
- Add compile-time verification
If frontend was selected:
Use the {frontend-plugin}/setup skill to:
- Initialize frontend project
- Generate API client from OpenAPI spec
- Set up routing and state management
- Configure build tools
- Add to docker-compose.yml
Aggregate Docker configurations from all plugins into a unified docker-compose.yml:
version: "3.8"
services:
# From database plugin
db:
image: { database-image }
environment:
# Database-specific env vars
volumes:
- db-data:/var/lib/db
healthcheck:
test: { database-health-check }
interval: 5s
timeout: 5s
retries: 5
# From backend plugin
api:
build: ./backend
ports:
- "3000:3000"
environment:
DATABASE_URL: { database-connection-string }
depends_on:
db:
condition: service_healthy
volumes:
- ./backend:/app
- /app/target # For build caching
# From frontend plugin (if selected)
web:
build: ./frontend
ports:
- "5173:5173"
environment:
VITE_API_URL: http://localhost:3000
volumes:
- ./frontend:/app
- /app/node_modules
volumes:
db-data:
If no OpenAPI spec exists, create a minimal starter:
openapi: 3.1.0
info:
title: My API
version: 1.0.0
description: API built with SpecForge
servers:
- url: http://localhost:3000
description: Local development
paths:
/health:
get:
summary: Health check
description: Returns API health status
responses:
"200":
description: API is healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
components:
schemas:
Error:
type: object
required:
- error
- message
properties:
error:
type: string
description: Error code
message:
type: string
description: Human-readable error message
Update or create CLAUDE.md with SpecForge configuration:
## SpecForge Configuration
**Stack Selection:**
- Backend: {technology}-{framework}
- Database: {database}
- Codegen: {technology}-{database}
- Frontend: {framework}-{variant} (optional)
**Installed Plugins:**
- specforge-backend-{technology}-{framework}
- specforge-db-{database}
- specforge-generate-{technology}-{database}
- specforge-frontend-{framework}-{variant} (optional)
**Project Structure:**
- OpenAPI Spec: `spec/openapi.yaml`
- Database Migrations: `migrations/`
- Backend Code: `backend/`
- Frontend Code: `frontend/` (optional)
**Development:**
- Start all services: `docker-compose up -d`
- View logs: `docker-compose logs -f`
- Stop services: `docker-compose down`
**SpecForge Workflow:**
1. Edit `spec/openapi.yaml` to define API endpoints
2. Run `/specforge:plan` to generate implementation plan
3. Run `/specforge:build` to generate code and implement handlers
4. Run `/specforge:test` to run test suite
5. Run `/specforge:validate` to validate everything works
6. Run `/specforge:ship` to prepare for deployment
Provide the user with:
Installation Summary:
Files Created:
Next Steps:
1. Review/edit your OpenAPI spec: spec/openapi.yaml
2. Define your database schema: migrations/001_initial.sql
3. Start development environment: docker-compose up -d
4. Generate implementation plan: /specforge:plan
5. Build your application: /specforge:build
Quick Start Commands:
# Start all services
docker-compose up -d
# Check service health
docker-compose ps
# View API logs
docker-compose logs -f api
# Run migrations
docker-compose exec api {migration-command}
If a plugin is not available in the marketplace:
If user selects incompatible plugins:
If project files already exist: