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
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 22
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BMad Code, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ TRADEMARK NOTICE:
24
+ BMad™ , BMAD-CORE™ and BMAD-METHOD™ are trademarks of BMad Code, LLC. The use of these
25
+ trademarks in this software does not grant any rights to use the trademarks
26
+ for any other purpose.
package/README.md ADDED
@@ -0,0 +1,213 @@
1
+ # Skill Forge (SKF)
2
+
3
+ SKF (Skill Forge) is a standalone BMAD module that transforms code repositories, documentation websites, and developer discourse into agentskills.io-compliant, version-pinned, provenance-backed agent skills. It provides a single expert agent (Ferris, Skill Architect & Integrity Guardian) and ten workflows spanning source analysis, skill briefing, AST-backed compilation, integrity testing, and ecosystem-ready export across progressive capability tiers (Quick/Forge/Deep).
4
+
5
+ Docs: <https://armelhbobdad.github.io/bmad-module-skill-forge/>
6
+
7
+ ## Why SKF
8
+
9
+ - AST-verified instructions with line-level provenance — no hallucinated guidance
10
+ - Progressive capability model that meets developers where they are
11
+ - Full lifecycle: discover, brief, compile, test, audit, update, export
12
+ - Version-pinned skills that track source changes and detect drift
13
+ - Zero hallucination tolerance — every instruction traces to code
14
+
15
+ ## How BMad Works
16
+
17
+ BMad works because it turns big, fuzzy work into **repeatable workflows**. Each workflow is broken into small steps with clear instructions, so the AI follows the same path every time. It also uses a **shared knowledge base** (standards and patterns) so outputs are consistent, not random. In short: **structured steps + shared standards = reliable results**.
18
+
19
+ ## How SKF Fits In
20
+
21
+ SKF plugs into BMad the same way a specialist plugs into a team. It uses the same step-by-step workflow engine and shared standards, but focuses exclusively on skill compilation and quality assurance. That means you get **evidence-based agent skills**, **AST-verified instructions**, and **drift detection** that align with the rest of the BMad process.
22
+
23
+ ## Architecture & Flow
24
+
25
+ BMad is a small **agent + workflow engine**. There is no external orchestrator — everything runs inside the LLM context window through structured instructions.
26
+
27
+ ### Building Blocks
28
+
29
+ Each workflow directory contains these files, and each has a specific job:
30
+
31
+ | File | What it does | When it loads |
32
+ | --- | --- | --- |
33
+ | `forger.agent.yaml` | Expert persona — identity, principles, critical actions, menu of triggers | First — always in context |
34
+ | `workflow.md` | Human-readable entry point — goals, mode menu (Create/Edit/Validate), routes to first step | Second — presents mode choice |
35
+ | `steps-c/*.md` | **Create** steps — primary execution, 4-9 sequential files | One at a time (just-in-time) |
36
+ | `data/*.md` | Workflow-specific reference data — schemas, heuristics, rules, patterns | Read by steps on demand |
37
+ | `templates/*.md` | Output skeletons with placeholder vars — steps fill these in to produce the final artifact | Read by steps when generating output |
38
+ | `skf-knowledge-index.csv` | Knowledge fragment index — id, name, tags, tier, file path | Read by steps to decide which fragments to load |
39
+ | `knowledge/*.md` | 8 reusable fragments — cross-cutting principles and patterns (e.g., `zero-hallucination.md`, `confidence-tiers.md`) | Selectively read into context when a step directs |
40
+
41
+ ```mermaid
42
+ flowchart LR
43
+ U[User] --> A[Agent Persona]
44
+ A --> W[Workflow Entry: workflow.md]
45
+ W --> S[Step Files: steps-c/]
46
+ S --> K[Knowledge Fragments<br/>skf-knowledge-index.csv → knowledge/*.md]
47
+ S --> D[Data & Templates<br/>data/*.md, templates/*.md]
48
+ S --> O[Outputs: skills/reports<br/>when a step writes output]
49
+ ```
50
+
51
+ ### How It Works at Runtime
52
+
53
+ 1. **Trigger** — User types `@Ferris CS` (or fuzzy match like `create-skill`). The agent menu in `forger.agent.yaml` maps the trigger to the workflow path.
54
+ 2. **Agent loads** — `forger.agent.yaml` injects the persona (identity, principles, critical actions) into the context window. Sidecar files (`forge-tier.yaml`, `preferences.yaml`) are loaded for persistent state.
55
+ 3. **Workflow loads** — `workflow.md` presents the mode choice and routes to the first step file.
56
+ 4. **Step-by-step execution** — Only the current step file is in context (just-in-time loading). Each step explicitly names the next one. The LLM reads, executes, saves output, then loads the next step. No future steps are ever preloaded.
57
+ 5. **Knowledge injection** — Steps consult `skf-knowledge-index.csv` and selectively load fragments from `knowledge/` by tags and relevance. Cross-cutting principles (zero hallucination, confidence tiers, provenance) are loaded only when a step directs — not preloaded.
58
+ 6. **Data injection** — Steps read `data/*.md` files as needed (schemas, heuristics, extraction patterns). This is deliberate context engineering: only the data relevant to the current step enters the context window.
59
+ 7. **Templates** — When a step produces output (e.g., a skill brief or test report), it reads the template file and fills in placeholders with computed results. The template provides consistent structure; the step provides the content.
60
+ 8. **Progress tracking** — Each step appends to an output file with state tracking. Resume mode reads this state and routes to the next incomplete step.
61
+
62
+ ### Ferris Operating Modes
63
+
64
+ Ferris operates in four workflow-driven modes (mode is determined by which workflow is running, not conversation state):
65
+
66
+ | Mode | Workflows | Behavior |
67
+ | --- | --- | --- |
68
+ | **Architect** | AN, BS, SF | Exploratory, assembling — discovers structure and scope |
69
+ | **Surgeon** | CS, QS, SS, US | Precise, preserving — extracts and compiles with provenance |
70
+ | **Audit** | AS, TS | Judgmental, scoring — evaluates quality and detects drift |
71
+ | **Delivery** | EX | Packaging, ecosystem-ready — bundles for distribution |
72
+
73
+ ## Install
74
+
75
+ There are three ways to install SKF, depending on your setup.
76
+
77
+ ### Method 1: Standalone (recommended for trying SKF)
78
+
79
+ ```bash
80
+ npx skill-forge install
81
+ ```
82
+
83
+ Or equivalently: `npx bmad-module-skill-forge install`
84
+
85
+ Installs SKF on its own. You'll be prompted for project name, output folders, and which IDEs to configure. The installer generates IDE-specific command files (e.g. `.claude/commands/`, `.cursor/commands/`) so workflows appear in your IDE's command palette.
86
+
87
+ ### Method 2: As a custom module during BMad Method installation
88
+
89
+ ```bash
90
+ npx bmad-method install
91
+ ```
92
+
93
+ When prompted **"Add custom modules from your computer?"**, select Yes and provide the path to the SKF `src/` folder (clone this repo first):
94
+
95
+ ```
96
+ Path to custom module folder: /path/to/bmad-module-skill-forge/src/
97
+ ```
98
+
99
+ This installs BMad core + SKF together with full IDE integration, manifests, and help catalog. Best when you want the complete BMad development workflow.
100
+
101
+ ### Method 3: Add SKF to an existing BMad project
102
+
103
+ If you already have BMad installed, you can add SKF afterward by running the standalone installer in the same directory:
104
+
105
+ ```bash
106
+ npx skill-forge install
107
+ ```
108
+
109
+ The installer detects the existing `_bmad/` directory and installs SKF alongside your current modules. IDE command files are generated for SKF workflows.
110
+
111
+ ## Quickstart
112
+
113
+ 1. **Setup your forge:** `@Ferris SF` — detects tools, sets your tier (Quick/Forge/Deep)
114
+ 2. **Quick skill (fastest):** `@Ferris QS <package-name>` — fast skill from a package name
115
+ 3. **Full skill:** `@Ferris BS` then `@Ferris CS` — brief then compile for maximum quality
116
+ 4. **Stack skill:** `@Ferris SS` — consolidated project stack skill with integration patterns
117
+ 5. **Export:** `@Ferris EX` — package for distribution, update CLAUDE.md
118
+
119
+ ## Workflows
120
+
121
+ | Trigger | Command | Purpose |
122
+ | --- | --- | --- |
123
+ | SF | `skf_setup_forge` | Initialize forge environment, detect tools, set tier |
124
+ | AN | `skf_analyze_source` | Discover what to skill in a large repo |
125
+ | BS | `skf_brief_skill` | Design a skill scope through guided discovery |
126
+ | CS | `skf_create_skill` | Compile a skill from brief (supports --batch) |
127
+ | QS | `skf_quick_skill` | Fast skill from package name or GitHub URL |
128
+ | SS | `skf_create_stack_skill` | Consolidated project stack skill with integration patterns |
129
+ | US | `skf_update_skill` | Smart regeneration preserving \[MANUAL\] sections |
130
+ | AS | `skf_audit_skill` | Drift detection between skill and current source |
131
+ | TS | `skf_test_skill` | Cognitive completeness verification — quality gate before export |
132
+ | EX | `skf_export_skill` | Package for distribution, inject into CLAUDE.md/AGENTS.md |
133
+
134
+ ## Progressive Capability Model
135
+
136
+ | Tier | Tools | Capability |
137
+ | --- | --- | --- |
138
+ | **Quick** | gh + skills_ref | Source reading + spec validation |
139
+ | **Forge** | + ast-grep | Structural truth, T1 confidence |
140
+ | **Deep** | + QMD | Knowledge search, temporal provenance |
141
+
142
+ The `setup-forge` workflow detects available tools and writes the tier to `forge-tier.yaml`. All subsequent workflows adapt their behavior to the detected tier.
143
+
144
+ ## Knowledge Base
145
+
146
+ SKF relies on a curated skill compilation knowledge base:
147
+
148
+ - Index: `src/knowledge/skf-knowledge-index.csv`
149
+ - Fragments: `src/knowledge/`
150
+
151
+ Workflows load only the fragments required for the current task to stay focused and compliant.
152
+
153
+ ## Configuration
154
+
155
+ SKF variables are defined in `src/module.yaml` and prompted during install:
156
+
157
+ | Variable | Purpose | Default |
158
+ | --- | --- | --- |
159
+ | `skills_output_folder` | Where generated skills are saved | `{project-root}/skills` |
160
+ | `forge_data_folder` | Where workspace artifacts are stored | `{project-root}/forge-data` |
161
+
162
+ Runtime configuration (tool detection, tier, parallel settings) is managed by the `setup-forge` workflow in `forge-tier.yaml`.
163
+
164
+ ## Module Structure
165
+
166
+ ```
167
+ src/
168
+ ├── module.yaml
169
+ ├── module-help.csv
170
+ ├── README.md
171
+ ├── docs/
172
+ │ ├── getting-started.md
173
+ │ ├── agents.md
174
+ │ ├── workflows.md
175
+ │ └── examples.md
176
+ ├── agents/
177
+ │ └── forger.agent.yaml
178
+ ├── forger/
179
+ │ ├── forge-tier.yaml
180
+ │ ├── preferences.yaml
181
+ │ └── README.md
182
+ ├── knowledge/
183
+ │ ├── skf-knowledge-index.csv
184
+ │ └── *.md (8 fragments)
185
+ └── workflows/
186
+ └── skillforge/
187
+ ├── setup-forge/
188
+ ├── analyze-source/
189
+ ├── brief-skill/
190
+ ├── create-skill/
191
+ ├── quick-skill/
192
+ ├── create-stack-skill/
193
+ ├── update-skill/
194
+ ├── audit-skill/
195
+ ├── test-skill/
196
+ └── export-skill/
197
+ ```
198
+
199
+ ## Contributing
200
+
201
+ See [CONTRIBUTORS.md](CONTRIBUTORS.md) for guidelines.
202
+
203
+ ## License
204
+
205
+ MIT License — see [LICENSE](LICENSE) for details.
206
+
207
+ ---
208
+
209
+ **Skill Forge (SKF)** — A standalone [BMad](https://github.com/bmad-code-org/BMAD-METHOD) module for agent skill compilation.
210
+
211
+ [![Contributors](https://contrib.rocks/image?repo=armelhbobdad/bmad-module-skill-forge)](https://github.com/armelhbobdad/bmad-module-skill-forge/graphs/contributors)
212
+
213
+ See [CONTRIBUTORS.md](CONTRIBUTORS.md) for contributor information.
package/docs/404.md ADDED
@@ -0,0 +1,20 @@
1
+ ---
2
+ title: Page Not Found
3
+ description: The page you're looking for doesn't exist
4
+ template: splash
5
+ ---
6
+
7
+ # Page Not Found
8
+
9
+ The page you're looking for doesn't exist.
10
+
11
+ ## What can you do?
12
+
13
+ - Check the URL for typos
14
+ - Go back to the [home page](/)
15
+ - Browse the [Getting Started guide](/getting-started/)
16
+ - Search for what you need using the search bar above
17
+
18
+ ## Need Help?
19
+
20
+ If you think this page should exist, please [open an issue](https://github.com/armelhbobdad/bmad-module-skill-forge/issues) on GitHub.
package/docs/agents.md ADDED
@@ -0,0 +1,73 @@
1
+ ---
2
+ title: Agents
3
+ description: Ferris agent reference — modes, capabilities, menu, and communication style
4
+ ---
5
+
6
+ # Agents Reference
7
+
8
+ SKF includes 1 specialized agent:
9
+
10
+ ---
11
+
12
+ ## Ferris — Skill Architect & Integrity Guardian
13
+
14
+ **ID:** `_bmad/skf/agents/forger.md`
15
+ **Icon:** ⚒️
16
+
17
+ **Role:**
18
+ Sole agent managing the entire skill compilation lifecycle. Ferris extracts, compiles, validates, and packages agent skills from code repositories, documentation, and developer discourse.
19
+
20
+ **When to Use:**
21
+ Ferris handles all SKF workflows. You always interact with Ferris — he switches modes based on which workflow you invoke.
22
+
23
+ **Key Capabilities:**
24
+ - AST analysis via ast-grep for structural truth
25
+ - QMD knowledge search for temporal context and evidence
26
+ - agentskills.io specification compliance and validation
27
+ - GitHub source navigation and package-to-repo resolution
28
+ - Cross-knowledge synthesis for stack skills and integration patterns
29
+
30
+ **Workflow-Driven Modes:**
31
+
32
+ | Mode | Behavior | Workflows |
33
+ |------|----------|-----------|
34
+ | **Architect** | Exploratory, structural, assembling | BS, CS, QS, SS, AN |
35
+ | **Surgeon** | Precise, semantic diffing, preserves [MANUAL] | US |
36
+ | **Audit** | Judgmental, drift reports, completeness scoring | AS, TS |
37
+ | **Delivery** | Packaging, platform-aware, ecosystem-ready | EX |
38
+
39
+ **Communication Style:**
40
+ - During work: structured reports with AST citations, no metaphor
41
+ - At transitions: forge language, brief and warm
42
+ - On completion: quiet craftsman's pride
43
+ - On errors: direct and actionable
44
+
45
+ **Menu:**
46
+
47
+ ```
48
+ ⚒️ Ferris — Skill Forge
49
+
50
+ START HERE:
51
+ [SF] Setup Forge — Initialize your forge environment
52
+ [AN] Analyze Source — Discover what to skill
53
+
54
+ CREATE:
55
+ [BS] Brief Skill — Design a skill scope
56
+ [CS] Create Skill — Compile a skill from brief
57
+ [QS] Quick Skill — Fast skill, no brief needed
58
+ [SS] Stack Skill — Consolidated project stack skill
59
+
60
+ MAINTAIN:
61
+ [US] Update Skill — Regenerate after changes
62
+ [AS] Audit Skill — Check for drift
63
+ [TS] Test Skill — Verify completeness
64
+
65
+ DELIVER:
66
+ [EX] Export Skill — Package for distribution
67
+
68
+ [WS] Workflow Status
69
+ [FM] Full Menu
70
+ ```
71
+
72
+ **Memory:**
73
+ Ferris has a sidecar (`_bmad/_memory/forger-sidecar/`) that persists user preferences and tool availability across sessions.
@@ -0,0 +1,301 @@
1
+ ---
2
+ title: Architecture
3
+ description: How Skill Forge works — output format, confidence model, progressive tiers, tool ecosystem, and key design decisions
4
+ ---
5
+
6
+ # Architecture
7
+
8
+ This page explains how SKF works under the hood — the output format, confidence model, progressive capability tiers, tool ecosystem, and the design decisions that make every instruction traceable.
9
+
10
+ ---
11
+
12
+ ## Why Another Tool?
13
+
14
+ AI agents hallucinate APIs. Not sometimes — constantly. The table below shows why every existing approach fails at scale:
15
+
16
+ | Approach | Strength | Fatal Flaw |
17
+ |----------|----------|------------|
18
+ | `npx skills init` | Format compliant | Empty shell. 0% intelligence. |
19
+ | LLM Summarization | High semantic context | Hallucination. Guesses parameters. No grounding. |
20
+ | RAG / Context stuffing | Good retrieval | Fragmented. Finds snippets, fails to synthesize. |
21
+ | Manual Authoring | High initial quality | Drift. Doesn't scale. |
22
+ | Copilot/Cursor built-in | Convenient | Generic. Doesn't know YOUR integration patterns. |
23
+ | **Skill Forge** | **Structural truth + automation** | **Rigid. (Feature, not bug.)** |
24
+
25
+ SKF solves this by mechanically extracting function signatures, type definitions, and usage patterns from source code — then compiling them into verifiable, version-pinned skills that comply with the [agentskills.io specification](https://agentskills.io/specification).
26
+
27
+ ---
28
+
29
+ ## Progressive Capability Model
30
+
31
+ SKF uses an additive tier model. Each tier is the previous tier plus one tool. You never lose capability by adding a tool.
32
+
33
+ | Tier | Tools | What You Get |
34
+ |------|-------|-------------|
35
+ | **Quick** | `gh_bridge` + `skills_ref` | Source reading + spec validation. Best-effort skills in under a minute. |
36
+ | **Forge** | + `ast_bridge` | Structural truth. AST-verified signatures. Co-import detection. T1 confidence. |
37
+ | **Deep** | + `qmd_bridge` | Knowledge search. Temporal provenance. Drift detection. Full intelligence. |
38
+
39
+ Setup detects your installed tools and sets your tier automatically:
40
+
41
+ ```
42
+ @Ferris SF
43
+ ```
44
+
45
+ ```
46
+ Forge initialized. Tools: gh, ast-grep, QMD. Tier: Deep. Ready.
47
+ ```
48
+
49
+ Don't have ast-grep or QMD yet? No problem — Quick mode works with just the GitHub CLI. Install tools later; your tier upgrades automatically.
50
+
51
+ ---
52
+
53
+ ## Confidence Tiers
54
+
55
+ Every claim in a generated skill carries a confidence tier that traces to its source:
56
+
57
+ | Tier | Source | Tool | What It Means |
58
+ |------|--------|------|---------------|
59
+ | **T1** | AST extraction | `ast_bridge` | Current code, structurally verified. Immutable for that version. |
60
+ | **T2** | QMD evidence / source reading | `qmd_bridge` / `gh_bridge` | Historical + planned context (issues, PRs, changelogs, docs). |
61
+ | **T3** | External documentation | `doc_fetcher` | External, untrusted. Quarantined. |
62
+
63
+ ### Temporal Provenance
64
+
65
+ Confidence tiers map to temporal scopes:
66
+
67
+ - **T1-now (instructions):** What ast-grep sees in the checked-out code. This is what your agent executes.
68
+ - **T2-past (annotations):** Closed issues, merged PRs, changelogs — why the API looks the way it does.
69
+ - **T2-future (annotations):** Open PRs, deprecation warnings, RFCs — what's coming.
70
+
71
+ Progressive disclosure controls how much context surfaces at each level:
72
+
73
+ | Output | Content |
74
+ |--------|---------|
75
+ | `context-snippet.md` | T1-now only — compressed, always-on |
76
+ | `SKILL.md` | T1-now + lightweight T2 annotations |
77
+ | `references/` | Full temporal context with all tiers |
78
+
79
+ ### Tier Constrains Authority
80
+
81
+ Your forge tier limits what authority claims a skill can make:
82
+
83
+ | Forge Tier | AST? | QMD? | Max Authority | Accuracy Guarantee |
84
+ |-----------|------|------|---------------|-------------------|
85
+ | Quick | No | No | `community` | Best-effort |
86
+ | Forge | Yes | No | `official` | Structural (AST-verified) |
87
+ | Deep | Yes | Yes | `official` | Full (structural + contextual + temporal) |
88
+
89
+ ---
90
+
91
+ ## Output Architecture
92
+
93
+ ### Per-Skill Output
94
+
95
+ Every generated skill produces a self-contained directory:
96
+
97
+ ```
98
+ skills/{name}/
99
+ ├── SKILL.md # Active skill (loaded on trigger)
100
+ ├── context-snippet.md # Passive context (compressed, always-on)
101
+ ├── metadata.json # Machine-readable provenance
102
+ └── references/ # Progressive disclosure
103
+ ├── {function-a}.md
104
+ ├── {function-b}.md
105
+ └── integrations/ # Stack skills only
106
+ ├── auth-db.md
107
+ └── pwa-auth.md
108
+ ```
109
+
110
+ ### SKILL.md Format
111
+
112
+ Skills follow the [agentskills.io specification](https://agentskills.io/specification) with frontmatter:
113
+
114
+ ```yaml
115
+ ---
116
+ name: payment-service
117
+ version: 2.1.0
118
+ description: Payment processing API skill — 23 verified functions
119
+ author: org/payment-team
120
+ ---
121
+ ```
122
+
123
+ Every instruction in the body traces to source:
124
+
125
+ ```
126
+ Extracted: `getToken(userId: string, options?: TokenOptions): Promise<AuthToken>`
127
+ [AST:src/auth/index.ts:L42]. Confidence: T1.
128
+ ```
129
+
130
+ ### metadata.json — The Birth Certificate
131
+
132
+ Machine-readable provenance for every skill:
133
+
134
+ ```json
135
+ {
136
+ "name": "payment-service",
137
+ "version": "2.1.0",
138
+ "skill_type": "individual",
139
+ "source_authority": "official",
140
+ "source_repo": "github.com/org/payment-service",
141
+ "source_commit": "a1b2c3d",
142
+ "forge_tier": "forge",
143
+ "spec_version": "1.3",
144
+ "generated_at": "2026-02-25T14:30:00Z",
145
+ "stats": {
146
+ "exports_documented": 23,
147
+ "exports_total": 23,
148
+ "coverage": 1.0,
149
+ "confidence_t1": 20,
150
+ "confidence_t2": 3,
151
+ "confidence_t3": 0
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### Stack Skill Output
157
+
158
+ Stack skills map how your dependencies interact — shared types, co-import patterns, integration points:
159
+
160
+ ```
161
+ skills/{project}-stack/
162
+ ├── SKILL.md # Integration patterns + project conventions
163
+ ├── context-snippet.md # Compressed stack index
164
+ ├── metadata.json # Component versions, integration graph
165
+ └── references/
166
+ ├── nextjs.md # Project-specific subset
167
+ ├── better-auth.md # Project-specific subset
168
+ └── integrations/
169
+ ├── auth-db.md # Cross-library pattern
170
+ └── pwa-auth.md # Cross-library pattern
171
+ ```
172
+
173
+ The primary source is your project repo. Component references trace to library repos. `skill_type: "stack"` in metadata.
174
+
175
+ ---
176
+
177
+ ## Dual-Output Strategy
178
+
179
+ Based on [Vercel research](https://github.com/vercel-labs/skills): passive context (AGENTS.md/CLAUDE.md) achieves 100% pass rate vs 53% for active skills alone.
180
+
181
+ Every skill generates both:
182
+
183
+ 1. **SKILL.md** — Active skill loaded on trigger with full instructions
184
+ 2. **context-snippet.md** — Passive context, compressed index injected into CLAUDE.md
185
+
186
+ ### Managed CLAUDE.md Section
187
+
188
+ Export injects a managed section between markers:
189
+
190
+ ```markdown
191
+ <!-- SKF:BEGIN updated:2026-02-25 -->
192
+ [SKF Skills]|3 skills|1 stack
193
+ |IMPORTANT: Prefer documented APIs over training data.
194
+ |
195
+ |payment-service → skills/payment-service/
196
+ | exports: getToken, refreshToken, revokeSession, createSession
197
+ |
198
+ |auth-service → skills/auth-service/
199
+ | exports: getSession, validateToken, revokeSession, createUser
200
+ |
201
+ |my-project-stack → skills/my-project-stack/
202
+ | stack: next@15, better-auth@3, spacetimedb@1, serwist@9
203
+ | integrations: auth↔db, pwa↔auth, gateway↔auth
204
+ <!-- SKF:END -->
205
+ ```
206
+
207
+ Two lines per skill (~30 tokens each). Developer controls placement. Ferris controls content. Snippet updates only happen at `export-skill` — create and update are draft operations.
208
+
209
+ ---
210
+
211
+ ## Tool Ecosystem
212
+
213
+ ### 4 MCP Tools
214
+
215
+ | Tool | Wraps | Purpose |
216
+ |------|-------|---------|
217
+ | **`gh_bridge`** | GitHub CLI (`gh`) | Source code access, issue mining, release tracking, PR intelligence |
218
+ | **`skills_ref`** | agentskills.io spec | Schema validation, frontmatter checks, ecosystem search |
219
+ | **`ast_bridge`** | ast-grep CLI | Structural extraction, custom AST queries, co-import detection |
220
+ | **`qmd_bridge`** | QMD (local search) | BM25 keyword search, vector semantic search, collection indexing |
221
+
222
+ Optional addon: **`doc_fetcher`** for remote documentation (Firecrawl/Jina.ai). Output quarantined as T3.
223
+
224
+ ### Conflict Resolution
225
+
226
+ When tools disagree, higher priority wins for instructions. Lower priority is preserved as annotations:
227
+
228
+ | Priority | Source | Tool |
229
+ |----------|--------|------|
230
+ | 1 (highest) | AST extraction | `ast_bridge` |
231
+ | 2 | QMD evidence | `qmd_bridge` |
232
+ | 3 | Source reading (non-AST) | `gh_bridge` |
233
+ | 4 | External documentation | `doc_fetcher` |
234
+
235
+ ### Internal Utility
236
+
237
+ **`manifest_reader`** detects and parses dependency files across ecosystems:
238
+
239
+ - **Full support:** `package.json`, `pyproject.toml`, `requirements.txt`, `Cargo.toml`, `go.mod`
240
+ - **Basic support:** `build.gradle`, `pom.xml`, `Gemfile`, `composer.json`
241
+
242
+ ---
243
+
244
+ ## Workspace Artifacts
245
+
246
+ Build artifacts are committable — another developer can reproduce the same skill:
247
+
248
+ ```
249
+ forge-data/{skill-name}/
250
+ ├── skill-brief.yaml # Compilation config
251
+ ├── provenance-map.json # Source map with AST bindings
252
+ ├── evidence-report.md # Build audit trail
253
+ └── extraction-rules.yaml # Language-specific ast-grep schema
254
+ ```
255
+
256
+ `skills/` and `forge-data/` are committed. Agent memory (`_bmad/_memory/forger-sidecar/`) is gitignored.
257
+
258
+ ---
259
+
260
+ ## Ownership Model
261
+
262
+ | Context | `source_authority` | Distribution |
263
+ |---------|-------------------|-------------|
264
+ | OSS library (maintainer generates) | `official` | `npx skills publish` to agentskills ecosystem |
265
+ | Internal service (team generates) | `internal` | `skills/` in repo, ships with code |
266
+ | External dependency (consumer generates) | `community` | Local `skills/`, marked as community |
267
+
268
+ Provenance maps enable verification: an `official` skill's provenance must trace to the actual source repo owned by the author.
269
+
270
+ ---
271
+
272
+ ## Key Design Decisions
273
+
274
+ | Decision | Rationale |
275
+ |----------|-----------|
276
+ | **Solo agent (Ferris), not multi-agent** | One domain (skill compilation) doesn't benefit from handoffs. Shared knowledge base (AST patterns, provenance maps) is the core asset. |
277
+ | **Workflows drive modes, not conversation** | Ferris doesn't auto-switch based on question content. Invoke a workflow to change mode. Predictable behavior. |
278
+ | **Hub-and-spoke cross-knowledge** | Each skill has one primary source. Cross-repo references use inline summary + pointer + `[XREF:repo:file:line]` provenance tag. |
279
+ | **Stack skill = compositional** | SKILL.md is the integration layer. references/ contains per-library + integration pairs. Partial regeneration on dependency updates. |
280
+ | **Snippet updates only at export** | Create/update are draft operations. Export publishes to skills/ and CLAUDE.md. No half-baked snippets. |
281
+ | **Bundle spec with opt-in update** | Offline-capable. 90-day staleness warning. `setup-forge --update-spec` fetches latest. |
282
+
283
+ ---
284
+
285
+ ## Security
286
+
287
+ - All tool wrappers use array-style subprocess execution — no shell interpolation
288
+ - Input sanitization: allowlist characters for repo names, file paths, patterns
289
+ - File paths validated against project root (no directory traversal)
290
+ - **Source code never leaves the machine.** All processing is local (AST, QMD, validation).
291
+ - `doc_fetcher` warns before transmitting URLs to external services
292
+
293
+ ---
294
+
295
+ ## Ecosystem Alignment
296
+
297
+ SKF produces skills compatible with the [agentskills.io](https://agentskills.io) ecosystem:
298
+
299
+ - Full [specification](https://agentskills.io/specification) compliance
300
+ - Distribution via [`npx skills add/publish`](https://www.npmjs.com/package/skills)
301
+ - Compatible with [agentskills/agentskills](https://github.com/agentskills/agentskills) and [vercel-labs/skills](https://github.com/vercel-labs/skills)