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,185 @@
1
+ ---
2
+ name: 'step-01-init'
3
+ description: 'Discover skill, load forge tier state, validate inputs, create test report'
4
+
5
+ nextStepFile: './step-02-detect-mode.md'
6
+ outputFile: '{output_folder}/test-report-{skill_name}.md'
7
+ templateFile: '../templates/test-report-template.md'
8
+ sidecarFile: '{sidecar_path}/forge-tier.yaml'
9
+ skillsOutputFolder: '{skills_output_folder}'
10
+ ---
11
+
12
+ # Step 1: Initialize Test
13
+
14
+ ## STEP GOAL:
15
+
16
+ Discover and validate the target skill, load forge tier state to determine analysis depth, and create the test report document from template.
17
+
18
+ ## MANDATORY EXECUTION RULES (READ FIRST):
19
+
20
+ ### Universal Rules:
21
+
22
+ - 🛑 NEVER proceed if required inputs are missing — halt with clear error
23
+ - 📖 CRITICAL: Read the complete step file before taking any action
24
+ - 🔄 CRITICAL: When loading next step, ensure entire file is read
25
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
26
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
27
+
28
+ ### Role Reinforcement:
29
+
30
+ - ✅ You are a skill auditor operating in Ferris's Audit mode
31
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
32
+ - ✅ Methodical, precise, evidence-based — zero hallucination
33
+ - ✅ Every finding must trace to actual artifacts
34
+
35
+ ### Step-Specific Rules:
36
+
37
+ - 🎯 Focus only on input discovery and validation — do NOT begin analysis
38
+ - 🚫 FORBIDDEN to start coverage or coherence checks in this step
39
+ - 💬 Report what was found clearly and concisely
40
+ - 📋 Validate all required files exist before proceeding
41
+
42
+ ## EXECUTION PROTOCOLS:
43
+
44
+ - 🎯 Discover skill path from user input or batch list
45
+ - 💾 Create output document from {templateFile}
46
+ - 📖 Load forge tier state from {sidecarFile}
47
+ - 🚫 FORBIDDEN to proceed if SKILL.md is missing
48
+
49
+ ## CONTEXT BOUNDARIES:
50
+
51
+ - Available: User-provided skill path, SKF module config
52
+ - Focus: Input validation and tier detection only
53
+ - Limits: Do not analyze skill content — just confirm it exists and is loadable
54
+ - Dependencies: setup-forge must have run (forge-tier.yaml must exist)
55
+
56
+ ## MANDATORY SEQUENCE
57
+
58
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
59
+
60
+ ### 1. Receive Skill Path
61
+
62
+ If skill path was provided as workflow argument, use it directly.
63
+
64
+ If no path provided, ask:
65
+
66
+ "**Which skill would you like to test?**
67
+
68
+ Provide the skill path or name. I'll search in `{skillsOutputFolder}`.
69
+
70
+ **Path or name:**"
71
+
72
+ ### 2. Validate Skill Exists
73
+
74
+ Check that the skill directory contains required files:
75
+
76
+ **Required files:**
77
+ - `{skillsOutputFolder}/{skill_name}/SKILL.md` — the skill documentation
78
+ - `{skillsOutputFolder}/{skill_name}/metadata.json` — skill metadata
79
+
80
+ **If SKILL.md missing:**
81
+ "**Error: SKILL.md not found at `{skillsOutputFolder}/{skill_name}/SKILL.md`**
82
+
83
+ This skill has not been created yet. Run the **create-skill** workflow first."
84
+
85
+ HALT — do not proceed.
86
+
87
+ **If metadata.json missing:**
88
+ "**Warning:** metadata.json not found. Proceeding with limited metadata. Some checks may be skipped."
89
+
90
+ ### 3. Load Forge Tier State
91
+
92
+ Read `{sidecarFile}` to determine available analysis depth.
93
+
94
+ **If forge-tier.yaml exists:**
95
+ - Read `detected_tier` value (Quick, Forge, or Deep)
96
+ - Read tool availability flags (ast_grep, gh_cli, qmd)
97
+
98
+ **If forge-tier.yaml missing:**
99
+ "**Warning:** Forge tier not detected. Defaulting to **Quick** tier (structural checks only).
100
+
101
+ Run **setup-forge** to enable deeper analysis with AST-backed verification."
102
+
103
+ Default to Quick tier and continue.
104
+
105
+ ### 4. Load Skill Metadata
106
+
107
+ Read `metadata.json` to extract:
108
+ - `skill_name` — display name
109
+ - `skill_type` — individual or stack (needed for mode detection)
110
+ - `source_path` — path to source code (if present)
111
+ - `created_date` — when skill was created
112
+ - `tier` — tier used during creation
113
+
114
+ If source path override was provided as optional input, use that instead.
115
+
116
+ ### 5. Create Output Document
117
+
118
+ Create `{outputFile}` from `{templateFile}` with initial frontmatter:
119
+
120
+ ```yaml
121
+ ---
122
+ workflowType: 'test-skill'
123
+ skillName: '{skill_name}'
124
+ testMode: ''
125
+ forgeTier: '{detected_tier}'
126
+ testResult: ''
127
+ score: ''
128
+ threshold: ''
129
+ testDate: '{current_date}'
130
+ stepsCompleted: ['step-01-init']
131
+ nextWorkflow: ''
132
+ ---
133
+ ```
134
+
135
+ ### 6. Report Initialization Status
136
+
137
+ "**Test initialization complete.**
138
+
139
+ **Skill:** {skill_name}
140
+ **Path:** {skill_path}
141
+ **Type:** {skill_type}
142
+ **Forge Tier:** {detected_tier}
143
+ **Source:** {source_path}
144
+
145
+ **Proceeding to mode detection...**"
146
+
147
+ ### 7. Auto-Proceed
148
+
149
+ Display: "**Proceeding to mode detection...**"
150
+
151
+ #### Menu Handling Logic:
152
+
153
+ - After initialization is complete, update {outputFile} frontmatter stepsCompleted, then immediately load, read entire file, then execute {nextStepFile}
154
+
155
+ #### EXECUTION RULES:
156
+
157
+ - This is an auto-proceed initialization step with no user choices
158
+ - Proceed directly to next step after setup
159
+
160
+ ## CRITICAL STEP COMPLETION NOTE
161
+
162
+ ONLY WHEN all required files are validated, forge tier is loaded, output document is created, and initialization status is reported, will you then load and read fully `{nextStepFile}` to execute mode detection.
163
+
164
+ ---
165
+
166
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
167
+
168
+ ### ✅ SUCCESS:
169
+
170
+ - Skill path validated (SKILL.md exists)
171
+ - Forge tier state loaded (or gracefully defaulted to Quick)
172
+ - Skill metadata extracted
173
+ - Output document created from template with initial frontmatter
174
+ - Initialization status reported clearly
175
+ - Auto-proceeded to step 02
176
+
177
+ ### ❌ SYSTEM FAILURE:
178
+
179
+ - Proceeding without validating SKILL.md exists
180
+ - Not loading forge tier state
181
+ - Not creating output document before proceeding
182
+ - Starting analysis in this step (coverage/coherence belongs to later steps)
183
+ - Hardcoding paths instead of using frontmatter variables
184
+
185
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: 'step-02-detect-mode'
3
+ description: 'Determine naive (individual) vs contextual (stack) testing mode'
4
+
5
+ nextStepFile: './step-03-coverage-check.md'
6
+ outputFile: '{output_folder}/test-report-{skill_name}.md'
7
+ ---
8
+
9
+ # Step 2: Detect Mode
10
+
11
+ ## STEP GOAL:
12
+
13
+ Examine the skill metadata to determine whether this is an individual skill (naive mode — API surface coverage only) or a stack skill (contextual mode — full coherence validation including cross-references and integration patterns).
14
+
15
+ ## MANDATORY EXECUTION RULES (READ FIRST):
16
+
17
+ ### Universal Rules:
18
+
19
+ - 🛑 NEVER override mode detection with assumptions — use actual metadata
20
+ - 📖 CRITICAL: Read the complete step file before taking any action
21
+ - 🔄 CRITICAL: When loading next step, ensure entire file is read
22
+ - ⚙️ 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
23
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
24
+
25
+ ### Role Reinforcement:
26
+
27
+ - ✅ You are a skill auditor in Ferris's Audit mode
28
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
29
+ - ✅ Mode detection is deterministic — based on metadata, not judgment
30
+ - ✅ Report the detected mode clearly and explain what it means for analysis depth
31
+
32
+ ### Step-Specific Rules:
33
+
34
+ - 🎯 Focus only on mode detection — do NOT begin coverage or coherence analysis
35
+ - 🚫 FORBIDDEN to start analyzing exports or references in this step
36
+ - 💬 Explain what each mode means for the upcoming analysis
37
+ - 📋 Set testMode in output frontmatter before proceeding
38
+
39
+ ## EXECUTION PROTOCOLS:
40
+
41
+ - 🎯 Read skill metadata to determine type
42
+ - 💾 Update {outputFile} frontmatter with testMode and append Test Summary section
43
+ - 📖 Update stepsCompleted in {outputFile}
44
+ - 🚫 FORBIDDEN to proceed without setting testMode
45
+
46
+ ## CONTEXT BOUNDARIES:
47
+
48
+ - Available: Skill metadata loaded in step 01, forge tier state, output document
49
+ - Focus: Mode detection only — classify skill type, set test mode
50
+ - Limits: Do not analyze content — just determine the correct testing mode
51
+ - Dependencies: step-01 must have validated skill exists and loaded metadata
52
+
53
+ ## MANDATORY SEQUENCE
54
+
55
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
56
+
57
+ ### 1. Examine Skill Type
58
+
59
+ Read the skill metadata (loaded in step 01) and check:
60
+
61
+ **Individual Skill indicators:**
62
+ - `skill_type: 'individual'` in metadata
63
+ - Single source library/package
64
+ - No cross-references to other skills
65
+ - Self-contained API surface
66
+
67
+ **Stack Skill indicators:**
68
+ - `skill_type: 'stack'` in metadata
69
+ - References multiple skills or packages
70
+ - Contains cross-references in SKILL.md
71
+ - Integration patterns documented between components
72
+
73
+ ### 2. Determine Test Mode
74
+
75
+ **IF individual skill → Naive Mode:**
76
+ - Coverage check: documented exports vs source API surface
77
+ - Coherence check: basic structural validation only (no cross-references to verify)
78
+ - Scoring: redistributed weights (no coherence category)
79
+
80
+ **IF stack skill → Contextual Mode:**
81
+ - Coverage check: documented exports vs source API surface (same as naive)
82
+ - Coherence check: full validation — cross-references exist, types match, integration patterns complete
83
+ - Scoring: full category weights including coherence
84
+
85
+ **IF metadata unclear or skill_type not set:**
86
+ - Default to **naive mode** (conservative — fewer checks, less chance of false negatives from missing context)
87
+ - Note the default in the report
88
+
89
+ ### 3. Update Output Document
90
+
91
+ Update `{outputFile}` frontmatter:
92
+ - Set `testMode: '{naive|contextual}'`
93
+
94
+ Append the **Test Summary** section to `{outputFile}`:
95
+
96
+ ```markdown
97
+ ## Test Summary
98
+
99
+ **Skill:** {skill_name}
100
+ **Test Mode:** {naive|contextual}
101
+ **Forge Tier:** {detected_tier}
102
+ **Threshold:** {threshold}%
103
+
104
+ **Mode Rationale:** {brief explanation of why this mode was selected}
105
+
106
+ **Analysis Plan:**
107
+ - Coverage Check: {what will be checked based on mode + tier}
108
+ - Coherence Check: {what will be checked based on mode + tier}
109
+ ```
110
+
111
+ ### 4. Report Mode Detection
112
+
113
+ "**Mode detected: {NAIVE|CONTEXTUAL}**
114
+
115
+ **{skill_name}** is {an individual skill / a stack skill}, so we'll run in **{naive/contextual}** mode.
116
+
117
+ **What this means:**
118
+ - Coverage: {brief description of coverage scope}
119
+ - Coherence: {brief description of coherence scope}
120
+ - Scoring: {which weight distribution applies}
121
+
122
+ **Proceeding to coverage check...**"
123
+
124
+ ### 5. Auto-Proceed
125
+
126
+ Display: "**Proceeding to coverage check...**"
127
+
128
+ #### Menu Handling Logic:
129
+
130
+ - After mode detection is complete, update {outputFile} frontmatter stepsCompleted, then immediately load, read entire file, then execute {nextStepFile}
131
+
132
+ #### EXECUTION RULES:
133
+
134
+ - This is an auto-proceed detection step with no user choices
135
+ - Proceed directly to next step after mode is set
136
+
137
+ ## CRITICAL STEP COMPLETION NOTE
138
+
139
+ ONLY WHEN testMode is set in the output frontmatter and the Test Summary section is appended to the output document, will you then load and read fully `{nextStepFile}` to execute coverage check.
140
+
141
+ ---
142
+
143
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
144
+
145
+ ### ✅ SUCCESS:
146
+
147
+ - Skill type correctly identified from metadata
148
+ - Test mode set (naive or contextual) in output frontmatter
149
+ - Test Summary section appended to output document
150
+ - Mode rationale documented
151
+ - Analysis plan stated based on mode + tier combination
152
+ - Auto-proceeded to step 03
153
+
154
+ ### ❌ SYSTEM FAILURE:
155
+
156
+ - Guessing mode without reading metadata
157
+ - Not setting testMode in output frontmatter
158
+ - Not appending Test Summary section
159
+ - Starting analysis in this step
160
+ - Hardcoding paths instead of using frontmatter variables
161
+
162
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,222 @@
1
+ ---
2
+ name: 'step-03-coverage-check'
3
+ description: 'Compare documented exports in SKILL.md against actual source API surface'
4
+
5
+ nextStepFile: './step-04-coherence-check.md'
6
+ outputFile: '{output_folder}/test-report-{skill_name}.md'
7
+ scoringRulesFile: '../data/scoring-rules.md'
8
+ ---
9
+
10
+ # Step 3: Coverage Check
11
+
12
+ ## STEP GOAL:
13
+
14
+ Compare the exports, functions, classes, types, and interfaces documented in SKILL.md against the actual source code API surface. Identify missing documentation, undocumented exports, and signature mismatches. Analysis depth scales with forge tier.
15
+
16
+ ## MANDATORY EXECUTION RULES (READ FIRST):
17
+
18
+ ### Universal Rules:
19
+
20
+ - 🛑 NEVER fabricate findings — every coverage result must trace to actual source code or SKILL.md content
21
+ - 📖 CRITICAL: Read the complete step file before taking any action
22
+ - 🔄 CRITICAL: When loading next step, ensure entire file is read
23
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
24
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
25
+
26
+ ### Role Reinforcement:
27
+
28
+ - ✅ You are a skill auditor in Ferris's Audit mode — zero hallucination
29
+ - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
30
+ - ✅ Every finding must include file:line citations from source code
31
+ - ✅ Report what IS documented vs what SHOULD BE documented — facts only
32
+
33
+ ### Step-Specific Rules:
34
+
35
+ - 🎯 Use subprocess optimization for per-file AST analysis (Pattern 2) when available
36
+ - 💬 Subprocess returns structured findings only, not full file contents
37
+ - 🚫 DO NOT BE LAZY — For EACH source file, launch a subprocess for deep analysis
38
+ - ⚙️ If subprocess unavailable, perform analysis in main thread sequentially
39
+ - 📋 Coverage depth must match the detected forge tier
40
+
41
+ ## EXECUTION PROTOCOLS:
42
+
43
+ - 🎯 Load SKILL.md exports section and source files
44
+ - 💾 Append Coverage Analysis section to {outputFile}
45
+ - 📖 Update stepsCompleted in {outputFile}
46
+ - 🚫 FORBIDDEN to proceed without completing all source file analysis
47
+
48
+ ## CONTEXT BOUNDARIES:
49
+
50
+ - Available: SKILL.md, source files, forge tier, test mode from step 02
51
+ - Focus: Export coverage comparison only — coherence is step 04
52
+ - Limits: Do NOT validate cross-references or integration patterns (that's coherence)
53
+ - Dependencies: step-02 must have set testMode and reported forge tier
54
+
55
+ ## MANDATORY SEQUENCE
56
+
57
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
58
+
59
+ ### 1. Extract Documented Exports from SKILL.md
60
+
61
+ Read SKILL.md and extract all documented items:
62
+
63
+ - **Functions:** name, parameters, return type, description
64
+ - **Classes:** name, methods, properties
65
+ - **Types/Interfaces:** name, fields
66
+ - **Constants/Enums:** name, values
67
+ - **Hooks/Patterns:** name, usage signature
68
+
69
+ Build the **documented inventory** — a list of everything the SKILL.md claims the source provides.
70
+
71
+ ### 2. Analyze Source Code (Tier-Dependent)
72
+
73
+ **Quick Tier (no tools):**
74
+ - Read source files directly
75
+ - Identify exported items by scanning for `export` keywords, `module.exports`, or language-specific export patterns
76
+ - Compare against documented inventory by name matching
77
+ - Cannot verify signatures — note as "unverified" in report
78
+
79
+ **Forge Tier (ast-grep available):**
80
+ DO NOT BE LAZY — For EACH source file in the skill's source path, launch a subprocess that:
81
+ 1. Uses ast-grep to extract all exported symbols with their full signatures
82
+ 2. Matches each export against the documented inventory
83
+ 3. Returns structured findings:
84
+
85
+ ```json
86
+ {
87
+ "file": "src/utils.ts",
88
+ "exports_found": ["formatDate", "parseConfig", "ConfigType"],
89
+ "exports_documented": ["formatDate", "parseConfig"],
90
+ "missing_docs": ["ConfigType"],
91
+ "signature_mismatches": [
92
+ {
93
+ "name": "formatDate",
94
+ "source_sig": "(date: Date, format?: string) => string",
95
+ "documented_sig": "(date: Date) => string",
96
+ "issue": "missing optional parameter 'format'"
97
+ }
98
+ ]
99
+ }
100
+ ```
101
+
102
+ If subprocess unavailable, perform ast-grep analysis in main thread per file.
103
+
104
+ **Deep Tier (ast-grep + gh + QMD):**
105
+ - All Forge tier checks, plus:
106
+ - Use gh CLI to verify source repository matches documented version
107
+ - Cross-check type definitions against their source declarations
108
+ - Verify re-exported symbols trace to their original source
109
+
110
+ ### 3. Build Coverage Results
111
+
112
+ Aggregate findings across all source files:
113
+
114
+ **Per-export status table:**
115
+
116
+ | Export | Type | Documented | Signature Match | File:Line | Status |
117
+ |--------|------|-----------|-----------------|-----------|--------|
118
+ | {name} | function/class/type | yes/no | yes/no/unverified | src/file.ts:42 | PASS/FAIL/WARN |
119
+
120
+ **Summary counts:**
121
+ - Total exports in source: {N}
122
+ - Documented in SKILL.md: {N}
123
+ - Missing documentation: {N}
124
+ - Signature mismatches: {N}
125
+ - Undocumented in SKILL.md but not in source (stale docs): {N}
126
+
127
+ ### 4. Load Scoring Rules
128
+
129
+ Load `{scoringRulesFile}` to determine category scores:
130
+
131
+ - **Export Coverage:** (documented / total_exports) * 100
132
+ - **Signature Accuracy:** (matching_signatures / total_documented) * 100 (Forge/Deep only, "N/A" for Quick)
133
+ - **Type Coverage:** (documented_types / total_types) * 100 (Forge/Deep only, "N/A" for Quick)
134
+
135
+ ### 5. Append Coverage Analysis to Output
136
+
137
+ Append the **Coverage Analysis** section to `{outputFile}`:
138
+
139
+ ```markdown
140
+ ## Coverage Analysis
141
+
142
+ **Tier:** {forge_tier}
143
+ **Source Path:** {source_path}
144
+ **Files Analyzed:** {count}
145
+
146
+ ### Export Coverage
147
+
148
+ | Export | Type | Documented | Signature | Source Location | Status |
149
+ |--------|------|-----------|-----------|-----------------|--------|
150
+ | ... per-export rows ... |
151
+
152
+ ### Coverage Summary
153
+
154
+ - **Exports Found:** {N}
155
+ - **Documented:** {N} ({percentage}%)
156
+ - **Missing Documentation:** {N}
157
+ - **Signature Mismatches:** {N}
158
+ - **Stale Documentation:** {N}
159
+
160
+ ### Category Scores
161
+
162
+ | Category | Score | Weight | Weighted |
163
+ |----------|-------|--------|----------|
164
+ | Export Coverage | {N}% | {weight}% | {weighted}% |
165
+ | Signature Accuracy | {N}% | {weight}% | {weighted}% |
166
+ | Type Coverage | {N}% | {weight}% | {weighted}% |
167
+ ```
168
+
169
+ ### 6. Report Coverage Results
170
+
171
+ "**Coverage check complete.**
172
+
173
+ **{skill_name}** — {forge_tier} tier analysis of {file_count} source files:
174
+
175
+ - Exports: {documented}/{total} documented ({percentage}%)
176
+ - Signatures: {matching}/{total} accurate ({percentage}% or N/A for Quick)
177
+ - Types: {documented_types}/{total_types} covered ({percentage}% or N/A for Quick)
178
+
179
+ **{N} issues found** — details in Coverage Analysis section.
180
+
181
+ **Proceeding to coherence check...**"
182
+
183
+ ### 7. Auto-Proceed
184
+
185
+ Display: "**Proceeding to coherence check...**"
186
+
187
+ #### Menu Handling Logic:
188
+
189
+ - After coverage analysis is complete, update {outputFile} frontmatter stepsCompleted, then immediately load, read entire file, then execute {nextStepFile}
190
+
191
+ #### EXECUTION RULES:
192
+
193
+ - This is an auto-proceed validation step with no user choices
194
+ - Proceed directly to next step after coverage is analyzed
195
+
196
+ ## CRITICAL STEP COMPLETION NOTE
197
+
198
+ ONLY WHEN all source files have been analyzed, the Coverage Analysis section has been appended to {outputFile}, and category scores have been calculated, will you then load and read fully `{nextStepFile}` to execute coherence check.
199
+
200
+ ---
201
+
202
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
203
+
204
+ ### ✅ SUCCESS:
205
+
206
+ - All source files analyzed at appropriate tier depth
207
+ - Every finding has file:line citation (Forge/Deep) or file-level reference (Quick)
208
+ - Per-export status table complete
209
+ - Category scores calculated per scoring rules
210
+ - Coverage Analysis section appended to output document
211
+ - Zero fabricated findings — all traceable to source
212
+
213
+ ### ❌ SYSTEM FAILURE:
214
+
215
+ - Fabricating export names or signatures not in source code
216
+ - Skipping source files (DO NOT BE LAZY)
217
+ - Not scaling analysis depth to forge tier
218
+ - Not calculating category scores
219
+ - Reporting coverage without per-export evidence
220
+ - Hardcoding paths instead of using frontmatter variables
221
+
222
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE. Zero hallucination — every finding traces to code.