bmad-module-skill-forge 1.8.0 → 1.9.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/docs/_data/pinned.yaml +1 -1
- package/docs/bmad-synergy.md +16 -0
- package/docs/deepwiki.md +89 -0
- package/docs/verifying-a-skill.md +8 -2
- package/docs/workflows.md +17 -11
- package/package.json +2 -2
- package/src/shared/_known-workarounds.yaml +155 -0
- package/src/shared/references/pipeline-contracts.md +11 -2
- package/src/shared/scripts/schemas/skf-brief-result-envelope.v1.json +6 -1
- package/src/shared/scripts/skf-detect-docs.py +412 -0
- package/src/shared/scripts/skf-emit-brief-result-envelope.py +12 -1
- package/src/shared/scripts/skf-preapply.py +192 -0
- package/src/shared/scripts/skf-shape-detect.py +563 -0
- package/src/shared/scripts/skf-validate-pins.py +368 -0
- package/src/skf-analyze-source/SKILL.md +26 -20
- package/src/skf-analyze-source/references/init.md +30 -0
- package/src/skf-analyze-source/references/step-auto-scope.md +525 -0
- package/src/skf-analyze-source/references/step-shape-detect.md +79 -0
- package/src/skf-audit-skill/SKILL.md +1 -0
- package/src/skf-audit-skill/assets/drift-report-template.md +6 -0
- package/src/skf-audit-skill/references/report.md +4 -0
- package/src/skf-audit-skill/references/severity-classify.md +1 -1
- package/src/skf-audit-skill/references/step-doc-drift.md +147 -0
- package/src/skf-brief-skill/SKILL.md +7 -3
- package/src/skf-brief-skill/references/gather-intent.md +14 -0
- package/src/skf-brief-skill/references/step-auto-brief.md +171 -0
- package/src/skf-brief-skill/references/step-auto-validate.md +209 -0
- package/src/skf-create-skill/SKILL.md +3 -0
- package/src/skf-create-skill/assets/skill-sections.md +2 -0
- package/src/skf-create-skill/references/compile.md +1 -1
- package/src/skf-create-skill/references/step-auto-shard.md +110 -0
- package/src/skf-create-skill/references/step-doc-rot.md +109 -0
- package/src/skf-create-skill/references/step-doc-sources.md +114 -0
- package/src/skf-forger/SKILL.md +8 -2
- package/src/skf-test-skill/SKILL.md +8 -7
- package/src/skf-test-skill/customize.toml +2 -1
- package/src/skf-test-skill/references/external-validators.md +1 -1
- package/src/skf-test-skill/references/init.md +16 -1
- package/src/skf-test-skill/references/report.md +5 -1
- package/src/skf-test-skill/references/score.md +95 -6
- package/src/skf-test-skill/references/step-hard-gate.md +73 -0
- package/src/skf-test-skill/templates/test-report-template.md +1 -0
|
@@ -20,13 +20,16 @@ Load `{scoringRulesFile}` to get:
|
|
|
20
20
|
- Category weights (naive vs contextual distribution)
|
|
21
21
|
- Tier-dependent scoring adjustments
|
|
22
22
|
|
|
23
|
-
**Resolve the pass threshold (precedence: CLI > scalar > bundled fallback):**
|
|
23
|
+
**Resolve the pass threshold (precedence: CLI > pipeline default > scalar > bundled fallback):**
|
|
24
24
|
|
|
25
|
-
1. If the workflow received `--threshold=<N>` on invocation, use that integer as `effective_threshold` (CLI wins).
|
|
26
|
-
2. Else if
|
|
27
|
-
3. Else
|
|
25
|
+
1. If the workflow received `--threshold=<N>` on invocation, use that integer as `effective_threshold` (CLI wins). Set `threshold_source` = `"CLI override ({N}%)"`.
|
|
26
|
+
2. Else if `{pipeline_default_threshold}` is set in workflow context (resolved by init.md §1b from the per-pipeline threshold lookup table when `{pipeline_alias}` is present), use it as `effective_threshold`. Set `threshold_source` = `"pipeline default ({pipeline_alias} → {N}%)"`.
|
|
27
|
+
3. Else if the resolved `{defaultThreshold}` workflow-context variable (from SKILL.md On Activation §3 — `workflow.default_threshold` scalar, default `80`) is set, use it as `effective_threshold`. Set `threshold_source` = `"workflow default ({N}%)"`.
|
|
28
|
+
4. Else fall back to `80` (the bundled default — this branch should be unreachable when SKILL.md resolution ran correctly, but keeps the step robust if customize.toml resolution failed silently). Set `threshold_source` = `"bundled fallback (80%)"`.
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
Store `threshold_source` in workflow context for use in the score report section.
|
|
31
|
+
|
|
32
|
+
Pass `effective_threshold` into the scoring-input JSON's `threshold` field in §3a (the compute-score.py script already honors this field). The CLI flag, pipeline default, and the scalar all feed the same downstream field; the script does not need to know which layer supplied the value.
|
|
30
33
|
|
|
31
34
|
**Docs-only mode check:** If the Coverage Analysis section in `{outputFile}` notes docs-only mode (set by step 3 for skills with all `[EXT:...]` citations and no local source), apply Quick-tier weight redistribution: Signature Accuracy and Type Coverage are not scored, their weights (22% + 14%) are redistributed proportionally to remaining active categories. Coverage score is based on documentation completeness rather than source coverage (as calculated by step 3).
|
|
32
35
|
|
|
@@ -82,7 +85,7 @@ Build a JSON object from the data gathered in steps 1-2:
|
|
|
82
85
|
"coherence": "{combined_coherence_percentage or null if naive mode}",
|
|
83
86
|
"externalValidation": "{external_validation_score or null if N/A}"
|
|
84
87
|
},
|
|
85
|
-
"threshold": "{effective_threshold from §1 — CLI --threshold wins, then workflow.default_threshold scalar, then 80}"
|
|
88
|
+
"threshold": "{effective_threshold from §1 — CLI --threshold wins, then pipeline default, then workflow.default_threshold scalar, then 80}"
|
|
86
89
|
}
|
|
87
90
|
```
|
|
88
91
|
|
|
@@ -150,6 +153,85 @@ IF score < threshold → FAIL
|
|
|
150
153
|
|
|
151
154
|
**Tooling-degraded cap:** If the `analysisConfidence` in output frontmatter is `degraded` (python3 missing, frontmatter validator missing, or other degraded state flagged in step 1), the step MUST cap the score at `threshold - 1` BEFORE the PASS/FAIL comparison. This forces a deterministic FAIL until tooling is restored. Do NOT override an INCONCLUSIVE result with the cap — INCONCLUSIVE remains the verdict.
|
|
152
155
|
|
|
156
|
+
### 4b. Threshold Fallback and Evidence Report
|
|
157
|
+
|
|
158
|
+
After §4 determines the result but before §5 recommends the next workflow, check whether a threshold fallback applies. The fallback converts a FAIL into a PASS at the 80% floor when the score is between 80% and the effective threshold, and documents the quality compromise in an evidence report.
|
|
159
|
+
|
|
160
|
+
**Fallback trigger conditions:**
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
IF result == "FAIL"
|
|
164
|
+
AND totalScore >= 80
|
|
165
|
+
AND effective_threshold > 80
|
|
166
|
+
THEN
|
|
167
|
+
→ THRESHOLD FALLBACK triggered
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Do NOT trigger fallback when:**
|
|
171
|
+
- `result == "INCONCLUSIVE"` — the evidence-floor verdict is never overridden by fallback
|
|
172
|
+
- `totalScore < 80` — that is a genuine FAIL (floor not met)
|
|
173
|
+
- `effective_threshold == 80` — there is nothing to fall back from
|
|
174
|
+
|
|
175
|
+
**When fallback triggers:**
|
|
176
|
+
|
|
177
|
+
1. Record `threshold_fallback: true`, `original_threshold: {effective_threshold}`, `fallback_threshold: 80` in workflow context.
|
|
178
|
+
2. Override `result` to `"PASS"`.
|
|
179
|
+
3. Set `effective_threshold = 80` for use by §5/§6/§7/§8.
|
|
180
|
+
4. Generate the evidence report (§4b.1 below).
|
|
181
|
+
|
|
182
|
+
#### 4b.1 Generate Evidence Report
|
|
183
|
+
|
|
184
|
+
Write the evidence report to `{forge_version}/evidence-report-fallback.md`. The report documents the quality compromise for audit purposes.
|
|
185
|
+
|
|
186
|
+
**Read gap entries:** extract findings from the Coverage Analysis and Coherence Analysis sections in `{outputFile}` — list each gap with severity (Critical through Low).
|
|
187
|
+
|
|
188
|
+
**Check for prior remediation:** glob `{forge_version}/test-report-{skill_name}-*.md` for a prior test report. If found, note the path — this implies remediation was attempted between runs. If not found, note "first test run — no prior remediation cycle".
|
|
189
|
+
|
|
190
|
+
**Check for post-score cap:** if Cap 1 or Cap 2 (§3d) fired, note the cap reason in the remediation section: "Score capped due to {cap_reason} — address tooling to test at the higher threshold."
|
|
191
|
+
|
|
192
|
+
**Evidence report template:**
|
|
193
|
+
|
|
194
|
+
```markdown
|
|
195
|
+
# Evidence Report: Threshold Fallback
|
|
196
|
+
|
|
197
|
+
**Skill:** {skill_name}
|
|
198
|
+
**Date:** {ISO-8601 timestamp}
|
|
199
|
+
**Run ID:** {run_id}
|
|
200
|
+
|
|
201
|
+
## Threshold Summary
|
|
202
|
+
|
|
203
|
+
| Field | Value |
|
|
204
|
+
|-------|-------|
|
|
205
|
+
| Attempted Threshold | {original_threshold}% |
|
|
206
|
+
| Achieved Score | {totalScore}% |
|
|
207
|
+
| Threshold Source | {threshold_source} |
|
|
208
|
+
| Final Accepted Threshold | 80% |
|
|
209
|
+
|
|
210
|
+
## Findings Preventing Higher Threshold
|
|
211
|
+
|
|
212
|
+
{For each gap entry from Coverage Analysis and Coherence Analysis:}
|
|
213
|
+
- **{GAP-NNN}: {title}** — Severity: {severity}, Category: {category}
|
|
214
|
+
|
|
215
|
+
{Count: N critical, M high, P medium, Q low, R info findings}
|
|
216
|
+
|
|
217
|
+
## Remediation Context
|
|
218
|
+
|
|
219
|
+
{If prior test report exists:}
|
|
220
|
+
A prior test run was found at `{prior_report_path}`, indicating remediation was attempted between runs.
|
|
221
|
+
|
|
222
|
+
{If no prior test report:}
|
|
223
|
+
No prior test report found for this skill version — this is the first test run.
|
|
224
|
+
|
|
225
|
+
{If post-score cap was active:}
|
|
226
|
+
**Note:** Score was capped due to {cap_reason}. Address tooling limitations to test at the higher threshold.
|
|
227
|
+
|
|
228
|
+
## Conclusion
|
|
229
|
+
|
|
230
|
+
Skill accepted at 80% floor (original target: {original_threshold}%). The {N} findings above prevented meeting the higher threshold. Review and address findings before the next pipeline run to achieve the {original_threshold}% target.
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Record `evidence_report_path: '{forge_version}/evidence-report-fallback.md'` in workflow context for use by §6/§7/§8 and by report.md.
|
|
234
|
+
|
|
153
235
|
### 5. Determine Next Workflow Recommendation
|
|
154
236
|
|
|
155
237
|
Based on test result:
|
|
@@ -203,6 +285,9 @@ Append the **Completeness Score** section to `{outputFile}`:
|
|
|
203
285
|
**Inconclusive Reasons:**
|
|
204
286
|
{bulleted list from script `inconclusiveReasons`}
|
|
205
287
|
|
|
288
|
+
**Threshold Source:** {threshold_source}
|
|
289
|
+
{If threshold_fallback is true:}
|
|
290
|
+
**Threshold Fallback:** scored {totalScore}% against {original_threshold}% target — accepted at 80% floor. Evidence report: {evidence_report_path}
|
|
206
291
|
**Weight Distribution:** {naive (redistributed) | contextual (full)}
|
|
207
292
|
**Tier Adjustment:** {none | Quick tier — signature and type coverage not scored}
|
|
208
293
|
**External Validators:** {both available | skill-check only | tessl only | none — weight redistributed}
|
|
@@ -225,6 +310,8 @@ Update `{outputFile}` frontmatter:
|
|
|
225
310
|
- `testResult: '{pass|pass-with-drift|fail|inconclusive}'` (lowercase; mirrors script `result`, with `pass-with-drift` substituted for `pass` when `allow_workspace_drift` was set and drift was observed — see §5 drift override)
|
|
226
311
|
- `score: '{total}%'`
|
|
227
312
|
- `threshold: '{threshold}%'`
|
|
313
|
+
- `thresholdSource: '{threshold_source}'`
|
|
314
|
+
- When `threshold_fallback` is true, add: `thresholdFallback: true`, `originalThreshold: '{original_threshold}%'`, `evidenceReportPath: '{evidence_report_path}'`
|
|
228
315
|
- `analysisConfidence: '{full|degraded|provenance-map|metadata-only|remote-only|docs-only}'`
|
|
229
316
|
- `nextWorkflow: '{export-skill|update-skill|manual-review}'`
|
|
230
317
|
- Append `'score'` to `stepsCompleted`
|
|
@@ -244,6 +331,8 @@ Update `{outputFile}` frontmatter:
|
|
|
244
331
|
| External Validation | {N}% | {WS}% |
|
|
245
332
|
|
|
246
333
|
**Threshold:** {threshold}%
|
|
334
|
+
{If threshold_fallback is true:}
|
|
335
|
+
**Threshold fallback:** scored {totalScore}% against {original_threshold}% target — accepted at 80% floor. Evidence report: {evidence_report_path}
|
|
247
336
|
**Recommendation:** {export-skill if pass | update-skill if fail}
|
|
248
337
|
|
|
249
338
|
**Proceeding to gap report...**"
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
nextStepFile: 'score.md'
|
|
3
|
+
outputFile: '{forge_version}/test-report-{skill_name}-{run_id}.md'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Config: communicate in {communication_language}. -->
|
|
7
|
+
|
|
8
|
+
# Step 4c: Hard Gate
|
|
9
|
+
|
|
10
|
+
## STEP GOAL:
|
|
11
|
+
|
|
12
|
+
Scan accumulated findings from coverage and coherence analysis for critical or high severity gaps. If any exist, block the pipeline with a clear listing of every blocking finding — no coverage score is computed or reported. If only medium, low, or info findings exist, pass through to scoring.
|
|
13
|
+
|
|
14
|
+
### §1. Read Findings from Output
|
|
15
|
+
|
|
16
|
+
Read `{outputFile}` and scan the **Coverage Analysis** and **Coherence Analysis** sections for GAP entries. Each GAP entry contains a severity marker in this format:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
**Severity:** {Critical|High|Medium|Low|Info}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Extract every line matching `**Severity:** Critical` or `**Severity:** High`. For each match, also capture the parent GAP heading (`### GAP-{NNN}: {title}`) and the `**Source:**` line to build a blocking-findings list.
|
|
23
|
+
|
|
24
|
+
### §2. Evaluate Gate
|
|
25
|
+
|
|
26
|
+
**Count blocking findings** (Critical + High severity).
|
|
27
|
+
|
|
28
|
+
**IF blocking findings exist → BLOCK (§3)**
|
|
29
|
+
|
|
30
|
+
**IF no blocking findings → PASS (§4)**
|
|
31
|
+
|
|
32
|
+
### §3. Block — Critical/High Findings Detected
|
|
33
|
+
|
|
34
|
+
The hard gate blocks the pipeline. No scoring step runs.
|
|
35
|
+
|
|
36
|
+
Update `{outputFile}` frontmatter:
|
|
37
|
+
- Set `testResult: 'fail'`
|
|
38
|
+
- Append `'hard-gate'` to `stepsCompleted`
|
|
39
|
+
|
|
40
|
+
Report to the user:
|
|
41
|
+
|
|
42
|
+
"**Hard gate BLOCKED — {N} critical/high finding(s) must be resolved before scoring.**
|
|
43
|
+
|
|
44
|
+
| # | GAP | Severity | Source |
|
|
45
|
+
|---|-----|----------|--------|
|
|
46
|
+
{for each blocking finding:}
|
|
47
|
+
| {i} | {GAP-NNN}: {title} | {severity} | {source} |
|
|
48
|
+
|
|
49
|
+
**{M} medium/low/info findings also noted (non-blocking).**
|
|
50
|
+
|
|
51
|
+
**Action required:** resolve all Critical and High findings, then re-run test-skill.
|
|
52
|
+
**Recommended next step:** update-skill"
|
|
53
|
+
|
|
54
|
+
**Headless envelope (if `{headless_mode}`):** emit to **stderr**:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
SKF_TEST_RESULT_JSON: {"status":"error","skill_name":"{skill_name}","verdict":"FAIL","score":null,"threshold":null,"report_path":"{outputFile}","next_workflow":"update-skill","exit_code":2,"halt_reason":"hard-gate-blocked"}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
HALT — do not chain to `{nextStepFile}`.
|
|
61
|
+
|
|
62
|
+
### §4. Pass — No Critical/High Findings
|
|
63
|
+
|
|
64
|
+
The hard gate passes. Medium, low, and info findings are documented in the gap report but do not block.
|
|
65
|
+
|
|
66
|
+
Update `{outputFile}` frontmatter:
|
|
67
|
+
- Append `'hard-gate'` to `stepsCompleted`
|
|
68
|
+
|
|
69
|
+
Report:
|
|
70
|
+
|
|
71
|
+
"**Hard gate passed** — {N} medium/low/info finding(s) noted, proceeding to scoring."
|
|
72
|
+
|
|
73
|
+
Update stepsCompleted, then load and execute `{nextStepFile}`.
|
|
@@ -28,6 +28,7 @@ Anchor / Step mapping:
|
|
|
28
28
|
Coverage Analysis → coverage-check
|
|
29
29
|
Coherence Analysis → coherence-check
|
|
30
30
|
External Validation→ external-validators
|
|
31
|
+
(hard gate) → step-hard-gate (reads findings, blocks or passes; no report section)
|
|
31
32
|
Completeness Score → score
|
|
32
33
|
Gap Report → report (includes Discovery Quality subsection)
|
|
33
34
|
-->
|