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,385 @@
1
+ ---
2
+ conversionFrom: 'src/workflows/analyze-source/analyze-source.spec.md'
3
+ originalFormat: 'workflow-spec-placeholder'
4
+ stepsCompleted: ['step-00-conversion', 'step-02-classification', 'step-03-requirements', 'step-04-tools', 'step-05-plan-review', 'step-06-design', 'step-07-foundation', 'step-08-build-step-01', 'step-09-build-remaining-steps']
5
+ created: 2026-02-27
6
+ status: BUILD_COMPLETE
7
+ validationStatus: COMPLETE
8
+ validationDate: 2026-02-27
9
+ validationReport: './validation-report.md'
10
+ approvedDate: 2026-02-27
11
+ ---
12
+
13
+ # Workflow Creation Plan
14
+
15
+ ## Conversion Source
16
+
17
+ **Original Path:** src/workflows/analyze-source/analyze-source.spec.md
18
+ **Original Format:** Workflow specification (placeholder β€” not yet built)
19
+ **Detected Structure:** Single spec document defining a create-only, 6-step workflow for brownfield source code analysis and skill decomposition
20
+
21
+ ---
22
+
23
+ ## Original Workflow Analysis
24
+
25
+ ### Goal (from source)
26
+
27
+ Decomposition engine β€” discover what to skill, recommend stack skill. Analyzes a large repo or multi-service project to identify discrete skillable units. Maps exports, service boundaries, and integration points. Produces N recommended skill-brief.yaml files and optionally recommends a stack skill. Primary entry point for brownfield onboarding.
28
+
29
+ ### Original Steps (Complete List)
30
+
31
+ **Step 1:** scan-project - Map project structure, detect service boundaries
32
+ **Step 2:** identify-units - Identify discrete skillable units (services, libraries, modules)
33
+ **Step 3:** map-exports - Count and categorize exports per unit
34
+ **Step 4:** detect-integrations - Find cross-unit integration points
35
+ **Step 5:** recommend - Present recommendations with rationale
36
+ **Step 6:** generate-briefs - Create skill-brief.yaml per confirmed unit
37
+
38
+ ### Output / Deliverable
39
+
40
+ - N x `{forge_data_folder}/{unit-name}/skill-brief.yaml` β€” One per recommended unit
41
+ - Analysis summary report
42
+
43
+ ### Input Requirements
44
+
45
+ **Required:**
46
+ - Project root or repo path
47
+
48
+ **Optional:**
49
+ - Scope hints (monorepo packages, service directories)
50
+
51
+ ### Key Instructions to LLM
52
+
53
+ - Primary agent: Ferris (Architect mode)
54
+ - Workflow type: Feature β€” discovery and planning
55
+ - Create-only mode (steps-c/ only, no edit or validate modes)
56
+ - Installed path: {project-root}/_bmad/skf/workflows/analyze-source
57
+ - web_bundle: true
58
+
59
+ ---
60
+
61
+ ## Conversion Notes
62
+
63
+ **What works well in original:**
64
+ - Clear 6-step decomposition pipeline with logical progression (scan β†’ identify β†’ map β†’ detect β†’ recommend β†’ generate)
65
+ - Well-defined input/output contract (repo path in, skill-brief.yaml files out)
66
+ - Spec identifies the right granularity for brownfield analysis
67
+ - Correct positioning as brownfield entry point β€” gateway workflow before brief-skill β†’ create-skill pipeline
68
+
69
+ **What needs improvement:**
70
+ - Spec is a placeholder with no implementation β€” steps need full instruction content
71
+ - No collaborative interaction patterns defined (menus, user decision points)
72
+ - No data files, templates, or supporting resources specified
73
+ - Missing details on how "skillable units" are defined and bounded (what boundaries define a discrete unit?)
74
+ - No tier awareness β€” all other SKF workflows use tier-dependent tooling (Quick=text patterns, Forge=AST, Deep=AST+QMD)
75
+ - No forge_data_folder integration despite referencing it for output paths
76
+ - No stack skill detection β€” should flag potential co-integrated library candidates for create-stack-skill
77
+
78
+ **Compliance gaps identified:**
79
+ - No workflow.md entry point file
80
+ - No step files exist yet (steps-c/ folder needs creation)
81
+ - No frontmatter with BMAD-required fields on steps
82
+ - No menu handling or continuation patterns
83
+ - No data/ or templates/ resources
84
+ - No validation mode (spec marks as create-only, but validation could add value)
85
+
86
+ ---
87
+
88
+ ## Memory-Informed Discovery Notes
89
+
90
+ ### Preserve
91
+ - 6-step linear pipeline matching proven architecture across all SKF workflows (quick-skill, brief-skill, create-stack-skill)
92
+ - Brownfield entry point positioning in the SKF lifecycle
93
+
94
+ ### Address
95
+ - Define "skillable unit" detection heuristics (service boundaries, package boundaries, independent entry points)
96
+ - Add tier-aware scanning: Quick (file structure only), Forge (AST analysis), Deep (semantic analysis with QMD)
97
+ - Connect to SKF config infrastructure (forge_data_folder, skills_output_folder)
98
+ - SKF module config.yaml doesn't exist yet β€” workflow needs graceful handling or setup-forge prerequisite
99
+
100
+ ### Add
101
+ - Interactive recommendation gate at step 05 β€” user confirms/rejects each unit before brief generation (matches Gate pattern from create-stack-skill and brief-skill)
102
+ - Output aligned to skill-brief.yaml schema (9 required fields: name, version, source_repo, language, scope, description, forge_tier, created, created_by)
103
+ - Scope type detection per unit (full-library / specific-modules / public-api)
104
+ - Existing skill detection β€” check forge_data_folder for already-created skills to avoid duplicates
105
+ - Stack skill candidate flagging for units with strong co-integration patterns
106
+
107
+ ### Audience
108
+ - Ferris in Architect mode β€” prescriptive precision, zero-hallucination, file:line citation tracing
109
+ - Developers onboarding existing multi-service projects needing automated decomposition
110
+
111
+ ---
112
+
113
+ ## Classification Decisions
114
+
115
+ **Workflow Name:** analyze-source
116
+ **Target Path:** {project-root}/_bmad/skf/workflows/analyze-source/
117
+
118
+ **4 Key Decisions:**
119
+ 1. **Document Output:** true β€” produces N x skill-brief.yaml files + analysis summary report
120
+ 2. **Module Affiliation:** skf β€” core SKF workflow with access to forge_data_folder, skills_output_folder, forge_tier
121
+ 3. **Session Type:** continuable β€” large repos will consume massive tokens during scanning/mapping; needs step-01b-continue.md and stepsCompleted tracking
122
+ 4. **Lifecycle Support:** create-only β€” discovery workflow is one-shot per project; re-analysis creates fresh rather than editing stale results
123
+
124
+ **Structure Implications:**
125
+ - Needs steps-c/ directory only (no steps-e/ or steps-v/)
126
+ - Needs step-01-init.md with continuation detection logic
127
+ - Needs step-01b-continue.md for resuming interrupted analysis
128
+ - Needs stepsCompleted tracking in output document frontmatter
129
+ - Output uses free-form template with progressive append
130
+ - Data folder for unit detection heuristics and skill-brief schema reference
131
+
132
+ ---
133
+
134
+ ## Requirements
135
+
136
+ **Flow Structure:**
137
+ - Pattern: Linear with strategic user gate
138
+ - Phases: Discovery (steps 01-04), Decision (step 05), Generation (step 06)
139
+ - Estimated steps: 6 create steps + 1 continuation step (step-01b) = 7 step files
140
+ - Output pattern: Plan-then-Build β€” steps 01-05 build analysis report, step 06 consumes report to generate skill-brief.yaml files
141
+
142
+ **User Interaction:**
143
+ - Style: Mixed β€” mostly autonomous discovery with collaborative gates
144
+ - Decision points:
145
+ - Step 05: Confirm/reject each recommended skillable unit
146
+ - Step 05: Flag stack skill candidates for create-stack-skill
147
+ - Step 06: Final confirmation before writing files
148
+ - Checkpoint frequency: Auto-proceed steps 01-04, full gate at step 05, summary at step 06
149
+
150
+ **Inputs Required:**
151
+ - Required: Project root or repo path
152
+ - Required: SKF module config (forge_data_folder, skills_output_folder, forge_tier)
153
+ - Required: forge-tier.yaml (determines Quick/Forge/Deep analysis depth)
154
+ - Optional: Scope hints (monorepo packages, service directories to focus on)
155
+ - Optional: Exclusion patterns (vendor dirs, test dirs, generated code to skip)
156
+ - Prerequisites: setup-forge workflow must have been run
157
+ - Init check: Scan forge_data_folder for existing skills to avoid duplicate recommendations
158
+
159
+ **Output Specifications:**
160
+ - Type: Multi-file document output
161
+ - Analysis summary report: Structured format (Project Overview, Units Found, Integration Map, Recommendations, Generation Results)
162
+ - Skill-brief.yaml files: Strict format per schema (9 required fields: name, version, source_repo, language, scope, description, forge_tier, created, created_by)
163
+ - Output locations: skill-brief.yaml β†’ {forge_data_folder}/{unit-name}/skill-brief.yaml, summary β†’ {output_folder}/analyze-source-report-{project_name}.md
164
+ - Frequency: N briefs per run (one per confirmed unit)
165
+
166
+ **Success Criteria:**
167
+ - Complete project scan β€” all service boundaries, packages, and entry points mapped
168
+ - Every identified unit classified with clear boundary definition (scope type: full-library / specific-modules / public-api)
169
+ - Integration points documented β€” cross-unit dependencies and co-import patterns captured
170
+ - Stack skill candidates flagged for create-stack-skill
171
+ - Existing skills detected β€” units with skills in forge_data_folder flagged as skip/update
172
+ - User confirmed all recommendations before generation
173
+ - Generated skill-brief.yaml files validate β€” all 9 fields present, name uniqueness enforced, scope has >= 1 include pattern
174
+ - Downstream ready β€” each brief consumable by brief-skill or create-skill pipeline
175
+
176
+ **Instruction Style:**
177
+ - Overall: Prescriptive with Ferris Architect mode
178
+ - Zero-hallucination β€” only report what's found in codebase
179
+ - File:line citation tracing β€” every claim backed by evidence
180
+ - Step 05 uses prescriptive presentation with collaborative discussion (user can ask "why?", Ferris explains with evidence)
181
+ - Positive capability framing throughout
182
+
183
+ ---
184
+
185
+ ## Workflow Design Preview
186
+
187
+ **Step count:** 5 create steps + 1 continuation step (step-01b) = 6 step files
188
+
189
+ **Phase 0 β€” Initialization (step-01-init / step-01b-continue)**
190
+ - Load SKF config, forge-tier.yaml, check existing skills
191
+ - Accept project root + optional scope hints
192
+ - Continuation detection and resume logic
193
+
194
+ **Phase 1 β€” Discovery (steps 02-04, autonomous)**
195
+ - Step 02: scan-project β€” Map project structure, detect service boundaries, package manifests
196
+ - Step 03: identify-units β€” Classify discrete skillable units, assign scope types
197
+ - Step 04: map-and-detect β€” Count/categorize exports per unit AND find cross-unit integration points, flag stack skill candidates
198
+
199
+ **Phase 2 β€” Decision (step 05, collaborative gate)**
200
+ - Step 05: recommend β€” Present findings with rationale, show conflicts, user confirms/rejects each unit
201
+
202
+ **Phase 3 β€” Generation (step 06, autonomous)**
203
+ - Step 06: generate-briefs β€” Create skill-brief.yaml per confirmed unit, write analysis summary, present final results
204
+
205
+ ---
206
+
207
+ ## Tools Configuration
208
+
209
+ **Core BMAD Tools:**
210
+ - **Party Mode:** excluded β€” no creative exploration phase in evidence-based analysis
211
+ - **Advanced Elicitation:** included as optional [A] menu at Step 05 only β€” quality gate for challenging unit boundary decisions
212
+ - **Brainstorming:** excluded β€” no ideation needed in code analysis
213
+
214
+ **LLM Features:**
215
+ - **Web-Browsing:** excluded β€” workflow analyzes local source code, not external resources
216
+ - **File I/O:** included β€” core to every step (reads project files, writes skill-brief.yaml + summary report)
217
+ - **Sub-Agents:** excluded β€” sequential approach sufficient for v1
218
+ - **Sub-Processes:** excluded β€” brief generation is lightweight, parallelization not needed
219
+
220
+ **Memory:**
221
+ - Type: continuable
222
+ - Tracking: stepsCompleted array, lastStep, lastContinued in output frontmatter
223
+ - State document: analysis summary report serves as persistent state (no sidecar needed)
224
+ - Step state: discovered units list, integration map, existing skills, confirmed units β€” all accumulate in report sections
225
+
226
+ **External Integrations:**
227
+ - None β€” fully self-contained, local filesystem only
228
+
229
+ **Installation Requirements:**
230
+ - None β€” all tools are built-in
231
+
232
+ ---
233
+
234
+ ## Workflow Design
235
+
236
+ ### Step Sequence
237
+
238
+ | Step | Name | Type | Menu | Goal |
239
+ |------|------|------|------|------|
240
+ | 01 | init | Init (Continuable) | Auto-proceed | Load config, check continuation, accept project path, check existing skills, create report |
241
+ | 01b | continue | Continuation | Auto-proceed | Read stepsCompleted from report, route to resume point |
242
+ | 02 | scan-project | Middle (Simple) | C-only | Map project structure, detect service boundaries, package manifests |
243
+ | 03 | identify-units | Middle (Simple) | C-only | Classify discrete skillable units with scope types |
244
+ | 04 | map-and-detect | Middle (Simple) | C-only | Map exports per unit, detect cross-unit integrations, flag stack candidates |
245
+ | 05 | recommend | Middle (Standard) | A/P/C | Present all findings with rationale, user confirms/rejects each unit |
246
+ | 06 | generate-briefs | Final | None | Generate skill-brief.yaml per confirmed unit, write summary, recommend next workflow |
247
+
248
+ ### Data Flow
249
+
250
+ ```
251
+ Step 01 β†’ Creates analysis-report.md from template
252
+ Step 02 β†’ Appends "## Project Scan" section
253
+ Step 03 β†’ Appends "## Identified Units" section
254
+ Step 04 β†’ Appends "## Export Map" + "## Integration Points" sections
255
+ Step 05 β†’ Appends "## Recommendations" section (with user confirmations)
256
+ Step 06 β†’ Reads report β†’ generates N skill-brief.yaml β†’ appends "## Generation Results"
257
+ ```
258
+
259
+ ### File Structure
260
+
261
+ ```
262
+ analyze-source/
263
+ β”œβ”€β”€ workflow.md
264
+ β”œβ”€β”€ data/
265
+ β”‚ β”œβ”€β”€ unit-detection-heuristics.md # Rules for identifying skillable units
266
+ β”‚ └── skill-brief-schema.md # Schema for skill-brief.yaml (9 fields)
267
+ β”œβ”€β”€ templates/
268
+ β”‚ └── analysis-report-template.md # Output document template
269
+ └── steps-c/
270
+ β”œβ”€β”€ step-01-init.md
271
+ β”œβ”€β”€ step-01b-continue.md
272
+ β”œβ”€β”€ step-02-scan-project.md
273
+ β”œβ”€β”€ step-03-identify-units.md
274
+ β”œβ”€β”€ step-04-map-and-detect.md
275
+ β”œβ”€β”€ step-05-recommend.md
276
+ └── step-06-generate-briefs.md
277
+ ```
278
+
279
+ ### Subprocess Optimization
280
+
281
+ | Step | Pattern | What | Fallback |
282
+ |------|---------|------|----------|
283
+ | 02 | Pattern 1 (Grep/Regex) | Scan directory structure for manifests, entry points, service configs across entire project | Sequential file reads in main thread |
284
+ | 04 | Pattern 2 (Per-file analysis) | Per-unit export mapping and integration detection | Analyze units sequentially in main thread |
285
+
286
+ ### Workflow Chaining
287
+
288
+ **Prerequisites:**
289
+ - setup-forge (required) β€” produces forge-tier.yaml
290
+
291
+ **Downstream recommendations (step 06):**
292
+ - brief-skill β€” for units needing detailed scoping refinement
293
+ - create-skill β€” for units where generated briefs are sufficient
294
+ - create-stack-skill β€” for flagged stack skill candidates
295
+
296
+ **Output contract:**
297
+ - `{forge_data_folder}/{unit-name}/skill-brief.yaml` β€” per confirmed unit
298
+ - `{output_folder}/analyze-source-report-{project_name}.md` β€” analysis summary
299
+ - Frontmatter: workflowType: 'analyze-source', nextWorkflow, stepsCompleted
300
+
301
+ ### Error Handling
302
+
303
+ | Scenario | Response |
304
+ |----------|----------|
305
+ | Missing forge-tier.yaml | Hard halt β€” "Run setup-forge first" |
306
+ | No skillable units found | Advisory exit β€” document empty scan results |
307
+ | Unit analysis partially fails | Continue with warnings, document gaps |
308
+ | Existing skill conflicts | Flag in recommendations, suggest update-skill |
309
+ | Project path invalid | Hard halt β€” request valid path |
310
+
311
+ ### Role and Persona
312
+
313
+ - Ferris in Architect mode β€” prescriptive precision
314
+ - Zero-hallucination β€” only report what's found in codebase
315
+ - File:line citation tracing for all claims
316
+ - Tier-aware analysis depth: Quick (file structure), Forge (AST), Deep (AST+QMD)
317
+
318
+ ---
319
+
320
+ ## Foundation Build Complete
321
+
322
+ **Created:**
323
+ - Folder structure at: `_bmad-output/bmb-creations/workflows/analyze-source/`
324
+ - `workflow.md` β€” entry point with SKF config loading, subprocess fallback rule, tier-aware analysis principle
325
+ - `templates/analysis-report-template.md` β€” structured output with frontmatter tracking (stepsCompleted, confirmed_units, stack_skill_candidates, existing_skills)
326
+ - `data/skill-brief-schema.md` β€” 9-field schema with validation rules and YAML template
327
+ - `data/unit-detection-heuristics.md` β€” detection signals (strong/moderate/weak), boundary classification, disqualification rules, stack skill candidate detection, tier-aware scanning depth
328
+
329
+ **Configuration:**
330
+ - Workflow name: analyze-source
331
+ - Continuable: yes
332
+ - Document output: yes β€” Structured report + Strict YAML
333
+ - Mode: create-only
334
+
335
+ **Next Steps:**
336
+ - Step 8: Build step-01-init (and step-01b-continue) βœ…
337
+ - Step 9: Build remaining steps (02 through 06)
338
+
339
+ ---
340
+
341
+ ## Step 01 Build Complete
342
+
343
+ **Created:**
344
+ - steps-c/step-01-init.md β€” continuable init with forge-tier check, project path collection, existing skill scan, auto-proceed
345
+ - steps-c/step-01b-continue.md β€” continuation handler with progress summary and step routing
346
+
347
+ **Step Configuration:**
348
+ - Type: Continuable init (auto-proceed)
349
+ - Input Discovery: No (but checks forge-tier.yaml prerequisite and existing skills)
350
+ - Next Step: step-02-scan-project
351
+ - Menu: Auto-proceed (no A/P β€” init step)
352
+
353
+ **Key Implementation Details:**
354
+ - Hard halt if forge-tier.yaml missing (directs to setup-forge)
355
+ - Scans forge_data_folder for existing skill-brief.yaml files
356
+ - Populates report frontmatter with project_path, forge_tier, existing_skills
357
+ - step-01b reads stepsCompleted to determine resume point and presents progress summary
358
+
359
+ ---
360
+
361
+ ## Steps 02-06 Build Complete
362
+
363
+ **Created:**
364
+ - steps-c/step-02-scan-project.md β€” Middle (Simple), C-only menu. Subprocess Pattern 1 for directory structure scanning. Maps directory tree, workspace configs, package manifests, entry points, service configs. Detects service boundaries with confidence levels. Presents scan results for user confirmation.
365
+ - steps-c/step-03-identify-units.md β€” Middle (Simple), C-only menu. Applies detection heuristics to each boundary. Classifies boundary type (service/package/module/library) and scope type (full-library/specific-modules/public-api). Runs disqualification checks. Cross-references existing_skills. Detects primary language per unit.
366
+ - steps-c/step-04-map-and-detect.md β€” Middle (Simple), C-only menu. Subprocess Pattern 2 (per-unit analysis). Maps export surfaces with tier-appropriate depth. Builds import graph cross-reference matrix. Detects integration points with coupling strength. Flags stack skill candidates using 4 indicators.
367
+ - steps-c/step-05-recommend.md β€” Middle (Standard), A/P/C menu. Collaborative gate β€” the primary user decision point. Builds recommendation cards with evidence-based rationale and proposed brief fields. User confirms (Y), rejects (N), or modifies (M) each unit. Addresses stack skill candidates. Requires final confirmation before proceeding.
368
+ - steps-c/step-06-generate-briefs.md β€” Final step, no menu. Generates skill-brief.yaml per confirmed unit using schema. Validates all 9 required fields. Presents generation preview for user confirmation before writing. Recommends next workflow per unit (create-skill, brief-skill, create-stack-skill, update-skill). Marks workflow complete.
369
+
370
+ **Step Configuration Summary:**
371
+
372
+ | Step | Type | Menu | Key Feature |
373
+ |------|------|------|-------------|
374
+ | 02 | Middle (Simple) | C-only | Subprocess Pattern 1 for broad scanning |
375
+ | 03 | Middle (Simple) | C-only | Heuristic-based classification with disqualification |
376
+ | 04 | Middle (Simple) | C-only | Subprocess Pattern 2 for per-unit deep analysis |
377
+ | 05 | Middle (Standard) | A/P/C | Collaborative gate β€” user confirms each unit |
378
+ | 06 | Final | None | Schema-validated YAML generation with next workflow recommendations |
379
+
380
+ **Data Flow Verification:**
381
+ - Step 02 appends "## Project Scan" β†’ Step 03 reads boundaries from it
382
+ - Step 03 appends "## Identified Units" β†’ Step 04 reads qualifying units from it
383
+ - Step 04 appends "## Export Map" + "## Integration Points" β†’ Step 05 reads all analysis data
384
+ - Step 05 appends "## Recommendations" + populates confirmed_units β†’ Step 06 reads confirmed units
385
+ - Step 06 appends "## Generation Results" + writes skill-brief.yaml files β†’ Workflow complete
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: analyze-source
3
+ description: Decomposition engine β€” discover what to skill, recommend stack skill
4
+ web_bundle: true
5
+ installed_path: '{project-root}/_bmad/skf/workflows/analyze-source'
6
+ ---
7
+
8
+ # Analyze Source
9
+
10
+ **Goal:** Analyze a large repo or multi-service project to identify discrete skillable units, map exports and integration points, and produce recommended skill-brief.yaml files as the primary entry point for brownfield onboarding.
11
+
12
+ **Your Role:** In addition to your name, communication_style, and persona, you are also a source code analyst and decomposition architect collaborating with a developer onboarding an existing project. This is a partnership, not a client-vendor relationship. You bring expertise in codebase analysis, service boundary detection, and skill scoping, while the user brings their domain knowledge of the project being analyzed. Work together as equals.
13
+
14
+ **Meta-Context:** This workflow is the entry point of the SKF skill creation pipeline. Its output (skill-brief.yaml files) feeds directly into brief-skill and create-skill workflows. The analysis must be thorough enough to produce actionable briefs, but scoped enough to avoid overwhelming the user with false positives.
15
+
16
+ ---
17
+
18
+ ## WORKFLOW ARCHITECTURE
19
+
20
+ ### Core Principles
21
+
22
+ - **Micro-file Design**: Each step of the overall goal is a self contained instruction file that you will adhere to 1 file as directed at a time
23
+ - **Just-In-Time Loading**: Only 1 current step file will be loaded, read, and executed to completion - never load future step files until told to do so
24
+ - **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed
25
+ - **State Tracking**: Document progress in output file frontmatter using `stepsCompleted` array
26
+ - **Append-Only Building**: Build the analysis report by appending content as directed to the output file
27
+ - **Tier-Aware Analysis**: Scanning depth adapts to forge tier β€” Quick (file structure), Forge (AST), Deep (AST+QMD)
28
+
29
+ ### Step Processing Rules
30
+
31
+ 1. **READ COMPLETELY**: Always read the entire step file before taking any action
32
+ 2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
33
+ 3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
34
+ 4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
35
+ 5. **SAVE STATE**: Update `stepsCompleted` in frontmatter before loading next step
36
+ 6. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
37
+
38
+ ### Critical Rules (NO EXCEPTIONS)
39
+
40
+ - πŸ›‘ **NEVER** load multiple step files simultaneously
41
+ - πŸ“– **ALWAYS** read entire step file before execution
42
+ - 🚫 **NEVER** skip steps or optimize the sequence
43
+ - πŸ’Ύ **ALWAYS** update frontmatter of output files when writing the final output for a specific step
44
+ - 🎯 **ALWAYS** follow the exact instructions in the step file
45
+ - ⏸️ **ALWAYS** halt at menus and wait for user input
46
+ - πŸ“‹ **NEVER** create mental todo lists from future steps
47
+ - βš™οΈ **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
48
+
49
+ ---
50
+
51
+ ## INITIALIZATION SEQUENCE
52
+
53
+ ### 1. Module Configuration Loading
54
+
55
+ Load and read full config from {project-root}/_bmad/skf/config.yaml and resolve:
56
+
57
+ - `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`, `forge_data_folder`, `skills_output_folder`
58
+
59
+ ### 2. First Step Execution
60
+
61
+ Load, read the full file and then execute `./steps-c/step-01-init.md` to begin the workflow.
@@ -0,0 +1,62 @@
1
+ ---
2
+ workflowType: 'audit-skill'
3
+ stepsCompleted: []
4
+ lastStep: ''
5
+ date: ''
6
+ user_name: ''
7
+ skill_name: ''
8
+ skill_path: ''
9
+ source_path: ''
10
+ forge_tier: ''
11
+ drift_score: ''
12
+ nextWorkflow: ''
13
+ previousWorkflow: 'create-skill'
14
+ ---
15
+
16
+ # Drift Report: {{skill_name}}
17
+
18
+ ## Audit Summary
19
+
20
+ **Skill:** {{skill_name}}
21
+ **Source:** {{source_path}}
22
+ **Tier:** {{forge_tier}}
23
+ **Date:** {{date}}
24
+ **Overall Drift Score:** {{drift_score}}
25
+
26
+ | Category | Count |
27
+ |----------|-------|
28
+ | CRITICAL | |
29
+ | HIGH | |
30
+ | MEDIUM | |
31
+ | LOW | |
32
+ | **Total** | |
33
+
34
+ ---
35
+
36
+ ## Structural Drift
37
+
38
+ <!-- Appended by step-03-structural-diff -->
39
+
40
+ ---
41
+
42
+ ## Semantic Drift
43
+
44
+ <!-- Appended by step-04-semantic-diff (Deep tier only) -->
45
+
46
+ ---
47
+
48
+ ## Severity Classification
49
+
50
+ <!-- Appended by step-05-severity-classify -->
51
+
52
+ ---
53
+
54
+ ## Remediation Suggestions
55
+
56
+ <!-- Appended by step-06-report -->
57
+
58
+ ---
59
+
60
+ ## Provenance
61
+
62
+ <!-- Appended by step-06-report -->
@@ -0,0 +1,52 @@
1
+ # Severity Classification Rules
2
+
3
+ ## Severity Levels
4
+
5
+ ### CRITICAL β€” Breaking Changes
6
+ - Removed or renamed public exports (functions, classes, types)
7
+ - Changed function signatures (parameter count, parameter types, return type)
8
+ - Removed or renamed modules/files referenced in skill
9
+ - Changed class inheritance or interface contracts
10
+ - **Impact:** Skill instructions will produce incorrect code if followed
11
+
12
+ ### HIGH β€” Significant Drift
13
+ - New public API exports not documented in skill (>3 new exports)
14
+ - Removed internal helpers that are referenced in documented patterns
15
+ - Changed default parameter values that affect documented behavior
16
+ - New required parameters added to documented functions
17
+ - Deprecated APIs still documented as current in skill
18
+ - **Impact:** Skill is incomplete or contains outdated guidance
19
+
20
+ ### MEDIUM β€” Moderate Drift
21
+ - Implementation changes behind a stable public API
22
+ - New optional parameters with defaults on documented functions
23
+ - New public exports not in skill (1-3 new exports)
24
+ - Moved functions between files (same API, different location)
25
+ - Changed internal implementation patterns documented in skill conventions
26
+ - **Impact:** Skill is functional but not fully current
27
+
28
+ ### LOW β€” Minor Drift
29
+ - Style or convention changes (formatting, naming patterns)
30
+ - Comment or documentation changes in source
31
+ - Whitespace or structural reorganization
32
+ - New private/internal functions not affecting public API
33
+ - Test file changes
34
+ - **Impact:** Cosmetic β€” skill remains accurate for practical use
35
+
36
+ ## Overall Drift Score
37
+
38
+ | Score | Criteria |
39
+ |-------|----------|
40
+ | CLEAN | 0 findings at any level |
41
+ | MINOR | LOW findings only, no MEDIUM+ |
42
+ | SIGNIFICANT | Any MEDIUM or HIGH findings, no CRITICAL |
43
+ | CRITICAL | Any CRITICAL findings present |
44
+
45
+ ## Confidence Tier Labels
46
+
47
+ | Label | Source | Reliability |
48
+ |-------|--------|-------------|
49
+ | T1 | AST extraction (ast-grep) | High β€” structural truth |
50
+ | T1-low | Text pattern matching (no AST) | Moderate β€” pattern-based |
51
+ | T2 | QMD temporal context | High β€” evidence-backed |
52
+ | T3 | External documentation reference | Variable β€” secondary source |