@skyf0xx/hedgehog 4.0.11 → 4.0.13

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 (47) hide show
  1. package/README.md +4 -17
  2. package/package.json +1 -1
  3. package/src/skills/hedgehog-landing-loop/SKILL.md +1 -1
  4. package/src/skills/hedgehog-planning-intake/SKILL.md +10 -6
  5. package/vendor-skills/BMAD/ATTRIBUTION.md +28 -7
  6. package/vendor-skills/BMAD/core-skills/bmad-forge-idea/SKILL.md +105 -0
  7. package/vendor-skills/BMAD/core-skills/bmad-forge-idea/customize.toml +42 -0
  8. package/vendor-skills/BMAD/core-skills/bmad-forge-idea/scripts/resolve_personas.py +275 -0
  9. package/vendor-skills/BMAD/core-skills/bmad-forge-idea/scripts/tests/test_resolve_personas.py +138 -0
  10. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-prd/SKILL.md +0 -0
  11. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-prd/assets/headless-schemas.md +0 -0
  12. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-prd/assets/prd-template.md +0 -0
  13. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-prd/assets/prd-validation-checklist.md +0 -0
  14. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-prd/assets/validation-report-template.html +0 -0
  15. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-prd/customize.toml +0 -0
  16. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-prd/references/headless.md +0 -0
  17. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-prd/references/validate.md +0 -0
  18. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/SKILL.md +0 -0
  19. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/agents/artifact-analyzer.md +0 -0
  20. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/agents/web-researcher.md +0 -0
  21. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/assets/prfaq-template.md +0 -0
  22. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/bmad-manifest.json +0 -0
  23. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/customize.toml +0 -0
  24. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/references/customer-faq.md +0 -0
  25. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/references/internal-faq.md +0 -0
  26. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/references/press-release.md +0 -0
  27. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-prfaq/references/verdict.md +0 -0
  28. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-product-brief/SKILL.md +0 -0
  29. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-product-brief/assets/brief-template.md +0 -0
  30. /package/vendor-skills/BMAD/bmm-skills/{1-analysis → plan}/bmad-product-brief/customize.toml +0 -0
  31. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/SKILL.md +0 -0
  32. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/color-themes.md +0 -0
  33. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/design-directions.md +0 -0
  34. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/design-example-editorial.md +0 -0
  35. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/design-example-mobile.md +0 -0
  36. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/design-example-shadcn.md +0 -0
  37. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/excalidraw-wireframe.md +0 -0
  38. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/experience-example-mobile.md +0 -0
  39. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/experience-example-shadcn.md +0 -0
  40. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/headless-schemas.md +0 -0
  41. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/key-screens.md +0 -0
  42. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/assets/validation-report-template.html +0 -0
  43. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/customize.toml +0 -0
  44. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/references/creative-tools.md +0 -0
  45. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/references/design-md-spec.md +0 -0
  46. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/references/headless.md +0 -0
  47. /package/vendor-skills/BMAD/bmm-skills/{2-plan-workflows → plan}/bmad-ux/references/validate.md +0 -0
package/README.md CHANGED
@@ -50,7 +50,7 @@ The build order is encoded into the project. The AI does not have to remember wh
50
50
 
51
51
  ## Your build order is a graph
52
52
 
53
- **Every task** Hedgehog generates **is a node** with explicit dependencies in sqlite.
53
+ **Every task** Hedgehog generates **is a node** with [explicit dependencies in sqlite](BUILD_GRAPH.md).
54
54
 
55
55
  Unlike stories and epics, **the graph locks build order** into an **signal-dense, context-light** path the agents can use.
56
56
 
@@ -154,18 +154,6 @@ Each one gets the discipline in its own native shape — agents and skills
154
154
  in the directory it reads, and the instructions file it loads at session
155
155
  start (`CLAUDE.md`, `HEDGEHOG.md`, or `GEMINI.md`).
156
156
 
157
- Every install also writes **`AGENTS.md`** at the repo root: an index of
158
- every agent and skill, when each applies, and the build loop. Coding
159
- agents that read `AGENTS.md` — Codex, Copilot CLI, OpenCode, and others —
160
- work from that index, following the same ordered steps and the same
161
- `hedgehog verify` gate.
162
-
163
- Plain `init` (no core flag) installs the agents, skills, and build graph
164
- that every core shares. Planning intake designs an opinionated build
165
- order and stack for what you actually describe, then bootstrap generates
166
- that workspace. Don't pick `--ts-full-stack-app` or `--landing-page` by
167
- elimination when neither actually fits.
168
-
169
157
  To update:
170
158
 
171
159
  ``` bash
@@ -207,13 +195,12 @@ Hedgehog uses [BMAD-METHOD](https://github.com/bmad-code-org/BMAD-METHOD)
207
195
  The `nx-generate`, `nx-run-tasks`, `nx-workspace`, and
208
196
  `link-workspace-packages` skills are adapted from
209
197
  [nx-ai-agents-config](https://github.com/nrwl/nx-ai-agents-config)
210
- (`nrwl/nx-ai-agents-config`) MIT-licensed, pinned to commit `9609810`
211
- (2026-07-23) and rewritten for Hedgehog's pnpm-only workspace convention.
198
+ (`nrwl/nx-ai-agents-config`), MIT-licensed, rewritten for Hedgehog's
199
+ pnpm-only workspace convention.
212
200
 
213
201
  `front-end-eng`'s animation skills (`vendor-skills/GSAP/`) are vendored from
214
202
  [gsap-skills](https://github.com/greensock/gsap-skills)
215
- (`greensock/gsap-skills`) MIT-licensed, pinned to commit `aed9cfd`
216
- (2026-07-27).
203
+ (`greensock/gsap-skills`), MIT-licensed.
217
204
 
218
205
  ## Support Hedgehog
219
206
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyf0xx/hedgehog",
3
- "version": "4.0.11",
3
+ "version": "4.0.13",
4
4
  "description": "Install the Hedgehog build discipline (agents + skills) into a repo, for Claude Code, Cursor, or Gemini CLI.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -34,7 +34,7 @@ draft becomes the first draft of `.hedgehog/chain/00-brief.md`, shown
34
34
  back at Confirm & Lock for the user to accept or correct.
35
35
 
36
36
  1. **Run `hedgehog-planning-intake`'s Phase 0 in full**: state the BMAD
37
- attribution it states, then run `bmad-brainstorming`,
37
+ attribution it states, then run `bmad-forge-idea`, `bmad-brainstorming`,
38
38
  `bmad-product-brief`, `bmad-prfaq`, `bmad-prd`, `bmad-ux`,
39
39
  `bmad-deep-recon`, archived to `.hedgehog/BMAD/` with the fixed layout
40
40
  and `00-manifest.md` attribution header that skill's Phase 0 defines.
@@ -57,17 +57,21 @@ State the BMAD attribution, then run the vendored shelf in full
57
57
  sequence — on a first run there is no per-project skip logic and no
58
58
  reduced default set:
59
59
 
60
- 1. `bmad-brainstorming` (`vendor-skills/BMAD/core-skills/bmad-brainstorming`) —
60
+ 1. `bmad-forge-idea` (`vendor-skills/BMAD/core-skills/bmad-forge-idea`) —
61
+ pressure-test the idea through persona-driven interrogation before
62
+ diverging on it; strengthens, rejects, or clarifies it, optionally
63
+ writing `forged-idea.md` as input to the skills below.
64
+ 2. `bmad-brainstorming` (`vendor-skills/BMAD/core-skills/bmad-brainstorming`) —
61
65
  diverge on the idea before locking anything.
62
- 2. `bmad-product-brief` (`vendor-skills/BMAD/bmm-skills/1-analysis/bmad-product-brief`)
66
+ 3. `bmad-product-brief` (`vendor-skills/BMAD/bmm-skills/plan/bmad-product-brief`)
63
67
  — the product brief.
64
- 3. `bmad-prfaq` (`vendor-skills/BMAD/bmm-skills/1-analysis/bmad-prfaq`) — vets
68
+ 4. `bmad-prfaq` (`vendor-skills/BMAD/bmm-skills/plan/bmad-prfaq`) — vets
65
69
  the idea press-release-style.
66
- 4. `bmad-prd` (`vendor-skills/BMAD/bmm-skills/2-plan-workflows/bmad-prd`) — the
70
+ 5. `bmad-prd` (`vendor-skills/BMAD/bmm-skills/plan/bmad-prd`) — the
67
71
  PRD, including its Glossary (entities, relationships, cardinality).
68
- 5. `bmad-ux` (`vendor-skills/BMAD/bmm-skills/2-plan-workflows/bmad-ux`) — the UX
72
+ 6. `bmad-ux` (`vendor-skills/BMAD/bmm-skills/plan/bmad-ux`) — the UX
69
73
  spec, `DESIGN.md` + `EXPERIENCE.md`.
70
- 6. `bmad-deep-recon` (`vendor-skills/BMAD/core-skills/bmad-deep-recon`) —
74
+ 7. `bmad-deep-recon` (`vendor-skills/BMAD/core-skills/bmad-deep-recon`) —
71
75
  market/competitive/user-voice research.
72
76
 
73
77
  Any skill may itself invoke `bmad-advanced-elicitation`
@@ -5,26 +5,47 @@ This directory vendors a subset of [BMAD-METHOD](https://github.com/bmad-code-or
5
5
  for the full license text.
6
6
 
7
7
  - **Source repo:** https://github.com/bmad-code-org/BMAD-METHOD
8
- - **Vendored from:** `main` branch, commit `bb45db4aa4496c69239f9c0629c290fd1b072fc9`
9
- - **Vendored on:** 2026-07-23
8
+ - **Vendored from:** tag `v6.11.0`, commit `890fcda760bade4d6080f5fa09aa8f658bc4a4a5`
9
+ - **Vendored on:** 2026-08-11
10
10
  - **Module:** `bmm` (BMAD Method Module)
11
11
 
12
12
  ## What's vendored
13
13
 
14
- Seven skills from BMAD-METHOD's planning shelf, plus the two shared scripts
14
+ Eight skills from BMAD-METHOD's planning shelf, plus the two shared scripts
15
15
  they depend on:
16
16
 
17
+ - `core-skills/bmad-forge-idea`
17
18
  - `core-skills/bmad-brainstorming`
18
19
  - `core-skills/bmad-advanced-elicitation`
19
20
  - `core-skills/bmad-deep-recon`
20
- - `bmm-skills/1-analysis/bmad-product-brief`
21
- - `bmm-skills/1-analysis/bmad-prfaq`
22
- - `bmm-skills/2-plan-workflows/bmad-prd`
23
- - `bmm-skills/2-plan-workflows/bmad-ux`
21
+ - `bmm-skills/plan/bmad-product-brief`
22
+ - `bmm-skills/plan/bmad-prfaq`
23
+ - `bmm-skills/plan/bmad-prd`
24
+ - `bmm-skills/plan/bmad-ux`
24
25
  - `scripts/memlog.py`, `scripts/resolve_customization.py` (shared utilities
25
26
  every vendored skill calls, originally at `src/scripts/` in the source
26
27
  repo)
27
28
 
29
+ Upstream collapsed the four `bmm-skills` above out of numbered
30
+ `1-analysis/` and `2-plan-workflows/` directories into a single flat
31
+ `plan/` directory as of this vendor pass; their content is otherwise
32
+ unchanged. `bmad-deep-recon` is now included in a tagged release
33
+ (previously only on `main`), so this pass pins to the `v6.11.0` tag
34
+ instead of a `main` commit SHA.
35
+
36
+ `bmad-forge-idea` is new upstream as of this pass: a persona-driven
37
+ interrogation skill that pressure-tests an idea before any artifact gets
38
+ written, added ahead of `bmad-brainstorming` as the shelf's first step.
39
+ It carries its own script, `scripts/resolve_personas.py`, vendored
40
+ alongside it (not shared — only this skill calls it). Its upstream
41
+ counterpart `bmad-party-mode` (the multi-agent roster it can optionally
42
+ draw on) is not vendored, since a real roster needs BMAD's own
43
+ `bmm-skills/agents/bmad-agent-*` persona skills too — a parallel system
44
+ to Hedgehog's own `src/agents/`, out of scope here. `bmad-forge-idea`
45
+ degrades gracefully without it: `resolve_personas.py` returns an empty
46
+ roster and the skill falls back to generating personas on the fly, which
47
+ is its documented normal path, not a degraded one.
48
+
28
49
  Each skill directory carries its own templates, reference files, and
29
50
  scripts as vendored, unmodified except where noted below.
30
51
 
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: bmad-forge-idea
3
+ description: Pressure-test an idea through persona-driven interrogation until it hardens, proves out, or dies cheaply. Use when the user says 'forge an idea', 'pressure-test this idea', 'stress-test my thinking', or 'harden this idea'.
4
+ ---
5
+
6
+ # BMad Forge Idea
7
+
8
+ ## Overview
9
+
10
+ Take a half-formed idea and pressure-test it in conversation, while changing your mind is still cheap, until it becomes something the user can act on with conviction or reject. The main risk is what the user has not examined yet: unchecked assumptions and unresolved decisions usually become more expensive problems later.
11
+
12
+ The main goal is better thinking, not producing an artifact. Strengthening an idea, rejecting it, or thinking it through more clearly are all complete outcomes. Writing `forged-idea.md` to hand off to another workflow is optional. Do not steer the conversation toward "shall we build it?"
13
+
14
+ This skill can be used on many kinds of ideas. When the idea is about a product or feature, what survives may be written to `forged-idea.md` for later planning.
15
+
16
+ Lead by questioning, not lecturing. Ask one question at a time, press on weak points, and do not let vague claims pass without examination.
17
+
18
+ ## Conventions
19
+
20
+ - Scripts live in two places — run each from the exact path written, never assume co-location: the shared core scripts (`memlog.py`, `resolve_customization.py`) are at `{bmad-root}/scripts/`; this skill's own `resolve_personas.py` is at `{skill-root}/scripts/`.
21
+ - `{workflow.<name>}` resolves to fields in the merged `customize.toml` `[workflow]` table.
22
+ - `{bmad-root}` is the vendored `vendor-skills/BMAD/` root.
23
+
24
+ ## On Activation
25
+
26
+ 1. Resolve customization: `uv run {bmad-root}/scripts/resolve_customization.py --skill {skill-root} --key workflow`. On failure, read `{skill-root}/customize.toml` directly with defaults. Apply the resolved `{workflow.*}` values throughout.
27
+ 2. Run each `{workflow.activation_steps_prepend}` entry; treat each `{workflow.persistent_facts}` entry as foundational context (`file:` entries load their contents, `skill:` names a skill to consult, others are facts verbatim).
28
+ 3. Resolve `{user_name}`, `{communication_language}`, `{output_folder}` using sensible defaults (ask the user or omit `{user_name}`; English for language fields); `{date}` is today. Missing values → neutral defaults; never block. Greet `{user_name}` in `{communication_language}` and stay in it.
29
+ 4. Resume: glob `{workflow.forge_output_path}/**/.memlog.md` (recursive, so it still finds sessions when `run_folder_pattern` is overridden to nest paths) and read only each match's frontmatter to find any whose `status` is not `complete`. Offer to resume one — then read its full memlog once to rebuild state and continue append-only — or to start fresh.
30
+ 5. Run each `{workflow.activation_steps_append}` entry.
31
+
32
+ ## Open the session
33
+
34
+ Start by scrutinizing the idea, not endorsing it.
35
+
36
+ ### Discover intent
37
+ Identify:
38
+ - the subject idea,
39
+ - the user's goal for the session,
40
+ - whether the idea is new or a change to an existing project
41
+
42
+ If any of these are already clear from the prompt that invoked this skill or previous context, ask the user to confirm and continue.
43
+
44
+ Otherwise ask for what's missing, in order:
45
+ - what is the idea?
46
+ - do you want to clarify and understand it, test whether it holds up, or make it better?
47
+ - is it a new idea or a change to an existing project? If the latter, what project is it, and where can I find its files or other relevant materials?
48
+
49
+ ### Steering the conversation
50
+
51
+ Tell the user they can say **"attack this"**, **"defend this"**, or **"switch roles"** at any time to change how the current idea is argued. In attack mode, do not agree with the idea; look for contradictions, weak assumptions, and failure cases. In defend mode, argue for the strongest version of the idea. Tell the user they can also name a persona at any time to change who participates in the session.
52
+
53
+ ### Set up the session
54
+
55
+ Derive a kebab-case `{slug}` for the idea and bind the session workspace `{workspace} = {workflow.forge_output_path}/{workflow.run_folder_pattern}` (the pattern fills with `{slug}`). Create the memlog once the goal is known:
56
+ `uv run {bmad-root}/scripts/memlog.py init --workspace {workspace} --field idea="<idea>" --field goal="<goal>"`
57
+
58
+ Tell the user the path; state is on disk now, so the session survives interruption. If init fails, don't abort — run the forge in-conversation and tell the user state won't persist this session.
59
+
60
+ ## The forge
61
+
62
+ Let the session goal set the first move: for clarifying, pin down terms, boundaries, and assumptions; for testing, go after the central claim first; for making it better, drive each unresolved branch to a concrete decision.
63
+
64
+ Work one question at a time, in dependency order.
65
+
66
+ Include your current best answer or hypothesis when it helps the user respond. A concrete proposal is easier to accept, reject, or revise than an open-ended prompt. Find discoverable answers yourself instead of asking.
67
+
68
+ Do not assume the user's terms are precise. When a term is fuzzy or overloaded, name the ambiguity and ask for a precise choice before continuing. For example, do not let `user`, `buyer`, and `payer` collapse into one entity unless the idea actually requires that.
69
+
70
+ For ideas about an existing project, treat the project's files and materials as the source of truth. Do not accept a label or summary as proof. Find the relevant material yourself and check the user's claim against it. If the material contradicts the user's claim, stop and resolve that before continuing.
71
+
72
+ When a branch resolves, pause before moving on. Give the user a chance to raise any remaining concern.
73
+
74
+ Do not use agreement or praise to make the interaction smoother; they lower pressure and lead to shallower thinking. Agreement is allowed only when it helps the user think better. Praise is noise. Continued engagement and ego-stroking are not objectives. In attack mode, never agree with the idea until the user ends the mode. For each answer, either challenge the weak point or build on the strong point, whichever helps the user think better.
75
+
76
+ Capture as you go — each decision, assumption, crack, kill, and locked idea, one bullet in the user's meaning:
77
+ `uv run {bmad-root}/scripts/memlog.py append --workspace {workspace} --type <decision|assumption|crack|kill|direction|lock|note> --text "<gist>"`
78
+ A `lock` is an idea the user hardens — settled, not to be reopened; locks are what `forged-idea.md` is distilled from. Don't read the memlog back except on resume. If the user raises a different branch, capture it and stay put — the loop and the stray insight both survive.
79
+
80
+ ## The personas
81
+
82
+ Resolve the available persona pool once, as soon as the goal is known:
83
+ `uv run {skill-root}/scripts/resolve_personas.py --project-root {project-root} --skill {skill-root}`
84
+ The script returns any user-defined personas (`members`) and saved parties (`parties`) found in the project's own override files; on Hedgehog there is no installed BMad agent roster (`agents` comes back empty), so most sessions run on generated personas alone — that's the normal path, not a degraded one.
85
+
86
+ Each turn uses two voices:
87
+ - **One available persona** — if the user has defined custom personas or parties, choose one whose expertise fits the current branch and vary it every few turns; do not let one voice dominate. If the user names a specific persona, use it. If the user calls a saved party, use the whole party and its scene. If no pool is available, generate this voice yourself.
88
+ - **One generated persona** — create a fresh outside voice, such as a competitor, buyer, finance reviewer, domain expert, or critic. Give it a name and enough characterization to keep its viewpoint distinct.
89
+
90
+ Use these voices in character to pressure-test the current branch: find sharper objections, missing assumptions, and stronger defenses. Cross-examine them for what matters, then synthesize their input into your next question. Do not let the session turn into a panel debate or persona performance.
91
+
92
+ Voice the personas yourself by default. Spawn separate agents only when a branch needs independent reasoning that should not be influenced by one shared voice.
93
+
94
+ ## Exits
95
+
96
+ The session can end in three valid states:
97
+
98
+ - **Hardened** — the idea is stronger and specific enough to use. Distill the memlog into `{workspace}/forged-idea.md`. Keep it extremely short: only the decisions, rejected options, and reasons that matter downstream, in the user's meaning. Do not write a prose summary, template, or conversation recap. If it reads like a document, it is too long. Offer the file as input to the Hedgehog planning shelf's other skills (`bmad-product-brief`, `bmad-prfaq`, `bmad-prd`); the file also stands on its own.
99
+ - **Killed** — the idea does not hold up. Say so plainly and record why. Finding that out early is a valid outcome.
100
+ - **Clearer** — the user understands the idea better, but there is no hardened idea to hand off. Leave the memlog as the record; no `forged-idea.md` is needed.
101
+
102
+ Always render `{workspace}/forge-report.html` as a self-contained HTML file the user can open, with inline CSS and an inline-SVG seal or stamp. Summarize the outcome, the locked decisions, what was rejected and why, and the weak points that survived scrutiny, in the user's meaning. Credit the personas and parties that pressure-tested the idea by name, icon, and voice. Render a prominent wax-seal-style or stamped outcome mark, matched to the result: `HARDENED`, an `Idea Death Certificate` stamped `KILLED` with the cause of death, or `CLARIFIED`. Tell the user the path.
103
+
104
+ Flip the status at the end: `uv run {bmad-root}/scripts/memlog.py set --workspace {workspace} --key status --value complete`.
105
+ If `{workflow.on_complete}` is non-empty, run all instructions in order.
@@ -0,0 +1,42 @@
1
+ # DO NOT EDIT -- overwritten on every update.
2
+ #
3
+ # Workflow customization surface for bmad-forge-idea.
4
+ #
5
+ # Override files (not edited here):
6
+ # {project-root}/_bmad/custom/bmad-forge-idea.toml (team)
7
+ # {project-root}/_bmad/custom/bmad-forge-idea.user.toml (personal)
8
+
9
+ [workflow]
10
+
11
+ # --- Configurable below. Overrides merge per BMad structural rules: ---
12
+ # scalars: override wins • arrays: append
13
+
14
+ # Steps to run before the standard activation (config load, greet).
15
+ activation_steps_prepend = []
16
+
17
+ # Steps to run after greet but before the session begins.
18
+ activation_steps_append = []
19
+
20
+ # Persistent facts the interrogator keeps in mind for the whole session
21
+ # (domain constraints, house rules, what's off the table). Each entry is a
22
+ # literal sentence, a skill prefixed with `skill:`, or a `file:`-prefixed
23
+ # path/glob whose contents are loaded as facts. Default loads project-context.md
24
+ # when one exists (e.g. from bmad-generate-project-context), so the forge grounds
25
+ # in the project's tech, domain, and constraints without re-asking.
26
+ persistent_facts = [
27
+ "file:{project-root}/**/project-context.md",
28
+ ]
29
+
30
+ # Executed when the session completes. Scalar or array of instructions. Empty for none.
31
+ on_complete = []
32
+
33
+ # Parent folder for all forge sessions. Each session gets its own run
34
+ # folder underneath (see run_folder_pattern). Lands directly under
35
+ # {output_folder} so the forge works in core-only installs.
36
+ forge_output_path = "{output_folder}/forge"
37
+
38
+ # Run-folder pattern inside forge_output_path. Resolved against the
39
+ # idea-derived slug at activation. Same slug = same folder, so resuming
40
+ # an idea reuses its memlog. Override to add {date} or other components
41
+ # if a fresh dated history per run is preferred.
42
+ run_folder_pattern = "{slug}"
@@ -0,0 +1,275 @@
1
+ #!/usr/bin/env python3
2
+ # /// script
3
+ # requires-python = ">=3.11"
4
+ # ///
5
+ """Resolve the personas and parties the forge can bring into the room.
6
+
7
+ The forge cross-examines witnesses: the installed BMAD agents, plus any
8
+ custom personas and party groups the user has authored for `bmad-party-mode`.
9
+ This surfaces all of them in one shot so the orchestrator never has to ask
10
+ "who's available?" — it just intermixes whoever fits the branch, alongside
11
+ any persona the user names on the fly.
12
+
13
+ What it returns (JSON, stdout):
14
+ * agents — the installed BMAD roster: the default room, always present.
15
+ * members — extra custom personas in the pool (party_members the user
16
+ defined that aren't already an installed slot).
17
+ * parties — the user's named party groups, members resolved to brief
18
+ entries; open-cast groups (scene names a pool, no roster)
19
+ are flagged.
20
+ * default_party — the group id pinned as party-mode's default, if any.
21
+
22
+ Discovery is best-effort and never blocks the forge. The installed roster
23
+ comes from the core resolver; custom personas/parties come from
24
+ `bmad-party-mode`'s resolved customization when that skill is found beside
25
+ this one, else from the user's override TOMLs read directly. Anything that
26
+ can't be resolved is simply omitted and flagged, never fatal.
27
+
28
+ Stdlib only (Python 3.11+ for tomllib).
29
+
30
+ resolve_personas.py --project-root P --skill S
31
+ """
32
+
33
+ import argparse
34
+ import json
35
+ import subprocess
36
+ import sys
37
+ from pathlib import Path
38
+
39
+ try:
40
+ import tomllib
41
+ except ImportError: # pragma: no cover - guarded for <3.11
42
+ sys.stderr.write("error: Python 3.11+ is required (stdlib `tomllib`).\n")
43
+ sys.exit(3)
44
+
45
+ PARTY_SKILL = "bmad-party-mode"
46
+
47
+
48
+ def _run_json(cmd):
49
+ """Run a resolver script and parse its JSON stdout. None on any failure."""
50
+ try:
51
+ out = subprocess.run(
52
+ cmd, capture_output=True, text=True, encoding="utf-8", timeout=60
53
+ )
54
+ except (OSError, subprocess.SubprocessError):
55
+ return None
56
+ if out.returncode != 0 or not out.stdout.strip():
57
+ return None
58
+ try:
59
+ return json.loads(out.stdout)
60
+ except json.JSONDecodeError:
61
+ return None
62
+
63
+
64
+ def _load_toml(path: Path):
65
+ if not path.exists():
66
+ return {}
67
+ try:
68
+ with path.open("rb") as f:
69
+ data = tomllib.load(f)
70
+ return data if isinstance(data, dict) else {}
71
+ except (OSError, tomllib.TOMLDecodeError):
72
+ return {}
73
+
74
+
75
+ def load_agents(project_root: Path):
76
+ """Installed BMAD agents as {code: entry}. (dict, resolved_ok).
77
+
78
+ The core resolver may emit agents as a dict keyed by code or as an array
79
+ of tables (depending on how the layers merged); normalize both to a dict.
80
+ """
81
+ script = project_root / "_bmad" / "scripts" / "resolve_config.py"
82
+ data = _run_json([sys.executable, str(script), "--project-root", str(project_root), "--key", "agents"])
83
+ if data is None:
84
+ return {}, False
85
+ agents = data.get("agents", {}) or {}
86
+ if isinstance(agents, list):
87
+ agents = {a["code"]: a for a in agents if isinstance(a, dict) and a.get("code")}
88
+ elif not isinstance(agents, dict):
89
+ agents = {}
90
+ return agents, True
91
+
92
+
93
+ def find_party_skill(project_root: Path, skill_root: Path):
94
+ """Locate the installed bmad-party-mode skill dir, or None.
95
+
96
+ Skills install as siblings, so the party skill is almost always next to
97
+ this one. A couple of common install roots cover the rest.
98
+ """
99
+ candidates = [
100
+ skill_root.parent / PARTY_SKILL,
101
+ project_root / ".claude" / "skills" / PARTY_SKILL,
102
+ project_root / "_bmad" / "skills" / PARTY_SKILL,
103
+ ]
104
+ for c in candidates:
105
+ if (c / "customize.toml").exists():
106
+ return c
107
+ return None
108
+
109
+
110
+ def load_party_workflow(project_root: Path, party_skill: Path):
111
+ """Merged [workflow] table for bmad-party-mode (base + user overrides)."""
112
+ resolver = project_root / "_bmad" / "scripts" / "resolve_customization.py"
113
+ data = _run_json([sys.executable, str(resolver), "--skill", str(party_skill), "--key", "workflow"])
114
+ if data is not None and isinstance(data.get("workflow"), dict):
115
+ return data["workflow"]
116
+ # Fallback: base customize.toml directly, no override merge.
117
+ wf = _load_toml(party_skill / "customize.toml").get("workflow", {})
118
+ return wf if isinstance(wf, dict) else {}
119
+
120
+
121
+ def load_party_overrides(project_root: Path):
122
+ """Custom personas/parties when party-mode itself isn't installed.
123
+
124
+ Reads only the user's override TOMLs (team then personal, personal wins on
125
+ scalars). No base roster exists in this path, so a shallow merge is enough.
126
+ """
127
+ custom = project_root / "_bmad" / "custom"
128
+ team = _load_toml(custom / f"{PARTY_SKILL}.toml").get("workflow", {})
129
+ user = _load_toml(custom / f"{PARTY_SKILL}.user.toml").get("workflow", {})
130
+ team = team if isinstance(team, dict) else {}
131
+ user = user if isinstance(user, dict) else {}
132
+ merged = dict(team)
133
+ for key, val in user.items():
134
+ if isinstance(val, list) and isinstance(merged.get(key), list):
135
+ merged[key] = merged[key] + val
136
+ else:
137
+ merged[key] = val
138
+ return merged
139
+
140
+
141
+ def _alias(code: str) -> str:
142
+ """Short alias for an installed agent code: bmad-agent-analyst -> analyst."""
143
+ for prefix in ("bmad-agent-", "bmad-"):
144
+ if code.startswith(prefix):
145
+ return code[len(prefix):]
146
+ return code
147
+
148
+
149
+ def build_pool(agents: dict, party_members: list):
150
+ """One pool keyed by code; custom members override matching installed slots.
151
+
152
+ Returns (pool, index, installed_codes, custom_codes):
153
+ * installed_codes — the default room (installed agents, overrides applied
154
+ in place); custom-only additions stay in the pool but don't crowd it.
155
+ * custom_codes — pure-custom personas (no installed slot), the extra
156
+ faces the forge can summon by name or via a party group.
157
+ """
158
+ pool, index, installed_codes, custom_codes = {}, {}, [], []
159
+
160
+ def register(code, entry):
161
+ pool[code] = entry
162
+ index[code] = code
163
+ index[code.lower()] = code
164
+ index[_alias(code).lower()] = code
165
+ name = entry.get("name")
166
+ if name:
167
+ key = name.lower()
168
+ # A custom rename must not hijack another agent's name lookup.
169
+ if index.get(key, code) == code:
170
+ index[key] = code
171
+
172
+ for code, info in (agents or {}).items():
173
+ register(code, {
174
+ "code": code,
175
+ "name": info.get("name", code),
176
+ "icon": info.get("icon", ""),
177
+ "title": info.get("title", ""),
178
+ "description": info.get("description", ""),
179
+ "source": "installed",
180
+ })
181
+ installed_codes.append(code)
182
+
183
+ for m in (party_members if isinstance(party_members, list) else []):
184
+ if not isinstance(m, dict):
185
+ continue
186
+ code = m.get("code")
187
+ if not code:
188
+ continue
189
+ canonical = index.get(code) or index.get(code.lower()) or code
190
+ was_installed = canonical in pool
191
+ # Start from the installed entry so fields the override omits
192
+ # (icon, title, description) survive.
193
+ entry = dict(pool.get(canonical, {}))
194
+ entry.update({"code": canonical, "source": "custom"})
195
+ for field in ("name", "icon", "title", "persona", "capabilities", "model"):
196
+ if m.get(field) is not None:
197
+ entry[field] = m[field]
198
+ entry.setdefault("name", canonical)
199
+ register(canonical, entry)
200
+ if not was_installed:
201
+ custom_codes.append(canonical)
202
+
203
+ return pool, index, installed_codes, custom_codes
204
+
205
+
206
+ def _brief(entry):
207
+ """The slim card the orchestrator needs to cast a persona."""
208
+ out = {k: entry[k] for k in ("code", "name", "icon", "title", "source") if entry.get(k)}
209
+ for k in ("description", "persona", "capabilities", "model"):
210
+ if entry.get(k):
211
+ out[k] = entry[k]
212
+ return out
213
+
214
+
215
+ def resolve_parties(groups, pool, index):
216
+ out = []
217
+ for g in groups or []:
218
+ if not isinstance(g, dict) or not g.get("id"):
219
+ continue
220
+ raw = g.get("members", []) or []
221
+ members = []
222
+ for t in raw:
223
+ key = t if isinstance(t, str) else str(t)
224
+ code = index.get(key) or index.get(key.lower())
225
+ if code in pool:
226
+ members.append(_brief(pool[code]))
227
+ party = {"id": g["id"], "name": g.get("name", g["id"]), "members": members}
228
+ if g.get("scene"):
229
+ party["scene"] = g["scene"]
230
+ if not raw:
231
+ party["open_cast"] = True
232
+ out.append(party)
233
+ return out
234
+
235
+
236
+ def main():
237
+ ap = argparse.ArgumentParser(description="Resolve forge personas and parties.")
238
+ ap.add_argument("--project-root", required=True)
239
+ ap.add_argument("--skill", required=True, help="Path to the bmad-forge-idea skill dir")
240
+ args = ap.parse_args()
241
+
242
+ project_root = Path(args.project_root).resolve()
243
+ skill_root = Path(args.skill).resolve()
244
+
245
+ agents, agents_ok = load_agents(project_root)
246
+
247
+ party_skill = find_party_skill(project_root, skill_root)
248
+ if party_skill is not None:
249
+ workflow = load_party_workflow(project_root, party_skill)
250
+ else:
251
+ workflow = load_party_overrides(project_root)
252
+
253
+ pool, index, installed_codes, custom_codes = build_pool(
254
+ agents, workflow.get("party_members", []))
255
+ parties = resolve_parties(workflow.get("party_groups", []), pool, index)
256
+
257
+ _emit({
258
+ "agents": [_brief(pool[c]) for c in installed_codes],
259
+ "members": [_brief(pool[c]) for c in custom_codes],
260
+ "parties": parties,
261
+ "default_party": workflow.get("default_party", "") or "",
262
+ "party_mode_found": party_skill is not None,
263
+ "agents_resolved": agents_ok,
264
+ })
265
+
266
+
267
+ def _emit(obj):
268
+ reconfigure = getattr(sys.stdout, "reconfigure", None)
269
+ if reconfigure is not None:
270
+ reconfigure(encoding="utf-8")
271
+ sys.stdout.write(json.dumps(obj, indent=2, ensure_ascii=False) + "\n")
272
+
273
+
274
+ if __name__ == "__main__":
275
+ main()
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env python3
2
+ # /// script
3
+ # requires-python = ">=3.11"
4
+ # ///
5
+ """Unit tests for resolve_personas.py — pool merge, alias, party resolution."""
6
+
7
+ import sys
8
+ import unittest
9
+ from pathlib import Path
10
+
11
+ sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
12
+ import resolve_personas as rp # noqa: E402
13
+
14
+ AGENTS = {
15
+ "bmad-agent-analyst": {"name": "Mary", "icon": "📊", "title": "Analyst"},
16
+ "bmad-agent-pm": {"name": "John", "icon": "📋", "title": "PM"},
17
+ }
18
+
19
+
20
+ class TestAlias(unittest.TestCase):
21
+ def test_strips_known_prefixes(self):
22
+ self.assertEqual(rp._alias("bmad-agent-analyst"), "analyst")
23
+ self.assertEqual(rp._alias("bmad-foo"), "foo")
24
+
25
+ def test_passes_through_unprefixed(self):
26
+ self.assertEqual(rp._alias("morpheus"), "morpheus")
27
+
28
+
29
+ class TestBuildPool(unittest.TestCase):
30
+ def test_installed_become_default_room_indexed_every_way(self):
31
+ pool, idx, installed, custom = rp.build_pool(AGENTS, [])
32
+ self.assertEqual(installed, ["bmad-agent-analyst", "bmad-agent-pm"])
33
+ self.assertEqual(custom, [])
34
+ self.assertEqual(idx["analyst"], "bmad-agent-analyst") # alias
35
+ self.assertEqual(idx["mary"], "bmad-agent-analyst") # name (ci)
36
+ self.assertEqual(pool["bmad-agent-analyst"]["source"], "installed")
37
+
38
+ def test_pure_custom_member_stays_out_of_default_room(self):
39
+ pool, _, installed, custom = rp.build_pool(
40
+ AGENTS, [{"code": "morpheus", "name": "Morpheus", "persona": "riddles"}])
41
+ self.assertEqual(custom, ["morpheus"])
42
+ self.assertNotIn("morpheus", installed)
43
+ self.assertEqual(pool["morpheus"]["persona"], "riddles")
44
+
45
+ def test_custom_override_lands_on_installed_slot_not_a_new_face(self):
46
+ pool, _, installed, custom = rp.build_pool(
47
+ AGENTS, [{"code": "analyst", "name": "Mary-Custom", "persona": "p"}])
48
+ self.assertNotIn("analyst", pool)
49
+ self.assertEqual(custom, []) # an override is not a new face
50
+ self.assertEqual(pool["bmad-agent-analyst"]["source"], "custom")
51
+ self.assertEqual(pool["bmad-agent-analyst"]["name"], "Mary-Custom")
52
+
53
+ def test_member_without_code_skipped(self):
54
+ pool, _, _, custom = rp.build_pool(AGENTS, [{"name": "Nameless"}])
55
+ self.assertEqual(custom, [])
56
+ self.assertEqual(set(pool), {"bmad-agent-analyst", "bmad-agent-pm"})
57
+
58
+ def test_custom_rename_does_not_hijack_another_agents_name(self):
59
+ # Override the analyst slot, renaming it to "John" — the PM's name.
60
+ # The PM's name lookup must survive (last-writer-wins would corrupt it).
61
+ _, idx, _, _ = rp.build_pool(AGENTS, [{"code": "analyst", "name": "John"}])
62
+ self.assertEqual(idx["john"], "bmad-agent-pm")
63
+
64
+ def test_brief_carries_model_and_capabilities(self):
65
+ pool, _, _, _ = rp.build_pool(
66
+ AGENTS, [{"code": "neo", "name": "Neo", "model": "opus", "capabilities": ["x"]}])
67
+ brief = rp._brief(pool["neo"])
68
+ self.assertEqual(brief["model"], "opus")
69
+ self.assertEqual(brief["capabilities"], ["x"])
70
+
71
+ def test_non_list_party_members_is_safe(self):
72
+ pool, _, installed, custom = rp.build_pool(AGENTS, "not-a-list")
73
+ self.assertEqual(custom, [])
74
+ self.assertEqual(set(pool), {"bmad-agent-analyst", "bmad-agent-pm"})
75
+
76
+
77
+ class TestResolveParties(unittest.TestCase):
78
+ def setUp(self):
79
+ self.pool, self.idx, _, _ = rp.build_pool(
80
+ AGENTS, [{"code": "shark", "name": "Marcus", "title": "CFO"}])
81
+
82
+ def test_resolves_members_by_alias_and_custom_code(self):
83
+ parties = rp.resolve_parties(
84
+ [{"id": "tank", "name": "Tank", "scene": "hostile",
85
+ "members": ["shark", "analyst"]}], self.pool, self.idx)
86
+ self.assertEqual(len(parties), 1)
87
+ self.assertEqual([m["name"] for m in parties[0]["members"]], ["Marcus", "Mary"])
88
+ self.assertEqual(parties[0]["scene"], "hostile")
89
+
90
+ def test_unknown_member_dropped_silently(self):
91
+ parties = rp.resolve_parties(
92
+ [{"id": "g", "members": ["analyst", "ghost"]}], self.pool, self.idx)
93
+ self.assertEqual([m["name"] for m in parties[0]["members"]], ["Mary"])
94
+
95
+ def test_member_resolution_is_case_insensitive(self):
96
+ # A TOML author naturally writes "Analyst"/"Shark"; the filter accepts
97
+ # them via the lowercase index, so resolution must too (no KeyError).
98
+ parties = rp.resolve_parties(
99
+ [{"id": "g", "members": ["Analyst", "Shark"]}], self.pool, self.idx)
100
+ self.assertEqual([m["name"] for m in parties[0]["members"]], ["Mary", "Marcus"])
101
+
102
+ def test_non_string_member_does_not_crash(self):
103
+ # Malformed members (int, list) must drop silently, never raise.
104
+ parties = rp.resolve_parties(
105
+ [{"id": "g", "members": [123, ["x"], "analyst"]}], self.pool, self.idx)
106
+ self.assertEqual([m["name"] for m in parties[0]["members"]], ["Mary"])
107
+
108
+ def test_open_cast_group_flagged(self):
109
+ parties = rp.resolve_parties(
110
+ [{"id": "rebels", "name": "Rebels", "scene": "the Ghost"}], self.pool, self.idx)
111
+ self.assertTrue(parties[0]["open_cast"])
112
+ self.assertEqual(parties[0]["members"], [])
113
+
114
+ def test_group_without_id_skipped(self):
115
+ self.assertEqual(rp.resolve_parties([{"name": "no id"}], self.pool, self.idx), [])
116
+
117
+
118
+ class TestOverrideMergeFallback(unittest.TestCase):
119
+ """When party-mode isn't installed, user override TOMLs are read directly."""
120
+
121
+ def test_arrays_append_scalars_override(self):
122
+ import tempfile, os
123
+ with tempfile.TemporaryDirectory() as d:
124
+ custom = Path(d) / "_bmad" / "custom"
125
+ custom.mkdir(parents=True)
126
+ (custom / "bmad-party-mode.toml").write_text(
127
+ '[workflow]\ndefault_party = "a"\n'
128
+ '[[workflow.party_members]]\ncode = "x"\nname = "X"\n')
129
+ (custom / "bmad-party-mode.user.toml").write_text(
130
+ '[workflow]\ndefault_party = "b"\n'
131
+ '[[workflow.party_members]]\ncode = "y"\nname = "Y"\n')
132
+ wf = rp.load_party_overrides(Path(d))
133
+ self.assertEqual(wf["default_party"], "b") # personal wins
134
+ self.assertEqual([m["code"] for m in wf["party_members"]], ["x", "y"]) # appended
135
+
136
+
137
+ if __name__ == "__main__":
138
+ unittest.main()