bmad-module-skill-forge 1.9.0 → 2.0.1
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/.nvmrc +1 -1
- package/README.md +10 -5
- package/docs/_data/pinned.yaml +2 -2
- package/docs/agents.md +11 -2
- package/docs/architecture.md +5 -4
- package/docs/bmad-synergy.md +30 -7
- package/docs/campaign.md +172 -0
- package/docs/examples.md +7 -3
- package/docs/forge-auto.md +90 -0
- package/docs/getting-started.md +9 -0
- package/docs/how-it-works.md +6 -4
- package/docs/index.md +4 -3
- package/docs/skill-model.md +1 -1
- package/docs/troubleshooting.md +17 -1
- package/docs/verifying-a-skill.md +2 -2
- package/docs/why-skf.md +1 -1
- package/docs/workflows.md +64 -24
- package/package.json +2 -2
- package/src/knowledge/skill-lifecycle.md +1 -1
- package/src/module-help.csv +4 -3
- package/src/shared/data/language-corpora.json +32 -0
- package/src/shared/references/pipeline-contracts.md +6 -3
- package/src/shared/scripts/schemas/skill-brief.v1.json +6 -1
- package/src/shared/scripts/skf-comention-pairs.py +350 -0
- package/src/shared/scripts/skf-count-tokens.py +222 -0
- package/src/shared/scripts/skf-derive-assembly-shape.py +107 -0
- package/src/shared/scripts/skf-detect-docs.py +240 -4
- package/src/shared/scripts/skf-detect-language.py +82 -3
- package/src/shared/scripts/skf-detect-tools.py +105 -2
- package/src/shared/scripts/skf-emit-result-envelope.py +17 -0
- package/src/shared/scripts/skf-enumerate-stack-skills.py +111 -2
- package/src/shared/scripts/skf-extract-public-api.py +53 -0
- package/src/shared/scripts/skf-find-cycles.py +246 -0
- package/src/shared/scripts/skf-hash-content.py +487 -2
- package/src/shared/scripts/skf-language-corpora.py +100 -0
- package/src/shared/scripts/skf-manifest-ops.py +67 -1
- package/src/shared/scripts/skf-merge-doc-urls.py +244 -0
- package/src/shared/scripts/skf-preapply.py +1 -1
- package/src/shared/scripts/skf-rebuild-managed-sections.py +180 -0
- package/src/shared/scripts/skf-recommend-scope-type.py +1 -2
- package/src/shared/scripts/skf-render-metadata-stats.py +499 -0
- package/src/shared/scripts/skf-rewrite-skill-name.py +308 -0
- package/src/shared/scripts/skf-shape-detect.py +576 -25
- package/src/shared/scripts/skf-shard-body.py +461 -0
- package/src/shared/scripts/skf-skill-inventory.py +139 -3
- package/src/shared/scripts/skf-structural-diff.py +307 -67
- package/src/shared/scripts/skf-validate-brief-schema.py +41 -6
- package/src/shared/scripts/skf-validate-feasibility-report.py +234 -0
- package/src/shared/scripts/skf-validate-frontmatter.py +17 -12
- package/src/shared/scripts/skf-validate-output.py +443 -10
- package/src/shared/scripts/skf-validate-pins.py +3 -3
- package/src/shared/scripts/skf-verify-no-trace.py +214 -0
- package/src/shared/scripts/skf-verify-provenance-completeness.py +439 -0
- package/src/shared/scripts/skf-write-skill-brief.py +21 -5
- package/src/skf-analyze-source/SKILL.md +17 -32
- package/src/skf-analyze-source/assets/skill-brief-schema.md +1 -1
- package/src/skf-analyze-source/customize.toml +2 -0
- package/src/skf-analyze-source/references/auto-docs-only.md +116 -0
- package/src/skf-analyze-source/references/continue.md +8 -13
- package/src/skf-analyze-source/references/generate-briefs.md +28 -12
- package/src/skf-analyze-source/references/headless-contract.md +33 -0
- package/src/skf-analyze-source/references/health-check.md +1 -2
- package/src/skf-analyze-source/references/identify-units.md +25 -36
- package/src/skf-analyze-source/references/init.md +12 -25
- package/src/skf-analyze-source/references/map-and-detect.md +8 -20
- package/src/skf-analyze-source/references/recommend.md +4 -14
- package/src/skf-analyze-source/references/scan-project.md +3 -11
- package/src/skf-analyze-source/references/step-auto-scope.md +211 -197
- package/src/skf-analyze-source/references/step-shape-detect.md +20 -13
- package/src/skf-analyze-source/references/unit-detection-heuristics.md +2 -2
- package/src/skf-audit-skill/SKILL.md +9 -6
- package/src/skf-audit-skill/customize.toml +2 -0
- package/src/skf-audit-skill/references/init.md +58 -32
- package/src/skf-audit-skill/references/re-index.md +15 -34
- package/src/skf-audit-skill/references/report.md +11 -58
- package/src/skf-audit-skill/references/semantic-diff.md +4 -22
- package/src/skf-audit-skill/references/severity-classify.md +53 -87
- package/src/skf-audit-skill/references/step-doc-drift.md +49 -19
- package/src/skf-audit-skill/references/structural-diff.md +43 -68
- package/src/skf-brief-skill/SKILL.md +7 -36
- package/src/skf-brief-skill/assets/scope-templates.md +1 -1
- package/src/skf-brief-skill/assets/skill-brief-schema.md +1 -1
- package/src/skf-brief-skill/customize.toml +14 -0
- package/src/skf-brief-skill/references/analyze-target.md +13 -18
- package/src/skf-brief-skill/references/confirm-brief.md +2 -15
- package/src/skf-brief-skill/references/draft-checkpoint.md +8 -8
- package/src/skf-brief-skill/references/gather-intent.md +27 -24
- package/src/skf-brief-skill/references/headless-args.md +1 -1
- package/src/skf-brief-skill/references/health-check.md +1 -22
- package/src/skf-brief-skill/references/invocation-contract.md +37 -0
- package/src/skf-brief-skill/references/scope-definition.md +6 -15
- package/src/skf-brief-skill/references/step-auto-brief.md +22 -9
- package/src/skf-brief-skill/references/step-auto-validate.md +3 -7
- package/src/skf-brief-skill/references/version-resolution.md +1 -1
- package/src/skf-brief-skill/references/write-brief.md +19 -13
- package/src/skf-campaign/SKILL.md +121 -0
- package/src/skf-campaign/assets/campaign-state-schema.json +191 -0
- package/src/skf-campaign/customize.toml +75 -0
- package/src/skf-campaign/manifest.yaml +15 -0
- package/src/skf-campaign/references/campaign-contracts.md +67 -0
- package/src/skf-campaign/references/campaign-directive-spec.md +32 -0
- package/src/skf-campaign/references/health-check.md +35 -0
- package/src/skf-campaign/references/step-01-setup.md +121 -0
- package/src/skf-campaign/references/step-02-strategy.md +102 -0
- package/src/skf-campaign/references/step-03-pins.md +56 -0
- package/src/skf-campaign/references/step-04-provenance.md +63 -0
- package/src/skf-campaign/references/step-05-skill-loop.md +103 -0
- package/src/skf-campaign/references/step-06-batch.md +88 -0
- package/src/skf-campaign/references/step-07-capstone.md +63 -0
- package/src/skf-campaign/references/step-08-verify.md +75 -0
- package/src/skf-campaign/references/step-09-refine.md +83 -0
- package/src/skf-campaign/references/step-10-export.md +106 -0
- package/src/skf-campaign/references/step-11-maintenance.md +84 -0
- package/src/skf-campaign/references/step-resume.md +115 -0
- package/src/skf-campaign/scripts/.gitkeep +0 -0
- package/src/skf-campaign/scripts/campaign-deps.py +244 -0
- package/src/skf-campaign/scripts/campaign-parse-manifest.py +119 -0
- package/src/skf-campaign/scripts/campaign-provenance.py +247 -0
- package/src/skf-campaign/scripts/campaign-render-batch.py +199 -0
- package/src/skf-campaign/scripts/campaign-render-kickoff.py +158 -0
- package/src/skf-campaign/scripts/campaign-report.py +249 -0
- package/src/skf-campaign/scripts/campaign-status.py +162 -0
- package/src/skf-campaign/scripts/campaign-validate-pins.py +174 -0
- package/src/skf-campaign/scripts/campaign-validate-state.py +207 -0
- package/src/skf-campaign/templates/campaign-brief-template.yaml +34 -0
- package/src/skf-campaign/templates/campaign-report-template.md +54 -0
- package/src/skf-campaign/templates/kickoff-template.md +48 -0
- package/src/skf-create-skill/SKILL.md +15 -4
- package/src/skf-create-skill/assets/compile-assembly-rules.md +35 -34
- package/src/skf-create-skill/assets/skill-sections.md +9 -100
- package/src/skf-create-skill/assets/tessl-dismissal-rules.md +4 -13
- package/src/skf-create-skill/customize.toml +13 -0
- package/src/skf-create-skill/references/authoritative-files-protocol.md +7 -7
- package/src/skf-create-skill/references/compile.md +37 -47
- package/src/skf-create-skill/references/component-extraction.md +8 -35
- package/src/skf-create-skill/references/ecosystem-check.md +9 -25
- package/src/skf-create-skill/references/enrich.md +4 -17
- package/src/skf-create-skill/references/extract.md +20 -27
- package/src/skf-create-skill/references/extraction-patterns-tracing.md +1 -1
- package/src/skf-create-skill/references/extraction-patterns.md +10 -8
- package/src/skf-create-skill/references/generate-artifacts.md +20 -25
- package/src/skf-create-skill/references/health-check.md +2 -2
- package/src/skf-create-skill/references/load-brief.md +16 -18
- package/src/skf-create-skill/references/report.md +27 -14
- package/src/skf-create-skill/references/source-resolution-protocols.md +4 -4
- package/src/skf-create-skill/references/step-auto-shard.md +52 -25
- package/src/skf-create-skill/references/step-doc-rot.md +33 -15
- package/src/skf-create-skill/references/step-doc-sources.md +13 -4
- package/src/skf-create-skill/references/sub/ccc-discover.md +2 -13
- package/src/skf-create-skill/references/sub/fetch-docs.md +33 -46
- package/src/skf-create-skill/references/sub/fetch-temporal.md +5 -20
- package/src/skf-create-skill/references/tier-degradation-rules.md +6 -8
- package/src/skf-create-skill/references/validate.md +69 -29
- package/src/skf-create-skill/scripts/scan-doc-rot.py +245 -0
- package/src/skf-create-stack-skill/SKILL.md +15 -9
- package/src/skf-create-stack-skill/assets/provenance-map-schema.md +1 -1
- package/src/skf-create-stack-skill/customize.toml +10 -0
- package/src/skf-create-stack-skill/references/compile-stack.md +7 -8
- package/src/skf-create-stack-skill/references/compose-mode-rules.md +2 -13
- package/src/skf-create-stack-skill/references/detect-integrations.md +49 -54
- package/src/skf-create-stack-skill/references/detect-manifests.md +37 -30
- package/src/skf-create-stack-skill/references/generate-output.md +24 -75
- package/src/skf-create-stack-skill/references/init.md +9 -81
- package/src/skf-create-stack-skill/references/manifest-patterns.md +5 -35
- package/src/skf-create-stack-skill/references/parallel-extract.md +12 -27
- package/src/skf-create-stack-skill/references/rank-and-confirm.md +6 -6
- package/src/skf-create-stack-skill/references/report.md +27 -62
- package/src/skf-create-stack-skill/references/validate.md +35 -31
- package/src/skf-drop-skill/SKILL.md +20 -23
- package/src/skf-drop-skill/customize.toml +10 -0
- package/src/skf-drop-skill/references/execute.md +67 -36
- package/src/skf-drop-skill/references/headless-contract.md +18 -0
- package/src/skf-drop-skill/references/health-check.md +1 -13
- package/src/skf-drop-skill/references/report.md +44 -10
- package/src/skf-drop-skill/references/select.md +93 -48
- package/src/skf-drop-skill/scripts/dir-sizes.py +116 -0
- package/src/skf-export-skill/SKILL.md +17 -14
- package/src/skf-export-skill/assets/managed-section-format.md +2 -5
- package/src/skf-export-skill/customize.toml +10 -6
- package/src/skf-export-skill/references/generate-snippet.md +21 -35
- package/src/skf-export-skill/references/load-skill.md +44 -42
- package/src/skf-export-skill/references/multi-skill-mode.md +1 -1
- package/src/skf-export-skill/references/orphan-context-detection.md +11 -3
- package/src/skf-export-skill/references/package.md +27 -33
- package/src/skf-export-skill/references/preflight-snippet-root-probe.md +24 -5
- package/src/skf-export-skill/references/result-envelope.md +28 -0
- package/src/skf-export-skill/references/summary.md +11 -5
- package/src/skf-export-skill/references/token-report.md +42 -24
- package/src/skf-export-skill/references/update-context.md +32 -33
- package/src/skf-forger/SKILL.md +32 -39
- package/src/skf-forger/references/pipeline-mode.md +34 -0
- package/src/skf-forger/scripts/parse-pipeline.py +270 -0
- package/src/skf-quick-skill/SKILL.md +10 -60
- package/src/skf-quick-skill/customize.toml +9 -0
- package/src/skf-quick-skill/references/batch-mode.md +6 -4
- package/src/skf-quick-skill/references/compile.md +15 -52
- package/src/skf-quick-skill/references/ecosystem-check.md +5 -20
- package/src/skf-quick-skill/references/finalize.md +12 -6
- package/src/skf-quick-skill/references/halt-contract.md +54 -0
- package/src/skf-quick-skill/references/health-check.md +3 -4
- package/src/skf-quick-skill/references/quick-extract.md +7 -18
- package/src/skf-quick-skill/references/registry-resolution.md +1 -23
- package/src/skf-quick-skill/references/resolve-target.md +27 -34
- package/src/skf-quick-skill/references/write-and-validate.md +10 -25
- package/src/skf-refine-architecture/SKILL.md +16 -8
- package/src/skf-refine-architecture/customize.toml +9 -0
- package/src/skf-refine-architecture/references/compile.md +10 -8
- package/src/skf-refine-architecture/references/gap-analysis.md +21 -50
- package/src/skf-refine-architecture/references/health-check.md +1 -1
- package/src/skf-refine-architecture/references/improvements.md +9 -25
- package/src/skf-refine-architecture/references/init.md +9 -16
- package/src/skf-refine-architecture/references/issue-detection.md +10 -25
- package/src/skf-refine-architecture/references/refinement-rules.md +4 -16
- package/src/skf-refine-architecture/references/report.md +14 -11
- package/src/skf-rename-skill/SKILL.md +11 -21
- package/src/skf-rename-skill/customize.toml +10 -0
- package/src/skf-rename-skill/references/execute.md +112 -82
- package/src/skf-rename-skill/references/exit-codes.md +12 -0
- package/src/skf-rename-skill/references/report.md +16 -8
- package/src/skf-rename-skill/references/select.md +69 -42
- package/src/skf-rename-skill/scripts/skf-validate-rename-name.py +161 -0
- package/src/skf-setup/SKILL.md +21 -13
- package/src/skf-setup/customize.toml +10 -0
- package/src/skf-setup/references/auto-index.md +11 -10
- package/src/skf-setup/references/ccc-index.md +14 -15
- package/src/skf-setup/references/detect-and-tier.md +10 -8
- package/src/skf-setup/references/report.md +26 -32
- package/src/skf-setup/references/tier-rules.md +2 -32
- package/src/skf-setup/references/write-config.md +9 -10
- package/src/skf-test-skill/SKILL.md +10 -8
- package/src/skf-test-skill/customize.toml +2 -0
- package/src/skf-test-skill/references/coherence-check.md +19 -31
- package/src/skf-test-skill/references/coverage-check.md +111 -67
- package/src/skf-test-skill/references/detect-mode.md +10 -41
- package/src/skf-test-skill/references/external-validators.md +11 -19
- package/src/skf-test-skill/references/init.md +39 -21
- package/src/skf-test-skill/references/migration-section-rules.md +4 -4
- package/src/skf-test-skill/references/report.md +60 -40
- package/src/skf-test-skill/references/score.md +32 -64
- package/src/skf-test-skill/references/scoring-rules.md +6 -62
- package/src/skf-test-skill/references/source-access-protocol.md +15 -5
- package/src/skf-test-skill/references/step-hard-gate.md +1 -3
- package/src/skf-test-skill/scripts/aggregate-coherence.py +276 -0
- package/src/skf-test-skill/scripts/check-metadata-coherence.py +359 -0
- package/src/skf-test-skill/scripts/combine-external-scores.py +190 -0
- package/src/skf-test-skill/scripts/compute-score.py +135 -4
- package/src/skf-test-skill/scripts/reconcile-coverage.py +327 -0
- package/src/skf-test-skill/scripts/validate-inventory.py +251 -0
- package/src/skf-test-skill/scripts/verify-declared-numerator.py +192 -0
- package/src/skf-update-skill/SKILL.md +17 -5
- package/src/skf-update-skill/customize.toml +11 -6
- package/src/skf-update-skill/references/detect-changes.md +48 -36
- package/src/skf-update-skill/references/health-check.md +5 -11
- package/src/skf-update-skill/references/init.md +40 -32
- package/src/skf-update-skill/references/manual-section-rules.md +1 -2
- package/src/skf-update-skill/references/merge-conflict-rules.md +1 -52
- package/src/skf-update-skill/references/merge.md +13 -57
- package/src/skf-update-skill/references/re-extract.md +27 -25
- package/src/skf-update-skill/references/report.md +14 -7
- package/src/skf-update-skill/references/validate.md +32 -30
- package/src/skf-update-skill/references/write.md +86 -51
- package/src/skf-update-skill/scripts/skf-new-file-diff.py +167 -0
- package/src/skf-verify-stack/SKILL.md +11 -21
- package/src/skf-verify-stack/customize.toml +12 -3
- package/src/skf-verify-stack/references/coverage-patterns.md +1 -29
- package/src/skf-verify-stack/references/coverage.md +21 -10
- package/src/skf-verify-stack/references/exit-codes.md +14 -0
- package/src/skf-verify-stack/references/health-check.md +1 -1
- package/src/skf-verify-stack/references/init.md +20 -25
- package/src/skf-verify-stack/references/integration-verification-rules.md +10 -19
- package/src/skf-verify-stack/references/integrations.md +44 -49
- package/src/skf-verify-stack/references/report.md +28 -34
- package/src/skf-verify-stack/references/requirements.md +3 -3
- package/src/skf-verify-stack/references/synthesize.md +36 -39
- package/src/skf-verify-stack/scripts/skf-coverage-tally.py +196 -0
- package/src/skf-verify-stack/scripts/skf-report-delta.py +256 -0
- package/src/skf-verify-stack/scripts/skf-verdict-rollup.py +258 -0
- package/tools/cli/lib/ui.js +3 -2
- package/docs/deepwiki.md +0 -89
- package/src/skf-rename-skill/references/rebuild-context.md +0 -110
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
nextStepFile: 'summary.md'
|
|
3
|
+
# Resolve `{countTokensHelper}` by probing `{countTokensProbeOrder}` in order
|
|
4
|
+
# (installed SKF module path first, src/ dev-checkout fallback); the first
|
|
5
|
+
# existing path wins. The helper emits deterministic per-artifact word/token
|
|
6
|
+
# metrics as JSON so this step renders exact numbers instead of re-reading every
|
|
7
|
+
# reference file to word-count it in-prompt. `tokens` is the char-over-four
|
|
8
|
+
# estimate shared with skf-validate-output.py so all SKF token numbers agree.
|
|
9
|
+
countTokensProbeOrder:
|
|
10
|
+
- '{project-root}/_bmad/skf/shared/scripts/skf-count-tokens.py'
|
|
11
|
+
- '{project-root}/src/shared/scripts/skf-count-tokens.py'
|
|
3
12
|
---
|
|
4
13
|
|
|
5
14
|
<!-- Config: communicate in {communication_language}. Render the token report in {document_output_language}. -->
|
|
@@ -14,27 +23,48 @@ To calculate approximate token counts for all exported artifacts and present a c
|
|
|
14
23
|
|
|
15
24
|
- Focus only on token counting and reporting — read-only measurement
|
|
16
25
|
- Auto-proceed when complete
|
|
17
|
-
- **Multi-skill mode:** when step 1 loaded more than one skill (`len(skill_batch) > 1`),
|
|
26
|
+
- **Multi-skill mode:** when step 1 loaded more than one skill (`len(skill_batch) > 1`), run the helper once per skill, then present one aggregate table with one row per skill (context-snippet.md, SKILL.md, metadata.json, references/, package total). The `managed_section` value is identical across runs (same target files) — measure and report it once for the run. See step 1 §1c.
|
|
18
27
|
|
|
19
28
|
## MANDATORY SEQUENCE
|
|
20
29
|
|
|
21
|
-
### 1.
|
|
30
|
+
### 1. Measure Token Counts
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
Resolve `{countTokensHelper}` from `{countTokensProbeOrder}` (see frontmatter) — the first existing path wins. Then run it against the resolved skill package, passing every target context file so the shared managed section is measured:
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
```bash
|
|
35
|
+
python3 {countTokensHelper} {resolved_skill_package} --target-file {context_file_1} --target-file {context_file_2}
|
|
36
|
+
```
|
|
26
37
|
|
|
27
|
-
|
|
28
|
-
2. **Managed section** — The complete `<!-- SKF:BEGIN/END -->` block (all skills, not just this one)
|
|
29
|
-
3. **SKILL.md** — The full active skill document
|
|
30
|
-
4. **metadata.json** — The machine-readable metadata
|
|
31
|
-
5. **references/** — Total across all reference files (if present)
|
|
32
|
-
6. **Full package total** — Sum of this skill's own artifacts (context-snippet.md + SKILL.md + metadata.json + references/). **Exclude the Managed section row (item 2)** — it is a shared all-skills cost (it bundles this skill's snippet plus every other skill's snippet), reported separately under Context Budget Impact. Including it would double-count this skill's snippet and fold in unrelated skills' costs.
|
|
38
|
+
Pass one `--target-file` per entry in `target_context_files` (resolved in step 1). The helper measures the managed section from the first target file that contains a `<!-- SKF:BEGIN -->…<!-- SKF:END -->` block.
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
The helper emits JSON:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"files": [{"path": "…", "role": "…", "exists": true, "words": 0, "tokens": 0}],
|
|
45
|
+
"references_total": {"count": 0, "words": 0, "tokens": 0},
|
|
46
|
+
"managed_section": {"present": true, "source_file": "…", "words": 0, "tokens": 0},
|
|
47
|
+
"package_total": {"words": 0, "tokens": 0}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Read the JSON — do not re-count words in-prompt.** Each `tokens` value is a char-over-four estimate (`len(text)//4`, the SKF-wide convention shared with `skf-validate-output.py`); each `words` value is the whitespace-split count for the report's Words column. The `files` array carries one row per artifact — `role` is one of `context-snippet`, `skill-md`, `metadata`, `reference`. `package_total` already sums context-snippet.md + SKILL.md + metadata.json + `references_total` and **excludes** the `managed_section` row: the managed section is a shared all-skills cost (it bundles this skill's snippet plus every other skill's snippet), so folding it in would double-count this skill's snippet and pull in unrelated skills. It is reported separately under Context Budget Impact.
|
|
52
|
+
|
|
53
|
+
**If `passive_context` was disabled:** the helper reports the `context-snippet.md` row with `exists: false` and `managed_section.present: false` — render both as "N/A (disabled)".
|
|
54
|
+
|
|
55
|
+
**Graceful fallback (helper cannot run — e.g. no Python/uv on claude.ai web):** count the same artifacts in-prompt using the char-over-four convention (`tokens ≈ len(text)//4`, `words` = whitespace-split count). The JSON shape above documents exactly what to measure: context-snippet.md, SKILL.md, metadata.json, each file under references/ (summed as references_total), and the `<!-- SKF:BEGIN -->…<!-- SKF:END -->` block from the first target context file. The package total sums the first four and excludes the managed section.
|
|
35
56
|
|
|
36
57
|
### 2. Present Token Report
|
|
37
58
|
|
|
59
|
+
Render the table straight from the helper JSON — no re-counting.
|
|
60
|
+
|
|
61
|
+
- `context-snippet.md` row → `files[].tokens` / `.words` for `role: context-snippet`
|
|
62
|
+
- `Managed section` row → `managed_section.words` / `.tokens` (report once for the run)
|
|
63
|
+
- `SKILL.md` row → `files[]` for `role: skill-md`
|
|
64
|
+
- `metadata.json` row → `files[]` for `role: metadata`
|
|
65
|
+
- `references/` row → `references_total.words` / `.tokens`; `{count}` files = `references_total.count`
|
|
66
|
+
- `Package total` row → `package_total.words` / `.tokens`
|
|
67
|
+
|
|
38
68
|
"**Token Report**
|
|
39
69
|
|
|
40
70
|
| Artifact | Words | Est. Tokens | Notes |
|
|
@@ -57,16 +87,4 @@ For each artifact, estimate tokens using the heuristic: **words * 1.3** (approxi
|
|
|
57
87
|
|
|
58
88
|
Display: "**Proceeding to export summary...**"
|
|
59
89
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- After token report is displayed, immediately load, read entire file, then execute {nextStepFile}
|
|
63
|
-
|
|
64
|
-
#### EXECUTION RULES:
|
|
65
|
-
|
|
66
|
-
- This is an auto-proceed step with no user choices
|
|
67
|
-
- Proceed directly to next step after reporting
|
|
68
|
-
|
|
69
|
-
## CRITICAL STEP COMPLETION NOTE
|
|
70
|
-
|
|
71
|
-
ONLY WHEN the token report is displayed will you load and read fully `{nextStepFile}` to execute the export summary.
|
|
72
|
-
|
|
90
|
+
Auto-proceed (no user choices): once the token report is displayed, load, read entirely, and execute `{nextStepFile}`.
|
|
@@ -99,9 +99,9 @@ The helper handles v2-schema enforcement, v1→v2 migration, and the `platforms`
|
|
|
99
99
|
|
|
100
100
|
Determine the set of skills to include in the rebuilt index:
|
|
101
101
|
|
|
102
|
-
1. Start with
|
|
103
|
-
2. For each skill, record its `active_version` from the manifest (v2 schema)
|
|
104
|
-
3.
|
|
102
|
+
1. Start with the manifest `exports` entries that survived the §4a integrity guard — those whose `active_version` resolves to a key in `versions` (if manifest exists)
|
|
103
|
+
2. For each surviving skill, record its `active_version` from the manifest (v2 schema)
|
|
104
|
+
3. The §4a integrity guard already skipped (and warned about) any entry whose `active_version` has no matching `versions` key, so build only from those survivors — no re-check or re-warning here.
|
|
105
105
|
4. **Exclude deprecated skills:** If the `active_version` entry in `versions.{active_version}` has `status: "deprecated"`, skip this skill entirely — it has been dropped via drop-skill workflow and must not appear in the managed section. Log: "Skipping {skill-name} — active version v{active_version} is deprecated"
|
|
106
106
|
5. Add the current export target skill name (ensures it is always included even before manifest is written) — use the version from `{resolved_skill_package}/metadata.json` as its `active_version`
|
|
107
107
|
6. This is the **exported skill set** — each entry has a skill name and its resolved `active_version`
|
|
@@ -114,7 +114,9 @@ Instead of globbing `{skills_output_folder}/*/context-snippet.md`, resolve snipp
|
|
|
114
114
|
1. Resolve `{skill_package}` using the skill's `active_version`: `{skills_output_folder}/{skill-name}/{active_version}/{skill-name}/`
|
|
115
115
|
2. Read `{skill_package}/context-snippet.md`
|
|
116
116
|
3. **If snippet exists:** Add to skill index
|
|
117
|
-
4. **If snippet does not exist at the versioned path:** Check for `active` symlink at `{skills_output_folder}/{skill-name}/active/{skill-name}/context-snippet.md`.
|
|
117
|
+
4. **If snippet does not exist at the versioned path:** Check for `active` symlink at `{skills_output_folder}/{skill-name}/active/{skill-name}/context-snippet.md`.
|
|
118
|
+
5. **If still not found, try the flat layout:** Read `{skills_output_folder}/{skill-name}/context-snippet.md` — a skill still on the pre-versioned flat layout (see `knowledge/version-paths.md` "Migration: Flat to Versioned"). This mirrors the flat-path fallback used when resolving a skill's SKILL.md in `load-skill.md` §1, so a manifest entry (or a first-export `--all` entry) that is still flat on disk is not silently dropped from the managed section.
|
|
119
|
+
6. **If none of the three paths yields a snippet, skip with warning:** "Snippet missing for {skill-name} v{active_version} — skipping from managed section"
|
|
118
120
|
|
|
119
121
|
**Skills NOT in the exported skill set are never scanned** — they have not been through export-skill and must not appear in the managed section (ADR-K).
|
|
120
122
|
|
|
@@ -126,15 +128,21 @@ A managed-section row becomes orphaned when a `[skill-name v...]` entry already
|
|
|
126
128
|
|
|
127
129
|
**Cheap pre-check (always run before §5 assembly).** Scan **every** target context file (not just the first), deduplicate by `(skill_name, version)`, and present one consolidated gate. Asymmetric orphans — a row present in `.cursorrules` but absent from `CLAUDE.md`, or vice versa — must be detected; otherwise the §4 rebuild loop silently overwrites the orphan-bearing file's content (ADR-J violation: silent loss of user content).
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
131
|
+
The parse / dedup-by-`(skill_name, version)` / set-diff-against-the-exported-set is deterministic marker surgery with one correct answer per input — a mis-parsed row silently drops an installed skill from the rebuilt managed section (the ADR-J/K regression this gate guards against). Delegate it to `{rebuildManagedSectionsHelper}` (resolve from `{rebuildManagedSectionsProbeOrder}` in frontmatter — first existing path wins; if no candidate exists, the same HALT as §9 applies: exit code 4, `halt_reason: "context-rebuild-failed"`). Do not re-derive the rows in-prompt.
|
|
132
|
+
|
|
133
|
+
1. Run the detector once across **every** target context file — pass each `target_context_files[].context_file` as a positional argument, and the comma-joined list of skill **names** from the exported skill set built in §4b (version is not needed for the orphan test) as `--exported-skills`:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
python3 {rebuildManagedSectionsHelper} orphan-detect {context-file-1} {context-file-2} … --exported-skills {name1,name2,…}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
2. Set `orphan_managed_rows = result["orphan_managed_rows"]`. The helper reads each context file that exists and has a `<!-- SKF:BEGIN -->` marker, parses its `[skill-name v...]` rows, drops those whose `skill_name` is in the exported set, and deduplicates the survivors by `(skill_name, version)` — first-seen `snippet_text` wins (divergent snippets across files for the same `(skill, version)` are a user-content asymmetry, but `(b) Preserve verbatim` writes one canonical row to every target file, so first-seen is deterministic), and each file the row appears in is appended to a sorted `source_files`. The returned shape is:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{"status": "ok", "orphan_managed_rows": [{"skill_name": "…", "version": "…", "snippet_text": "…", "source_files": ["…"]}]}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Each entry's `snippet_text` is the byte-exact prior snippet (re-emitted unchanged if (b) is chosen — the only surviving copy of an orphan's snippet is this known-exact string, never model-reconstructed); `source_files` carries provenance for the gate display and the audit `deviations[]` entry. A missing file, a file with no marker, or a section with no skill rows contributes nothing — the helper already handles those, so the list is empty in those cases.
|
|
138
146
|
|
|
139
147
|
**If `orphan_managed_rows` is non-empty:** load `references/orphan-row-detection.md` and follow its (a) Drop / (b) Preserve verbatim / (c) Cancel gate protocol. The reference handles user prompting (with per-orphan `source_files` provenance), headless default (Preserve verbatim), `deviations[]` recording (including `source_files` per orphan for audit), and §6 result-contract integration.
|
|
140
148
|
|
|
@@ -211,7 +219,7 @@ Assemble the managed section in **two shapes** — the §9 write paths consume d
|
|
|
211
219
|
**Case 4: Malformed markers (file contains `<!-- SKF:BEGIN` but no `<!-- SKF:END -->`)**
|
|
212
220
|
- Action: HALT (exit code 5, `halt_reason: "malformed-markers"`) with warning: "Malformed SKF markers detected in `{target-file}` — `<!-- SKF:BEGIN` found but `<!-- SKF:END -->` is missing. Please restore the end marker manually before running export."
|
|
213
221
|
- Do NOT attempt to write or append — the file is in an inconsistent state.
|
|
214
|
-
- In headless mode, emit the error envelope per
|
|
222
|
+
- In headless mode, emit the error envelope per `references/result-envelope.md` with `manifest_path: null`, `context_files_updated: []`.
|
|
215
223
|
|
|
216
224
|
### 7. Present Change Preview
|
|
217
225
|
|
|
@@ -253,18 +261,13 @@ Display: "**Select:** [C] Continue — write changes to {target-file} | [X] Canc
|
|
|
253
261
|
|
|
254
262
|
Display: "**Select:** [C] Continue — write changes to all targets | [X] Cancel and exit"
|
|
255
263
|
|
|
256
|
-
####
|
|
257
|
-
|
|
258
|
-
- IF C: Write the changes to all target files (or single target), verify each write succeeded, then load, read entire file, then execute {nextStepFile}
|
|
259
|
-
- IF X (or `cancel` / `exit` / `:q`): Display "Cancelled — no context files were written." and HALT (exit code 6, `halt_reason: "user-cancelled"`). In headless, emit the error envelope per SKILL.md "Result Contract (Headless)" with the resolved `skills`, `context_files_updated: []`, and `manifest_path: null`.
|
|
260
|
-
- IF Any other: help user respond, then [Redisplay Menu Options](#8-present-menu-options)
|
|
264
|
+
#### Gate handling
|
|
261
265
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
-
|
|
265
|
-
- **
|
|
266
|
-
-
|
|
267
|
-
- In dry-run mode, auto-proceed without writing
|
|
266
|
+
- **[C]** — write the changes to all target files (or the single target), verify each write succeeded, then load, read entirely, and execute `{nextStepFile}`.
|
|
267
|
+
- **[X]** / `cancel` / `exit` / `:q` — Display "Cancelled — no context files were written." and HALT (exit code 6, `halt_reason: "user-cancelled"`). In headless, emit the error envelope per `references/result-envelope.md` with the resolved `skills`, `context_files_updated: []`, and `manifest_path: null`.
|
|
268
|
+
- **Any other input** — help the user respond, then redisplay this gate.
|
|
269
|
+
- **Headless** [default C]: auto-approve with [C], log "headless: auto-approve context file update".
|
|
270
|
+
- **Dry-run**: auto-proceed without writing.
|
|
268
271
|
|
|
269
272
|
### 9. Write and Verify (Non-Dry-Run Only)
|
|
270
273
|
|
|
@@ -274,7 +277,7 @@ After user confirms with 'C', resolve the helpers in parallel — these are inde
|
|
|
274
277
|
- `{atomicWriteHelper}` ← first existing path in `{atomicWriteProbeOrder}` (used for Case 1)
|
|
275
278
|
- `{manifestOpsHelper}` ← first existing path in `{manifestOpsProbeOrder}` (used in §9b)
|
|
276
279
|
|
|
277
|
-
If any helper has no existing candidate, HALT (exit code 4, `halt_reason: "context-rebuild-failed"`) and emit the error envelope per
|
|
280
|
+
If any helper has no existing candidate, HALT (exit code 4, `halt_reason: "context-rebuild-failed"`) and emit the error envelope per `references/result-envelope.md` — the rewrite's safety guarantees depend on these helpers and a fall-through to LLM-driven writes would silently regress atomicity, marker preservation, and the Case 4 malformed-marker HARD HALT contract.
|
|
278
281
|
|
|
279
282
|
**Stage content via a shell-safe channel (all cases).** Managed-section snippets routinely contain backticks and `$` — API names like `` `Room::connect(...)` ``, tokens like `$threshold` and `${…}`. Inlining them as a double-quoted shell argument (`--content "…"`) or via `echo "…"` lets bash run command substitution and variable expansion, silently corrupting the written bytes — and because the helper's byte-identity verify runs against the already-corrupted string, it would still report success. No quoting style is safe (content can also contain single quotes, e.g. `'eager' | 'on-demand'`), so **never** inline the section into the command. Instead write the assembled section to a staging file with your file-write tool (which performs no shell interpretation), then feed it to the helper via stdin redirection — the helper reads stdin whenever `--content` is absent:
|
|
280
283
|
|
|
@@ -313,7 +316,7 @@ The helper performs the surgical between-marker swap with post-write verificatio
|
|
|
313
316
|
**Verification (deferred to helpers):** the `replace`/`insert`/`write` actions above each perform their own verification. Treat any non-zero exit as a write failure:
|
|
314
317
|
|
|
315
318
|
- HALT (exit code 4, `halt_reason: "context-rebuild-failed"`) and report `{target-file}: {captured stderr}`.
|
|
316
|
-
- In headless mode, emit the error envelope.
|
|
319
|
+
- In headless mode, emit the error envelope per `references/result-envelope.md`.
|
|
317
320
|
- Continue to the next target file only on success — partial-batch writes are acceptable in single-skill mode but the overall envelope reports per-target outcomes.
|
|
318
321
|
|
|
319
322
|
On success per file, report: "**{target-file} updated successfully.** Verified by `{rebuildManagedSectionsHelper}` (or `{atomicWriteHelper}` for Case 1)."
|
|
@@ -322,7 +325,7 @@ On success per file, report: "**{target-file} updated successfully.** Verified b
|
|
|
322
325
|
|
|
323
326
|
**This section executes ONCE after all context-file iterations complete** (outside the per-context-file loop defined in section 3). Only IDEs whose target context files were successfully written and verified in section 9 are recorded.
|
|
324
327
|
|
|
325
|
-
**`ides` field definition:** `ides` is the list of IDE identifiers from `config.yaml.ides` (e.g. `claude-code`, `cursor`, `github-copilot`) whose context files were successfully written and verified in section 9. It is NOT the context file name (`CLAUDE.md`) and NOT the skill root path (`.claude/skills/`). Each IDE → context file → skill root mapping is defined in `
|
|
328
|
+
**`ides` field definition:** `ides` is the list of IDE identifiers from `config.yaml.ides` (e.g. `claude-code`, `cursor`, `github-copilot`) whose context files were successfully written and verified in section 9. It is NOT the context file name (`CLAUDE.md`) and NOT the skill root path (`.claude/skills/`). Each IDE → context file → skill root mapping is defined in `{managedSectionData}`.
|
|
326
329
|
|
|
327
330
|
1. Read `{skills_output_folder}/.export-manifest.json` (or start with `{"schema_version": "2", "exports": {}}` if it does not exist)
|
|
328
331
|
2. Ensure `schema_version` is `"2"` (if v1 was migrated in section 4a, the migrated structure is already in context). If any version entry still has a legacy `platforms` key, rename it to `ides` in place (see §4a).
|
|
@@ -356,9 +359,5 @@ On success per file, report: "**{target-file} updated successfully.** Verified b
|
|
|
356
359
|
|
|
357
360
|
**Dry-run mode:** Do NOT update the manifest. Display: "**[DRY RUN] Export manifest would be updated for {skill-name-list} — ides: {ides_written}.**" (list every skill in `skill_batch`)
|
|
358
361
|
|
|
359
|
-
**Error handling:** If `{manifestOpsHelper}` exits non-zero, HALT (exit code 4, `halt_reason: "manifest-write-failed"`) with the captured `stderr`. The managed section was already written successfully; the operator's recovery path is to manually reconcile the on-disk managed section with the manifest, then re-run `[EX] Export Skill --all` to refresh the manifest. In headless mode, emit the error envelope per
|
|
360
|
-
|
|
361
|
-
## CRITICAL STEP COMPLETION NOTE
|
|
362
|
-
|
|
363
|
-
ONLY WHEN the user confirms changes by selecting 'C' (or auto-proceed in dry-run) and the write is verified will you load and read fully `{nextStepFile}` to execute the token report.
|
|
362
|
+
**Error handling:** If `{manifestOpsHelper}` exits non-zero, HALT (exit code 4, `halt_reason: "manifest-write-failed"`) with the captured `stderr`. The managed section was already written successfully; the operator's recovery path is to manually reconcile the on-disk managed section with the manifest, then re-run `[EX] Export Skill --all` to refresh the manifest. In headless mode, emit the error envelope per `references/result-envelope.md` with `manifest_path: null` and the partial `context_files_updated` list.
|
|
364
363
|
|
package/src/skf-forger/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Skill compilation specialist — the forge master. Use when the use
|
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Resident agent of the Skill Forge — the central hub that dispatches to specialized workflows across the skill lifecycle (source analysis, briefing, compilation, testing, ecosystem export) while holding one persona for the whole session.
|
|
11
11
|
|
|
12
12
|
## Identity & Principles
|
|
13
13
|
|
|
@@ -43,8 +43,9 @@ Structured reports with inline AST citations during work — no metaphor, no com
|
|
|
43
43
|
| 12 | EX | Package for distribution and inject context into CLAUDE.md/AGENTS.md/.cursorrules | skf-export-skill |
|
|
44
44
|
| 13 | RS | Rename a skill across all its versions (transactional) | skf-rename-skill |
|
|
45
45
|
| 14 | DS | Drop a skill — deprecate (soft) or purge (hard) | skf-drop-skill |
|
|
46
|
-
| 15 |
|
|
47
|
-
| 16 |
|
|
46
|
+
| 15 | — | Orchestrate multi-library skill campaigns with dependency tracking | skf-campaign |
|
|
47
|
+
| 16 | KI | List available knowledge fragments | (inline action) |
|
|
48
|
+
| 17 | WS | Show current lifecycle position and forge tier status | (inline action) |
|
|
48
49
|
|
|
49
50
|
Say "dismiss" or "exit persona" to leave Ferris at any time.
|
|
50
51
|
|
|
@@ -52,9 +53,8 @@ Say "dismiss" or "exit persona" to leave Ferris at any time.
|
|
|
52
53
|
|
|
53
54
|
- **GUARD (config):** Verify `{project-root}/_bmad/skf/config.yaml` exists. If missing — HARD HALT: "**Cannot initialize.** SKF config not found. Run the `skf-setup` skill to initialize your forge environment."
|
|
54
55
|
- **GUARD (sidecar):** Verify `{sidecar_path}` resolves to an actual directory path (not a literal `{sidecar_path}` string). If it does not resolve — HARD HALT: "**Cannot initialize.** `sidecar_path` is not defined in your installed config.yaml. Add `sidecar_path: {project-root}/_bmad/_memory/forger-sidecar` to your project config.yaml and retry. This is a known installer issue with `prompt: false` config variables."
|
|
55
|
-
- Load
|
|
56
|
-
-
|
|
57
|
-
- ONLY write STATE files to `{project-root}/_bmad/_memory/forger-sidecar/` — reading from knowledge/ and workflow files is expected
|
|
56
|
+
- Load `{sidecar_path}/preferences.yaml` and `{sidecar_path}/forge-tier.yaml` in full. If either is absent — a first run before `skf-setup` populated the sidecar — treat it as empty defaults and continue; the first-run path below handles a null tier.
|
|
57
|
+
- Write state files only to `{project-root}/_bmad/_memory/forger-sidecar/`; reading from knowledge/ and workflow files elsewhere is expected.
|
|
58
58
|
- When a workflow step directs knowledge consultation, consult `{project-root}/_bmad/skf/knowledge/skf-knowledge-index.csv` to select the relevant fragment(s) and load only those files. If the CSV is missing or empty, inform the user and continue without knowledge augmentation
|
|
59
59
|
- Load the referenced fragment(s) from `{project-root}/_bmad/skf/` using the path in the `fragment_file` column (e.g., `knowledge/overview.md` resolves to `{project-root}/_bmad/skf/knowledge/overview.md`) before giving recommendations on the topic the step directed
|
|
60
60
|
|
|
@@ -63,54 +63,47 @@ Say "dismiss" or "exit persona" to leave Ferris at any time.
|
|
|
63
63
|
1. Load config from `{project-root}/_bmad/skf/config.yaml` and resolve:
|
|
64
64
|
- `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`, `sidecar_path`, `skills_output_folder`, `forge_data_folder`
|
|
65
65
|
|
|
66
|
-
2. Execute Critical Actions above
|
|
66
|
+
2. Execute the Critical Actions above, loading `preferences.yaml` and `forge-tier.yaml` in parallel.
|
|
67
67
|
|
|
68
|
-
3. **Resolve `{headless_mode}`**:
|
|
68
|
+
3. **Resolve `{headless_mode}`**: `true` if the invocation includes `--headless`/`-H` or preferences sets `headless_mode: true`, else `false`; pass it to all downstream workflows. Headless skips interaction gates, not progress reporting. See `shared/references/headless-gate-convention.md` for gate-type resolution.
|
|
69
69
|
|
|
70
70
|
4. **Detect user context** from forge-tier.yaml:
|
|
71
|
-
- If `tier` is null/missing → first-run user. After greeting, highlight recommended starting paths
|
|
71
|
+
- If `tier` is null/missing → first-run user. After greeting, highlight the recommended starting paths: **SF** (run this first — detects tools, sets the forge tier), **QS** (fastest trial — give a GitHub URL or package name), **BS** (guided path for a high-quality skill from a codebase), **KI** (see available knowledge fragments).
|
|
72
72
|
- If returning user with `compact_greeting: true` in preferences → greet briefly and ask what they'd like to work on. Show the capabilities table only if they ask.
|
|
73
73
|
- Otherwise → present the full capabilities table.
|
|
74
74
|
|
|
75
75
|
5. **Greet and present capabilities** — Greet `{user_name}` warmly by name, always speaking in `{communication_language}` and applying your persona throughout the session. Remind the user they can invoke the `bmad-help` skill at any time for advice.
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
The menu is a choice point — wait for the user's input rather than firing a workflow they never picked. Accept a number, a menu code, or a fuzzy command match.
|
|
78
78
|
|
|
79
|
-
**
|
|
79
|
+
6. **Surface any interrupted pipeline** — glob `{sidecar_path}/pipeline-result-latest.json`. If it exists and its overall pipeline status (`summary.status`) is `failed` or `partial`, read the recorded per-step status for the workflow it halted on and the workflows still pending, and include a resume offer in the greeting as the recommended next action. Accepting it re-enters Pipeline Mode with the pending codes; the user may pick any menu code instead. If the file is absent or its status is `success`, stay silent.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
**Dispatch** — when the user responds with a code, number, or command:
|
|
82
|
+
|
|
83
|
+
- **Multiple codes** (space- or arrow-separated, or a pipeline alias) → enter **Pipeline Mode** below.
|
|
84
|
+
- **`KI` or `WS`** → run the matching handler under **Inline Actions** below (these rows carry no registered skill).
|
|
85
|
+
- **Any other single code** → invoke the skill named in its Capabilities row, by that exact name. Dispatching to a name not in the table invents a capability that does not exist, so match the input to an exact registered skill first.
|
|
86
|
+
- If a delegated workflow fails or is interrupted, acknowledge the failure, summarize what happened, and re-present the capabilities menu.
|
|
87
|
+
|
|
88
|
+
## Inline Actions
|
|
82
89
|
|
|
83
|
-
|
|
90
|
+
These menu codes resolve to a handler here, not a registered skill:
|
|
91
|
+
|
|
92
|
+
- **KI** — Load and display `{project-root}/_bmad/skf/knowledge/skf-knowledge-index.csv`, the cross-cutting knowledge fragments available for JiT loading. If the CSV is missing, inform the user and suggest running SF (setup).
|
|
93
|
+
- **WS** — Show the current lifecycle position, active skill briefs, and forge tier status.
|
|
94
|
+
|
|
95
|
+
## Pipeline Mode
|
|
84
96
|
|
|
85
|
-
|
|
97
|
+
When the user provides multiple workflow codes (e.g. `BS CS TS EX`, `QS TS EX`) or a pipeline alias (`forge`, `forge-auto`, `forge-quick`, `maintain`), execute them as a chained pipeline. Load `references/pipeline-mode.md` for the run procedure — parsing, sequence validation, the execute loop, circuit breakers, result contract, and special behaviors — and `shared/references/pipeline-contracts.md` for the alias, data-flow, and threshold tables.
|
|
86
98
|
|
|
87
|
-
|
|
88
|
-
**Alias lifecycle:** When the parsed alias is `onboard`, emit a deprecation notice **before** expanding the alias and **before** pipeline progress reporting begins. Emit on **every** invocation — this is not a one-time warning. After emitting the notice, expand `onboard` → `AN CS TS EX` as normal (no behavioral change — existing 80% default threshold applies):
|
|
99
|
+
Only the alias names need recognizing here; `pipeline-mode.md` step 1 expands them against the pipeline-contracts.md table. One expansion is pinned here because its test gate is non-default: `forge-auto` → `AN[auto] BS[auto] CS TS[min:90] EX`, whose `TS[min:90]` matches init.md §1b's `forge-auto` → 90. Each chained workflow runs with `{pipeline_alias}` set to the alias name (`forge-auto`, `forge`, `forge-quick`, `maintain`) or `null` for ad-hoc code sequences.
|
|
89
100
|
|
|
90
|
-
|
|
101
|
+
Two alias gotchas must be caught here, at recognition, before that procedure runs:
|
|
91
102
|
|
|
92
|
-
|
|
93
|
-
3. **Set `{headless_mode}` = true** — pipelines auto-activate headless mode for all workflows in the chain. The user committed to the sequence by providing it.
|
|
94
|
-
4. **Execute left to right** — for each workflow in the sequence:
|
|
95
|
-
- a. **Report start**: "Pipeline [{current}/{total}]: Starting {code} ({description})..."
|
|
96
|
-
- b. **Resolve inputs** from the previous workflow's output using the Data Flow table in pipeline-contracts.md. If the previous workflow produced a `skill_name`, `brief_path`, or other handoff data, pass it as the input argument.
|
|
97
|
-
- c. **Invoke the workflow** with `{headless_mode}` = true, `{pipeline_alias}` set to the alias name (`deepwiki`, `forge`, `forge-quick`, `onboard`, `maintain`, or `null` for ad-hoc sequences), and any resolved arguments.
|
|
98
|
-
- d. **Check circuit breaker** after completion. Load the output artifact and validate against the threshold (default or user-specified via `[min:N]`). If the check fails: halt the pipeline, report what completed and what remains.
|
|
99
|
-
- e. **Report completion**: "Pipeline [{current}/{total}]: {code} complete — {brief summary of output}."
|
|
100
|
-
5. **Pipeline summary** — after all workflows complete (or on halt), present a summary:
|
|
101
|
-
- Completed workflows with key outputs
|
|
102
|
-
- Failed/halted workflow (if any) with the halt reason
|
|
103
|
-
- Remaining workflows that were not executed
|
|
104
|
-
- Next steps recommendation
|
|
105
|
-
6. **Result Contract** — write the pipeline result contract per `shared/references/output-contract-schema.md`: the per-run record at `{sidecar_path}/pipeline-result-{YYYYMMDD-HHmmss}.json` (UTC timestamp, resolution to seconds) and a copy at `{sidecar_path}/pipeline-result-latest.json` (stable path for pipeline consumers — copy, not symlink). Include one entry per completed workflow in `outputs` (referencing each workflow's own `-latest.json` result record); include per-step status and the overall pipeline status in `summary`.
|
|
103
|
+
**Deprecated (`deepwiki`):** expand it exactly as `forge-auto` and set `{pipeline_alias}` = `forge-auto`, but first emit a one-time notice:
|
|
106
104
|
|
|
107
|
-
|
|
105
|
+
> ⚠️ **`deepwiki` is now `forge-auto`.** The alias was renamed to avoid confusion with the DeepWiki MCP — this pipeline auto-forges a verified skill from source and does **not** call that MCP. `deepwiki` still works as a deprecated alias; prefer `forge-auto <repo-url>` going forward.
|
|
108
106
|
|
|
109
|
-
**
|
|
110
|
-
- `AN` in a pipeline with `CS`: if AN produces multiple recommended briefs, auto-select all and process sequentially in batch mode. If only one unit found, auto-select it.
|
|
111
|
-
- `AS` followed by `US`: if `summary.severity` in `audit-skill-result-latest.json` is CLEAN, skip US and report "No drift detected — skipping update."
|
|
112
|
-
- `TS` followed by `EX`: if test result is FAIL and score is below the circuit breaker threshold, halt before EX.
|
|
107
|
+
**Removed (`onboard`):** do NOT expand it. HALT with:
|
|
113
108
|
|
|
114
|
-
**
|
|
115
|
-
- **KI**: Load and display `{project-root}/_bmad/skf/knowledge/skf-knowledge-index.csv` — cross-cutting knowledge fragments available for JiT loading. If the CSV is missing, inform the user and suggest running SF (setup).
|
|
116
|
-
- **WS**: Show current lifecycle position, active skill briefs, and forge tier status.
|
|
109
|
+
> 🚫 **onboard has been removed.** Use `forge-auto <repo-url>` instead. forge-auto auto-scopes, auto-briefs, and tests at 90% quality. Run `forge-auto` with any GitHub URL, doc URL, or `--pin <version>`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Pipeline Mode Execution
|
|
2
|
+
|
|
3
|
+
The forger enters this procedure when the user supplies multiple workflow codes (e.g. `BS CS TS EX`, `QS TS EX`) or a pipeline alias (`forge`, `forge-auto`, `forge-quick`, `maintain`). It chains the workflows left to right, forwarding each output to the next input.
|
|
4
|
+
|
|
5
|
+
Load `shared/references/pipeline-contracts.md` for the alias-expansion table, the Data Flow output→input map, circuit-breaker thresholds, bracket syntax, and the anti-pattern list. This file covers the run procedure that consumes those tables.
|
|
6
|
+
|
|
7
|
+
## Activation
|
|
8
|
+
|
|
9
|
+
1. **Parse the sequence** — run `uv run scripts/parse-pipeline.py '<sequence>'` (from the skf-forger skill root). It tokenizes (space or arrow separated), expands aliases, classifies each bracket argument (`CS[cocoindex]` → target, `TS[min:80]` → circuit-breaker override, `AN[auto]` → mode flag), and returns the normalized `plan`/`codes` plus any `anti_patterns` as JSON. Consume that output rather than re-deriving the expansion or checks by hand. `deepwiki`/`onboard` are already resolved at recognition before this procedure runs, so the sequence reaching this step is normalized. If the script cannot run, fall back to expanding aliases against the pipeline-contracts.md alias table and applying its anti-pattern table by hand.
|
|
10
|
+
|
|
11
|
+
2. **Validate the sequence** — the parse output's `anti_patterns` array already lists any matches (EX before TS, CS without a brief, duplicate codes, US without AS), each with a message and suggestion. If it is non-empty, warn the user and ask to confirm or adjust. In `{headless_mode}`, warn but proceed.
|
|
12
|
+
|
|
13
|
+
3. **Force `{headless_mode}` = true** — pipelines auto-activate headless mode for every workflow in the chain; the user committed to the sequence by providing it.
|
|
14
|
+
|
|
15
|
+
4. **Execute left to right** — for each workflow:
|
|
16
|
+
- a. **Report start:** "Pipeline [{current}/{total}]: Starting {code} ({description})..."
|
|
17
|
+
- b. **Resolve inputs** from the previous workflow's output using the Data Flow table in pipeline-contracts.md. Pass any produced `skill_name`, `brief_path`, or other handoff data as the input argument.
|
|
18
|
+
- c. **Invoke the workflow** with `{headless_mode}` = true, `{pipeline_alias}` set to the alias name (`forge-auto`, `forge`, `forge-quick`, `maintain`, or `null` for ad-hoc sequences), and any resolved arguments.
|
|
19
|
+
- d. **Check the circuit breaker** after completion — load the output artifact and validate it against the threshold (default, or user-specified via `[min:N]`). On failure, halt the pipeline and report what completed and what remains.
|
|
20
|
+
- e. **Report completion:** "Pipeline [{current}/{total}]: {code} complete — {brief summary of output}."
|
|
21
|
+
|
|
22
|
+
5. **Pipeline summary** — after all workflows complete (or on halt), present: completed workflows with key outputs; the failed/halted workflow (if any) with its halt reason; remaining unexecuted workflows; and a next-steps recommendation.
|
|
23
|
+
|
|
24
|
+
6. **Result contract** — write the pipeline result contract per `shared/references/output-contract-schema.md`: the per-run record at `{sidecar_path}/pipeline-result-{YYYYMMDD-HHmmss}.json` (UTC timestamp, resolution to seconds) and a copy at `{sidecar_path}/pipeline-result-latest.json` (stable path for consumers — copy, not symlink). Include one entry per completed workflow in `outputs` (each referencing that workflow's own `-latest.json` record); record per-step status for every workflow in the sequence — completed, halted, and not-yet-run — plus the overall pipeline status (`summary.status` — one of `success`, `failed`, or `partial`) in `summary`. On a `failed`/`partial` status, the forger's On Activation resume check reads that per-step record to offer continuation of the not-yet-run workflows.
|
|
25
|
+
|
|
26
|
+
## forge-auto argument passing
|
|
27
|
+
|
|
28
|
+
`forge-auto <repo-url> --pin <version>` — the `--pin` argument flows to AN's pipeline data context alongside the `[auto]` flag. AN's `step-auto-scope.md §0b` consumes it for pin resolution.
|
|
29
|
+
|
|
30
|
+
## Special behaviors
|
|
31
|
+
|
|
32
|
+
- **`AN` with `CS`:** if AN produces multiple recommended briefs, auto-select all and process them sequentially in batch mode. If only one unit is found, auto-select it.
|
|
33
|
+
- **`AS` followed by `US`:** if `summary.severity` in `audit-skill-result-latest.json` is CLEAN, skip US and report "No drift detected — skipping update."
|
|
34
|
+
- **`TS` followed by `EX`:** if the test result is FAIL and the score is below the circuit-breaker threshold, halt before EX.
|