Claude-skill-registry bmad-planner
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/bmad-planner" ~/.claude/skills/majiayu000-claude-skill-registry-bmad-planner && rm -rf "$T"
skills/data/bmad-planner/SKILL.mdBMAD Planner
Purpose
Business Model, Architecture, and Design documentation created in main repository before feature development begins.
Now available as an interactive callable Python script - saves ~2,000-2,700 tokens per feature compared to manual reproduction.
When to Use
- Current directory: main repository (not worktree)
- Current branch:
contrib/<gh-user> - Phase: Planning (Phase 1)
Interactive Callable Tool
BMAD is now an interactive callable tool that runs as a Python script in the main repository.
Invocation
Command:
python .claude/skills/bmad-planner/scripts/create_planning.py \ <slug> <gh_user>
Arguments:
: Feature slug (e.g., my-feature)slug
: GitHub usernamegh_user
: Optional flag to skip git commit (for testing)--no-commit
Example:
# In main repo on contrib branch python .claude/skills/bmad-planner/scripts/create_planning.py \ my-feature stharrold
Interactive Session Flow
Session output:
Working in main repository... Branch: contrib/stharrold ====================================================================== BMAD Interactive Planning Tool ====================================================================== Creating planning documents for: my-feature GitHub user: stharrold Output directory: planning/my-feature ====================================================================== 🧠 BMAD Analyst Persona - Requirements Gathering ====================================================================== I'll help create the requirements document through interactive Q&A. ---------------------------------------------------------------------- What problem does this feature solve? > Add German vocabulary search by part of speech Who are the primary users of this feature? > German language learners [... continues with 5-10 questions ...] ✓ Requirements gathering complete! ====================================================================== 🏗️ BMAD Architect Persona - Technical Architecture Design ====================================================================== Based on the requirements, I'll design the technical architecture. ---------------------------------------------------------------------- Technology Stack: Web framework (if applicable)? 1) FastAPI 2) Flask 3) Django 4) None [default: None] > 4 [... continues with 5-8 questions ...] ✓ Architecture design complete! ====================================================================== 📋 BMAD PM Persona - Epic Breakdown ====================================================================== Analyzing requirements and architecture to create epic breakdown... ---------------------------------------------------------------------- ✓ Identified 3 epics: - E-001: Data Layer Foundation (Priority: P0, Medium complexity) - E-002: Core Business Logic (Priority: P0, High complexity) - E-003: Testing & Quality Assurance (Priority: P1, Medium complexity) ✓ Epic breakdown complete! ====================================================================== Generating Planning Documents ====================================================================== ✓ Created planning/my-feature/CLAUDE.md ✓ Created planning/my-feature/README.md ✓ Created planning/my-feature/ARCHIVED/CLAUDE.md ✓ Created planning/my-feature/ARCHIVED/README.md ✓ Created planning/my-feature/requirements.md ✓ Created planning/my-feature/architecture.md ✓ Created planning/my-feature/epics.md Committing planning documents... ✓ Committed planning documents for my-feature ====================================================================== ✓ BMAD Planning Documents Created Successfully! ====================================================================== Files created in planning/my-feature: - requirements.md (Business requirements and acceptance criteria) - architecture.md (Technical architecture and design) - epics.md (Epic breakdown and planning) - CLAUDE.md (Context for Claude Code) - README.md (Human-readable overview) - ARCHIVED/ (Directory for deprecated planning docs) Next steps: 1. Review planning documents in planning/my-feature 2. Create feature worktree 3. SpecKit will auto-detect and use these planning documents 4. Token savings: ~1,700-2,700 tokens by reusing planning context
What happens:
- Script validates location (main repo, contrib branch)
- Conducts 🧠 Analyst Q&A (5-10 questions)
- Generates requirements.md from template + Q&A responses
- Conducts 🏗️ Architect Q&A (5-8 questions)
- Generates architecture.md from template + Q&A responses
- Automatically analyzes requirements + architecture (📋 PM)
- Generates epics.md with epic breakdown
- Creates compliant planning/<slug>/ directory structure
- Commits changes to contrib branch
Token Efficiency:
| Approach | Token Usage | Savings |
|---|---|---|
| Before (manual): Claude Code reproduces BMAD each time | ~2,500 tokens | - |
| After (callable tool): Claude Code calls script | ~200 tokens | ~2,300 tokens (92%) |
Script Architecture
Location:
.claude/skills/bmad-planner/scripts/create_planning.py
Key functions:
- Verify main repo, contrib branchdetect_context()
- 🧠 Requirements Q&Ainteractive_qa_analyst()
- 🏗️ Architecture Q&Ainteractive_qa_architect()
- 📋 Auto-generate epicsgenerate_epic_breakdown()
- Replace placeholders, inject Q&A responsesprocess_*_template()
- CLAUDE.md, README.md, ARCHIVED/create_directory_structure()
- Git commitcommit_planning_docs()
Document Templates
Templates are located in
templates/:
- Business requirements and acceptance criteria (170 lines)requirements.md.template
- System architecture and design decisions (418 lines)architecture.md.template
- Epic breakdown with priorities and dependencies (245 lines)epics.md.template
Interactive Planning Approach
BMAD uses a three-persona method to gather comprehensive planning information through interactive Q&A sessions with the user.
🧠 Persona 1: BMAD Analyst (Requirements)
Role: Business Analyst creating Product Requirements Document
Process:
- Ask user about problem statement and business context
- Identify target users and stakeholders
- Define success criteria and measurable outcomes
- Gather functional and non-functional requirements
- Document user stories with scenarios
- Identify risks and constraints
Interactive Q&A Example:
I'll help create the requirements document using the BMAD Analyst persona. What problem does this feature solve? > [User describes the problem] Who are the primary users of this feature? > [User identifies user types] How will we measure success for this feature? > [User defines success metrics] What are the must-have capabilities? (functional requirements) > [User lists key capabilities] Any performance, security, or scalability requirements? (non-functional) > [User specifies NFRs]
Generates:
planning/<feature>/requirements.md using comprehensive template
🏗️ Persona 2: BMAD Architect (Architecture)
Role: Technical Architect designing system architecture
Process:
- Read requirements.md for business context
- Ask user about technology preferences and constraints
- Design system components and data models
- Define API contracts and integration points
- Specify security, error handling, testing strategies
- Document deployment and observability approach
Interactive Q&A Example:
Based on the requirements, I'll design the technical architecture. Technology preferences? - Web framework: FastAPI / Flask / Django? > [User chooses framework] Database requirements? - Development: SQLite - Production: PostgreSQL / MySQL? > [User chooses database] Performance targets? - Response time: < 200ms? - Concurrent users: How many? > [User specifies targets] Container strategy? - Using Podman (default for this project) - Multi-container setup needed? > [User confirms approach]
Generates:
planning/<feature>/architecture.md using comprehensive template
📋 Persona 3: BMAD PM (Epic Breakdown)
Role: Project Manager breaking down work into epics
Process:
- Read requirements.md + architecture.md for full context
- Identify major work streams (epics)
- Define scope, complexity, and dependencies for each epic
- Prioritize epics (P0/P1/P2)
- Create implementation timeline
- Estimate effort and identify risks
Analysis:
Analyzing requirements and architecture to create epic breakdown... Identified 3 major epics: 1. E-001: Data Layer (Foundation) - P0, High complexity 2. E-002: API Layer (Core functionality) - P0, Medium complexity 3. E-003: Testing & Quality - P1, Medium complexity Dependencies detected: E-001 → E-002 (API needs data layer) E-002 → E-003 (tests need API) Creating epic breakdown document...
Generates:
planning/<feature>/epics.md with epic definitions, priorities, timeline
How to Invoke BMAD
When workflow-orchestrator loads bmad-planner during Phase 1, it calls the create_planning.py script.
Workflow Orchestrator Code:
# In workflow orchestrator - Phase 1.1 if current_phase == 1 and current_step == '1.1': import subprocess result = subprocess.run([ 'python', '.claude/skills/bmad-planner/scripts/create_planning.py', slug, # my-feature gh_user, # stharrold ], check=True) # Script handles: # - 🧠 Analyst Q&A with user # - 🏗️ Architect Q&A with user # - 📋 PM epic breakdown (automatic) # - requirements.md, architecture.md, epics.md generation # - Directory structure creation # - Git commit print(f"✓ BMAD planning created in planning/{slug}/") print(" Next: Create feature worktree (Phase 2)")
User Experience:
Phase 1: BMAD Planning Session Workflow calls: python .claude/skills/bmad-planner/scripts/create_planning.py my-feature stharrold Script conducts interactive session: 🧠 BMAD Analyst: Requirements gathering [5-10 questions] 🏗️ BMAD Architect: Architecture design [5-8 questions] 📋 BMAD PM: Epic breakdown [automatic analysis] ✓ Generated: planning/my-feature/requirements.md ✓ Generated: planning/my-feature/architecture.md ✓ Generated: planning/my-feature/epics.md ✓ Committed to contrib branch ✓ BMAD planning complete! Next: Create feature worktree (Phase 2 will use these docs) Token savings: ~2,300 tokens vs manual approach
Integration with Workflow
The workflow-orchestrator calls the create_planning.py script during Phase 1:
# In workflow orchestrator if current_phase == 1 and current_step == '1.1': import subprocess result = subprocess.run([ 'python', '.claude/skills/bmad-planner/scripts/create_planning.py', slug, gh_user, ], check=True) print(f"✓ BMAD planning created: planning/{slug}/")
Output Files
BMAD generates three planning documents that become input context for SpecKit:
planning/<feature-name>/ ├── requirements.md # Business requirements (170 lines from template) │ ├─ Problem statement, stakeholders │ ├─ Functional requirements (FR-001, FR-002...) │ ├─ Non-functional requirements (performance, security...) │ ├─ User stories with scenarios │ └─ Risks, assumptions, success criteria │ ├── architecture.md # Technical architecture (418 lines from template) │ ├─ System overview, components │ ├─ Technology stack with justifications │ ├─ Data models, API endpoints │ ├─ Container architecture (Containerfile, podman-compose.yml) │ ├─ Security, error handling, testing strategies │ └─ Deployment, observability, disaster recovery │ ├── epics.md # Epic breakdown (245 lines from template) │ ├─ Epic definitions (scope, complexity, priority) │ ├─ Dependencies and critical path │ ├─ Implementation timeline │ └─ Resource requirements and risks │ ├── CLAUDE.md # Context for this planning directory ├── README.md # Human-readable overview └── ARCHIVED/ # Deprecated planning documents
These files become input context for SpecKit in Phase 2.
Integration with SpecKit
BMAD documents are used as context when creating SpecKit specifications:
Data Flow: BMAD → SpecKit
Phase 1 (Main Repo, contrib branch):
BMAD Interactive Session ↓ planning/<feature>/ ├── requirements.md ├── architecture.md └── epics.md
Create Worktree:
# Worktree creation preserves link to main repo git worktree add ../repo_feature_<slug> feature/<timestamp>_<slug>
Phase 2 (Worktree):
SpecKit reads from main repo: ../planning/<feature>/requirements.md → Business context ../planning/<feature>/architecture.md → Technical design ../planning/<feature>/epics.md → Epic priorities SpecKit generates (informed by BMAD): specs/<feature>/spec.md ← Detailed specification specs/<feature>/plan.md ← Implementation tasks
Why This Connection Matters
Consistency:
- Technology choices in spec.md match architecture.md stack
- spec.md acceptance criteria cover requirements.md success criteria
- plan.md tasks align with epics.md breakdown
Completeness:
- All functional requirements from requirements.md appear in spec.md
- Non-functional requirements (performance, security) included
- Epic dependencies reflected in plan.md task ordering
Traceability:
- spec.md sections reference FR-001, FR-002... from requirements.md
- plan.md tasks map to E-001, E-002... from epics.md
- Architecture decisions from architecture.md justify implementation choices
Less Rework:
- Planning clarifies requirements before coding
- Design decisions made explicit
- Reduces ambiguity and prevents scope creep
Integration with Workflow
The workflow-orchestrator calls this skill during Phase 1:
# In workflow orchestrator if current_phase == 1 and current_step == '1.1': load_skill('bmad-planner') create_planning_docs(feature_name, gh_user) commit_changes('docs: add BMAD planning for ' + feature_name)
Template Placeholders
Both templates use these placeholders:
- Feature name (title case){{TITLE}}
- Creation date (YYYY-MM-DD){{DATE}}
- GitHub username{{GH_USER}}
Best Practices
- Requirements first: Define business needs before technical design
- Acceptance criteria: Make success measurable
- Architecture clarity: Explain design decisions and trade-offs
- Technology justification: Document why specific tools/frameworks chosen
- Non-functional requirements: Don't forget performance, security, scalability