7-stage TDD-first workflow for Claude Code
npx skills add https://github.com/harshanandak/forge --skill sonarcloud-analysisInstallez cette compétence avec la CLI et commencez à utiliser le flux de travail SKILL.md dans votre espace de travail.
Ship features with confidence using a 7-stage TDD-first workflow for AI coding agents.
/plan → /dev → /validate → /ship → /review → /premerge → /verify
✅ TDD-First: Write tests before code
✅ Design-First: One-question-at-a-time Q&A captures intent upfront
✅ Multi-Agent: Universal AGENTS.md works with 8 agents
Adding a login button with Forge:
/plan login-button # Design Q&A → research → branch + task list
/dev # TDD: RED → GREEN → REFACTOR cycles
/validate # Type check + lint + tests + security scan
/ship # Create PR with full documentation
Result: Feature shipped with tests, security validated, fully documented.
Without Forge (chaotic):
With Forge (systematic):
→ See complete walkthrough in QUICKSTART.md
# Step 1: Install the package (as dev dependency)
bun add -D forge-workflow
# Step 2: Setup for your AI agent
bunx forge setup
That's it! Forge will:
Prerequisites: Node.js, Git, GitHub account
Optional tools: Beads (issue tracking)
| Flag | Description |
|---|---|
--agents=<list> |
Comma-separated agents to set up (e.g., --agents=claude,cursor) |
--all |
Set up all supported agents |
--dry-run |
Preview what setup would do without writing files |
--non-interactive |
Skip all prompts (use defaults). Auto-enabled when CI=true |
--symlink |
Create CLAUDE.md as a symlink to AGENTS.md instead of a copy |
--sync |
Enable Beads GitHub sync (scaffolds workflow + PAT) |
--verbose |
Show file-by-file detail instead of summary |
--force |
Overwrite existing files even if content matches |
→ Detailed setup guide for all agents
| Stage | Command | Purpose |
|---|---|---|
| utility | /status |
Ranked issue dashboard with conflict detection |
| 1. Plan | /plan |
Design Q&A → research → branch + task list |
| 2. Dev | /dev |
Subagent TDD per task (spec + quality review) |
| 3. Validate | /validate |
Validate: types, lint, tests, security |
| 4. Ship | /ship |
Create PR with documentation |
| 5. Review | /review |
Address ALL PR feedback (Greptile, reviewers, CI/CD) |
| 6. Premerge | /premerge |
Complete docs on feature branch, hand off PR |
| 7. Verify | /verify |
Post-merge health check (CI on main) |
Full workflow guide: AGENTS.md
Works with 8 AI coding agents via universal AGENTS.md:
| Agent | Features | Setup Time |
|---|---|---|
| Claude Code | Custom slash commands, .claude/ directory | 30 seconds |
| GitHub Copilot | Enterprise support, .github/copilot-instructions.md | 30 seconds |
| Kilo Code | Auto failure recovery, .kilo.md | 30 seconds |
| Cursor | Native modes (Plan/Ask/Debug), .cursor/rules/ | 30 seconds |
| Codex CLI | OpenAI terminal agent, AGENTS.md | 30 seconds |
| Agent | Features | Setup Time |
|---|---|---|
| OpenCode | Flexible, opencode.json | 30 seconds |
| Goose | Model flexibility, open-source | 30 seconds |
Quick setup (auto-detects agents):
bunx forge setup
Setup for specific agent:
bunx forge setup --agent=copilot # GitHub Copilot
bunx forge setup --agent=cursor # Cursor IDE
bunx forge setup --agent=kilo # Kilo Code
bunx forge setup --agent=codex # Codex CLI
Setup for all Tier 1 agents:
bunx forge setup --all
→ Agent-specific setup instructions
Tests are written BEFORE code, every single time:
No feature ships without tests. Period.
AI researches best practices before you write a line of code:
Saves hours of debugging and refactoring later.
One workflow, works with ALL major AI agents:
AGENTS.md file (universal standard)Switch agents anytime without changing your workflow.
Git hooks automatically enforce TDD practices:
# Validation CLI
forge-preflight status # Check project prerequisites
forge-preflight dev # Validate before /dev stage
forge-preflight ship # Validate before /ship stage
Curated plugin catalog across 7 workflow stages — plan, dev, validate, ship, review, and more:
bunx forge recommend # Recommendations for your project
bunx forge recommend --budget free # Only free tools
→ Validation docs | Plugin docs
Smart setup that adapts to your project:
Intelligent File Merging
bunx forge setup --merge=smart # Intelligent merge
Auto-Detection
.forge/context.jsonWorkflow Profiles (planned — not yet wired into setup)
critical: Full 8-stage workflow (auth, payments, security-sensitive)standard: 7-stage workflow (typical features)refactor: Behavior-preserving 5-stage workflowsimple: Streamlined 4-stage workflowhotfix: Minimal 3-stage workflow (production fixes)docs: Minimal 3-stage workflow (documentation/config)bunx forge setup --type=critical # Set workflow manually
Context Interview (optional)
bunx forge setup --interview # Gather project context
Multi-layer quality enforcement before merge:
Greptile AI Code Review
# Branch protection requires Greptile review to pass
# Typically completes in 1-2 minutes
GitHub Actions Workflows
Git Hooks (Lefthook)
Forge integrates with powerful tools:
┌──────────────────────────────────────────────┐
│ FORGE TOOLCHAIN │
├──────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ BEADS │ │ GITHUB │ │
│ │ Issue │ │ PR │ │
│ │ Tracking │ │ Workflow │ │
│ └──────────┘ └──────────┘ │
│ │ │ │
│ └──────────────────────────────┘ │
│ │ │
│ ┌─────▼─────┐ │
│ │ FORGE │ │
│ │ 7-Stage │ │
│ │ Workflow │ │
│ └───────────┘ │
│ │
└──────────────────────────────────────────────┘
All tools are optional - Forge works standalone.
Beads (optional): Git-backed issue tracking that survives context clearing
bun add -g @beads/bd && bd init
GitHub CLI (recommended): Required for PR workflow
gh auth login
Task: Add a health check endpoint
/plan health-check-endpoint # Design Q&A → research → branch + task list
/dev # 8 min: TDD implementation
/validate # 2 min: All validations pass
/ship # 2 min: PR created
# → Greptile AI review completes (~2 min)
/review # 3 min: Address Greptile feedback
/premerge # 2 min: Complete docs, hand off PR
Task: Fix SQL injection vulnerability
/plan sql-injection-fix # Design Q&A → OWASP research → branch
/dev # 8 min: Fix + tests
/validate # 3 min: Security scan
/ship # 2 min: PR with security notes
# → Greptile validates security fix (~2 min)
/review # 5 min: Address security feedback
/premerge # 3 min: Complete docs, hand off PR
Task: Add authentication system
/plan user-authentication # Design Q&A → deep research → branch
/dev # 1-2 days: TDD implementation
/validate # 30 min: Full validation
/ship # 15 min: PR with docs
/review # Varies: Address feedback
/premerge # 15 min: Complete docs, hand off PR
/verify # 15 min: Post-merge health check
→ More examples in docs/EXAMPLES.md
TDD-First: Tests before code, always
Design-First: One-question-at-a-time Q&A captures intent before research
Security Built-In: OWASP Top 10 for every feature
Documentation Progressive: Update at each stage
Multi-Session: Work persists across sessions
→ Read the philosophy in AGENTS.md
📚 New to Forge?
→ QUICKSTART.md - Your first feature in 5 minutes
📖 Learn the workflow
→ AGENTS.md - Complete guide with examples
🛠️ Setup the toolchain
→ docs/TOOLCHAIN.md - Beads, GitHub CLI
🎯 See real examples
→ docs/EXAMPLES.md - Real-world use cases
💬 Have questions?
→ GitHub Discussions
🐛 Found a bug?
→ GitHub Issues
# Forge commands
/status # Check current context
/plan <feature> # Design Q&A → research → branch + task list
/dev # TDD development
/validate # Validate everything
/ship # Create PR
/review <pr> # Address feedback
/premerge <pr> # Complete docs, hand off PR
/verify # Post-merge health check
# Issue commands (via Forge)
bd init # Initialize Beads tracking
forge ready # Find ready work
forge create "title" # Create issue
forge update <id> --status X # Update status
forge sync # Sync Beads state
For advanced Beads operations that Forge does not wrap yet, use bd directly for
bd comments, bd dep, and bd dolt.
Forge is the preferred command surface for routine workflows, but Beads (bd)
remains the underlying source of truth for issue state and IDs.
MIT © Harsha Nandak
Ready to start?
bun add -D forge-workflow
bunx forge setup
/status
Then open QUICKSTART.md and ship your first feature! 🚀