From claude-gen
Generate project structure, documentation (PRD/SRS/UI Mockup), and code from a requirements file
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-gen:generateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Raw arguments: `$ARGUMENTS`
Raw arguments: $ARGUMENTS
Parse $ARGUMENTS to extract:
--phase <name> where <name> is one of: init, docs, codeExamples:
/claude-gen:generate requirements.md → full pipeline
/claude-gen:generate requirements.md --phase init → Phase 1 only
/claude-gen:generate requirements.md --phase docs → Phase 2 only
/claude-gen:generate requirements.md --phase code → Phase 3 only
If no --phase flag is provided → run the full pipeline (all 3 phases sequentially).
.generated/analysis/ and .generated/docs/ directories if they don't exist--phase is provided, verify it is one of init, docs, code. Otherwise STOP with error.Before each phase, create a safety checkpoint.
# Checkpoint: save current state before making changes
git add -A 2>$null; if ($?) { git stash push -m "claude-gen-checkpoint: before <phase-name> -- $(Get-Date -Format o)" 2>$null }
If a phase fails (agent reports error or required output files are missing):
# Rollback: restore state from before the failed phase
git stash pop 2>$null
If a phase succeeds, drop the stash:
# Success: discard the checkpoint stash
git stash drop 2>$null
After the final successful phase, create a commit:
git add -A 2>$null; if ($?) { git commit -m "claude-gen: generated from <requirements-filename>" 2>$null }
# Checkpoint: save current state before making changes
git add -A && git stash push -m "claude-gen-checkpoint: before <phase-name> — $(date -Iseconds)" 2>/dev/null || true
# Rollback on failure
git stash pop 2>/dev/null || true
# Success: drop checkpoint
git stash drop 2>/dev/null || true
# Final commit
git add -A && git commit -m "claude-gen: generated from <requirements-filename>" 2>/dev/null || true
Note: All git commands gracefully handle cases where git is not initialized or the working directory is not a git repo. Choose the command set appropriate for your operating system.
--phase value | Phases to run |
|---|---|
| (not set) | Phase 1 → Phase 2 → Phase 3 |
init | Phase 1 only |
docs | Phase 2 only |
code | Phase 3 only |
Execute phases sequentially. Each phase MUST complete before starting the next.
Skip condition: Only run if --phase is init or not set.
Git checkpoint: Create checkpoint before starting.
Delegate to the init-explorer subagent with the following context:
REQUIREMENTS FILE: <requirements-file-path>
TASK: Analyze the existing codebase (if any) or initialize a new project structure based on the requirements.
OUTPUT TO: .generated/analysis/
Post-phase validation:
.generated/analysis/project-overview.md exists.generated/analysis/tech-stack.md exists.generated/analysis/conventions.md exists.generated/analysis/manifest.json exists and status is "complete" or "partial"If ANY check fails → rollback and STOP with error listing which files are missing.
If ALL checks pass → drop checkpoint stash and proceed.
Skip condition: Only run if --phase is docs or not set.
Pre-phase validation (when running standalone with --phase docs):
.generated/analysis/manifest.json exists with valid status"Phase 2 requires completed Phase 1. Run: /claude-gen:generate <file> --phase init"Git checkpoint: Create checkpoint before starting.
Delegate to the gen-doc subagent with the following context:
REQUIREMENTS FILE: <requirements-file-path>
ANALYSIS DIR: .generated/analysis/
OUTPUT TO: .generated/docs/
TEMPLATES DIR: templates/
TASK: Generate PRD, SRS, UI Mockups (per screen), and API Contracts based on requirements + project analysis.
Post-phase validation:
.generated/docs/PRD.md exists.generated/docs/SRS.md exists.generated/docs/manifest.json exists and status is "complete" or "partial".generated/docs/ui-mockups/.generated/docs/api-contracts/If ANY of checks 1-3 fail → rollback and STOP with error. If checks 4-5 fail → WARN but continue (some projects may be FE-only or BE-only).
If critical checks pass → drop checkpoint stash and proceed.
Skip condition: Only run if --phase is code or not set.
Pre-phase validation (when running standalone with --phase code):
.generated/analysis/manifest.json exists with valid status.generated/docs/manifest.json exists with valid status"Phase 3 requires completed Phase 1 and 2. Run: /claude-gen:generate <file> --phase init then --phase docs"Git checkpoint: Create checkpoint before starting.
Delegate to the gen-code subagent with the following context:
REQUIREMENTS FILE: <requirements-file-path>
ANALYSIS DIR: .generated/analysis/
DOCS DIR: .generated/docs/
TASK: Generate implementation code based on PRD, SRS, UI Mockups, and API Contracts. Follow existing codebase conventions.
Wait for completion. Drop checkpoint stash on success.
Post-phase: Create final git commit:
git add -A && git commit -m "claude-gen: generated from <requirements-filename>" 2>/dev/null || true
After all executed phases complete, provide a summary:
.generated/docs/ with their purposes.generated/docs/manifest.json → assumptionsFormat the summary as a clean markdown table or bullet list.
npx claudepluginhub tductam/code-gen --plugin claude-genInitializes projects: detects existing code, questions for requirements, researches via subagents, scopes needs, generates roadmap.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.