bmad-module-skill-forge 0.2.0 → 0.4.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 (115) hide show
  1. package/README.md +73 -159
  2. package/docs/agents.md +2 -2
  3. package/docs/architecture.md +155 -25
  4. package/docs/concepts.md +96 -0
  5. package/docs/examples.md +52 -2
  6. package/docs/getting-started.md +30 -14
  7. package/docs/index.md +16 -41
  8. package/docs/workflows.md +3 -3
  9. package/package.json +6 -4
  10. package/src/forger/forge-tier.yaml +1 -1
  11. package/src/forger/preferences.yaml +8 -1
  12. package/src/knowledge/doc-fetcher.md +55 -0
  13. package/src/knowledge/overview.md +17 -16
  14. package/src/knowledge/progressive-capability.md +9 -1
  15. package/src/knowledge/provenance-tracking.md +31 -23
  16. package/src/knowledge/qmd-registry.md +132 -0
  17. package/src/knowledge/skf-knowledge-index.csv +2 -0
  18. package/src/module.yaml +2 -2
  19. package/src/workflows/analyze-source/data/skill-brief-schema.md +24 -4
  20. package/src/workflows/analyze-source/steps-c/step-01-init.md +19 -9
  21. package/src/workflows/analyze-source/steps-c/step-01b-continue.md +2 -2
  22. package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +10 -2
  23. package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +17 -2
  24. package/src/workflows/analyze-source/steps-c/step-05-recommend.md +2 -1
  25. package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +3 -3
  26. package/src/workflows/analyze-source/templates/analysis-report-template.md +1 -1
  27. package/src/workflows/analyze-source/validation-report.md +1 -1
  28. package/src/workflows/analyze-source/workflow-plan-analyze-source.md +1 -1
  29. package/src/workflows/analyze-source/workflow.md +1 -1
  30. package/src/workflows/audit-skill/steps-c/step-01-init.md +8 -5
  31. package/src/workflows/audit-skill/steps-c/step-02-re-index.md +12 -2
  32. package/src/workflows/audit-skill/validation-report.md +2 -2
  33. package/src/workflows/audit-skill/workflow-plan-audit-skill.md +1 -1
  34. package/src/workflows/brief-skill/data/scope-templates.md +60 -0
  35. package/src/workflows/brief-skill/data/skill-brief-schema.md +38 -3
  36. package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +20 -4
  37. package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +20 -64
  38. package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +1 -1
  39. package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +60 -5
  40. package/src/workflows/brief-skill/workflow.md +2 -1
  41. package/src/workflows/create-skill/data/compile-assembly-rules.md +110 -0
  42. package/src/workflows/create-skill/data/extraction-patterns.md +216 -3
  43. package/src/workflows/create-skill/data/skill-sections.md +81 -27
  44. package/src/workflows/create-skill/data/source-resolution-protocols.md +138 -0
  45. package/src/workflows/create-skill/data/tier-degradation-rules.md +46 -0
  46. package/src/workflows/create-skill/steps-c/step-01-load-brief.md +7 -4
  47. package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +10 -7
  48. package/src/workflows/create-skill/steps-c/step-03-extract.md +51 -10
  49. package/src/workflows/create-skill/steps-c/step-03b-fetch-temporal.md +238 -0
  50. package/src/workflows/create-skill/steps-c/step-03c-fetch-docs.md +220 -0
  51. package/src/workflows/create-skill/steps-c/step-04-enrich.md +40 -10
  52. package/src/workflows/create-skill/steps-c/step-05-compile.md +49 -82
  53. package/src/workflows/create-skill/steps-c/step-06-validate.md +152 -63
  54. package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +53 -3
  55. package/src/workflows/create-skill/steps-c/step-08-report.md +1 -1
  56. package/src/workflows/create-skill/workflow-plan-create-skill.md +42 -10
  57. package/src/workflows/create-skill/workflow.md +3 -2
  58. package/src/workflows/create-stack-skill/data/stack-skill-template.md +20 -7
  59. package/src/workflows/create-stack-skill/steps-c/step-01-init.md +2 -2
  60. package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +14 -0
  61. package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +28 -7
  62. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +10 -7
  63. package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +66 -68
  64. package/src/workflows/create-stack-skill/validation-report.md +1 -1
  65. package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +4 -4
  66. package/src/workflows/export-skill/data/managed-section-format.md +1 -0
  67. package/src/workflows/export-skill/data/snippet-format.md +33 -14
  68. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +16 -2
  69. package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +29 -22
  70. package/src/workflows/export-skill/steps-c/step-04-update-context.md +1 -1
  71. package/src/workflows/export-skill/steps-c/step-05-token-report.md +1 -1
  72. package/src/workflows/export-skill/validation-report.md +1 -1
  73. package/src/workflows/export-skill/workflow-plan-export-skill.md +8 -8
  74. package/src/workflows/export-skill/workflow.md +1 -1
  75. package/src/workflows/quick-skill/data/skill-template.md +27 -7
  76. package/src/workflows/quick-skill/steps-c/step-04-compile.md +44 -13
  77. package/src/workflows/quick-skill/steps-c/step-05-validate.md +79 -16
  78. package/src/workflows/quick-skill/validation-report.md +4 -4
  79. package/src/workflows/quick-skill/workflow-plan-quick-skill.md +4 -4
  80. package/src/workflows/quick-skill/workflow.md +2 -0
  81. package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +12 -3
  82. package/src/workflows/setup-forge/steps-c/step-02-write-config.md +10 -2
  83. package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +111 -40
  84. package/src/workflows/setup-forge/steps-c/step-04-report.md +13 -0
  85. package/src/workflows/setup-forge/workflow.md +1 -0
  86. package/src/workflows/test-skill/data/scoring-rules.md +14 -6
  87. package/src/workflows/test-skill/data/source-access-protocol.md +45 -0
  88. package/src/workflows/test-skill/steps-c/step-01-init.md +38 -13
  89. package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +2 -3
  90. package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +25 -5
  91. package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +22 -47
  92. package/src/workflows/test-skill/steps-c/step-04b-external-validators.md +219 -0
  93. package/src/workflows/test-skill/steps-c/step-05-score.md +25 -27
  94. package/src/workflows/test-skill/steps-c/step-06-report.md +9 -4
  95. package/src/workflows/test-skill/templates/test-report-template.md +2 -1
  96. package/src/workflows/test-skill/validation-report.md +1 -1
  97. package/src/workflows/test-skill/workflow-plan-test-skill.md +7 -3
  98. package/src/workflows/test-skill/workflow.md +1 -1
  99. package/src/workflows/update-skill/data/remote-source-resolution.md +43 -0
  100. package/src/workflows/update-skill/data/tier-degradation-rules.md +46 -0
  101. package/src/workflows/update-skill/steps-c/step-01-init.md +13 -7
  102. package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +26 -0
  103. package/src/workflows/update-skill/steps-c/step-03-re-extract.md +38 -9
  104. package/src/workflows/update-skill/steps-c/step-04-merge.md +3 -3
  105. package/src/workflows/update-skill/steps-c/step-05-validate.md +63 -67
  106. package/src/workflows/update-skill/steps-c/step-06-write.md +37 -14
  107. package/src/workflows/update-skill/steps-c/step-07-report.md +1 -1
  108. package/src/workflows/update-skill/validation-report.md +4 -4
  109. package/src/workflows/update-skill/workflow-plan-update-skill.md +4 -4
  110. package/src/workflows/update-skill/workflow.md +1 -1
  111. package/tools/cli/commands/status.js +4 -4
  112. package/tools/cli/commands/uninstall.js +1 -1
  113. package/tools/cli/commands/update.js +2 -2
  114. package/tools/cli/lib/ui.js +60 -16
  115. package/tools/cli/lib/version-check.js +2 -2
package/README.md CHANGED
@@ -1,204 +1,118 @@
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**.
1
+ <div align="center">
18
2
 
19
- ## How SKF Fits In
3
+ <img src="website/public/img/skf-logo.svg" alt="Skill Forge Logo" width="120" />
20
4
 
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.
5
+ # Skill Forge (SKF)
22
6
 
23
- ## Architecture & Flow
7
+ **Turn code and docs into instructions AI agents can actually follow.**
24
8
 
25
- BMad is a small **agent + workflow engine**. There is no external orchestrator — everything runs inside the LLM context window through structured instructions.
9
+ [![Quality & Validation](https://github.com/armelhbobdad/bmad-module-skill-forge/actions/workflows/quality.yaml/badge.svg)](https://github.com/armelhbobdad/bmad-module-skill-forge/actions/workflows/quality.yaml)
10
+ [![npm](https://img.shields.io/npm/v/bmad-module-skill-forge)](https://www.npmjs.com/package/bmad-module-skill-forge)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
12
+ [![BMad Module](https://img.shields.io/badge/BMad-module-blue)](https://github.com/bmad-code-org/BMAD-METHOD)
13
+ [![Docs](https://img.shields.io/badge/docs-online-green)](https://armelhbobdad.github.io/bmad-module-skill-forge/)
14
+ [![GitHub stars](https://img.shields.io/github/stars/armelhbobdad/bmad-module-skill-forge?style=social)](https://github.com/armelhbobdad/bmad-module-skill-forge/stargazers)
26
15
 
27
- ### Building Blocks
16
+ *Skill Forge analyzes your code repositories, documentation, and developer discourse to build verified instruction files for AI agents. Every instruction links back to where it came from — nothing is made up.*
28
17
 
29
- Each workflow directory contains these files, and each has a specific job:
18
+ **If SKF helps your agent stop hallucinating, give it a — it helps others find this tool.**
30
19
 
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 |
20
+ </div>
40
21
 
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
- ```
22
+ ---
50
23
 
51
- ### How It Works at Runtime
24
+ ## The Problem
52
25
 
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.
26
+ You ask an AI agent to use a library. It invents function names that don't exist. It guesses parameter types. You paste documentation into the context — it still gets details wrong. You write instructions by hand — they go stale the moment the code changes.
61
27
 
62
- ### Ferris Operating Modes
28
+ This isn't an edge case. It's the default experience.
63
29
 
64
- Ferris operates in four workflow-driven modes (mode is determined by which workflow is running, not conversation state):
30
+ ## How Skill Forge Fixes This
65
31
 
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 |
32
+ 1. **Analyzes your sources** extracts real function signatures, types, and patterns from code repositories, documentation websites, and developer discourse
33
+ 2. **Compiles verified instruction files** every instruction links to the exact file and line it came from
34
+ 3. **Follows an open standard** skills comply with the [agentskills.io](https://agentskills.io) spec and work across Claude, Cursor, Copilot, and other AI agents
72
35
 
73
- ## Install
36
+ ## Before vs After
74
37
 
75
- There are three ways to install SKF, depending on your setup.
38
+ **Without SKF** your agent guesses:
76
39
 
77
- ### Method 1: Standalone (recommended for trying SKF)
40
+ ```python
41
+ import cognee
78
42
 
79
- ```bash
80
- npx skill-forge install
43
+ # Agent hallucinates: sync call, wrong parameter name, missing await
44
+ results = cognee.search("What does Cognee do?", mode="graph")
81
45
  ```
82
46
 
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
47
+ **With SKF** your agent reads the verified skill:
88
48
 
89
- ```bash
90
- npx bmad-method install
91
- ```
49
+ ```python
50
+ import cognee
92
51
 
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/
52
+ # Agent follows the skill instruction:
53
+ # `search(query_text: str, query_type: SearchType = GRAPH_COMPLETION) -> List[SearchResult]`
54
+ # [AST:cognee/api/v1/search/search.py:L26]
55
+ results = await cognee.search(
56
+ query_text="What does Cognee do?",
57
+ query_type=cognee.SearchType.GRAPH_COMPLETION
58
+ )
97
59
  ```
98
60
 
99
- This installs BMad core + SKF together with full IDE integration, manifests, and help catalog. Best when you want the complete BMad development workflow.
61
+ The skill told the agent the real function name, the real parameters, and that the call requires `await` all traced to the exact source line. This is from a [real generated skill](https://github.com/armelhbobdad/oh-my-skills).
100
62
 
101
- ### Method 3: Add SKF to an existing BMad project
63
+ ## Install
102
64
 
103
- If you already have BMad installed, you can add SKF afterward by running the standalone installer in the same directory:
65
+ Requires [Node.js](https://nodejs.org/) >= 22.
104
66
 
105
67
  ```bash
106
- npx skill-forge install
68
+ npx bmad-module-skill-forge install
107
69
  ```
108
70
 
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
71
+ You'll be prompted for project name, output folders, and IDE configuration. See the [docs](https://armelhbobdad.github.io/bmad-module-skill-forge/getting-started/) for other install methods.
118
72
 
119
- ## Workflows
73
+ ## Quick Start
120
74
 
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 |
75
+ 1. **Set up your environment:** `@Ferris SF` — detects your tools and sets your capability tier
76
+ 2. **Generate your first skill:** `@Ferris QS <package-name>` — creates a verified skill in under a minute
77
+ 3. **Full quality path:** `@Ferris BS` then `@Ferris CS` brief first, then compile for maximum accuracy
133
78
 
134
- ## Progressive Capability Model
79
+ See the [workflows docs](https://armelhbobdad.github.io/bmad-module-skill-forge/workflows/) for all 10 available workflows.
135
80
 
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 |
81
+ ## Who Is This For?
141
82
 
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.
83
+ - **You use AI agents to write code** and they keep getting API calls wrong hallucinating function names, guessing parameter types, inventing methods that don't exist
84
+ - **You maintain a library** and want to ship official, verified instruction files so AI agents use your API correctly
85
+ - **You manage a codebase with many dependencies** and want a consolidated "stack skill" that teaches your agent how all the pieces fit together
86
+ - **You use a SaaS API or closed-source tool** with no public code — SKF can generate skills from documentation alone
143
87
 
144
- ## Knowledge Base
88
+ ## Learn More
145
89
 
146
- SKF relies on a curated skill compilation knowledge base:
90
+ - **[Getting Started](https://armelhbobdad.github.io/bmad-module-skill-forge/getting-started/)** Installation, prerequisites, and your first skill
91
+ - **[Concepts](https://armelhbobdad.github.io/bmad-module-skill-forge/concepts/)** — Plain-English definitions of all key terms
92
+ - **[How It Works](https://armelhbobdad.github.io/bmad-module-skill-forge/architecture/)** — Architecture, capability tiers, output format, and design decisions
93
+ - **[Workflows](https://armelhbobdad.github.io/bmad-module-skill-forge/workflows/)** — All 10 workflows with commands and connection diagrams
94
+ - **[Agents](https://armelhbobdad.github.io/bmad-module-skill-forge/agents/)** — Ferris: the AI agent that runs all SKF workflows
95
+ - **[Examples](https://armelhbobdad.github.io/bmad-module-skill-forge/examples/)** — Real-world scenarios, tips, and troubleshooting
147
96
 
148
- - Index: `src/knowledge/skf-knowledge-index.csv`
149
- - Fragments: `src/knowledge/`
97
+ ## Acknowledgements
150
98
 
151
- Workflows load only the fragments required for the current task to stay focused and compliant.
99
+ SKF builds on these excellent open-source tools:
152
100
 
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
- ```
101
+ | Tool | Role in SKF |
102
+ |--------------------------------------------------------------|--------------------------------------------------------------------|
103
+ | [agentskills.io](https://github.com/agentskills/agentskills) | Skill specification and ecosystem standard |
104
+ | [GitHub CLI](https://cli.github.com/) | Source code access and repository intelligence (all tiers) |
105
+ | [ast-grep](https://github.com/ast-grep/ast-grep) | AST-based structural code extraction (Forge/Deep tiers) |
106
+ | [ast-grep MCP](https://github.com/ast-grep/ast-grep-mcp) | MCP server for memory-efficient AST queries (recommended) |
107
+ | [QMD](https://github.com/tobi/qmd) | Local hybrid search engine for knowledge indexing (Deep tier) |
108
+ | [skill-check](https://github.com/thedaviddias/skill-check) | Skill validation, auto-fix, quality scoring, and security scanning |
109
+ | [Snyk Agent Scan](https://github.com/snyk/agent-scan) | Security scanning for prompt injection and data exposure (optional) |
110
+ | [tessl](https://tessl.io) | Content quality review, actionability scoring, and AI judge evaluation |
111
+ | [BMad Method](https://github.com/bmad-code-org/BMAD-METHOD) | Agent-workflow framework that SKF extends as a module |
198
112
 
199
113
  ## Contributing
200
114
 
201
- See [CONTRIBUTORS.md](CONTRIBUTORS.md) for guidelines.
115
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
202
116
 
203
117
  ## License
204
118
 
package/docs/agents.md CHANGED
@@ -5,7 +5,7 @@ description: Ferris agent reference — modes, capabilities, menu, and communica
5
5
 
6
6
  # Agents Reference
7
7
 
8
- SKF includes 1 specialized agent:
8
+ Ferris is the AI agent that runs all SKF workflows. You always interact with Ferris — he switches modes based on which workflow you invoke.
9
9
 
10
10
  ---
11
11
 
@@ -31,7 +31,7 @@ Ferris handles all SKF workflows. You always interact with Ferris — he switche
31
31
 
32
32
  | Mode | Behavior | Workflows |
33
33
  |------|----------|-----------|
34
- | **Architect** | Exploratory, structural, assembling | BS, CS, QS, SS, AN |
34
+ | **Architect** | Exploratory, structural, assembling | SF, AN, BS, CS, QS, SS |
35
35
  | **Surgeon** | Precise, semantic diffing, preserves [MANUAL] | US |
36
36
  | **Audit** | Judgmental, drift reports, completeness scoring | AS, TS |
37
37
  | **Delivery** | Packaging, platform-aware, ecosystem-ready | EX |
@@ -1,11 +1,73 @@
1
1
  ---
2
- title: Architecture
3
- description: How Skill Forge works — output format, confidence model, progressive tiers, tool ecosystem, and key design decisions
2
+ title: How It Works
3
+ description: How Skill Forge works — the BMad framework, architecture, output format, confidence model, progressive tiers, and tool ecosystem
4
4
  ---
5
5
 
6
- # Architecture
6
+ # How It Works
7
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.
8
+ This page is for people who want to understand how SKF works under the hood. It covers the BMad framework, workflow architecture, capability tiers, output format, tool ecosystem, and key design decisions. For plain-English definitions of key terms, see [Concepts](../concepts.md).
9
+
10
+ ---
11
+
12
+ ## How BMad Works
13
+
14
+ 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**.
15
+
16
+ ## How SKF Fits In
17
+
18
+ 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.
19
+
20
+ ---
21
+
22
+ ## Architecture & Flow
23
+
24
+ BMad is a small **agent + workflow engine**. There is no external orchestrator — everything runs inside the LLM context window through structured instructions.
25
+
26
+ ### Building Blocks
27
+
28
+ Each workflow directory contains these files, and each has a specific job:
29
+
30
+ | File | What it does | When it loads |
31
+ |---------------------------|---------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
32
+ | `forger.agent.yaml` | Expert persona — identity, principles, critical actions, menu of triggers | First — always in context |
33
+ | `workflow.md` | Human-readable entry point — goals, mode menu (Create/Edit/Validate), routes to first step | Second — presents mode choice |
34
+ | `steps-c/*.md` | **Create** steps — primary execution, 4-9 sequential files | One at a time (just-in-time) |
35
+ | `data/*.md` | Workflow-specific reference data — schemas, heuristics, rules, patterns | Read by steps on demand |
36
+ | `templates/*.md` | Output skeletons with placeholder vars — steps fill these in to produce the final artifact | Read by steps when generating output |
37
+ | `skf-knowledge-index.csv` | Knowledge fragment index — id, name, tags, tier, file path | Read by steps to decide which fragments to load |
38
+ | `knowledge/*.md` | 10 reusable fragments — cross-cutting principles and patterns (e.g., `zero-hallucination.md`, `confidence-tiers.md`) | Selectively read into context when a step directs |
39
+
40
+ ```mermaid
41
+ flowchart LR
42
+ U[User] --> A[Agent Persona]
43
+ A --> W[Workflow Entry: workflow.md]
44
+ W --> S[Step Files: steps-c/]
45
+ S --> K[Knowledge Fragments<br/>skf-knowledge-index.csv → knowledge/*.md]
46
+ S --> D[Data & Templates<br/>data/*.md, templates/*.md]
47
+ S --> O[Outputs: skills/reports<br/>when a step writes output]
48
+ ```
49
+
50
+ ### How It Works at Runtime
51
+
52
+ 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.
53
+ 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.
54
+ 3. **Workflow loads** — `workflow.md` presents the mode choice and routes to the first step file.
55
+ 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.
56
+ 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.
57
+ 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.
58
+ 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.
59
+ 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.
60
+
61
+ ### Ferris Operating Modes
62
+
63
+ Ferris operates in four workflow-driven modes (mode is determined by which workflow is running, not conversation state):
64
+
65
+ | Mode | Workflows | Behavior |
66
+ |---------------|--------------------|-------------------------------------------------------------|
67
+ | **Architect** | SF, AN, BS, CS, QS, SS | Exploratory, assembling — discovers structure and scope |
68
+ | **Surgeon** | US | Precise, preserving — extracts and compiles with provenance |
69
+ | **Audit** | AS, TS | Judgmental, scoring — evaluates quality and detects drift |
70
+ | **Delivery** | EX | Packaging, ecosystem-ready — bundles for distribution |
9
71
 
10
72
  ---
11
73
 
@@ -22,7 +84,7 @@ AI agents hallucinate APIs. Not sometimes — constantly. The table below shows
22
84
  | Copilot/Cursor built-in | Convenient | Generic. Doesn't know YOUR integration patterns. |
23
85
  | **Skill Forge** | **Structural truth + automation** | **Rigid. (Feature, not bug.)** |
24
86
 
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).
87
+ SKF solves this by mechanically extracting function signatures, type definitions, and usage patterns from code repositories and enriching them with documentation and developer discourse — then compiling everything into verifiable, version-pinned skills that comply with the [agentskills.io specification](https://agentskills.io/specification).
26
88
 
27
89
  ---
28
90
 
@@ -32,7 +94,7 @@ SKF uses an additive tier model. Each tier is the previous tier plus one tool. Y
32
94
 
33
95
  | Tier | Tools | What You Get |
34
96
  |------|-------|-------------|
35
- | **Quick** | `gh_bridge` + `skills_ref` | Source reading + spec validation. Best-effort skills in under a minute. |
97
+ | **Quick** | `gh_bridge` + `skill-check` + `tessl` | Source reading + spec validation + content quality review. Best-effort skills in under a minute. |
36
98
  | **Forge** | + `ast_bridge` | Structural truth. AST-verified signatures. Co-import detection. T1 confidence. |
37
99
  | **Deep** | + `qmd_bridge` | Knowledge search. Temporal provenance. Drift detection. Full intelligence. |
38
100
 
@@ -48,6 +110,29 @@ Forge initialized. Tools: gh, ast-grep, QMD. Tier: Deep. Ready.
48
110
 
49
111
  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
112
 
113
+ ### Tier Override — Comparing Output Across Tiers
114
+
115
+ You can force a specific tier by setting `tier_override` in your preferences file (`_bmad/_memory/forger-sidecar/preferences.yaml`):
116
+
117
+ ```yaml
118
+ # Force Forge tier regardless of detected tools
119
+ tier_override: Forge
120
+ ```
121
+
122
+ This is useful for comparing skill quality across tiers for the same target:
123
+
124
+ ```
125
+ # 1. Set tier_override: Quick in preferences.yaml
126
+ @Ferris CS # compile at Quick tier
127
+
128
+ # 2. Change to tier_override: Forge
129
+ @Ferris CS # recompile at Forge tier — compare output
130
+
131
+ # 3. Reset to tier_override: ~ (auto-detect)
132
+ ```
133
+
134
+ Set `tier_override` to `Quick`, `Forge`, or `Deep`. Set to `~` (null) to return to auto-detection. The override is respected by all tier-aware workflows (CS, SS, US, AS, TS).
135
+
51
136
  ---
52
137
 
53
138
  ## Confidence Tiers
@@ -176,7 +261,7 @@ The primary source is your project repo. Component references trace to library r
176
261
 
177
262
  ## Dual-Output Strategy
178
263
 
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.
264
+ Based on [Vercel research](https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals): passive context (AGENTS.md/CLAUDE.md) achieves 100% pass rate vs 53% for active skills alone.
180
265
 
181
266
  Every skill generates both:
182
267
 
@@ -189,37 +274,43 @@ Export injects a managed section between markers:
189
274
 
190
275
  ```markdown
191
276
  <!-- 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
277
+ [payment-service v2.1.0]|root: skills/payment-service/
278
+ |IMPORTANT: payment-service v2.1.0 read SKILL.md before writing payment-service code. Do NOT rely on training data.
279
+ |quick-start:{SKILL.md#quick-start}
280
+ |api: getToken(), refreshToken(), revokeSession(), createSession()
281
+ |key-types:{SKILL.md#key-types} TokenOptions, AuthToken, SessionConfig
282
+ |gotchas: all token methods async, session ID changed from userId in v2.0
283
+
284
+ [auth-service v1.5.0]|root: skills/auth-service/
285
+ |IMPORTANT: auth-service v1.5.0 — read SKILL.md before writing auth-service code. Do NOT rely on training data.
286
+ |quick-start:{SKILL.md#quick-start}
287
+ |api: getSession(), validateToken(), revokeSession(), createUser()
288
+ |gotchas: RBAC requires middleware setup, validateToken returns null not throw
289
+
290
+ [my-project-stack v1.0.0]|root: skills/my-project-stack/
291
+ |IMPORTANT: my-project-stack — read SKILL.md before writing integration code. Do NOT rely on training data.
292
+ |stack: next@15, better-auth@3, spacetimedb@1, serwist@9
293
+ |integrations: auth↔db, pwa↔auth
294
+ |gotchas: auth session type must match DB schema, update Serwist cache on auth flow changes
204
295
  <!-- SKF:END -->
205
296
  ```
206
297
 
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.
298
+ ~80-120 tokens per skill (version-pinned, retrieval instruction, section anchors, inline gotchas). Aligned with [Vercel's research](https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals) finding that indexed format with explicit retrieval instructions dramatically improves agent performance. Developer controls placement. Ferris controls content. Snippet updates only happen at `export-skill` — create and update are draft operations.
208
299
 
209
300
  ---
210
301
 
211
302
  ## Tool Ecosystem
212
303
 
213
- ### 4 MCP Tools
304
+ ### 6 Tools
214
305
 
215
306
  | Tool | Wraps | Purpose |
216
307
  |------|-------|---------|
217
308
  | **`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 |
309
+ | **`skill-check`** | [thedaviddias/skill-check](https://github.com/thedaviddias/skill-check) | Validation + auto-fix (`check --fix`), quality scoring (0-100), security scan, split-body, diff comparison |
310
+ | **`tessl`** | [tessl](https://tessl.io) | Content quality review, actionability scoring, progressive disclosure evaluation, AI judge with suggestions |
219
311
  | **`ast_bridge`** | ast-grep CLI | Structural extraction, custom AST queries, co-import detection |
220
312
  | **`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.
313
+ | **`doc_fetcher`** | Environment web tools | Remote documentation fetching for T3-confidence content. Tool-agnostic — uses whatever web fetching is available (Firecrawl, WebFetch, curl, etc.). Output quarantined as T3. |
223
314
 
224
315
  ### Conflict Resolution
225
316
 
@@ -282,13 +373,52 @@ Provenance maps enable verification: an `official` skill's provenance must trace
282
373
 
283
374
  ---
284
375
 
376
+ ## Knowledge Base
377
+
378
+ SKF relies on a curated skill compilation knowledge base:
379
+
380
+ - Index: `src/knowledge/skf-knowledge-index.csv`
381
+ - Fragments: `src/knowledge/`
382
+
383
+ Workflows load only the fragments required for the current task to stay focused and compliant.
384
+
385
+ ## Module Structure
386
+
387
+ ```
388
+ src/
389
+ ├── module.yaml
390
+ ├── module-help.csv
391
+ ├── agents/
392
+ │ └── forger.agent.yaml
393
+ ├── forger/
394
+ │ ├── forge-tier.yaml
395
+ │ ├── preferences.yaml
396
+ │ └── README.md
397
+ ├── knowledge/
398
+ │ ├── skf-knowledge-index.csv
399
+ │ └── *.md (10 fragments)
400
+ └── workflows/
401
+ ├── setup-forge/
402
+ ├── analyze-source/
403
+ ├── brief-skill/
404
+ ├── create-skill/
405
+ ├── quick-skill/
406
+ ├── create-stack-skill/
407
+ ├── update-skill/
408
+ ├── audit-skill/
409
+ ├── test-skill/
410
+ └── export-skill/
411
+ ```
412
+
413
+ ---
414
+
285
415
  ## Security
286
416
 
287
417
  - All tool wrappers use array-style subprocess execution — no shell interpolation
288
418
  - Input sanitization: allowlist characters for repo names, file paths, patterns
289
419
  - File paths validated against project root (no directory traversal)
290
420
  - **Source code never leaves the machine.** All processing is local (AST, QMD, validation).
291
- - `doc_fetcher` warns before transmitting URLs to external services
421
+ - `doc_fetcher` informs users which URLs will be fetched externally before processing
292
422
 
293
423
  ---
294
424