bmad-plus 0.12.2 → 0.14.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 (127) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +96 -461
  3. package/package.json +12 -5
  4. package/readme-international/README.de.md +42 -9
  5. package/readme-international/README.es.md +43 -10
  6. package/readme-international/README.fr.md +42 -9
  7. package/src/bmad-plus/agents/agent-orchestrator/SKILL.md +5 -3
  8. package/src/bmad-plus/module.yaml +270 -220
  9. package/src/bmad-plus/packs/pack-dev-studio/README.md +133 -141
  10. package/src/bmad-plus/packs/pack-dev-studio/SKILL.md +49 -0
  11. package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/analyst-agent.md +35 -60
  12. package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/document-project.md +59 -59
  13. package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/domain-research.md +55 -93
  14. package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/market-research.md +58 -93
  15. package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/prfaq.md +55 -132
  16. package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/product-brief.md +63 -78
  17. package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/tech-writer-agent.md +54 -69
  18. package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/technical-research.md +54 -93
  19. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/architect-agent.md +32 -60
  20. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/create-architecture.md +67 -71
  21. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/create-epics-stories.md +61 -90
  22. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/generate-project-context.md +56 -78
  23. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/implementation-readiness.md +55 -88
  24. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-01-init.md +20 -153
  25. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-01b-continue.md +20 -173
  26. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-02-context.md +14 -220
  27. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-03-starter.md +20 -329
  28. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-04-decisions.md +15 -314
  29. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-05-patterns.md +15 -355
  30. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-06-structure.md +15 -375
  31. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-07-validation.md +14 -357
  32. package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-08-complete.md +13 -78
  33. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/checkpoint-preview.md +52 -65
  34. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-01-gather-context.md +14 -81
  35. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-02-review.md +14 -31
  36. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-03-triage.md +14 -45
  37. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-04-present.md +13 -128
  38. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review.md +61 -87
  39. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/correct-course.md +55 -298
  40. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/create-story.md +52 -426
  41. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-agent.md +48 -69
  42. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-story-checklist.md +22 -80
  43. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-story.md +60 -482
  44. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/investigate.md +50 -184
  45. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/qa-e2e-tests.md +57 -173
  46. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/quick-dev.md +56 -108
  47. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/retrospective.md +54 -1509
  48. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/sprint-planning.md +54 -296
  49. package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/sprint-status.md +41 -283
  50. package/src/bmad-plus/packs/pack-dev-studio/categories/planning/create-prd.md +58 -18
  51. package/src/bmad-plus/packs/pack-dev-studio/categories/planning/create-ux-design.md +103 -72
  52. package/src/bmad-plus/packs/pack-dev-studio/categories/planning/edit-prd.md +55 -27
  53. package/src/bmad-plus/packs/pack-dev-studio/categories/planning/pm-agent.md +34 -60
  54. package/src/bmad-plus/packs/pack-dev-studio/categories/planning/prd.md +46 -87
  55. package/src/bmad-plus/packs/pack-dev-studio/categories/planning/steps/step-01-init.md +10 -0
  56. package/src/bmad-plus/packs/pack-dev-studio/categories/planning/ux-designer-agent.md +30 -60
  57. package/src/bmad-plus/packs/pack-dev-studio/categories/planning/validate-prd.md +57 -27
  58. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/advanced-elicitation.md +47 -138
  59. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/adversarial-review.md +48 -34
  60. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/bmad-help.md +51 -68
  61. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/brainstorming.md +46 -3
  62. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/customize.md +68 -109
  63. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/distillator.md +53 -174
  64. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/edge-case-hunter.md +39 -53
  65. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/editorial-review-prose.md +45 -83
  66. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/editorial-review-structure.md +45 -176
  67. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/index-docs.md +45 -63
  68. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/party-mode.md +53 -124
  69. package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/shard-doc.md +44 -100
  70. package/src/bmad-plus/packs/pack-dev-studio/dev-studio-orchestrator.md +56 -116
  71. package/src/bmad-plus/packs/pack-dev-studio/shared/architecture-decision-template.md +49 -12
  72. package/src/bmad-plus/packs/pack-dev-studio/shared/bwml-spec.md +51 -328
  73. package/src/bmad-plus/packs/pack-dev-studio/shared/catalog.json +489 -0
  74. package/src/bmad-plus/packs/pack-dev-studio/shared/execution.md +69 -0
  75. package/src/bmad-plus/packs/pack-dev-studio/shared/module-help.csv +39 -32
  76. package/src/bmad-plus/packs/pack-dev-studio/upstream-sync.yaml +85 -14
  77. package/src/bmad-plus/packs/pack-memory/README.md +6 -0
  78. package/src/bmad-plus/packs/pack-memory/memory-orchestrator.md +12 -5
  79. package/src/bmad-plus/packs/pack-seo/SKILL.md +27 -1
  80. package/src/bmad-plus/packs/pack-seo/scripts/seo_apis.py +8 -8
  81. package/src/bmad-plus/packs/pack-seo/scripts/seo_fetch.py +1 -2
  82. package/src/bmad-plus/packs/pack-seo/scripts/seo_report.py +0 -1
  83. package/src/bmad-plus/packs/pack-seo/seo-chief.md +16 -1
  84. package/src/bmad-plus/packs/pack-seo/seo-judge.md +12 -0
  85. package/src/bmad-plus/packs/pack-seo/seo-scout.md +12 -0
  86. package/src/bmad-plus/skills/bmad-plus-autopilot/SKILL.md +4 -4
  87. package/src/bmad-plus/skills/bmad-plus-sync/SKILL.md +5 -3
  88. package/src/bmad-plus/skills/dev-studio/SKILL.md +19 -0
  89. package/tools/bmad-plus-npx.js +4 -2
  90. package/tools/build/adapters.config.js +60 -51
  91. package/tools/build/check-counts.js +52 -54
  92. package/tools/build/check-install-contract.js +450 -0
  93. package/tools/build/generate-adapters.js +252 -56
  94. package/tools/build/generate.js +364 -14
  95. package/tools/build/generated-adapters/.codex/AGENTS.md +20 -7
  96. package/tools/build/generated-adapters/.cursor/rules/bmad-plus.mdc +20 -7
  97. package/tools/build/generated-adapters/.opencode/AGENTS.md +20 -7
  98. package/tools/build/generated-adapters/AGENTS.md +20 -7
  99. package/tools/build/generated-adapters/CLAUDE.md +20 -7
  100. package/tools/build/generated-adapters/CONVENTIONS.md +20 -7
  101. package/tools/build/generated-adapters/GEMINI.md +20 -7
  102. package/tools/build/module.template.yaml +82 -0
  103. package/tools/build/pack-delivery.js +78 -0
  104. package/tools/cli/bmad-plus-cli.js +16 -1
  105. package/tools/cli/commands/doctor.js +49 -217
  106. package/tools/cli/commands/install.js +109 -164
  107. package/tools/cli/commands/studio.js +68 -0
  108. package/tools/cli/commands/uninstall.js +173 -65
  109. package/tools/cli/commands/update-check.js +31 -0
  110. package/tools/cli/commands/update-policy.js +39 -0
  111. package/tools/cli/commands/update.js +102 -113
  112. package/tools/cli/i18n.js +60 -0
  113. package/tools/cli/lib/ide-config.js +4 -261
  114. package/tools/cli/lib/install-manifest.js +17 -0
  115. package/tools/cli/lib/installation-health.js +360 -0
  116. package/tools/cli/lib/installed-adapters.js +89 -0
  117. package/tools/cli/lib/npm-runner.js +177 -0
  118. package/tools/cli/lib/pack-copy.js +62 -66
  119. package/tools/cli/lib/packs.js +546 -3
  120. package/tools/cli/lib/python-health.js +233 -0
  121. package/tools/cli/lib/python-provision.js +2 -2
  122. package/tools/cli/lib/studio.js +310 -0
  123. package/tools/cli/lib/update-check.js +153 -0
  124. package/tools/cli/lib/update-dispatch.js +182 -0
  125. package/tools/cli/lib/update-policy.js +90 -0
  126. package/tools/cli/lib/update-transaction.js +334 -0
  127. package/tools/release/publication-content.js +901 -0
@@ -1,111 +1,70 @@
1
- ---
2
- name: bmad-customize
3
- description: Authors and updates customization overrides for installed BMad skills. Use when the user says 'customize bmad', 'override a skill', 'change agent behavior', or 'customize a workflow'.
1
+ ---
2
+ name: customize
3
+ description: Adapt supported BMAD+ configuration or explicit local instructions while preserving existing project settings and custom files.
4
4
  ---
5
5
 
6
- # BMad Customize
7
-
8
- Translate the user's intent into a correctly-placed TOML override file under `{project-root}/custom/` for a customizable agent or workflow skill. Discover, route, author, write, verify.
9
-
10
- Scope v1: per-skill `[agent]` overrides (`bmad-agent-<role>.toml` / `.user.toml`) and per-skill `[workflow]` overrides (`bmad-<workflow>.toml` / `.user.toml`). Central config (`{project-root}/custom/config.toml`) is out of scope — point users at the [How to Customize BMad guide](https://docs.bmad-method.org/how-to/customize-bmad/).
11
-
12
- When the target's `agent configuration` doesn't expose what the user wants, say so plainly. Don't invent fields.
13
-
14
- ## Preflight
15
-
16
- - No `{project-root}/` → BMad isn't installed. Say so, stop.
17
- - `{project-root}/scripts/resolve_customization.py` missing → continue, but Step 6 verify falls back to manual merge.
18
- - Both present → proceed.
19
-
20
- ## Activation
21
-
22
- Load `config.toml` and `config.user.toml` from `{project-root}` for `user_name` (default `BMad`) and `communication_language` (default `English`). Greet. If the user's invocation already names a target skill AND a specific change, jump to Step 3.
23
-
24
- ## Step 1: Classify intent
25
-
26
- - **Directed** — specific skill + specific change → Step 3.
27
- - **Exploratory** — "what can I customize?" → Step 2.
28
- - **Audit/iterate** — wants to review or change something already customized → Step 2, lead with skills that have existing overrides; read the existing override in Step 3 before composing.
29
- - **Cross-cutting** — could live on multiple surfaces → Step 3, choose agent vs workflow explicitly with the user.
30
-
31
- ## Step 2: Discovery
32
-
33
- ```
34
- List all installed BMAD+ agents and skills from your project directory
35
- ```
36
-
37
- Use `--extra-root <path>` (repeatable) if the user has skills installed in additional locations.
38
-
39
- Group the returned `agents` and `workflows` for the user; for each show name, description, whether `has_team_override` or `has_user_override` is true. Surface any `errors[]`. For audit/iterate intents, lead with already-overridden entries.
40
-
41
- Empty list: show `scanned_roots`, ask whether skills live elsewhere (offer `--extra-root`); otherwise stop.
42
-
43
- ## Step 3: Determine the right surface
44
-
45
- Read the target's `agent configuration`. Top-level `[agent]` or `[workflow]` block defines the surface.
46
-
47
- If a team or user override already exists, read it first and summarize what's already overridden before composing.
48
-
49
- **Cross-cutting intent — walk both surfaces with the user:**
50
- - Every workflow a given agent runs → agent surface (e.g. `bmad-agent-pm.toml` with `persistent_facts`, `principles`).
51
- - One workflow only → workflow surface (e.g. `bmad-prd.toml` with `activation_steps_prepend`).
52
- - Several specific workflows → multiple workflow overrides in sequence, not an agent override.
53
-
54
- **Single-surface heuristic:**
55
- - Workflow-level: template swap, output path, step-specific behavior, or a named scalar already exposed (`*_template`, `on_complete`). Surgical, reliable.
56
- - Agent-level: persona, communication style, org-wide facts, menu changes, behavior that should apply to every workflow the agent dispatches.
57
-
58
- When ambiguous, present both with tradeoff, recommend one, let the user decide.
59
-
60
- Intent outside the exposed surface (step logic, ordering, anything not in `agent configuration`): say so; offer `activation_steps_prepend`/`append` or `persistent_facts` as approximations, or recommend `bmad-builder` to create a custom skill.
61
-
62
- ## Step 4: Compose the override
63
-
64
- Translate plain-English into TOML against the target's `agent configuration` fields. If an existing override was read, frame the change as additive.
65
-
66
- Merge semantics:
67
- - **Scalars** (`icon`, `role`, `*_template`, `on_complete`) — override wins.
68
- - **Append arrays** (`persistent_facts`, `activation_steps_prepend`/`append`, `principles`) — team/user entries append in order.
69
- - **Keyed arrays of tables** (menu items with `code` or `id`) — matching keys replace, new keys append.
70
-
71
- Overrides are sparse: only the fields being changed. Never copy the whole `agent configuration`.
72
-
73
- **Template swap** (`*_template` scalar): offer to copy the default template to `{project-root}/custom/{skill-name}-{purpose}-template.md`, point the override at the new path, offer to help edit it.
74
-
75
- ## Step 5: Team or user placement
76
-
77
- Under `{project-root}/custom/`:
78
- - `{skill-name}.toml` — team, committed. Policies, org conventions, compliance.
79
- - `{skill-name}.user.toml` — user, gitignored. Personal tone, private facts, shortcuts.
80
-
81
- Default by character (policy → team, personal → user), confirm before writing.
82
-
83
- ## Step 6: Show, confirm, write, verify
84
-
85
- 1. Show the full TOML. If the file exists, show a diff. Never silently overwrite.
86
- 2. Wait for explicit yes.
87
- 3. Write. Create `{project-root}/custom/` if needed.
88
- 4. Verify:
89
- ```
90
- <!-- Adapted for BMAD+: original script dependency removed -->
91
- ```
92
- Show the merged output, point out the changed fields.
93
-
94
- **Resolver missing or fails:** read whichever layers exist — `<install-path>/agent configuration` (base), `{project-root}/custom/{skill-name}.toml` (team), `{project-root}/custom/{skill-name}.user.toml` (user) — apply base → team → user with the same merge rules (scalars override, tables deep-merge, `code`/`id`-keyed arrays merge by key, all other arrays append), describe how the changed fields resolve.
95
-
96
- **Verify shows override didn't land** (field unchanged, merge conflict, file not picked up): re-enter Step 4 with the verify output as context. Usually wrong field name, wrong merge mode (scalar vs array), or wrong scope.
97
- 5. Summarize what changed, where the file lives, how to iterate. Remind the user to commit team overrides.
98
-
99
- ## Complete when
100
-
101
- - Override file written (or user explicitly aborted).
102
- - User has seen resolver output (or manual fallback merge summary).
103
- - User has acknowledged the summary.
104
-
105
- Otherwise the skill isn't done — finish or tell the user they're exiting incomplete.
106
-
107
- ## When this skill can't help
108
-
109
- - **Central config** (`{project-root}/custom/config.toml`) — see the [How to Customize BMad guide](https://docs.bmad-method.org/how-to/customize-bmad/).
110
- - **Step logic, ordering, behavior not in `agent configuration`** — open a feature request, or use `bmad-builder` to create a custom skill. Offer to help with either.
111
- - **Skills without a `agent configuration`** — not customizable.
6
+ # Customize Dev Studio
7
+
8
+ Read the [execution guide](../../shared/execution.md) and adopt
9
+ [Oholiab](../implementation/dev-agent.md).
10
+
11
+ ## Inputs
12
+
13
+ A concrete customization request and the selected project, plus the target agent
14
+ or workflow when the request changes its behavior. Inspect the existing
15
+ installation and project instructions before proposing a file change.
16
+
17
+ ## Supported configuration
18
+
19
+ Dev Studio reads these optional string fields from `_bmad/config.yaml`:
20
+
21
+ | Field | Default when absent | Purpose |
22
+ | --- | --- | --- |
23
+ | user_name | user | Name used in project context |
24
+ | communication_language | English | Conversation preference |
25
+ | document_output_language | English | Document preference |
26
+ | output_folder | _bmad-output | Base for proposed workflow reports |
27
+ | project_name | Selected directory name | Project label |
28
+
29
+ Current user instructions take precedence over language preferences. Existing
30
+ unrelated YAML settings remain intact. A malformed existing file or a known field
31
+ with the wrong type must be corrected explicitly; do not silently replace it.
32
+ This pack does not load TOML overrides or merge hidden customization layers.
33
+
34
+ ## Procedure
35
+
36
+ 1. Identify the intended behavior and where it belongs. Use the supported YAML
37
+ fields for configuration. Use an actual project instruction file already read
38
+ by the host for broader conventions. Use the specific workflow or persona file
39
+ only for an explicitly requested local change to that instruction.
40
+ 2. Read the target file, applicable project rules and any previous customization.
41
+ Distinguish the framework source checkout from a consumer installation. In a
42
+ source checkout edit the maintained source. In an installation a change to an
43
+ owned pack file becomes a local customization that future updates must preserve.
44
+ Never hand-edit an adapter marked as generated; follow its source instructions.
45
+ 3. Prepare and apply the smallest change covered by the user's request. Preserve
46
+ unrelated YAML keys, comments and user-authored content. Do not replace the
47
+ whole configuration to change one value. If no target instruction file is
48
+ automatically loaded by the host, document the required explicit loading step;
49
+ creating a new file alone does not activate it.
50
+ 4. Validate the result with the available YAML parser and inspect the diff.
51
+ Prepare a representative workflow through the CLI to verify resolved
52
+ configuration and loaded instruction text. Preparation verifies loading; it
53
+ does not demonstrate that an LLM followed the new behavior.
54
+ 5. Explain what changed, which host or command reads it, the check performed and
55
+ how to revert the specific change. Keep a locally customized pack instruction
56
+ identified as such; do not adopt or overwrite its ownership hash merely to hide
57
+ the customization.
58
+
59
+ ## Output
60
+
61
+ The common report includes the request, changed path and fields, before/after
62
+ summary, resolved configuration or instruction evidence, remaining limitations
63
+ and a precise rollback description. Keep private values out of public examples.
64
+
65
+ ## Acceptance and continuation
66
+
67
+ The requested setting resolves as intended, unrelated settings are preserved and
68
+ the activation mechanism is real. On resume, read the latest file and compare
69
+ prior evidence before changing anything; preserve intervening edits and recheck
70
+ the representative prepared context.
@@ -1,177 +1,56 @@
1
1
  ---
2
- name: bmad-distillator
3
- description: Lossless LLM-optimized compression of source documents. Use when the user requests to 'distill documents' or 'create a distillate'.
2
+ name: distillator
3
+ description: Create a compact context brief with traceable decisions, constraints, omissions and source references.
4
4
  ---
5
5
 
6
- # Distillator: A Document Distillation Engine
7
-
8
- ## Overview
9
-
10
- This skill produces hyper-compressed, token-efficient documents (distillates) from any set of source documents. A distillate preserves every fact, decision, constraint, and relationship from the sources while stripping all overhead that humans need and LLMs don't. Act as an information extraction and compression specialist. The output is a single dense document (or semantically-split set) that a downstream LLM workflow can consume as sole context input without information loss.
11
-
12
- This is a compression task, not a summarization task. Summaries are lossy. Distillates are lossless compression optimized for LLM consumption.
13
-
14
- ## On Activation
15
-
16
- 1. **Validate inputs.** The caller must provide:
17
- - **source_documents** (required) — One or more file paths, folder paths, or glob patterns to distill
18
- - **downstream_consumer** (optional) — What workflow/agent consumes this distillate (e.g., "PRD creation", "architecture design"). When provided, use it to judge signal vs noise. When omitted, preserve everything.
19
- - **token_budget** (optional) — Approximate target size. When provided and the distillate would exceed it, trigger semantic splitting.
20
- - **output_path** (optional) — Where to save. When omitted, save adjacent to the primary source document with `-distillate.md` suffix.
21
- - **--validate** (flag) — Run round-trip reconstruction test after producing the distillate.
22
-
23
- 2. **Route** — proceed to Stage 1.
24
-
25
- ## Stages
26
-
27
- | # | Stage | Purpose |
28
- |---|-------|---------|
29
- | 1 | Analyze | Run analysis script, determine routing and splitting |
30
- | 2 | Compress | Spawn compressor agent(s) to produce the distillate |
31
- | 3 | Verify & Output | Completeness check, format check, save output |
32
- | 4 | Round-Trip Validate | (--validate only) Reconstruct and diff against originals |
33
-
34
- ### Stage 1: Analyze
35
-
36
- Run `scripts/analyze_sources.py --help` then run it with the source paths. Use its routing recommendation and grouping output to drive Stage 2. Do NOT read the source documents yourself.
37
-
38
- ### Stage 2: Compress
39
-
40
- **Single mode** (routing = `"single"`, ≤3 files, ≤15K estimated tokens):
41
-
42
- Spawn one subagent using `agents/distillate-compressor.md` with all source file paths.
43
-
44
- **Fan-out mode** (routing = `"fan-out"`):
45
-
46
- 1. Spawn one compressor subagent per group from the analysis output. Each compressor receives only its group's file paths and produces an intermediate distillate.
47
-
48
- 2. After all compressors return, spawn one final **merge compressor** subagent using `agents/distillate-compressor.md`. Pass it the intermediate distillate contents as its input (not the original files). Its job is cross-group deduplication, thematic regrouping, and final compression.
49
-
50
- 3. Clean up intermediate distillate content (it exists only in memory, not saved to disk).
51
-
52
- **Graceful degradation:** If subagent spawning is unavailable, read the source documents and perform the compression work directly using the same instructions from `agents/distillate-compressor.md`. For fan-out, process groups sequentially then merge.
53
-
54
- The compressor returns a structured JSON result containing the distillate content, source headings, named entities, and token estimate.
55
-
56
- ### Stage 3: Verify & Output
57
-
58
- After the compressor (or merge compressor) returns:
59
-
60
- 1. **Completeness check.** Using the headings and named entities list returned by the compressor, verify each appears in the distillate content. If gaps are found, send them back to the compressor for a targeted fix pass — not a full recompression. Limit to 2 fix passes maximum.
61
-
62
- 2. **Format check.** Verify the output follows distillate format rules:
63
- - No prose paragraphs (only bullets)
64
- - No decorative formatting
65
- - No repeated information
66
- - Each bullet is self-contained
67
- - Themes are clearly delineated with `##` headings
68
-
69
- 3. **Determine output format.** Using the split prediction from Stage 1 and actual distillate size:
70
-
71
- **Single distillate** (≤~5,000 tokens or token_budget not exceeded):
72
-
73
- Save as a single file with frontmatter:
74
-
75
- ```yaml
76
- ---
77
- type: bmad-distillate
78
- sources:
79
- - "{relative path to source file 1}"
80
- - "{relative path to source file 2}"
81
- downstream_consumer: "{consumer or 'general'}"
82
- created: "{date}"
83
- token_estimate: {approximate token count}
84
- parts: 1
85
- ---
86
- ```
87
-
88
- **Split distillate** (>~5,000 tokens, or token_budget requires it):
89
-
90
- Create a folder `{base-name}-distillate/` containing:
91
-
92
- ```
93
- {base-name}-distillate/
94
- ├── _index.md # Orientation, cross-cutting items, section manifest
95
- ├── 01-{topic-slug}.md # Self-contained section
96
- ├── 02-{topic-slug}.md
97
- └── 03-{topic-slug}.md
98
- ```
99
-
100
- The `_index.md` contains:
101
- - Frontmatter with sources (relative paths from the distillate folder to the originals)
102
- - 3-5 bullet orientation (what was distilled, from what)
103
- - Section manifest: each section's filename + 1-line description
104
- - Cross-cutting items that span multiple sections
105
-
106
- Each section file is self-contained — loadable independently. Include a 1-line context header: "This section covers [topic]. Part N of M."
107
-
108
- Source paths in frontmatter must be relative to the distillate's location.
109
-
110
- 4. **Measure distillate.** Run `scripts/analyze_sources.py` on the final distillate file(s) to get accurate token counts for the output. Use the `total_estimated_tokens` from this analysis as `distillate_total_tokens`.
111
-
112
- 5. **Report results.** Always return structured JSON output:
113
-
114
- ```json
115
- {
116
- "status": "complete",
117
- "distillate": "{path or folder path}",
118
- "section_distillates": ["{path1}", "{path2}"] or null,
119
- "source_total_tokens": N,
120
- "distillate_total_tokens": N,
121
- "compression_ratio": "X:1",
122
- "source_documents": ["{path1}", "{path2}"],
123
- "completeness_check": "pass" or "pass_with_additions"
124
- }
125
- ```
126
-
127
- Where `source_total_tokens` is from the Stage 1 analysis and `distillate_total_tokens` is from step 4. The `compression_ratio` is `source_total_tokens / distillate_total_tokens` formatted as "X:1" (e.g., "3.2:1").
128
-
129
- 6. If `--validate` flag was set, proceed to Stage 4. Otherwise, done.
130
-
131
- ### Stage 4: Round-Trip Validation (--validate only)
132
-
133
- This stage proves the distillate is lossless by reconstructing source documents from the distillate alone. Use for critical documents where information loss is unacceptable, or as a quality gate for high-stakes downstream workflows. Not for routine use — it adds significant token cost.
134
-
135
- 1. **Spawn the reconstructor agent** using `agents/round-trip-reconstructor.md`. Pass it ONLY the distillate file path (or `_index.md` path for split distillates) — it must NOT have access to the original source documents.
136
-
137
- For split distillates, spawn one reconstructor per section in parallel. Each receives its section file plus the `_index.md` for cross-cutting context.
138
-
139
- **Graceful degradation:** If subagent spawning is unavailable, this stage cannot be performed by the main agent (it has already seen the originals). Report that round-trip validation requires subagent support and skip.
140
-
141
- 2. **Receive reconstructions.** The reconstructor returns reconstruction file paths saved adjacent to the distillate.
142
-
143
- 3. **Perform semantic diff.** Read both the original source documents and the reconstructions. For each section of the original, assess:
144
- - Is the core information present in the reconstruction?
145
- - Are specific details preserved (numbers, names, decisions)?
146
- - Are relationships and rationale intact?
147
- - Did the reconstruction add anything not in the original? (indicates hallucination filling gaps)
148
-
149
- 4. **Produce validation report** saved adjacent to the distillate as `-validation-report.md`:
150
-
151
- ```markdown
152
- ---
153
- type: distillate-validation
154
- distillate: "{distillate path}"
155
- sources: ["{source paths}"]
156
- created: "{date}"
157
- ---
158
-
159
- ## Validation Summary
160
- - Status: PASS | PASS_WITH_WARNINGS | FAIL
161
- - Information preserved: {percentage estimate}
162
- - Gaps found: {count}
163
- - Hallucinations detected: {count}
164
-
165
- ## Gaps (information in originals but missing from reconstruction)
166
- - {gap description} — Source: {which original}, Section: {where}
167
-
168
- ## Hallucinations (information in reconstruction not traceable to originals)
169
- - {hallucination description} — appears to fill gap in: {section}
170
-
171
- ## Possible Gap Markers (flagged by reconstructor)
172
- - {marker description}
173
- ```
174
-
175
- 5. **If gaps are found**, offer to run a targeted fix pass on the distillate — adding the missing information without full recompression. Limit to 2 fix passes maximum.
176
-
177
- 6. **Clean up** — delete the temporary reconstruction files after the report is generated.
6
+ # Distillator
7
+
8
+ Read the [execution guide](../../shared/execution.md) and adopt
9
+ [Huldah](../analysis/tech-writer-agent.md).
10
+
11
+ ## Inputs
12
+
13
+ At least one explicit source document, its intended reader or next task, and any
14
+ size limit. If the task or limit is absent, state a practical default: a brief for
15
+ the next project contributor, with no fixed compression ratio. Inspect every
16
+ source; preserve the originals. Summarization can lose information and must never
17
+ be described as lossless compression.
18
+
19
+ ## Procedure
20
+
21
+ 1. Inventory source paths, dates and hashes when available. Separate current
22
+ decisions from proposals, superseded claims and unresolved disagreement. Note
23
+ unreadable sections or sources that exceed the available context.
24
+ 2. Extract the facts the next task depends on: objective, acceptance criteria,
25
+ constraints, interfaces, decisions with reasons, current state and blockers.
26
+ Keep exact identifiers, units, conditions and negations where they affect the
27
+ work. Do not turn an approximate figure into a precise one.
28
+ 3. Draft a compact brief with source pointers next to material claims. Preserve
29
+ incompatible claims as an explicit conflict; do not silently choose a winner.
30
+ Use a small table for a useful mapping rather than opaque abbreviations.
31
+ 4. Check the brief against the sources. Trace each decision and constraint back
32
+ to a section. Check numbers, names and exceptions separately. If a size limit
33
+ would hide a required constraint, report the tradeoff and retain that detail.
34
+ 5. List what was omitted and when the reader must reopen an original document.
35
+ Include the next action and the exact sources needed to perform it.
36
+
37
+ ## Output
38
+
39
+ Write the common workflow report with these additional sections:
40
+
41
+ - Purpose and source inventory.
42
+ - Current facts and constraints, with references.
43
+ - Decisions and rationale; unresolved conflicts.
44
+ - Completed work, open work and next action.
45
+ - Omitted material and original documents to reopen.
46
+
47
+ Use the report itself as the brief, or link to a separate user-requested brief.
48
+ If reporting a reduction, measure both texts with the same word or byte counter
49
+ and name that measure. Do not invent token counts.
50
+
51
+ ## Acceptance and continuation
52
+
53
+ Every material assertion has a source or an explicit assumption label. Required
54
+ constraints remain readable; omissions and uninspected inputs are visible. The
55
+ source files are unchanged. On resume, compare the source inventory and hashes;
56
+ refresh affected claims and recheck their dependents before reusing the brief.
@@ -1,67 +1,53 @@
1
1
  ---
2
- name: bmad-review-edge-case-hunter
3
- description: 'Walk every branching path and boundary condition in content, report only unhandled edge cases. Orthogonal to adversarial review - method-driven not attitude-driven. Use when you need exhaustive edge-case analysis of code, specs, or diffs.'
2
+ name: edge-case-hunter
3
+ description: Derive concrete boundary and failure scenarios from a feature, interface or implementation.
4
4
  ---
5
5
 
6
- # Edge Case Hunter Review
6
+ # Edge Case Hunter
7
7
 
8
- **Goal:** You are a pure path tracer. Never comment on whether code is good or bad; only list missing handling.
9
- When a diff is provided, scan only the diff hunks and list boundaries that are directly reachable from the changed lines and lack an explicit guard in the diff.
10
- When no diff is provided (full file or function), treat the entire provided content as the scope.
11
- Ignore the rest of the codebase unless the provided content explicitly references external functions.
8
+ Read the [execution guide](../../shared/execution.md) and adopt
9
+ [Bezalel](../architecture/architect-agent.md).
12
10
 
13
- **Inputs:**
14
- - **content** — Content to review: diff, full file, or function
15
- - **also_consider** (optional) — Areas to keep in mind during review alongside normal edge-case analysis
11
+ ## Inputs
16
12
 
17
- **MANDATORY: Execute steps in the Execution section IN EXACT ORDER. DO NOT skip steps or change the sequence. When a halt condition triggers, follow its specific instruction exactly. Each action within a step is a REQUIRED action to complete that step.**
13
+ A feature, interface, state transition or failure concern, with its intended
14
+ behavior and relevant artifacts where available. For a code claim, inspect the
15
+ implementation before describing it as present. A description alone supports
16
+ design scenarios, not verified defects.
18
17
 
19
- **Your method is exhaustive path enumeration — mechanically walk every branch, not hunt by intuition. Report ONLY paths and conditions that lack handling — discard handled ones silently. Do NOT editorialize or add filler — findings only.**
18
+ ## Procedure
20
19
 
20
+ 1. Map the relevant inputs, states, outputs and trust boundaries. Identify the
21
+ invariant that should hold and any user-visible behavior that must remain true.
22
+ Keep the scope narrow enough to inspect.
23
+ 2. Derive applicable boundaries: absent or malformed input, minimum and maximum
24
+ size, duplicate requests, concurrent changes, interruption, timeout, partial
25
+ failure, stale state, cancellation, permission changes and recovery. Include
26
+ time, locale, accessibility or resource limits when they affect this feature.
27
+ 3. Turn relevant cases into concrete scenarios. Specify initial state, trigger,
28
+ expected behavior, failure consequence and an observable check. Discard cases
29
+ already impossible under a verified constraint and record the reason.
30
+ 4. Inspect code or run safe existing checks to see which cases are covered.
31
+ Distinguish a design gap, a reproduced defect, an unexecuted scenario and
32
+ verified protection. Record the command or source location behind each status.
33
+ 5. Prioritize by consequence and plausible exposure, with reasons. Propose the
34
+ smallest regression check or design decision for each material gap. If the user
35
+ requested fixes, carry those out within scope using the implementation workflow;
36
+ a list of cases by itself does not establish a fix.
21
37
 
22
- ## EXECUTION
38
+ ## Output
23
39
 
24
- ### Step 1: Receive Content
40
+ The common report includes a boundary map and a scenario table:
25
41
 
26
- - Load the content to review strictly from provided input
27
- - If content is empty, or cannot be decoded as text, return `[{"location":"N/A","trigger_condition":"Input empty or undecodable","guard_snippet":"Provide valid content to review","potential_consequence":"Review skipped — no analysis performed"}]` and stop
28
- - Identify content type (diff, full file, or function) to determine scope rules
42
+ | Scenario | Initial state and trigger | Expected behavior | Evidence/status | Impact | Next check |
43
+ | --- | --- | --- | --- | --- | --- |
29
44
 
30
- ### Step 2: Exhaustive Path Analysis
45
+ Include invariant violations separately from preferred UX improvements. Record
46
+ cases excluded by inspected constraints and any unavailable execution capability.
31
47
 
32
- **Walk every branching path and boundary condition within scope — report only unhandled ones.**
48
+ ## Acceptance and continuation
33
49
 
34
- - If `also_consider` input was provided, incorporate those areas into the analysis
35
- - Walk all branching paths: control flow (conditionals, loops, error handlers, early returns) and domain boundaries (where values, states, or conditions transition). Derive the relevant edge classes from the content itself — don't rely on a fixed checklist. Examples: missing else/default, unguarded inputs, off-by-one loops, arithmetic overflow, implicit type coercion, race conditions, timeout gaps
36
- - For each path: determine whether the content handles it
37
- - Collect only the unhandled paths as findings — discard handled ones silently
38
-
39
- ### Step 3: Validate Completeness
40
-
41
- - Revisit every edge class from Step 2 — e.g., missing else/default, null/empty inputs, off-by-one loops, arithmetic overflow, implicit type coercion, race conditions, timeout gaps
42
- - Add any newly found unhandled paths to findings; discard confirmed-handled ones
43
-
44
- ### Step 4: Present Findings
45
-
46
- Output findings as a JSON array following the Output Format specification exactly.
47
-
48
-
49
- ## OUTPUT FORMAT
50
-
51
- Return ONLY a valid JSON array of objects. Each object must contain exactly these four fields and nothing else:
52
-
53
- ```json
54
- [{
55
- "location": "file:start-end (or file:line when single line, or file:hunk when exact line unavailable)",
56
- "trigger_condition": "one-line description (max 15 words)",
57
- "guard_snippet": "minimal code sketch that closes the gap (single-line escaped string, no raw newlines or unescaped quotes)",
58
- "potential_consequence": "what could actually go wrong (max 15 words)"
59
- }]
60
- ```
61
-
62
- No extra text, no explanations, no markdown wrapping. An empty array `[]` is valid when no unhandled paths are found.
63
-
64
-
65
- ## HALT CONDITIONS
66
-
67
- - If content is empty or cannot be decoded as text, return `[{"location":"N/A","trigger_condition":"Input empty or undecodable","guard_snippet":"Provide valid content to review","potential_consequence":"Review skipped — no analysis performed"}]` and stop
50
+ Each retained case can become an observable check. Reproduced defects include
51
+ reproduction evidence; unrun cases are labeled accurately. On resume, compare
52
+ changed interfaces and invariants, rerun affected checks and preserve evidence for
53
+ closed cases. Do not mark the whole feature robust because a sample passed.