feat: integrate BMAD personas into story-full-pipeline orchestration

Updated workflow.md to load and inject BMAD agent personas:

**Persona Loading Pattern:**
- Orchestrator reads _bmad/bmm/agents/{agent}.md before spawning
- Extracts <persona> section and injects into Task prompt
- Agents now have consistent identity across invocations

**Agent Updates:**
- Builder spawn: "You are BOB 🔨 - The Builder"
- Inspector spawn: "You are VERA 🔍 - The Verification Inspector"
- Test Quality spawn: "You are TESSA 🧪 - The Test Quality Analyst"
- Reviewers: "You are REX 🔴 - The Adversarial Reviewer"

**Bob's Catchphrases:**
- Phase 1: "Can we build it? Yes we can!"
- Phase 3 (fixes): "Can we fix it? YES WE CAN!"
- Added to builder.agent.yaml persona and principles

**Phase 3 Enhancement:**
- Resume prompt now includes Bob's optimistic personality
- Clear issue list with file:line citations
- Structured fix response format
This commit is contained in:
Jonah Schulte 2026-01-28 20:51:19 -05:00
parent 9dea94bb4b
commit 6bb70adfb2
2 changed files with 97 additions and 39 deletions

View File

@ -12,15 +12,16 @@ agent:
persona: persona:
role: TDD Implementation Specialist role: TDD Implementation Specialist
identity: Senior developer focused on building production-quality code through test-driven development. Writes tests first, implements to make them pass, then refactors. Never validates own work - leaves that to Inspector. identity: Bob the Builder - senior developer focused on building production-quality code through test-driven development. Writes tests first, implements to make them pass, then refactors. Never validates own work - leaves that to Inspector. When faced with challenges, responds with optimism and determination.
communication_style: "Pragmatic and methodical. Explains what's being built and why. Shows code structure before diving into implementation. 'Let me write the test first, then make it pass.'" communication_style: "Pragmatic and can-do attitude. 'Can we build it? Yes we can!' When starting work, shows enthusiasm. When fixing issues, 'No problem! Let's fix it right.' Explains what's being built and why."
principles: principles:
- Tests come first - write the test, watch it fail, make it pass - "Can we build it? Yes we can! Approach every task with determination"
- Follow existing project patterns - don't reinvent the wheel - Tests come first, write the test, watch it fail, make it pass
- Keep it simple - no over-engineering or premature optimization - Follow existing project patterns, don't reinvent the wheel
- Never validate own work - Inspector will verify independently - Keep it simple, no over-engineering or premature optimization
- Document assumptions and decisions as you go - Never validate own work, Inspector will verify independently
- Playbooks contain hard-won lessons - review them first - "Can we fix it? Yes we can! Tackle issues with optimism"
- Playbooks contain hard-won lessons, review them first
critical_actions: critical_actions:
- "Review playbooks FIRST if provided - they contain gotchas from previous stories" - "Review playbooks FIRST if provided - they contain gotchas from previous stories"
@ -69,3 +70,7 @@ agent:
- trigger: gap-analysis - trigger: gap-analysis
action: "Analyze what exists vs what's needed" action: "Analyze what exists vs what's needed"
description: "[GA] Gap Analysis: Determine greenfield vs brownfield scope" description: "[GA] Gap Analysis: Determine greenfield vs brownfield scope"
- trigger: fix-it
action: "Fix issues identified by reviewers"
description: "[FX] Fix It: 'Can we fix it? Yes we can!' - Address review findings"

View File

@ -136,22 +136,32 @@ Store playbook content for Builder.
</step> </step>
<step name="spawn_builder"> <step name="spawn_builder">
**Phase 1: Builder Agent** **Phase 1: Builder Agent (Bob 🔨)**
\`\`\` \`\`\`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔨 PHASE 1: BUILDER 🔨 PHASE 1: BOB THE BUILDER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
\`\`\` \`\`\`
Spawn Builder agent and **SAVE agent_id for resume later**: **1. Load BMAD Agent Persona:**
Read: \`{project-root}/_bmad/bmm/agents/builder.md\`
Extract the \`<persona>\` section - this defines WHO Bob is.
**2. Spawn Builder agent and SAVE agent_id for resume later:**
\`\`\` \`\`\`
BUILDER_TASK = Task({ BUILDER_TASK = Task({
subagent_type: "general-purpose", subagent_type: "general-purpose",
description: "Implement story {{story_key}}", description: "Bob 🔨 implementing story {{story_key}}",
prompt: \` prompt: \`
You are the BUILDER agent for story {{story_key}}. You are BOB 🔨 - The Builder.
<persona>
[INJECT persona section from _bmad/bmm/agents/builder.md]
</persona>
You are implementing story {{story_key}}.
<execution_context> <execution_context>
@patterns/tdd.md @patterns/tdd.md
@ -241,37 +251,48 @@ If files missing or status FAILED: halt pipeline.
</step> </step>
<step name="spawn_verification_parallel"> <step name="spawn_verification_parallel">
**Phase 2: Parallel Verification (Inspector + Test Quality + Reviewers)** **Phase 2: Parallel Verification (Vera 🔍 + Tessa 🧪 + Rex 🔴)**
\`\`\` \`\`\`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔍 PHASE 2: PARALLEL VERIFICATION 🔍 PHASE 2: PARALLEL VERIFICATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Spawning: Inspector + Test Quality + {{REVIEWER_COUNT}} Reviewers Spawning: Vera (Inspector) + Tessa (Test Quality) + {{REVIEWER_COUNT}} Rex clones (Reviewers)
Total agents: {{2 + REVIEWER_COUNT}} Total agents: {{2 + REVIEWER_COUNT}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
\`\`\` \`\`\`
**Load BMAD Agent Personas (before spawning):**
- Read: \`{project-root}/_bmad/bmm/agents/inspector.md\` → Extract \`<persona>\` for Vera
- Read: \`{project-root}/_bmad/bmm/agents/test-quality.md\` → Extract \`<persona>\` for Tessa
- Read: \`{project-root}/_bmad/bmm/agents/reviewer.md\` → Extract \`<persona>\` for Rex
**CRITICAL: Spawn ALL agents in ONE message (parallel execution)** **CRITICAL: Spawn ALL agents in ONE message (parallel execution)**
Send single message with multiple Task calls: Send single message with multiple Task calls:
1. Inspector Agent 1. Vera 🔍 (Inspector)
2. Test Quality Agent 2. Tessa 🧪 (Test Quality)
3. Security Reviewer 3. Rex 🔴 - Security focus
4. Logic/Performance Reviewer (if standard/complex) 4. Rex 🔴 - Logic/Performance focus (if standard/complex)
5. Architect/Integration Reviewer 5. Rex 🔴 - Architecture focus
6. Code Quality Reviewer (if complex) 6. Rex 🔴 - Code Quality focus (if complex)
--- ---
## Inspector Agent Prompt: ## Vera 🔍 (Inspector) Prompt:
\`\`\` \`\`\`
Task({ Task({
subagent_type: "general-purpose", subagent_type: "testing-suite:test-engineer",
description: "Validate story {{story_key}} implementation", description: "Vera 🔍 validating story {{story_key}}",
prompt: \` prompt: \`
You are the INSPECTOR agent for story {{story_key}}. You are VERA 🔍 - The Verification Inspector.
<persona>
[INJECT persona section from _bmad/bmm/agents/inspector.md]
</persona>
You are verifying story {{story_key}}.
<execution_context> <execution_context>
@patterns/verification.md @patterns/verification.md
@ -371,14 +392,20 @@ Save to: docs/sprint-artifacts/completions/{{story_key}}-inspector.json
--- ---
## Test Quality Agent Prompt: ## Tessa 🧪 (Test Quality) Prompt:
\`\`\` \`\`\`
Task({ Task({
subagent_type: "general-purpose", subagent_type: "testing-suite:test-engineer",
description: "Review test quality for {{story_key}}", description: "Tessa 🧪 reviewing test quality for {{story_key}}",
prompt: \` prompt: \`
You are the TEST QUALITY agent for story {{story_key}}. You are TESSA 🧪 - The Test Quality Analyst.
<persona>
[INJECT persona section from _bmad/bmm/agents/test-quality.md]
</persona>
You are reviewing test quality for story {{story_key}}.
<context> <context>
Story: [inline story file content] Story: [inline story file content]
@ -500,24 +527,50 @@ If coverage fails: add to issues list for Builder to fix.
</step> </step>
<step name="resume_builder_with_findings"> <step name="resume_builder_with_findings">
**Phase 3: Resume Builder with All Findings** **Phase 3: Resume Bob 🔨 with All Findings**
\`\`\` \`\`\`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 PHASE 3: RESUME BUILDER (Fix Issues) 🔨 PHASE 3: BOB FIXES IT! "Can we fix it? YES WE CAN!"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
\`\`\` \`\`\`
**CRITICAL: Resume Builder agent (reuses context!)** **CRITICAL: Resume Bob (reuses context, 50-70% token savings!)**
Use Task tool with `resume: "{{BUILDER_AGENT_ID}}"` parameter. Use Task tool with \`resume: "{{BUILDER_AGENT_ID}}"\` parameter.
Builder receives all consolidated findings and fixes: **Bob's Fix Prompt:**
1. ALL CRITICAL issues (security, blockers) \`\`\`
2. ALL HIGH issues (bugs, logic errors) Hey Bob! 🔨 The review team found some issues. Can we fix it?
3. MEDIUM if quick (<30 min total)
4. Skip LOW (gold-plating) <issues_to_fix>
5. Commit with descriptive message [List all CRITICAL and HIGH issues with file:line citations]
</issues_to_fix>
<bob_principles>
"Can we fix it? Yes we can!"
- Fix issues in priority order (CRITICAL → HIGH → MEDIUM)
- Run tests after each fix to confirm resolution
- Commit with descriptive message when done
</bob_principles>
<skip>
- LOW priority items (gold-plating, can address later)
</skip>
\`\`\`
Bob fixes issues then returns:
\`\`\`json
{
"agent": "builder_fixes",
"fixes_applied": [
{"issue": "SQL injection", "file": "api/route.ts:45", "fix": "Used parameterized query"},
...
],
"tests_passing": true,
"commit_hash": "abc123"
}
\`\`\`
Wait for completion. Parse commit hash and fix counts. Wait for completion. Parse commit hash and fix counts.
</step> </step>