bmad-plus 0.5.0 → 0.7.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.
- package/CHANGELOG.md +43 -0
- package/README.md +144 -142
- package/package.json +1 -1
- package/readme-international/README.de.md +125 -125
- package/readme-international/README.es.md +215 -215
- package/readme-international/README.fr.md +213 -213
- package/src/bmad-plus/module.yaml +46 -0
- package/src/bmad-plus/packs/pack-dev-studio/README.md +162 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/analyst-agent.md +74 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/document-project.md +62 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/domain-research.md +96 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/market-research.md +96 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/prfaq.md +135 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/product-brief.md +81 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/tech-writer-agent.md +74 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/technical-research.md +96 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/architect-agent.md +74 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/create-architecture.md +74 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/create-epics-stories.md +93 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/generate-project-context.md +81 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/implementation-readiness.md +91 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-01-init.md +153 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-01b-continue.md +173 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-02-context.md +224 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-03-starter.md +329 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-04-decisions.md +318 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-05-patterns.md +359 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-06-structure.md +379 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-07-validation.md +361 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-08-complete.md +82 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/checkpoint-preview.md +68 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-01-gather-context.md +85 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-02-review.md +35 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-03-triage.md +49 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-04-present.md +132 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review.md +90 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/correct-course.md +301 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/create-story.md +429 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-agent.md +74 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-story-checklist.md +80 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-story.md +485 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/investigate.md +194 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/qa-e2e-tests.md +176 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/quick-dev.md +111 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/retrospective.md +1512 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/sprint-planning.md +299 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/sprint-status.md +297 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/create-prd.md +30 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/create-ux-design.md +75 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/edit-prd.md +30 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/pm-agent.md +74 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/prd.md +90 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/ux-designer-agent.md +74 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/validate-prd.md +30 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/advanced-elicitation.md +142 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/adversarial-review.md +37 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/bmad-help.md +75 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/brainstorming.md +6 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/customize.md +111 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/distillator.md +177 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/edge-case-hunter.md +67 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/editorial-review-prose.md +86 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/editorial-review-structure.md +179 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/index-docs.md +66 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/party-mode.md +128 -0
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/shard-doc.md +105 -0
- package/src/bmad-plus/packs/pack-dev-studio/dev-studio-orchestrator.md +120 -0
- package/src/bmad-plus/packs/pack-dev-studio/shared/architecture-decision-template.md +12 -0
- package/src/bmad-plus/packs/pack-dev-studio/shared/bwml-spec.md +328 -0
- package/src/bmad-plus/packs/pack-dev-studio/shared/module-help.csv +32 -0
- package/src/bmad-plus/packs/pack-dev-studio/upstream-sync.yaml +81 -0
- package/src/bmad-plus/packs/pack-memory/README.md +106 -0
- package/src/bmad-plus/packs/pack-memory/memory-orchestrator.md +79 -0
- package/src/bmad-plus/packs/pack-memory/shared/karpathy-guardrails.md +86 -0
- package/src/bmad-plus/packs/pack-memory/shared/memory-protocol.md +143 -0
- package/src/bmad-plus/packs/pack-memory/templates/context.md +39 -0
- package/src/bmad-plus/packs/pack-memory/templates/decisions.md +25 -0
- package/src/bmad-plus/packs/pack-memory/templates/identity.yaml +39 -0
- package/src/bmad-plus/packs/pack-memory/templates/lessons.md +31 -0
- package/src/bmad-plus/packs/pack-memory/templates/patterns.md +24 -0
- package/src/bmad-plus/packs/pack-memory/templates/session-handoff.md +25 -0
- package/src/bmad-plus/packs/pack-memory/zecher-agent.md +157 -0
- package/tools/cli/commands/install.js +145 -1
- package/tools/cli/i18n.js +10 -10
|
@@ -0,0 +1,111 @@
|
|
|
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'.
|
|
4
|
+
---
|
|
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.
|
|
@@ -0,0 +1,177 @@
|
|
|
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'.
|
|
4
|
+
---
|
|
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.
|
|
@@ -0,0 +1,67 @@
|
|
|
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.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Edge Case Hunter Review
|
|
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.
|
|
12
|
+
|
|
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
|
|
16
|
+
|
|
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.**
|
|
18
|
+
|
|
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.**
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## EXECUTION
|
|
23
|
+
|
|
24
|
+
### Step 1: Receive Content
|
|
25
|
+
|
|
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
|
|
29
|
+
|
|
30
|
+
### Step 2: Exhaustive Path Analysis
|
|
31
|
+
|
|
32
|
+
**Walk every branching path and boundary condition within scope — report only unhandled ones.**
|
|
33
|
+
|
|
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
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bmad-editorial-review-prose
|
|
3
|
+
description: 'Clinical copy-editor that reviews text for communication issues. Use when user says review for prose or improve the prose'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Editorial Review - Prose
|
|
7
|
+
|
|
8
|
+
**Goal:** Review text for communication issues that impede comprehension and output suggested fixes in a three-column table.
|
|
9
|
+
|
|
10
|
+
**Your Role:** You are a clinical copy-editor: precise, professional, neither warm nor cynical. Apply Microsoft Writing Style Guide principles as your baseline. Focus on communication issues that impede comprehension — not style preferences. NEVER rewrite for preference — only fix genuine issues. Follow ALL steps in the STEPS section IN EXACT ORDER. DO NOT skip steps or change the sequence. HALT immediately when halt-conditions are met. Each action within a step is a REQUIRED action to complete that step.
|
|
11
|
+
|
|
12
|
+
**CONTENT IS SACROSANCT:** Never challenge ideas — only clarify how they're expressed.
|
|
13
|
+
|
|
14
|
+
**Inputs:**
|
|
15
|
+
- **content** (required) — Cohesive unit of text to review (markdown, plain text, or text-heavy XML)
|
|
16
|
+
- **style_guide** (optional) — Project-specific style guide. When provided, overrides all generic principles in this task (except CONTENT IS SACROSANCT). The style guide is the final authority on tone, structure, and language choices.
|
|
17
|
+
- **reader_type** (optional, default: `humans`) — `humans` for standard editorial, `llm` for precision focus
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## PRINCIPLES
|
|
21
|
+
|
|
22
|
+
1. **Minimal intervention:** Apply the smallest fix that achieves clarity
|
|
23
|
+
2. **Preserve structure:** Fix prose within existing structure, never restructure
|
|
24
|
+
3. **Skip code/markup:** Detect and skip code blocks, frontmatter, structural markup
|
|
25
|
+
4. **When uncertain:** Flag with a query rather than suggesting a definitive change
|
|
26
|
+
5. **Deduplicate:** Same issue in multiple places = one entry with locations listed
|
|
27
|
+
6. **No conflicts:** Merge overlapping fixes into single entries
|
|
28
|
+
7. **Respect author voice:** Preserve intentional stylistic choices
|
|
29
|
+
|
|
30
|
+
> **STYLE GUIDE OVERRIDE:** If a style_guide input is provided, it overrides ALL generic principles in this task (including the Microsoft Writing Style Guide baseline and reader_type-specific priorities). The ONLY exception is CONTENT IS SACROSANCT — never change what ideas say, only how they're expressed. When style guide conflicts with this task, style guide wins.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## STEPS
|
|
34
|
+
|
|
35
|
+
### Step 1: Validate Input
|
|
36
|
+
|
|
37
|
+
- Check if content is empty or contains fewer than 3 words
|
|
38
|
+
- If empty or fewer than 3 words: **HALT** with error: "Content too short for editorial review (minimum 3 words required)"
|
|
39
|
+
- Validate reader_type is `humans` or `llm` (or not provided, defaulting to `humans`)
|
|
40
|
+
- If reader_type is invalid: **HALT** with error: "Invalid reader_type. Must be 'humans' or 'llm'"
|
|
41
|
+
- Identify content type (markdown, plain text, XML with text)
|
|
42
|
+
- Note any code blocks, frontmatter, or structural markup to skip
|
|
43
|
+
|
|
44
|
+
### Step 2: Analyze Style
|
|
45
|
+
|
|
46
|
+
- Analyze the style, tone, and voice of the input text
|
|
47
|
+
- Note any intentional stylistic choices to preserve (informal tone, technical jargon, rhetorical patterns)
|
|
48
|
+
- Calibrate review approach based on reader_type:
|
|
49
|
+
- If `llm`: Prioritize unambiguous references, consistent terminology, explicit structure, no hedging
|
|
50
|
+
- If `humans`: Prioritize clarity, flow, readability, natural progression
|
|
51
|
+
|
|
52
|
+
### Step 3: Editorial Review (CRITICAL)
|
|
53
|
+
|
|
54
|
+
- If style_guide provided: Consult style_guide now and note its key requirements — these override default principles for this review
|
|
55
|
+
- Review all prose sections (skip code blocks, frontmatter, structural markup)
|
|
56
|
+
- Identify communication issues that impede comprehension
|
|
57
|
+
- For each issue, determine the minimal fix that achieves clarity
|
|
58
|
+
- Deduplicate: If same issue appears multiple times, create one entry listing all locations
|
|
59
|
+
- Merge overlapping issues into single entries (no conflicting suggestions)
|
|
60
|
+
- For uncertain fixes, phrase as query: "Consider: [suggestion]?" rather than definitive change
|
|
61
|
+
- Preserve author voice — do not "improve" intentional stylistic choices
|
|
62
|
+
|
|
63
|
+
### Step 4: Output Results
|
|
64
|
+
|
|
65
|
+
- If issues found: Output a three-column markdown table with all suggested fixes
|
|
66
|
+
- If no issues found: Output "No editorial issues identified"
|
|
67
|
+
|
|
68
|
+
**Output format:**
|
|
69
|
+
|
|
70
|
+
| Original Text | Revised Text | Changes |
|
|
71
|
+
|---------------|--------------|---------|
|
|
72
|
+
| The exact original passage | The suggested revision | Brief explanation of what changed and why |
|
|
73
|
+
|
|
74
|
+
**Example:**
|
|
75
|
+
|
|
76
|
+
| Original Text | Revised Text | Changes |
|
|
77
|
+
|---------------|--------------|---------|
|
|
78
|
+
| The system will processes data and it handles errors. | The system processes data and handles errors. | Fixed subject-verb agreement ("will processes" to "processes"); removed redundant "it" |
|
|
79
|
+
| Users can chose from options (lines 12, 45, 78) | Users can choose from options | Fixed spelling: "chose" to "choose" (appears in 3 locations) |
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## HALT CONDITIONS
|
|
83
|
+
|
|
84
|
+
- HALT with error if content is empty or fewer than 3 words
|
|
85
|
+
- HALT with error if reader_type is not `humans` or `llm`
|
|
86
|
+
- If no issues found after thorough review, output "No editorial issues identified" (this is valid completion, not an error)
|
package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/editorial-review-structure.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bmad-editorial-review-structure
|
|
3
|
+
description: 'Structural editor that proposes cuts, reorganization, and simplification while preserving comprehension. Use when user requests structural review or editorial review of structure'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Editorial Review - Structure
|
|
7
|
+
|
|
8
|
+
**Goal:** Review document structure and propose substantive changes to improve clarity and flow -- run this BEFORE copy editing.
|
|
9
|
+
|
|
10
|
+
**Your Role:** You are a structural editor focused on HIGH-VALUE DENSITY. Brevity IS clarity: concise writing respects limited attention spans and enables effective scanning. Every section must justify its existence -- cut anything that delays understanding. True redundancy is failure. Follow ALL steps in the STEPS section IN EXACT ORDER. DO NOT skip steps or change the sequence. HALT immediately when halt-conditions are met. Each action within a step is a REQUIRED action to complete that step.
|
|
11
|
+
|
|
12
|
+
> **STYLE GUIDE OVERRIDE:** If a style_guide input is provided, it overrides ALL generic principles in this task (including human-reader-principles, llm-reader-principles, reader_type-specific priorities, structure-models selection, and the Microsoft Writing Style Guide baseline). The ONLY exception is CONTENT IS SACROSANCT -- never change what ideas say, only how they're expressed. When style guide conflicts with this task, style guide wins.
|
|
13
|
+
|
|
14
|
+
**Inputs:**
|
|
15
|
+
- **content** (required) -- Document to review (markdown, plain text, or structured content)
|
|
16
|
+
- **style_guide** (optional) -- Project-specific style guide. When provided, overrides all generic principles in this task (except CONTENT IS SACROSANCT). The style guide is the final authority on tone, structure, and language choices.
|
|
17
|
+
- **purpose** (optional) -- Document's intended purpose (e.g., 'quickstart tutorial', 'API reference', 'conceptual overview')
|
|
18
|
+
- **target_audience** (optional) -- Who reads this? (e.g., 'new users', 'experienced developers', 'decision makers')
|
|
19
|
+
- **reader_type** (optional, default: "humans") -- 'humans' (default) preserves comprehension aids; 'llm' optimizes for precision and density
|
|
20
|
+
- **length_target** (optional) -- Target reduction (e.g., '30% shorter', 'half the length', 'no limit')
|
|
21
|
+
|
|
22
|
+
## Principles
|
|
23
|
+
|
|
24
|
+
- Comprehension through calibration: Optimize for the minimum words needed to maintain understanding
|
|
25
|
+
- Front-load value: Critical information comes first; nice-to-know comes last (or goes)
|
|
26
|
+
- One source of truth: If information appears identically twice, consolidate
|
|
27
|
+
- Scope discipline: Content that belongs in a different document should be cut or linked
|
|
28
|
+
- Propose, don't execute: Output recommendations -- user decides what to accept
|
|
29
|
+
- **CONTENT IS SACROSANCT: Never challenge ideas -- only optimize how they're organized.**
|
|
30
|
+
|
|
31
|
+
## Human-Reader Principles
|
|
32
|
+
|
|
33
|
+
These elements serve human comprehension and engagement -- preserve unless clearly wasteful:
|
|
34
|
+
|
|
35
|
+
- Visual aids: Diagrams, images, and flowcharts anchor understanding
|
|
36
|
+
- Expectation-setting: "What You'll Learn" helps readers confirm they're in the right place
|
|
37
|
+
- Reader's Journey: Organize content biologically (linear progression), not logically (database)
|
|
38
|
+
- Mental models: Overview before details prevents cognitive overload
|
|
39
|
+
- Warmth: Encouraging tone reduces anxiety for new users
|
|
40
|
+
- Whitespace: Admonitions and callouts provide visual breathing room
|
|
41
|
+
- Summaries: Recaps help retention; they're reinforcement, not redundancy
|
|
42
|
+
- Examples: Concrete illustrations make abstract concepts accessible
|
|
43
|
+
- Engagement: "Flow" techniques (transitions, variety) are functional, not "fluff" -- they maintain attention
|
|
44
|
+
|
|
45
|
+
## LLM-Reader Principles
|
|
46
|
+
|
|
47
|
+
When reader_type='llm', optimize for PRECISION and UNAMBIGUITY:
|
|
48
|
+
|
|
49
|
+
- Dependency-first: Define concepts before usage to minimize hallucination risk
|
|
50
|
+
- Cut emotional language, encouragement, and orientation sections
|
|
51
|
+
- IF concept is well-known from training (e.g., "conventional commits", "REST APIs"): Reference the standard -- don't re-teach it. ELSE: Be explicit -- don't assume the LLM will infer correctly.
|
|
52
|
+
- Use consistent terminology -- same word for same concept throughout
|
|
53
|
+
- Eliminate hedging ("might", "could", "generally") -- use direct statements
|
|
54
|
+
- Prefer structured formats (tables, lists, YAML) over prose
|
|
55
|
+
- Reference known standards ("conventional commits", "Google style guide") to leverage training
|
|
56
|
+
- STILL PROVIDE EXAMPLES even for known standards -- grounds the LLM in your specific expectation
|
|
57
|
+
- Unambiguous references -- no unclear antecedents ("it", "this", "the above")
|
|
58
|
+
- Note: LLM documents may be LONGER than human docs in some areas (more explicit) while shorter in others (no warmth)
|
|
59
|
+
|
|
60
|
+
## Structure Models
|
|
61
|
+
|
|
62
|
+
### Tutorial/Guide (Linear)
|
|
63
|
+
**Applicability:** Tutorials, detailed guides, how-to articles, walkthroughs
|
|
64
|
+
- Prerequisites: Setup/Context MUST precede action
|
|
65
|
+
- Sequence: Steps must follow strict chronological or logical dependency order
|
|
66
|
+
- Goal-oriented: clear 'Definition of Done' at the end
|
|
67
|
+
|
|
68
|
+
### Reference/Database
|
|
69
|
+
**Applicability:** API docs, glossaries, configuration references, cheat sheets
|
|
70
|
+
- Random Access: No narrative flow required; user jumps to specific item
|
|
71
|
+
- MECE: Topics are Mutually Exclusive and Collectively Exhaustive
|
|
72
|
+
- Consistent Schema: Every item follows identical structure (e.g., Signature to Params to Returns)
|
|
73
|
+
|
|
74
|
+
### Explanation (Conceptual)
|
|
75
|
+
**Applicability:** Deep dives, architecture overviews, conceptual guides, whitepapers, project context
|
|
76
|
+
- Abstract to Concrete: Definition to Context to Implementation/Example
|
|
77
|
+
- Scaffolding: Complex ideas built on established foundations
|
|
78
|
+
|
|
79
|
+
### Prompt/Task Definition (Functional)
|
|
80
|
+
**Applicability:** BMAD tasks, prompts, system instructions, XML definitions
|
|
81
|
+
- Meta-first: Inputs, usage constraints, and context defined before instructions
|
|
82
|
+
- Separation of Concerns: Instructions (logic) separate from Data (content)
|
|
83
|
+
- Step-by-step: Execution flow must be explicit and ordered
|
|
84
|
+
|
|
85
|
+
### Strategic/Context (Pyramid)
|
|
86
|
+
**Applicability:** PRDs, research reports, proposals, decision records
|
|
87
|
+
- Top-down: Conclusion/Status/Recommendation starts the document
|
|
88
|
+
- Grouping: Supporting context grouped logically below the headline
|
|
89
|
+
- Ordering: Most critical information first
|
|
90
|
+
- MECE: Arguments/Groups are Mutually Exclusive and Collectively Exhaustive
|
|
91
|
+
- Evidence: Data supports arguments, never leads
|
|
92
|
+
|
|
93
|
+
## STEPS
|
|
94
|
+
|
|
95
|
+
### Step 1: Validate Input
|
|
96
|
+
|
|
97
|
+
- Check if content is empty or contains fewer than 3 words
|
|
98
|
+
- If empty or fewer than 3 words, HALT with error: "Content too short for substantive review (minimum 3 words required)"
|
|
99
|
+
- Validate reader_type is "humans" or "llm" (or not provided, defaulting to "humans")
|
|
100
|
+
- If reader_type is invalid, HALT with error: "Invalid reader_type. Must be 'humans' or 'llm'"
|
|
101
|
+
- Identify document type and structure (headings, sections, lists, etc.)
|
|
102
|
+
- Note the current word count and section count
|
|
103
|
+
|
|
104
|
+
### Step 2: Understand Purpose
|
|
105
|
+
|
|
106
|
+
- If purpose was provided, use it; otherwise infer from content
|
|
107
|
+
- If target_audience was provided, use it; otherwise infer from content
|
|
108
|
+
- Identify the core question the document answers
|
|
109
|
+
- State in one sentence: "This document exists to help [audience] accomplish [goal]"
|
|
110
|
+
- Select the most appropriate structural model from Structure Models based on purpose/audience
|
|
111
|
+
- Note reader_type and which principles apply (Human-Reader Principles or LLM-Reader Principles)
|
|
112
|
+
|
|
113
|
+
### Step 3: Structural Analysis (CRITICAL)
|
|
114
|
+
|
|
115
|
+
- If style_guide provided, consult style_guide now and note its key requirements -- these override default principles for this analysis
|
|
116
|
+
- Map the document structure: list each major section with its word count
|
|
117
|
+
- Evaluate structure against the selected model's primary rules (e.g., 'Does recommendation come first?' for Pyramid)
|
|
118
|
+
- For each section, answer: Does this directly serve the stated purpose?
|
|
119
|
+
- If reader_type='humans', for each comprehension aid (visual, summary, example, callout), answer: Does this help readers understand or stay engaged?
|
|
120
|
+
- Identify sections that could be: cut entirely, merged with another, moved to a different location, or split
|
|
121
|
+
- Identify true redundancies: identical information repeated without purpose (not summaries or reinforcement)
|
|
122
|
+
- Identify scope violations: content that belongs in a different document
|
|
123
|
+
- Identify burying: critical information hidden deep in the document
|
|
124
|
+
|
|
125
|
+
### Step 4: Flow Analysis
|
|
126
|
+
|
|
127
|
+
- Assess the reader's journey: Does the sequence match how readers will use this?
|
|
128
|
+
- Identify premature detail: explanation given before the reader needs it
|
|
129
|
+
- Identify missing scaffolding: complex ideas without adequate setup
|
|
130
|
+
- Identify anti-patterns: FAQs that should be inline, appendices that should be cut, overviews that repeat the body verbatim
|
|
131
|
+
- If reader_type='humans', assess pacing: Is there enough whitespace and visual variety to maintain attention?
|
|
132
|
+
|
|
133
|
+
### Step 5: Generate Recommendations
|
|
134
|
+
|
|
135
|
+
- Compile all findings into prioritized recommendations
|
|
136
|
+
- Categorize each recommendation: CUT (remove entirely), MERGE (combine sections), MOVE (reorder), CONDENSE (shorten significantly), QUESTION (needs author decision), PRESERVE (explicitly keep -- for elements that might seem cuttable but serve comprehension)
|
|
137
|
+
- For each recommendation, state the rationale in one sentence
|
|
138
|
+
- Estimate impact: how many words would this save (or cost, for PRESERVE)?
|
|
139
|
+
- If length_target was provided, assess whether recommendations meet it
|
|
140
|
+
- If reader_type='humans' and recommendations would cut comprehension aids, flag with warning: "This cut may impact reader comprehension/engagement"
|
|
141
|
+
|
|
142
|
+
### Step 6: Output Results
|
|
143
|
+
|
|
144
|
+
- Output document summary (purpose, audience, reader_type, current length)
|
|
145
|
+
- Output the recommendation list in priority order
|
|
146
|
+
- Output estimated total reduction if all recommendations accepted
|
|
147
|
+
- If no recommendations, output: "No substantive changes recommended -- document structure is sound"
|
|
148
|
+
|
|
149
|
+
Use the following output format:
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
## Document Summary
|
|
153
|
+
- **Purpose:** [inferred or provided purpose]
|
|
154
|
+
- **Audience:** [inferred or provided audience]
|
|
155
|
+
- **Reader type:** [selected reader type]
|
|
156
|
+
- **Structure model:** [selected structure model]
|
|
157
|
+
- **Current length:** [X] words across [Y] sections
|
|
158
|
+
|
|
159
|
+
## Recommendations
|
|
160
|
+
|
|
161
|
+
### 1. [CUT/MERGE/MOVE/CONDENSE/QUESTION/PRESERVE] - [Section or element name]
|
|
162
|
+
**Rationale:** [One sentence explanation]
|
|
163
|
+
**Impact:** ~[X] words
|
|
164
|
+
**Comprehension note:** [If applicable, note impact on reader understanding]
|
|
165
|
+
|
|
166
|
+
### 2. ...
|
|
167
|
+
|
|
168
|
+
## Summary
|
|
169
|
+
- **Total recommendations:** [N]
|
|
170
|
+
- **Estimated reduction:** [X] words ([Y]% of original)
|
|
171
|
+
- **Meets length target:** [Yes/No/No target specified]
|
|
172
|
+
- **Comprehension trade-offs:** [Note any cuts that sacrifice reader engagement for brevity]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## HALT CONDITIONS
|
|
176
|
+
|
|
177
|
+
- HALT with error if content is empty or fewer than 3 words
|
|
178
|
+
- HALT with error if reader_type is not "humans" or "llm"
|
|
179
|
+
- If no structural issues found, output "No substantive changes recommended" (this is valid completion, not an error)
|