bmad-module-skill-forge 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/.nvmrc +1 -0
  2. package/LICENSE +26 -0
  3. package/README.md +213 -0
  4. package/docs/404.md +20 -0
  5. package/docs/agents.md +73 -0
  6. package/docs/architecture.md +301 -0
  7. package/docs/examples.md +144 -0
  8. package/docs/getting-started.md +198 -0
  9. package/docs/index.md +75 -0
  10. package/docs/workflows.md +190 -0
  11. package/package.json +109 -0
  12. package/src/agents/forger.agent.yaml +93 -0
  13. package/src/forger/README.md +17 -0
  14. package/src/forger/forge-tier.yaml +13 -0
  15. package/src/forger/preferences.yaml +10 -0
  16. package/src/knowledge/agentskills-spec.md +158 -0
  17. package/src/knowledge/confidence-tiers.md +153 -0
  18. package/src/knowledge/manual-section-integrity.md +156 -0
  19. package/src/knowledge/overview.md +56 -0
  20. package/src/knowledge/progressive-capability.md +120 -0
  21. package/src/knowledge/provenance-tracking.md +163 -0
  22. package/src/knowledge/skf-knowledge-index.csv +9 -0
  23. package/src/knowledge/skill-lifecycle.md +150 -0
  24. package/src/knowledge/zero-hallucination.md +101 -0
  25. package/src/module-help.csv +12 -0
  26. package/src/module.yaml +22 -0
  27. package/src/workflows/README.md +148 -0
  28. package/src/workflows/analyze-source/data/skill-brief-schema.md +75 -0
  29. package/src/workflows/analyze-source/data/unit-detection-heuristics.md +88 -0
  30. package/src/workflows/analyze-source/steps-c/step-01-init.md +191 -0
  31. package/src/workflows/analyze-source/steps-c/step-01b-continue.md +144 -0
  32. package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +208 -0
  33. package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +199 -0
  34. package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +222 -0
  35. package/src/workflows/analyze-source/steps-c/step-05-recommend.md +236 -0
  36. package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +239 -0
  37. package/src/workflows/analyze-source/templates/analysis-report-template.md +41 -0
  38. package/src/workflows/analyze-source/validation-report.md +657 -0
  39. package/src/workflows/analyze-source/workflow-plan-analyze-source.md +385 -0
  40. package/src/workflows/analyze-source/workflow.md +61 -0
  41. package/src/workflows/audit-skill/data/drift-report-template.md +62 -0
  42. package/src/workflows/audit-skill/data/severity-rules.md +52 -0
  43. package/src/workflows/audit-skill/steps-c/step-01-init.md +195 -0
  44. package/src/workflows/audit-skill/steps-c/step-02-re-index.md +191 -0
  45. package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +194 -0
  46. package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +199 -0
  47. package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +210 -0
  48. package/src/workflows/audit-skill/steps-c/step-06-report.md +217 -0
  49. package/src/workflows/audit-skill/validation-report.md +545 -0
  50. package/src/workflows/audit-skill/workflow-plan-audit-skill.md +318 -0
  51. package/src/workflows/audit-skill/workflow.md +63 -0
  52. package/src/workflows/brief-skill/data/skill-brief-schema.md +82 -0
  53. package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +184 -0
  54. package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +203 -0
  55. package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +225 -0
  56. package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +185 -0
  57. package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +156 -0
  58. package/src/workflows/brief-skill/validation-report.md +630 -0
  59. package/src/workflows/brief-skill/workflow-plan-brief-skill.md +360 -0
  60. package/src/workflows/brief-skill/workflow.md +57 -0
  61. package/src/workflows/create-skill/data/extraction-patterns.md +63 -0
  62. package/src/workflows/create-skill/data/skill-sections.md +166 -0
  63. package/src/workflows/create-skill/steps-c/step-01-load-brief.md +176 -0
  64. package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +143 -0
  65. package/src/workflows/create-skill/steps-c/step-03-extract.md +184 -0
  66. package/src/workflows/create-skill/steps-c/step-04-enrich.md +152 -0
  67. package/src/workflows/create-skill/steps-c/step-05-compile.md +198 -0
  68. package/src/workflows/create-skill/steps-c/step-06-validate.md +162 -0
  69. package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +165 -0
  70. package/src/workflows/create-skill/steps-c/step-08-report.md +160 -0
  71. package/src/workflows/create-skill/validation-report.md +189 -0
  72. package/src/workflows/create-skill/workflow-plan-create-skill.md +491 -0
  73. package/src/workflows/create-skill/workflow.md +52 -0
  74. package/src/workflows/create-stack-skill/data/integration-patterns.md +61 -0
  75. package/src/workflows/create-stack-skill/data/manifest-patterns.md +35 -0
  76. package/src/workflows/create-stack-skill/data/stack-skill-template.md +110 -0
  77. package/src/workflows/create-stack-skill/steps-c/step-01-init.md +142 -0
  78. package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +145 -0
  79. package/src/workflows/create-stack-skill/steps-c/step-03-rank-and-confirm.md +161 -0
  80. package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +155 -0
  81. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +154 -0
  82. package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +160 -0
  83. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +202 -0
  84. package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +193 -0
  85. package/src/workflows/create-stack-skill/steps-c/step-09-report.md +137 -0
  86. package/src/workflows/create-stack-skill/validation-report.md +401 -0
  87. package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +481 -0
  88. package/src/workflows/create-stack-skill/workflow.md +59 -0
  89. package/src/workflows/export-skill/data/managed-section-format.md +70 -0
  90. package/src/workflows/export-skill/data/snippet-format.md +32 -0
  91. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +184 -0
  92. package/src/workflows/export-skill/steps-c/step-02-package.md +153 -0
  93. package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +166 -0
  94. package/src/workflows/export-skill/steps-c/step-04-update-context.md +222 -0
  95. package/src/workflows/export-skill/steps-c/step-05-token-report.md +126 -0
  96. package/src/workflows/export-skill/steps-c/step-06-summary.md +167 -0
  97. package/src/workflows/export-skill/validation-report.md +263 -0
  98. package/src/workflows/export-skill/workflow-plan-export-skill.md +369 -0
  99. package/src/workflows/export-skill/workflow.md +56 -0
  100. package/src/workflows/quick-skill/data/registry-resolution.md +91 -0
  101. package/src/workflows/quick-skill/data/skill-template.md +66 -0
  102. package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +165 -0
  103. package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +143 -0
  104. package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +177 -0
  105. package/src/workflows/quick-skill/steps-c/step-04-compile.md +180 -0
  106. package/src/workflows/quick-skill/steps-c/step-05-validate.md +150 -0
  107. package/src/workflows/quick-skill/steps-c/step-06-write.md +160 -0
  108. package/src/workflows/quick-skill/validation-report.md +543 -0
  109. package/src/workflows/quick-skill/workflow-plan-quick-skill.md +405 -0
  110. package/src/workflows/quick-skill/workflow.md +56 -0
  111. package/src/workflows/setup-forge/data/tier-rules.md +50 -0
  112. package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +140 -0
  113. package/src/workflows/setup-forge/steps-c/step-02-write-config.md +141 -0
  114. package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +116 -0
  115. package/src/workflows/setup-forge/steps-c/step-04-report.md +131 -0
  116. package/src/workflows/setup-forge/validation-report.md +504 -0
  117. package/src/workflows/setup-forge/workflow-plan-setup-forge.md +428 -0
  118. package/src/workflows/setup-forge/workflow.md +49 -0
  119. package/src/workflows/test-skill/data/output-section-formats.md +96 -0
  120. package/src/workflows/test-skill/data/scoring-rules.md +74 -0
  121. package/src/workflows/test-skill/steps-c/step-01-init.md +185 -0
  122. package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +162 -0
  123. package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +222 -0
  124. package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +249 -0
  125. package/src/workflows/test-skill/steps-c/step-05-score.md +222 -0
  126. package/src/workflows/test-skill/steps-c/step-06-report.md +175 -0
  127. package/src/workflows/test-skill/templates/test-report-template.md +24 -0
  128. package/src/workflows/test-skill/validation-report.md +390 -0
  129. package/src/workflows/test-skill/workflow-plan-test-skill.md +288 -0
  130. package/src/workflows/test-skill/workflow.md +57 -0
  131. package/src/workflows/update-skill/data/manual-section-rules.md +44 -0
  132. package/src/workflows/update-skill/data/merge-conflict-rules.md +62 -0
  133. package/src/workflows/update-skill/steps-c/step-01-init.md +208 -0
  134. package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +184 -0
  135. package/src/workflows/update-skill/steps-c/step-03-re-extract.md +187 -0
  136. package/src/workflows/update-skill/steps-c/step-04-merge.md +230 -0
  137. package/src/workflows/update-skill/steps-c/step-05-validate.md +187 -0
  138. package/src/workflows/update-skill/steps-c/step-06-write.md +204 -0
  139. package/src/workflows/update-skill/steps-c/step-07-report.md +201 -0
  140. package/src/workflows/update-skill/validation-report.md +559 -0
  141. package/src/workflows/update-skill/workflow-plan-update-skill.md +441 -0
  142. package/src/workflows/update-skill/workflow.md +56 -0
  143. package/tools/cli/commands/install.js +33 -0
  144. package/tools/cli/commands/status.js +195 -0
  145. package/tools/cli/commands/uninstall.js +226 -0
  146. package/tools/cli/commands/update.js +63 -0
  147. package/tools/cli/lib/compiler.js +306 -0
  148. package/tools/cli/lib/ide-commands.js +244 -0
  149. package/tools/cli/lib/installer.js +307 -0
  150. package/tools/cli/lib/manifest.js +109 -0
  151. package/tools/cli/lib/ui.js +277 -0
  152. package/tools/cli/lib/version-check.js +86 -0
  153. package/tools/cli/skf-cli.js +45 -0
  154. package/tools/skf-npx-wrapper.js +36 -0
@@ -0,0 +1,203 @@
1
+ ---
2
+ name: 'step-02-analyze-target'
3
+ description: 'Analyze target repository structure, detect language, and list modules and exports'
4
+
5
+ nextStepFile: './step-03-scope-definition.md'
6
+ ---
7
+
8
+ # Step 2: Analyze Target
9
+
10
+ ## STEP GOAL:
11
+
12
+ To analyze the target repository by resolving its location, reading its structure, detecting the primary language, and listing top-level modules and exports — providing the user with a factual foundation for scoping decisions.
13
+
14
+ ## MANDATORY EXECUTION RULES (READ FIRST):
15
+
16
+ ### Universal Rules:
17
+
18
+ - 🛑 NEVER generate content without user input
19
+ - 📖 CRITICAL: Read the complete step file before taking any action
20
+ - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
21
+ - 📋 YOU ARE A FACILITATOR, not a content generator
22
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
23
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
24
+
25
+ ### Role Reinforcement:
26
+
27
+ - ✅ You are a source code analyst in Ferris Architect mode
28
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
29
+ - ✅ Report ONLY what is found — zero hallucination tolerance
30
+ - ✅ You bring structural analysis expertise, user brings their domain understanding
31
+
32
+ ### Step-Specific Rules:
33
+
34
+ - 🎯 Focus only on analysis — do not define scope yet (that's step 03)
35
+ - 🚫 FORBIDDEN to make scoping decisions or recommendations in this step
36
+ - 🚫 FORBIDDEN to hallucinate or guess about repository contents
37
+ - 💬 Approach: Prescriptive — exact analysis instructions, factual reporting
38
+ - 📋 Report everything found; let the user interpret for scoping
39
+
40
+ ## EXECUTION PROTOCOLS:
41
+
42
+ - 🎯 Follow the MANDATORY SEQUENCE exactly
43
+ - 💾 Analysis results are accumulated conversationally for use in step 03
44
+ - 📖 This step is autonomous — minimal user interaction required
45
+ - 🚫 FORBIDDEN to proceed if target is inaccessible — halt with actionable error
46
+
47
+ ## CONTEXT BOUNDARIES:
48
+
49
+ - Available context: Target repo (URL or path), user intent, skill name, forge tier — all from step 01
50
+ - Focus: Structural analysis of the repository
51
+ - Limits: Do not read file contents deeply — only structure, exports, and metadata
52
+ - Dependencies: Confirmed target repository from step 01
53
+
54
+ ## MANDATORY SEQUENCE
55
+
56
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
57
+
58
+ ### 1. Resolve Target Location
59
+
60
+ **For GitHub URLs:**
61
+ - Use `gh api repos/{owner}/{repo}` to verify the repository exists
62
+ - Use `gh api repos/{owner}/{repo}/git/trees/HEAD?recursive=1` to get the file tree
63
+ - If inaccessible: **HALT** — "**Error:** Cannot access repository at {url}. Please verify the URL is correct and you have access. If private, ensure `gh auth` is configured."
64
+
65
+ **For local paths:**
66
+ - Verify the directory exists
67
+ - List the directory tree
68
+ - If path doesn't exist: **HALT** — "**Error:** Directory not found at {path}. Please verify the path is correct."
69
+
70
+ Display: "**Resolving target...**"
71
+
72
+ ### 2. Read Repository Structure
73
+
74
+ List the top-level directory structure:
75
+
76
+ "**Repository Structure:**
77
+ ```
78
+ {repo-name}/
79
+ ├── {top-level files}
80
+ ├── {top-level directories}/
81
+ │ └── ...
82
+ └── ...
83
+ ```
84
+ **Total:** {file count} files, {directory count} directories"
85
+
86
+ ### 3. Detect Primary Language
87
+
88
+ Examine file extensions and configuration files to detect the primary language:
89
+
90
+ **Detection signals (check in order):**
91
+ 1. `package.json` → JavaScript/TypeScript
92
+ 2. `tsconfig.json` → TypeScript
93
+ 3. `Cargo.toml` → Rust
94
+ 4. `pyproject.toml` or `setup.py` or `setup.cfg` → Python
95
+ 5. `go.mod` → Go
96
+ 6. `pom.xml` or `build.gradle` → Java
97
+ 7. `*.csproj` or `*.sln` → C#
98
+ 8. `Gemfile` → Ruby
99
+ 9. File extension frequency analysis as fallback
100
+
101
+ "**Detected language:** {language}
102
+ **Confidence:** {high/medium/low}
103
+ **Detection source:** {what config file or pattern confirmed it}"
104
+
105
+ If confidence is low or ambiguous: flag for user override in step 03.
106
+
107
+ ### 4. List Top-Level Modules and Exports
108
+
109
+ Based on detected language, identify public API surface:
110
+
111
+ **For JavaScript/TypeScript:**
112
+ - Check `package.json` for `main`, `exports`, `module` fields
113
+ - Look for `index.ts`/`index.js` in `src/`
114
+ - List directories under `src/` as potential modules
115
+
116
+ **For Python:**
117
+ - Check `__init__.py` files for public exports
118
+ - List top-level packages under the source directory
119
+
120
+ **For Rust:**
121
+ - Check `lib.rs` for `pub mod` declarations
122
+ - List modules from `src/` directory
123
+
124
+ **For other languages:**
125
+ - List top-level source directories as potential modules
126
+ - Note any obvious entry points
127
+
128
+ "**Top-Level Modules/Directories:**
129
+ {numbered list of modules with brief description of each}
130
+
131
+ **Detected Exports/Entry Points:**
132
+ {numbered list of public-facing items found}"
133
+
134
+ ### 5. Report Analysis Summary
135
+
136
+ Present the complete analysis:
137
+
138
+ "**Analysis Complete**
139
+
140
+ ---
141
+
142
+ **Target:** {repo URL or path}
143
+ **Language:** {detected language} ({confidence})
144
+ **Structure:** {file count} files across {directory count} directories
145
+
146
+ **Key Modules ({count}):**
147
+ {bulleted list of modules}
148
+
149
+ **Public Exports/Entry Points ({count}):**
150
+ {bulleted list of exports}
151
+
152
+ **Notable Files:**
153
+ - README: {found/not found}
154
+ - Tests: {found/not found — location}
155
+ - Docs: {found/not found — location}
156
+ - Config: {list of config files found}
157
+
158
+ ---
159
+
160
+ {If language confidence is low:}
161
+ **Note:** Language detection confidence is low. You'll be able to override this in the next step.
162
+
163
+ Moving to scope definition where you'll choose what to include and exclude."
164
+
165
+ ### 6. Auto-Proceed to Scope Definition
166
+
167
+ Display: "**Proceeding to scope definition...**"
168
+
169
+ #### Menu Handling Logic:
170
+
171
+ - After analysis report is presented to user, immediately load, read entire file, then execute {nextStepFile}
172
+
173
+ #### EXECUTION RULES:
174
+
175
+ - This is an auto-proceed step — analysis is factual reporting with no user choices
176
+ - Proceed directly to step 03 after presenting the analysis summary
177
+
178
+ ## CRITICAL STEP COMPLETION NOTE
179
+
180
+ ONLY WHEN the analysis is complete and the summary has been presented to the user will you load and read fully `./step-03-scope-definition.md` to begin scope definition.
181
+
182
+ ---
183
+
184
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
185
+
186
+ ### ✅ SUCCESS:
187
+
188
+ - Target repository resolved and accessible
189
+ - Repository structure listed clearly
190
+ - Primary language detected with confidence level
191
+ - Top-level modules and exports identified
192
+ - Analysis summary presented factually
193
+ - Auto-proceeded to scope definition
194
+
195
+ ### ❌ SYSTEM FAILURE:
196
+
197
+ - Hallucinating or guessing about repository contents
198
+ - Making scoping recommendations (too early — that's step 03)
199
+ - Proceeding when target is inaccessible (must halt with error)
200
+ - Not detecting or reporting the primary language
201
+ - Skipping the analysis summary
202
+
203
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: 'step-03-scope-definition'
3
+ description: 'Collaboratively define skill scope boundaries using analysis findings and scope templates'
4
+
5
+ nextStepFile: './step-04-confirm-brief.md'
6
+ advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
7
+ partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
8
+ ---
9
+
10
+ # Step 3: Scope Definition
11
+
12
+ ## STEP GOAL:
13
+
14
+ To collaboratively define the skill's inclusion and exclusion boundaries using the analysis findings from step 02, scope templates, and the user's intent from step 01.
15
+
16
+ ## MANDATORY EXECUTION RULES (READ FIRST):
17
+
18
+ ### Universal Rules:
19
+
20
+ - 🛑 NEVER generate content without user input
21
+ - 📖 CRITICAL: Read the complete step file before taking any action
22
+ - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
23
+ - 📋 YOU ARE A FACILITATOR, not a content generator
24
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
25
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
26
+
27
+ ### Role Reinforcement:
28
+
29
+ - ✅ You are a skill boundary architect in Ferris Architect mode (collaborative, exploratory)
30
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
31
+ - ✅ We engage in collaborative dialogue, not command-response
32
+ - ✅ You bring API surface design expertise, user brings their domain knowledge of what's valuable
33
+ - ✅ Maintain warm, guiding tone — help the user make informed scoping decisions
34
+
35
+ ### Step-Specific Rules:
36
+
37
+ - 🎯 Focus only on defining scope boundaries — do not write the brief yet (that's step 05)
38
+ - 🚫 FORBIDDEN to make scope decisions unilaterally — user drives all scope choices
39
+ - 💬 Approach: Intent-based discovery — "Which parts are most relevant to your use case?"
40
+ - 📋 Produce: scope type, include patterns, exclude patterns
41
+
42
+ ## EXECUTION PROTOCOLS:
43
+
44
+ - 🎯 Follow the MANDATORY SEQUENCE exactly
45
+ - 💾 Accumulate scope decisions conversationally for use in subsequent steps
46
+ - 📖 Reference analysis findings from step 02 throughout
47
+ - 🚫 FORBIDDEN to proceed without user confirmation of scope boundaries
48
+
49
+ ## CONTEXT BOUNDARIES:
50
+
51
+ - Available context: Target repo, user intent, skill name, forge tier (step 01), repo structure, detected language, modules, exports (step 02)
52
+ - Focus: Defining WHAT is in scope and what is NOT
53
+ - Limits: Do not generate the brief — only define boundaries
54
+ - Dependencies: Analysis findings from step 02
55
+
56
+ ## MANDATORY SEQUENCE
57
+
58
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
59
+
60
+ ### 1. Present Scope Context
61
+
62
+ "**Let's define the scope for your skill.**
63
+
64
+ Based on the analysis, here's what we're working with:
65
+
66
+ - **Target:** {repo}
67
+ - **Language:** {detected language}
68
+ - **Modules found:** {count} — {list names}
69
+ - **Your intent:** {user intent from step 01}
70
+ {If scope hints from step 01:}
71
+ - **Your initial scope hints:** {hints}"
72
+
73
+ ### 2. Offer Scope Templates
74
+
75
+ "**How broadly should this skill cover the library?**
76
+
77
+ **[F] Full Library** — Include everything. Best for smaller, focused libraries.
78
+ - All public exports, all modules
79
+ - Exclude only tests, build artifacts, and internal utilities
80
+
81
+ **[M] Specific Modules** — Select which modules to include. Best for large libraries where only some parts are relevant.
82
+ - You choose which modules/directories
83
+ - Fine-grained control over what's in and out
84
+
85
+ **[P] Public API Only** — Include only the public-facing API surface. Best for libraries with a clear public/private boundary.
86
+ - Entry points and exported interfaces only
87
+ - Internal implementation excluded
88
+
89
+ Which scope type fits your needs?"
90
+
91
+ Wait for user selection.
92
+
93
+ ### 3. Define Boundaries Based on Selection
94
+
95
+ **If [F] Full Library:**
96
+
97
+ "**Full Library scope selected.**
98
+
99
+ Default inclusions:
100
+ - All source files under {main source directory}
101
+ - All public modules: {list from analysis}
102
+
103
+ Default exclusions:
104
+ - Test files (`**/*.test.*`, `**/*.spec.*`, `**/test/`, `**/tests/`)
105
+ - Build artifacts (`**/dist/`, `**/build/`, `**/target/`)
106
+ - Configuration files
107
+ - Documentation source files
108
+
109
+ Any additional exclusions you'd like to add? Or adjustments to these defaults?"
110
+
111
+ **If [M] Specific Modules:**
112
+
113
+ "**Specific Modules scope selected.**
114
+
115
+ Here are the modules found in the analysis:
116
+
117
+ {numbered list of modules from step 02 with brief descriptions}
118
+
119
+ Which modules would you like to include? (Enter numbers, comma-separated):"
120
+
121
+ Wait for selection. Then:
122
+
123
+ "**Selected modules:**
124
+ - {list selected modules}
125
+
126
+ For these modules, should I include:
127
+ - **A)** Everything in those modules (all files)
128
+ - **B)** Only public exports from those modules
129
+
130
+ Any files or patterns to explicitly exclude within these modules?"
131
+
132
+ **If [P] Public API Only:**
133
+
134
+ "**Public API scope selected.**
135
+
136
+ From the analysis, these appear to be the public entry points:
137
+
138
+ {numbered list of exports/entry points from step 02}
139
+
140
+ Which of these would you like to include? (Enter numbers, or 'all'):"
141
+
142
+ Wait for selection. Then:
143
+
144
+ "**Selected exports:**
145
+ - {list selected exports}
146
+
147
+ Exclusions will include all internal implementation files, tests, and utilities.
148
+
149
+ Any additional items you'd like to include or exclude?"
150
+
151
+ ### 4. Handle Language Override
152
+
153
+ {If language detection confidence was low from step 02:}
154
+
155
+ "**Language confirmation needed.**
156
+
157
+ The analysis detected **{language}** with low confidence. Is this correct, or should we set a different primary language?"
158
+
159
+ Wait for confirmation or override.
160
+
161
+ ### 5. Summarize Scope Decisions
162
+
163
+ "**Scope Summary:**
164
+
165
+ **Type:** {Full Library / Specific Modules / Public API}
166
+
167
+ **Include:**
168
+ {bulleted list of include patterns}
169
+
170
+ **Exclude:**
171
+ {bulleted list of exclude patterns}
172
+
173
+ **Language:** {confirmed language}
174
+
175
+ {If any scope notes:}
176
+ **Notes:** {scope notes}
177
+
178
+ Does this look right? You can adjust before we continue."
179
+
180
+ Wait for confirmation. Make adjustments if requested.
181
+
182
+ ### 6. Present MENU OPTIONS
183
+
184
+ Display: **Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Continue to Brief Confirmation
185
+
186
+ #### Menu Handling Logic:
187
+
188
+ - IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
189
+ - IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
190
+ - IF C: Load, read entire file, then execute {nextStepFile}
191
+ - IF Any other comments or queries: help user respond then [Redisplay Menu Options](#6-present-menu-options)
192
+
193
+ #### EXECUTION RULES:
194
+
195
+ - ALWAYS halt and wait for user input after presenting menu
196
+ - ONLY proceed to next step when user selects 'C'
197
+ - After other menu items execution, return to this menu
198
+ - User can chat or ask questions — always respond and then redisplay menu
199
+
200
+ ## CRITICAL STEP COMPLETION NOTE
201
+
202
+ ONLY WHEN C is selected and scope boundaries are confirmed will you load and read fully `./step-04-confirm-brief.md` to present the complete brief for confirmation.
203
+
204
+ ---
205
+
206
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
207
+
208
+ ### ✅ SUCCESS:
209
+
210
+ - Scope type selected by user (Full Library, Specific Modules, or Public API)
211
+ - Include patterns defined and confirmed
212
+ - Exclude patterns defined and confirmed
213
+ - Language confirmed (or overridden if detection was low confidence)
214
+ - User confirmed the scope summary
215
+ - Menu presented and user input handled correctly
216
+
217
+ ### ❌ SYSTEM FAILURE:
218
+
219
+ - Making scope decisions without user input
220
+ - Not presenting the scope templates for user selection
221
+ - Skipping the scope summary confirmation
222
+ - Not handling language override when detection confidence was low
223
+ - Writing the brief in this step (too early — that's step 05)
224
+
225
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,185 @@
1
+ ---
2
+ name: 'step-04-confirm-brief'
3
+ description: 'Present complete skill brief for user review and confirmation before writing'
4
+
5
+ nextStepFile: './step-05-write-brief.md'
6
+ reviseStepFile: './step-03-scope-definition.md'
7
+ briefSchemaFile: '../data/skill-brief-schema.md'
8
+ advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
9
+ partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
10
+ ---
11
+
12
+ # Step 4: Confirm Brief
13
+
14
+ ## STEP GOAL:
15
+
16
+ To present the complete skill brief in human-readable format, highlighting all fields that will be written to skill-brief.yaml, and obtain explicit user approval before writing.
17
+
18
+ ## MANDATORY EXECUTION RULES (READ FIRST):
19
+
20
+ ### Universal Rules:
21
+
22
+ - 🛑 NEVER generate content without user input
23
+ - 📖 CRITICAL: Read the complete step file before taking any action
24
+ - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
25
+ - 📋 YOU ARE A FACILITATOR, not a content generator
26
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
27
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
28
+
29
+ ### Role Reinforcement:
30
+
31
+ - ✅ You are a quality reviewer in Ferris Architect mode
32
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
33
+ - ✅ Present information precisely and clearly — this is a confirmation gate
34
+ - ✅ Highlight anything with low confidence or defaults that the user should verify
35
+
36
+ ### Step-Specific Rules:
37
+
38
+ - 🎯 Focus only on presenting and confirming — do not write files yet (that's step 05)
39
+ - 🚫 FORBIDDEN to proceed without explicit user approval
40
+ - 💬 Approach: Prescriptive — exact presentation format showing all YAML fields
41
+ - 📋 This is a P2 confirmation gate — the user MUST approve before continuing
42
+
43
+ ## EXECUTION PROTOCOLS:
44
+
45
+ - 🎯 Follow the MANDATORY SEQUENCE exactly
46
+ - 💾 Load the schema to ensure all required fields are presented
47
+ - 📖 This is a mandatory checkpoint — no auto-proceed
48
+ - 🚫 FORBIDDEN to write skill-brief.yaml in this step
49
+
50
+ ## CONTEXT BOUNDARIES:
51
+
52
+ - Available context: All gathered data from steps 01-03 (target, intent, name, tier, language, scope)
53
+ - Focus: Presenting the complete brief for final review
54
+ - Limits: Do not write files — only present for approval
55
+ - Dependencies: Confirmed scope boundaries from step 03
56
+
57
+ ## MANDATORY SEQUENCE
58
+
59
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
60
+
61
+ ### 1. Load Schema
62
+
63
+ Load `{briefSchemaFile}` to reference required fields and the human-readable presentation format.
64
+
65
+ ### 2. Assemble Complete Brief
66
+
67
+ Compile all gathered data from steps 01-03 into the complete brief:
68
+
69
+ - **name:** {skill name from step 01}
70
+ - **version:** "1.0.0" (default)
71
+ - **source_repo:** {target repo from step 01}
72
+ - **language:** {detected/confirmed language from steps 02-03}
73
+ - **description:** {derived from user intent in step 01}
74
+ - **forge_tier:** {tier from step 01}
75
+ - **created:** {current date}
76
+ - **created_by:** {user_name from config}
77
+ - **scope.type:** {scope type from step 03}
78
+ - **scope.include:** {include patterns from step 03}
79
+ - **scope.exclude:** {exclude patterns from step 03}
80
+ - **scope.notes:** {any scope notes from step 03}
81
+
82
+ ### 3. Present Brief for Review
83
+
84
+ Using the presentation format from the schema:
85
+
86
+ "**Please review the complete skill brief before I write it.**
87
+
88
+ ---
89
+
90
+ ```
91
+ Skill Brief: {name}
92
+ ====================
93
+
94
+ Target: {source_repo}
95
+ Language: {language}
96
+ Forge Tier: {forge_tier}
97
+ Description: {description}
98
+
99
+ Scope: {scope.type}
100
+ Include: {scope.include patterns, one per line}
101
+ Exclude: {scope.exclude patterns, one per line}
102
+ Notes: {scope.notes}
103
+
104
+ Version: {version}
105
+ Created: {created}
106
+ Created by: {created_by}
107
+ ```
108
+
109
+ ---"
110
+
111
+ ### 4. Highlight Items Needing Attention
112
+
113
+ Flag any fields that may need review:
114
+
115
+ {If language was overridden or low confidence:}
116
+ "**Note:** Language was {auto-detected / manually overridden}."
117
+
118
+ {If description was derived (not stated by user):}
119
+ "**Note:** Description was derived from your stated intent. Adjust if needed."
120
+
121
+ {If forge tier was defaulted:}
122
+ "**Note:** Forge tier defaulted to Quick (no forge-tier.yaml found)."
123
+
124
+ {If any scope patterns seem broad or narrow:}
125
+ "**Note:** {specific observation about scope breadth}."
126
+
127
+ "**This is your last chance to make changes before writing the file.**
128
+
129
+ You can:
130
+ - Adjust any field by telling me what to change
131
+ - Revise scope boundaries by selecting [R]
132
+ - Proceed to write by selecting [C]"
133
+
134
+ ### 5. Handle Inline Adjustments
135
+
136
+ If the user requests changes to specific fields (name, description, version, etc.):
137
+ - Make the adjustment
138
+ - Re-present the updated brief
139
+ - Return to the menu
140
+
141
+ ### 6. Present MENU OPTIONS
142
+
143
+ Display: **Select an Option:** [R] Revise Scope [A] Advanced Elicitation [P] Party Mode [C] Approve and Write
144
+
145
+ #### Menu Handling Logic:
146
+
147
+ - IF R: Load, read entire file, then execute {reviseStepFile} to re-enter scope definition
148
+ - IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
149
+ - IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
150
+ - IF C: Load, read entire file, then execute {nextStepFile}
151
+ - IF Any other comments or queries: help user respond, apply any field adjustments, re-present brief if changed, then [Redisplay Menu Options](#6-present-menu-options)
152
+
153
+ #### EXECUTION RULES:
154
+
155
+ - ALWAYS halt and wait for user input after presenting menu
156
+ - ONLY proceed to write step when user selects 'C'
157
+ - After other menu items execution, return to this menu
158
+ - User can chat, request field changes, or ask questions — always respond and then redisplay menu
159
+
160
+ ## CRITICAL STEP COMPLETION NOTE
161
+
162
+ ONLY WHEN C is selected and the user has explicitly approved the brief will you load and read fully `./step-05-write-brief.md` to write the skill-brief.yaml file.
163
+
164
+ ---
165
+
166
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
167
+
168
+ ### ✅ SUCCESS:
169
+
170
+ - Schema loaded for field reference
171
+ - Complete brief assembled from all gathered data
172
+ - Brief presented in human-readable format
173
+ - Low-confidence or defaulted fields highlighted
174
+ - User explicitly approved the brief
175
+ - Menu presented with revise option
176
+
177
+ ### ❌ SYSTEM FAILURE:
178
+
179
+ - Writing skill-brief.yaml in this step (too early)
180
+ - Proceeding without explicit user approval
181
+ - Not presenting all required fields
182
+ - Not highlighting defaulted or low-confidence values
183
+ - Not offering the [R] Revise option
184
+
185
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.