$npx -y skills add armelhbobdad/bmad-module-skill-forge --skill skf-create-stack-skillConsolidated project stack skill with integration patterns — code-mode (analyzes manifests) or compose-mode (synthesizes from existing skills + architecture doc). Use when the user requests to "create a stack skill", "forge a stack", or "stack this project".
| 1 | # Create Stack Skill |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Produces a consolidated stack skill documenting how libraries connect. **Code-mode** analyzes dependency manifests and co-import patterns from actual source code. **Compose-mode** synthesizes from pre-generated individual skills and architecture documents when no codebase exists yet. Every finding must trace to actual code with file:line citations; in compose-mode, inferred integrations are permitted but must be labeled `[inferred from shared domain]`. |
| 6 | |
| 7 | ## Conventions |
| 8 | |
| 9 | - Bare paths (e.g. `references/<name>.md`) resolve from the skill root. |
| 10 | - The `knowledge/` and `shared/` prefixes are the exception: they resolve from the **SKF module root** (`{project-root}/_bmad/skf/` when installed, `src/` during development), not the skill root — they point at module-shared reference docs (`knowledge/tool-resolution.md`, `knowledge/version-paths.md`) and scripts/schemas (`shared/references/…`) that live once at the module root, mirroring the resolution note `references/health-check.md` carries for `shared/health-check.md`. |
| 11 | - `references/` holds prompt content carved out of SKILL.md (workflow stages chained via frontmatter `nextStepFile`, plus static reference docs); `scripts/` and `assets/` hold deterministic helpers and templates. |
| 12 | - `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives, if present). |
| 13 | - `{project-root}`-prefixed paths resolve from the project working directory. |
| 14 | - `{skill-name}` resolves to the skill directory's basename. |
| 15 | |
| 16 | ## Role |
| 17 | |
| 18 | You are a dependency analyst and integration architect. You bring expertise in dependency analysis, cross-library integration patterns, and compositional architecture, while the user brings their project knowledge and scope preferences. |
| 19 | |
| 20 | ## Workflow Rules |
| 21 | |
| 22 | These rules apply to every step in this workflow: |
| 23 | |
| 24 | - Zero hallucination — all extracted content must trace to actual source code (compose-mode inferences must be labeled) |
| 25 | - Only load one step file at a time — never preload future steps |
| 26 | - If any instruction references a subprocess or tool you lack, achieve the outcome in your main context thread |
| 27 | - Always communicate in `{communication_language}` |
| 28 | - If `{headless_mode}` is true, auto-proceed through confirmation gates with their default action and log each auto-decision |
| 29 | - Warnings use a single accumulator — see `## Workflow state contract` below for shape and surfacing. |
| 30 | |
| 31 | ## Workflow state contract |
| 32 | |
| 33 | Every step that emits a warning appends a structured entry to a single in-memory list named `workflow_warnings[]` (the one accumulator for the whole workflow). Each entry has the shape `{step: "step-NN", severity: "info|warn|error", code: "<short-slug>", message: "<human text>", context: {<optional fields>}}`. Step 7 surfaces these in `evidence-report.md`; step 8 may add validation findings; step 9 §5 reads the accumulated list and renders the user-facing "Warnings" section. |
| 34 | |
| 35 | **Single-pass — no mid-run checkpoint.** State lives in memory until step 7 commits `provenance-map.json`/`evidence-report.md`; the workflow keeps no resumable checkpoint and On Activation does not probe for a prior run — the analysis is deterministic and cheap to redo, and the two gates are trivially re-confirmed. If interrupted before that commit, restart from step 1. |
| 36 | |
| 37 | ## Stages |
| 38 | |
| 39 | | # | Step | File | Auto-proceed | |
| 40 | |---|------|------|--------------| |
| 41 | | 1 | Initialize & Mode Detection | references/init.md | No (confirm) | |
| 42 | | 2 | Detect Manifests | references/detect-manifests.md | Yes | |
| 43 | | 3 | Rank & Confirm Libraries | references/rank-and-confirm.md | No (confirm) | |
| 44 | | 4 | Parallel Extract | references/parallel-extract.md | Yes | |
| 45 | | 5 | Detect Integrations | references/detect-integrations.md | Yes | |
| 46 | | 6 | Compile Stack | references/compile-stack.md | No (review) | |
| 47 | | 7 | Generate Output | references/generate-output.md | Yes | |
| 48 | | 8 | Validate | references/validate.md | Yes | |
| 49 | | 9 | Report | references/report.md | Yes | |
| 50 | | 10 | Workflow Health Check | references/health-check.md | Yes | |
| 51 | |
| 52 | ## Invocation Contract |
| 53 | |
| 54 | | Aspect | Detail | |
| 55 | |--------|--------| |
| 56 | | **Inputs** | project_path [required], mode (code/compose) [auto-detected] | |
| 57 | | **Gates** | step 3: Confirm Gate [C] | step 6: Review Gate [C] | |
| 58 | | **Outputs** | SKILL.md (stack), context-snippet.md, metadata.json | |
| 59 | | **Headless** | All gates auto-resolve with default action when `{headless_mode}` is true | |
| 60 | | **Exit codes** | See "Exit Codes" below | |
| 61 | |
| 62 | ## Exit Codes |
| 63 | |
| 64 | Every HARD HALT in this workflow exits with a stable code so headless automators can branch on the failure class without grepping message text: |
| 65 | |
| 66 | | Code | Meaning | Raised by (halt_reason) |