@ikunin/sprintpilot 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +330 -0
  3. package/_Sprintpilot/.secrets-allowlist +26 -0
  4. package/_Sprintpilot/Sprintpilot.md +216 -0
  5. package/_Sprintpilot/lib/runtime/args.js +77 -0
  6. package/_Sprintpilot/lib/runtime/git.js +24 -0
  7. package/_Sprintpilot/lib/runtime/http.js +96 -0
  8. package/_Sprintpilot/lib/runtime/log.js +30 -0
  9. package/_Sprintpilot/lib/runtime/secrets.js +151 -0
  10. package/_Sprintpilot/lib/runtime/spawn.js +68 -0
  11. package/_Sprintpilot/lib/runtime/text.js +26 -0
  12. package/_Sprintpilot/lib/runtime/yaml-lite.js +160 -0
  13. package/_Sprintpilot/manifest.yaml +26 -0
  14. package/_Sprintpilot/modules/autopilot/config.yaml +20 -0
  15. package/_Sprintpilot/modules/git/branching-and-pr-strategy.md +101 -0
  16. package/_Sprintpilot/modules/git/config.yaml +83 -0
  17. package/_Sprintpilot/modules/git/templates/commit-patch.txt +1 -0
  18. package/_Sprintpilot/modules/git/templates/commit-story.txt +1 -0
  19. package/_Sprintpilot/modules/git/templates/pr-body.md +20 -0
  20. package/_Sprintpilot/modules/ma/config.yaml +9 -0
  21. package/_Sprintpilot/scripts/create-pr.js +284 -0
  22. package/_Sprintpilot/scripts/detect-platform.js +64 -0
  23. package/_Sprintpilot/scripts/health-check.js +98 -0
  24. package/_Sprintpilot/scripts/lint-changed.js +249 -0
  25. package/_Sprintpilot/scripts/lock.js +195 -0
  26. package/_Sprintpilot/scripts/sanitize-branch.js +107 -0
  27. package/_Sprintpilot/scripts/stage-and-commit.js +190 -0
  28. package/_Sprintpilot/scripts/sync-status.js +141 -0
  29. package/_Sprintpilot/skills/sprint-autopilot-off/SKILL.md +6 -0
  30. package/_Sprintpilot/skills/sprint-autopilot-off/workflow.md +154 -0
  31. package/_Sprintpilot/skills/sprint-autopilot-on/SKILL.md +6 -0
  32. package/_Sprintpilot/skills/sprint-autopilot-on/workflow.md +1119 -0
  33. package/_Sprintpilot/skills/sprintpilot-assess/SKILL.md +6 -0
  34. package/_Sprintpilot/skills/sprintpilot-assess/agents/debt-classifier.md +64 -0
  35. package/_Sprintpilot/skills/sprintpilot-assess/agents/dependency-auditor.md +57 -0
  36. package/_Sprintpilot/skills/sprintpilot-assess/agents/migration-analyzer.md +62 -0
  37. package/_Sprintpilot/skills/sprintpilot-assess/workflow.md +114 -0
  38. package/_Sprintpilot/skills/sprintpilot-code-review/SKILL.md +6 -0
  39. package/_Sprintpilot/skills/sprintpilot-code-review/agents/acceptance-auditor.md +51 -0
  40. package/_Sprintpilot/skills/sprintpilot-code-review/agents/blind-hunter.md +39 -0
  41. package/_Sprintpilot/skills/sprintpilot-code-review/agents/edge-case-hunter.md +46 -0
  42. package/_Sprintpilot/skills/sprintpilot-code-review/workflow.md +111 -0
  43. package/_Sprintpilot/skills/sprintpilot-codebase-map/SKILL.md +6 -0
  44. package/_Sprintpilot/skills/sprintpilot-codebase-map/agents/architecture-mapper.md +129 -0
  45. package/_Sprintpilot/skills/sprintpilot-codebase-map/agents/concerns-hunter.md +135 -0
  46. package/_Sprintpilot/skills/sprintpilot-codebase-map/agents/integration-mapper.md +138 -0
  47. package/_Sprintpilot/skills/sprintpilot-codebase-map/agents/quality-assessor.md +143 -0
  48. package/_Sprintpilot/skills/sprintpilot-codebase-map/agents/stack-analyzer.md +133 -0
  49. package/_Sprintpilot/skills/sprintpilot-codebase-map/workflow.md +120 -0
  50. package/_Sprintpilot/skills/sprintpilot-migrate/SKILL.md +6 -0
  51. package/_Sprintpilot/skills/sprintpilot-migrate/agents/dependency-analyzer.md +51 -0
  52. package/_Sprintpilot/skills/sprintpilot-migrate/agents/risk-assessor.md +55 -0
  53. package/_Sprintpilot/skills/sprintpilot-migrate/agents/stack-mapper.md +49 -0
  54. package/_Sprintpilot/skills/sprintpilot-migrate/agents/test-parity-analyzer.md +49 -0
  55. package/_Sprintpilot/skills/sprintpilot-migrate/resources/coexistence-patterns.md +59 -0
  56. package/_Sprintpilot/skills/sprintpilot-migrate/resources/strategies.md +43 -0
  57. package/_Sprintpilot/skills/sprintpilot-migrate/templates/component-card.md +11 -0
  58. package/_Sprintpilot/skills/sprintpilot-migrate/templates/migration-epics.md +35 -0
  59. package/_Sprintpilot/skills/sprintpilot-migrate/templates/migration-plan.md +66 -0
  60. package/_Sprintpilot/skills/sprintpilot-migrate/workflow.md +235 -0
  61. package/_Sprintpilot/skills/sprintpilot-party-mode/SKILL.md +6 -0
  62. package/_Sprintpilot/skills/sprintpilot-party-mode/workflow.md +138 -0
  63. package/_Sprintpilot/skills/sprintpilot-research/SKILL.md +6 -0
  64. package/_Sprintpilot/skills/sprintpilot-research/workflow.md +128 -0
  65. package/_Sprintpilot/skills/sprintpilot-reverse-architect/SKILL.md +6 -0
  66. package/_Sprintpilot/skills/sprintpilot-reverse-architect/agents/component-mapper.md +53 -0
  67. package/_Sprintpilot/skills/sprintpilot-reverse-architect/agents/data-flow-tracer.md +54 -0
  68. package/_Sprintpilot/skills/sprintpilot-reverse-architect/agents/pattern-extractor.md +67 -0
  69. package/_Sprintpilot/skills/sprintpilot-reverse-architect/workflow.md +119 -0
  70. package/_Sprintpilot/skills/sprintpilot-update/SKILL.md +6 -0
  71. package/_Sprintpilot/skills/sprintpilot-update/workflow.md +46 -0
  72. package/_Sprintpilot/templates/agent-rules.md +43 -0
  73. package/bin/sprintpilot.js +95 -0
  74. package/lib/commands/check-update.js +54 -0
  75. package/lib/commands/install.js +876 -0
  76. package/lib/commands/uninstall.js +218 -0
  77. package/lib/core/bmad-config.js +113 -0
  78. package/lib/core/file-ops.js +90 -0
  79. package/lib/core/gitignore.js +54 -0
  80. package/lib/core/markers.js +126 -0
  81. package/lib/core/tool-registry.js +73 -0
  82. package/lib/core/update-check.js +39 -0
  83. package/lib/core/v1-detect.js +86 -0
  84. package/lib/prompts.js +82 -0
  85. package/lib/substitute.js +39 -0
  86. package/package.json +49 -0
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: sprintpilot-assess
3
+ description: 'Tech debt, dependency audit, and migration assessment via 3 parallel agents. Runs after sprintpilot-codebase-map. Produces actionable findings with confidence levels, effort estimates, and a prioritized brownfield-assessment.md. Use for brownfield projects before sprint planning.'
4
+ ---
5
+
6
+ Follow the instructions in ./workflow.md.
@@ -0,0 +1,64 @@
1
+ # Tech Debt Classifier Agent
2
+
3
+ You are classifying and prioritizing tech debt findings from the codebase analysis.
4
+
5
+ ## Task
6
+
7
+ Take the concerns-analysis.md findings and classify each into actionable categories with effort estimates and confidence levels.
8
+
9
+ ## Categories
10
+
11
+ - **Critical**: blocks feature development or poses security risk
12
+ - **High**: degrades reliability or developer productivity significantly
13
+ - **Medium**: increases maintenance burden, should be addressed in next quarter
14
+ - **Low**: minor improvement, address opportunistically
15
+
16
+ ## Classification Criteria
17
+
18
+ For each concern from concerns-analysis.md:
19
+ 1. **Impact** — what breaks or degrades if not addressed?
20
+ 2. **Urgency** — is it getting worse over time?
21
+ 3. **Effort** — S (< 1 story), M (1-2 stories), L (3-5 stories), XL (> 5 stories)
22
+ 4. **Confidence** — High (clear evidence), Medium (likely but needs verification), Low (suspected)
23
+ 5. **Dependencies** — does fixing this require other changes first?
24
+
25
+ ## Output Format
26
+
27
+ ```markdown
28
+ ## Tech Debt Classification
29
+
30
+ ### Summary
31
+ | Severity | Count | Total Effort |
32
+ |----------|-------|-------------|
33
+ | Critical | N | ... |
34
+ | High | N | ... |
35
+ | Medium | N | ... |
36
+ | Low | N | ... |
37
+
38
+ ### Classified Findings
39
+
40
+ #### Critical
41
+ 1. **[DEBT-001]** Title
42
+ - Source: concerns-analysis.md [C-NNN]
43
+ - Impact: ...
44
+ - Effort: M
45
+ - Confidence: High
46
+ - Evidence: file:line
47
+ - Recommendation: ...
48
+ - Blocked by: none
49
+ - Blocks: DEBT-XXX
50
+
51
+ #### High
52
+ ...
53
+
54
+ #### Medium
55
+ ...
56
+
57
+ #### Low
58
+ ...
59
+
60
+ ### Recommended Remediation Order
61
+ [Ordered list considering dependencies and impact]
62
+ ```
63
+
64
+ ## Context (concerns-analysis.md)
@@ -0,0 +1,57 @@
1
+ # Dependency Auditor Agent
2
+
3
+ You are auditing all project dependencies for versions, vulnerabilities, and upgrade paths.
4
+
5
+ ## Task
6
+
7
+ Analyze the project's dependencies using the stack-analysis.md analysis provided below as context. You have Bash access to run audit tools.
8
+
9
+ ## Method
10
+
11
+ 1. **Run available audit tools** via Bash:
12
+ - `npm audit --json 2>/dev/null` or `yarn audit --json 2>/dev/null`
13
+ - `pip audit 2>/dev/null` or `safety check 2>/dev/null`
14
+ - `cargo audit 2>/dev/null`
15
+ - `bundle audit check 2>/dev/null`
16
+ If none available, fall back to manual analysis of lockfiles/manifests.
17
+
18
+ 2. **Check for outdated packages** via Bash:
19
+ - `npm outdated --json 2>/dev/null`
20
+ - `pip list --outdated --format=json 2>/dev/null`
21
+
22
+ 3. **Identify**:
23
+ - Packages with known CVEs
24
+ - Major version upgrades available
25
+ - Deprecated packages (check for deprecation notices)
26
+ - Packages with no recent releases (>2 years)
27
+ - Duplicate/conflicting versions
28
+
29
+ ## Output Format
30
+
31
+ ```markdown
32
+ ## Dependency Audit
33
+
34
+ ### Vulnerabilities Found
35
+ | Package | Current | Severity | CVE | Fix Version |
36
+ |---------|---------|----------|-----|-------------|
37
+ | ... | ... | ... | ... | ... |
38
+
39
+ ### Outdated Packages
40
+ | Package | Current | Latest | Type | Breaking? |
41
+ |---------|---------|--------|------|-----------|
42
+ | ... | ... | ... | major/minor/patch | yes/no |
43
+
44
+ ### Deprecated/Unmaintained
45
+ | Package | Last Release | Replacement |
46
+ |---------|-------------|-------------|
47
+ | ... | ... | ... |
48
+
49
+ ### Upgrade Paths
50
+ For each major upgrade needed:
51
+ - **Package**: current → target
52
+ - **Breaking changes**: ...
53
+ - **Effort**: S/M/L
54
+ - **Confidence**: High/Medium/Low
55
+ ```
56
+
57
+ ## Context (stack-analysis.md)
@@ -0,0 +1,62 @@
1
+ # Migration Analyzer Agent
2
+
3
+ You are analyzing what framework/library migrations are needed and planning upgrade paths.
4
+
5
+ ## Task
6
+
7
+ Using stack-analysis.md and concerns-analysis.md as context, identify all components that need migration/upgrade and produce a phased roadmap.
8
+
9
+ ## What to Analyze
10
+
11
+ 1. **Major framework upgrades** — React 17→18, Django 3→4, Rails 6→7, etc.
12
+ 2. **Runtime upgrades** — Node.js, Python, Rust edition
13
+ 3. **Build tool migrations** — webpack→vite, create-react-app→next.js
14
+ 4. **Database migrations** — schema changes, ORM version upgrades
15
+ 5. **API version upgrades** — deprecated API versions in use
16
+ 6. **Infrastructure** — Docker base image updates, k8s API versions
17
+
18
+ ## For Each Migration
19
+
20
+ 1. **Current state** — what version/tool is in use now
21
+ 2. **Target state** — what it should be upgraded to
22
+ 3. **Breaking changes** — what will break
23
+ 4. **Migration effort** — S/M/L/XL
24
+ 5. **Dependencies** — what must be done first
25
+ 6. **Risk** — what could go wrong
26
+ 7. **Rollback** — can it be rolled back?
27
+
28
+ ## Output Format
29
+
30
+ ```markdown
31
+ ## Migration Analysis
32
+
33
+ ### Migrations Needed
34
+ | Component | Current | Target | Effort | Risk | Priority |
35
+ |-----------|---------|--------|--------|------|----------|
36
+ | ... | ... | ... | ... | ... | ... |
37
+
38
+ ### Detailed Migration Paths
39
+
40
+ #### [MIG-001] Component: current → target
41
+ - **Breaking changes**: ...
42
+ - **Effort**: M (1-2 sprints)
43
+ - **Dependencies**: MIG-XXX must complete first
44
+ - **Risk**: Medium — ...
45
+ - **Steps**:
46
+ 1. ...
47
+ 2. ...
48
+ - **Rollback plan**: ...
49
+ - **Confidence**: High/Medium/Low
50
+
51
+ ### Phased Roadmap
52
+ ```
53
+ Phase 1 (foundation): MIG-001, MIG-003
54
+ Phase 2 (core): MIG-002
55
+ Phase 3 (cleanup): MIG-004, MIG-005
56
+ ```
57
+
58
+ ### No-Action Items
59
+ [Components that are current and don't need migration]
60
+ ```
61
+
62
+ ## Context (stack-analysis.md + concerns-analysis.md)
@@ -0,0 +1,114 @@
1
+ # Multi-Agent Assessment
2
+
3
+ ## Purpose
4
+
5
+ Deep-dive assessment of tech debt, dependency health, and migration paths. Runs after `sprintpilot-codebase-map` and consumes its outputs. Produces actionable, prioritized findings with effort estimates.
6
+
7
+ ## Prerequisites
8
+
9
+ Run `sprintpilot-codebase-map` first. This skill reads from `{output_folder}/codebase-analysis/`.
10
+
11
+ ## Output Location
12
+
13
+ `{output_folder}/codebase-analysis/brownfield-assessment.md`
14
+
15
+ ---
16
+
17
+ ## Step 1 — Verify Prerequisites
18
+
19
+ <action>Check that codebase analysis outputs exist:
20
+ - `{output_folder}/codebase-analysis/stack-analysis.md`
21
+ - `{output_folder}/codebase-analysis/concerns-analysis.md`
22
+ - `{output_folder}/codebase-analysis/quality-analysis.md`
23
+ If missing, suggest running `sprintpilot-codebase-map` first.
24
+ </action>
25
+
26
+ <action>Read all available analysis files to pass as context to agents.</action>
27
+
28
+ ---
29
+
30
+ ## Step 2 — Launch 3 Assessment Agents in Parallel
31
+
32
+ <critical>
33
+ All 3 Agent calls MUST be in the same message.
34
+ Each agent receives the codebase analysis outputs as context.
35
+ Each agent has Bash access for running audit tools.
36
+ </critical>
37
+
38
+ ### Agent 1: Dependency Auditor
39
+
40
+ ```
41
+ Agent(
42
+ description: "Dependency audit and vulnerability scan",
43
+ prompt: <read from ./agents/dependency-auditor.md, append stack-analysis.md content>
44
+ )
45
+ ```
46
+
47
+ ### Agent 2: Debt Classifier
48
+
49
+ ```
50
+ Agent(
51
+ description: "Tech debt classification and prioritization",
52
+ prompt: <read from ./agents/debt-classifier.md, append concerns-analysis.md content>
53
+ )
54
+ ```
55
+
56
+ ### Agent 3: Migration Analyzer
57
+
58
+ ```
59
+ Agent(
60
+ description: "Framework upgrade and migration path analysis",
61
+ prompt: <read from ./agents/migration-analyzer.md, append stack-analysis.md + concerns-analysis.md content>
62
+ )
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Step 3 — Synthesize
68
+
69
+ <action>Collect all 3 agent results.</action>
70
+
71
+ <action>Produce unified `brownfield-assessment.md`:
72
+
73
+ ```markdown
74
+ # Brownfield Assessment
75
+
76
+ ## Executive Summary
77
+ [2-3 sentences: overall health, top risks, recommended action]
78
+
79
+ ## Priority Matrix
80
+
81
+ | ID | Category | Severity | Confidence | Effort | Title |
82
+ |----|----------|----------|------------|--------|-------|
83
+ | DEBT-001 | ... | Critical/High/Med/Low | High/Med/Low | S/M/L/XL | ... |
84
+
85
+ ## Detailed Findings
86
+
87
+ ### [DEBT-001] Title
88
+ - **Category**: Framework upgrade / Dependency / Security / Code quality
89
+ - **Severity**: Critical
90
+ - **Confidence**: High (evidence: ...)
91
+ - **Effort**: L (2-3 stories)
92
+ - **Evidence**:
93
+ - `file:line` — description
94
+ - **Migration path**: step-by-step
95
+ - **Blocked by**: None / DEBT-XXX
96
+ - **Blocks**: DEBT-XXX
97
+
98
+ ### [DEBT-002] ...
99
+
100
+ ## Recommended Sprint Stories
101
+ [For top-priority findings, suggest story titles and scope]
102
+
103
+ ## Migration Roadmap
104
+ [Phased plan if major migrations are needed]
105
+ ```
106
+ </action>
107
+
108
+ <action>Write to `{output_folder}/codebase-analysis/brownfield-assessment.md`</action>
109
+
110
+ <action>Suggest next steps:
111
+ - `sprintpilot-reverse-architect` — extract architecture from code
112
+ - `sprintpilot-migrate` — detailed migration planning (if major upgrades needed)
113
+ - `bmad-sprint-planning` — plan stories from assessment findings
114
+ </action>
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: sprintpilot-code-review
3
+ description: 'Parallel 3-layer code review via subagents. Launches Blind Hunter (adversarial), Edge Case Hunter, and Acceptance Auditor simultaneously. Collects results, triages findings, and produces prioritized patch list. Use instead of stock bmad-code-review for deeper, faster reviews.'
4
+ ---
5
+
6
+ Follow the instructions in ./workflow.md.
@@ -0,0 +1,51 @@
1
+ # Acceptance Auditor — Code Review Agent
2
+
3
+ You are a QA auditor verifying that the implementation satisfies the story's acceptance criteria. You have the diff, the story file, and project access.
4
+
5
+ ## Rules
6
+
7
+ - Every acceptance criterion (AC) must be explicitly verified against the code.
8
+ - If an AC is NOT covered by the implementation, flag it as MISSING.
9
+ - If an AC is partially covered, flag what's missing.
10
+ - If the implementation does something NOT in the ACs, note it as EXTRA (not necessarily bad, but worth flagging).
11
+ - Cap your response at 2000 tokens.
12
+
13
+ ## What to Check
14
+
15
+ For each acceptance criterion in the story:
16
+ 1. **Implemented?** — Is there code that addresses this criterion?
17
+ 2. **Tested?** — Is there a test that verifies this criterion?
18
+ 3. **Correct?** — Does the implementation actually satisfy the criterion, or does it miss a nuance?
19
+
20
+ Also check:
21
+ 4. **Task list completion** — Are all tasks and subtasks in the story file addressed?
22
+ 5. **File List accuracy** — Does the story's File List match the actual files changed?
23
+ 6. **No regressions** — Do the changes break any existing functionality visible in the diff?
24
+
25
+ ## Output Format
26
+
27
+ ```
28
+ ## AC Verification
29
+
30
+ | AC | Status | Evidence | Notes |
31
+ |----|--------|----------|-------|
32
+ | AC-1: <text> | PASS/FAIL/PARTIAL | file:line | ... |
33
+ | AC-2: <text> | PASS/FAIL/PARTIAL | file:line | ... |
34
+
35
+ ## Issues Found
36
+
37
+ 1. [SEVERITY] AC-N not satisfied — file:line
38
+ What's missing: ...
39
+ Suggested fix: ...
40
+
41
+ 2. ...
42
+
43
+ ## Extra (not in ACs)
44
+ - <description of extra behavior>
45
+ ```
46
+
47
+ If all ACs pass, say "All acceptance criteria verified" with the evidence table.
48
+
49
+ ## Story and Diff
50
+
51
+ The story file content and diff follow below. Review them now.
@@ -0,0 +1,39 @@
1
+ # Blind Hunter — Adversarial Code Review Agent
2
+
3
+ You are a ruthless code reviewer. You see ONLY the diff — no project context, no story, no acceptance criteria. Your job is to find bugs, vulnerabilities, and bad practices purely from the code changes.
4
+
5
+ ## Rules
6
+
7
+ - You have NO project context. Do not ask for it. Review only what you see.
8
+ - Be specific: cite exact file paths and line numbers.
9
+ - Focus on things that will break in production, not style preferences.
10
+ - Cap your response at 2000 tokens. Be concise.
11
+
12
+ ## What to Look For
13
+
14
+ 1. **Bugs**: null/undefined access, off-by-one, race conditions, resource leaks, incorrect logic
15
+ 2. **Security**: injection (SQL, XSS, command), auth bypass, exposed secrets, insecure defaults
16
+ 3. **Error handling**: swallowed exceptions, missing error paths, unchecked return values
17
+ 4. **Performance**: O(n²) in hot paths, unbounded allocations, missing pagination, N+1 queries
18
+ 5. **Type safety**: unchecked casts, any/unknown abuse, missing validation at boundaries
19
+
20
+ ## Output Format
21
+
22
+ Return findings as a numbered list:
23
+
24
+ ```
25
+ 1. [SEVERITY] file:line — Title
26
+ Description of the issue.
27
+ Suggested fix: ...
28
+
29
+ 2. [SEVERITY] file:line — Title
30
+ ...
31
+ ```
32
+
33
+ Severity: CRITICAL, HIGH, MEDIUM, LOW
34
+
35
+ If the diff looks clean, say "No issues found" — do not manufacture findings.
36
+
37
+ ## Diff to Review
38
+
39
+ The diff follows below. Review it now.
@@ -0,0 +1,46 @@
1
+ # Edge Case Hunter — Code Review Agent
2
+
3
+ You are a methodical edge case analyst. You have access to the diff AND the project codebase (via Read, Grep, Glob tools). Your job is to find boundary conditions, missing validations, and scenarios the developer didn't consider.
4
+
5
+ ## Rules
6
+
7
+ - Use Read/Grep/Glob to understand how changed code interacts with the rest of the codebase.
8
+ - Think about inputs at the extremes: empty, null, max length, unicode, concurrent access, negative numbers.
9
+ - Focus on cases that the tests probably DON'T cover.
10
+ - Cap your response at 2000 tokens. Be concise.
11
+
12
+ ## What to Look For
13
+
14
+ 1. **Boundary conditions**: empty arrays, zero-length strings, max int, negative values
15
+ 2. **Missing validation**: user input not sanitized, API responses not checked, file paths not validated
16
+ 3. **State issues**: stale state after error, partial updates without rollback, cache invalidation gaps
17
+ 4. **Concurrency**: shared mutable state, missing locks, TOCTOU races
18
+ 5. **Integration boundaries**: API contract mismatches, schema drift, timezone handling, encoding issues
19
+ 6. **Error propagation**: errors swallowed at boundaries, misleading error messages, partial failure states
20
+
21
+ ## Method
22
+
23
+ For each changed file in the diff:
24
+ 1. Read the full file (not just the diff) to understand context
25
+ 2. Grep for callers of changed functions to assess blast radius
26
+ 3. Think: "What input would make this fail?"
27
+ 4. Think: "What happens if the thing this calls fails?"
28
+
29
+ ## Output Format
30
+
31
+ ```
32
+ 1. [SEVERITY] file:line — Edge Case Title
33
+ Scenario: When <condition>, then <what goes wrong>
34
+ Impact: <what breaks>
35
+ Suggested fix: ...
36
+
37
+ 2. ...
38
+ ```
39
+
40
+ Severity: CRITICAL, HIGH, MEDIUM, LOW
41
+
42
+ If no edge cases found, say "No edge cases identified" — do not manufacture findings.
43
+
44
+ ## Diff to Review
45
+
46
+ The diff follows below. Review it now, then explore the codebase as needed.
@@ -0,0 +1,111 @@
1
+ # Multi-Agent Code Review
2
+
3
+ ## Purpose
4
+
5
+ Perform a thorough code review using 3 parallel subagents, each with a different review lens. Results are collected, deduplicated, and triaged into a prioritized action list.
6
+
7
+ ## When to Use
8
+
9
+ Use this instead of stock `bmad-code-review` when you want deeper coverage. The autopilot can be configured to call this automatically.
10
+
11
+ ---
12
+
13
+ ## Step 1 — Gather Context
14
+
15
+ <action>Identify the story being reviewed from sprint-status.yaml or user input.</action>
16
+ <action>Generate the diff to review:
17
+ ```bash
18
+ git diff origin/main...HEAD --unified=5
19
+ ```
20
+ If the diff exceeds 3000 lines, summarize by file and only pass relevant sections to agents.
21
+ Save full diff to `review-diff.txt` for agent reference.
22
+ </action>
23
+ <action>Read the story file to extract acceptance criteria.</action>
24
+ <action>Set `{{diff_file}}` = path to review-diff.txt</action>
25
+ <action>Set `{{story_file}}` = path to story file</action>
26
+
27
+ ---
28
+
29
+ ## Step 2 — Launch 3 Review Agents in Parallel
30
+
31
+ Launch ALL THREE agents in a **single message** using the Agent tool. Each agent gets its own inlined prompt (not a Skill reference).
32
+
33
+ <critical>
34
+ All 3 Agent calls MUST be in the same message to run in parallel.
35
+ Each agent's result is capped at ~2000 tokens via structured output instructions.
36
+ </critical>
37
+
38
+ ### Agent 1: Blind Hunter (Adversarial Review)
39
+
40
+ ```
41
+ Agent(
42
+ description: "Blind adversarial code review",
43
+ prompt: <read from ./agents/blind-hunter.md, append diff content or diff_file path>
44
+ )
45
+ ```
46
+
47
+ ### Agent 2: Edge Case Hunter
48
+
49
+ ```
50
+ Agent(
51
+ description: "Edge case analysis",
52
+ prompt: <read from ./agents/edge-case-hunter.md, append diff content or diff_file path>
53
+ )
54
+ ```
55
+
56
+ ### Agent 3: Acceptance Auditor
57
+
58
+ ```
59
+ Agent(
60
+ description: "Acceptance criteria audit",
61
+ prompt: <read from ./agents/acceptance-auditor.md, append diff content + story file content>
62
+ )
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Step 3 — Triage Results
68
+
69
+ <action>Collect all 3 agent results.</action>
70
+
71
+ <action>For each finding, classify:
72
+ - **PATCH** — concrete code fix needed, actionable
73
+ - **WARN** — valid concern but no code change needed (document for awareness)
74
+ - **DISMISS** — false positive, not applicable, or already handled
75
+
76
+ Deduplication rules:
77
+ - Same file + same line range + same concern → merge into one finding
78
+ - **Contradictory findings** (Agent A says "add check", Agent B says "remove check"):
79
+ → If Acceptance Auditor cites an AC → Acceptance Auditor wins
80
+ → Otherwise → classify as `decision_needed` and flag for user
81
+ </action>
82
+
83
+ <action>Produce the triage report:
84
+
85
+ ```markdown
86
+ ## Code Review — Triage Report
87
+
88
+ ### PATCH (apply these)
89
+ 1. **[P1]** {title} — {file}:{line} — {description} — Source: {agent}
90
+ 2. **[P2]** ...
91
+
92
+ ### WARN (acknowledge, no code change)
93
+ 1. **[W1]** {title} — {description} — Source: {agent}
94
+
95
+ ### DISMISSED
96
+ 1. **[D1]** {reason} — Source: {agent}
97
+
98
+ ### DECISION NEEDED (contradictory or ambiguous)
99
+ 1. **[DN1]** {description} — Agent A says: ... / Agent B says: ...
100
+ ```
101
+ </action>
102
+
103
+ ---
104
+
105
+ ## Step 4 — Output
106
+
107
+ <action>Present the triage report to the caller (autopilot or user).</action>
108
+ <action>If running under autopilot: the autopilot will auto-apply all PATCH findings and commit each one.</action>
109
+ <action>If running manually: present findings and ask user which to apply.</action>
110
+
111
+ <action>Suggest next step: "Apply patches, then run full test suite."</action>
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: sprintpilot-codebase-map
3
+ description: 'Parallel 5-stream codebase analysis for brownfield projects. Launches Stack Analyzer, Architecture Mapper, Quality Assessor, Concerns Hunter, and Integration Mapper simultaneously. Produces structured, evidence-based analysis optimized for downstream planning agents. Run before bmad-create-architecture or bmad-create-prd on existing codebases. Inspired by GSD map-codebase (https://github.com/gsd-build/get-shit-done).'
4
+ ---
5
+
6
+ Follow the instructions in ./workflow.md.