bmad-module-skill-forge 2.0.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/docs/_data/pinned.yaml +1 -1
- package/package.json +2 -2
- package/src/knowledge/skill-lifecycle.md +1 -1
- package/src/module-help.csv +2 -2
- 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-detect-docs.py +232 -1
- package/src/shared/scripts/skf-detect-language.py +77 -0
- package/src/shared/scripts/skf-detect-tools.py +105 -2
- package/src/shared/scripts/skf-enumerate-stack-skills.py +111 -2
- 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-manifest-ops.py +67 -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-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 +39 -1
- 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 +1 -1
- package/src/shared/scripts/skf-verify-no-trace.py +214 -0
- package/src/shared/scripts/skf-verify-provenance-completeness.py +439 -0
- package/src/skf-analyze-source/SKILL.md +17 -32
- 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 +42 -180
- 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/customize.toml +14 -0
- package/src/skf-brief-skill/references/analyze-target.md +6 -14
- package/src/skf-brief-skill/references/confirm-brief.md +2 -14
- package/src/skf-brief-skill/references/draft-checkpoint.md +8 -8
- package/src/skf-brief-skill/references/gather-intent.md +19 -22
- 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 +4 -14
- package/src/skf-brief-skill/references/step-auto-brief.md +1 -5
- package/src/skf-brief-skill/references/step-auto-validate.md +1 -5
- package/src/skf-brief-skill/references/version-resolution.md +1 -1
- package/src/skf-brief-skill/references/write-brief.md +17 -10
- package/src/skf-campaign/SKILL.md +15 -84
- package/src/skf-campaign/customize.toml +2 -0
- package/src/skf-campaign/manifest.yaml +4 -0
- package/src/skf-campaign/references/campaign-contracts.md +67 -0
- package/src/skf-campaign/references/campaign-directive-spec.md +14 -103
- package/src/skf-campaign/references/step-01-setup.md +4 -5
- package/src/skf-campaign/references/step-02-strategy.md +8 -3
- package/src/skf-campaign/references/step-03-pins.md +1 -1
- package/src/skf-campaign/references/step-04-provenance.md +1 -1
- package/src/skf-campaign/references/step-05-skill-loop.md +1 -1
- package/src/skf-campaign/references/step-06-batch.md +7 -6
- package/src/skf-campaign/references/step-11-maintenance.md +2 -2
- package/src/skf-campaign/references/step-resume.md +9 -8
- package/src/skf-campaign/scripts/campaign-deps.py +10 -1
- package/src/skf-campaign/scripts/campaign-render-batch.py +199 -0
- package/src/skf-campaign/scripts/campaign-status.py +162 -0
- package/src/skf-campaign/templates/campaign-brief-template.yaml +1 -1
- package/src/skf-create-skill/SKILL.md +14 -3
- package/src/skf-create-skill/assets/compile-assembly-rules.md +17 -38
- 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 +34 -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 +14 -29
- package/src/skf-create-skill/references/extraction-patterns-tracing.md +1 -1
- package/src/skf-create-skill/references/extraction-patterns.md +7 -7
- package/src/skf-create-skill/references/generate-artifacts.md +9 -23
- package/src/skf-create-skill/references/health-check.md +1 -1
- package/src/skf-create-skill/references/load-brief.md +16 -18
- package/src/skf-create-skill/references/report.md +12 -15
- package/src/skf-create-skill/references/source-resolution-protocols.md +3 -3
- package/src/skf-create-skill/references/step-auto-shard.md +52 -25
- package/src/skf-create-skill/references/step-doc-rot.md +30 -12
- package/src/skf-create-skill/references/step-doc-sources.md +2 -2
- package/src/skf-create-skill/references/sub/ccc-discover.md +2 -13
- package/src/skf-create-skill/references/sub/fetch-docs.md +8 -50
- 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 +59 -28
- 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 +51 -31
- 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 +42 -10
- package/src/skf-drop-skill/references/select.md +88 -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 +27 -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 +14 -7
- package/src/skf-refine-architecture/customize.toml +9 -0
- package/src/skf-refine-architecture/references/compile.md +9 -7
- 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 +13 -10
- 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 +107 -78
- 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 +20 -12
- package/src/skf-setup/customize.toml +10 -0
- package/src/skf-setup/references/auto-index.md +9 -10
- package/src/skf-setup/references/ccc-index.md +14 -15
- package/src/skf-setup/references/detect-and-tier.md +6 -8
- package/src/skf-setup/references/report.md +22 -31
- 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 +109 -75
- 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 +38 -20
- 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 +6 -6
- 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 +131 -1
- 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 +14 -0
- package/src/skf-update-skill/references/detect-changes.md +19 -37
- package/src/skf-update-skill/references/health-check.md +3 -9
- package/src/skf-update-skill/references/init.md +39 -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 +12 -24
- 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/src/skf-rename-skill/references/rebuild-context.md +0 -110
|
@@ -34,7 +34,7 @@ Continue to step 2.
|
|
|
34
34
|
Before searching, check which QMD collections are available:
|
|
35
35
|
|
|
36
36
|
1. Read the sidecar `forge-tier.yaml` to get registered `qmd_collections` entries
|
|
37
|
-
2. Identify which collections contain enrichment context — collections with `type` equal to `"temporal"` (issues, PRs, changelogs) or `"docs"` (fetched external documentation). Do
|
|
37
|
+
2. Identify which collections contain enrichment context — collections with `type` equal to `"temporal"` (issues, PRs, changelogs) or `"docs"` (fetched external documentation). Do not include `"extraction"` or `"brief"` type collections.
|
|
38
38
|
3. **If no enrichment collections exist** (no `"temporal"` or `"docs"` type collections): report this and auto-proceed. Display:
|
|
39
39
|
|
|
40
40
|
"**Enrichment: no enrichment collections available.**
|
|
@@ -66,7 +66,7 @@ For each function, derive the **module context** from the extraction inventory's
|
|
|
66
66
|
|
|
67
67
|
**Tool resolution for qmd_bridge:** QMD MCP exposes a single `query` tool that accepts a `searches[]` array. Each entry has a `type` field — `'lex'` for BM25 keyword search, `'vec'` for semantic vector search, `'hyde'` for hypothetical-document retrieval — plus `query` and `intent` fields. Claude Code: `mcp__plugin_qmd-plugin_qmd__query`. Cursor: qmd MCP server. CLI: `qmd search "{query}"` (BM25) / `qmd vector-search "{query}"` (semantic). See `knowledge/tool-resolution.md`.
|
|
68
68
|
|
|
69
|
-
**Tool probe (graceful degradation):** If any tool-not-found error surfaces while invoking `query` (e.g., legacy `vector_search` still expected by an older client, or a bridge returns "tool not registered"), treat it as a non-fatal failure for that function's enrichment and continue with the remaining functions. Do
|
|
69
|
+
**Tool probe (graceful degradation):** If any tool-not-found error surfaces while invoking `query` (e.g., legacy `vector_search` still expected by an older client, or a bridge returns "tool not registered"), treat it as a non-fatal failure for that function's enrichment and continue with the remaining functions. Do not retry against the stale `vector_search` tool name — that name was removed from the QMD MCP server. Record the degradation in context for the evidence report.
|
|
70
70
|
|
|
71
71
|
**For each QMD result:**
|
|
72
72
|
|
|
@@ -108,20 +108,7 @@ Display brief enrichment summary:
|
|
|
108
108
|
|
|
109
109
|
Proceeding to compilation..."
|
|
110
110
|
|
|
111
|
-
### 6.
|
|
111
|
+
### 6. Auto-Proceed
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
After enrichment is complete (or skipped for non-Deep tiers), immediately load, read entire file, then execute `{nextStepFile}`.
|
|
116
|
-
|
|
117
|
-
#### EXECUTION RULES:
|
|
118
|
-
|
|
119
|
-
- This is an auto-proceed step with no user choices
|
|
120
|
-
- Quick/Forge/Forge+ tiers skip directly to next step with no output
|
|
121
|
-
- Deep tier displays brief enrichment summary then auto-proceeds
|
|
122
|
-
- QMD failures do not halt — degrade and proceed
|
|
123
|
-
|
|
124
|
-
## CRITICAL STEP COMPLETION NOTE
|
|
125
|
-
|
|
126
|
-
ONLY WHEN enrichment is complete (Deep tier) or the step is skipped (Quick/Forge/Forge+) will you proceed to load `{nextStepFile}` for SKILL.md compilation.
|
|
113
|
+
No user interaction. After enrichment completes (or is skipped for non-Deep tiers), load `{nextStepFile}`, read it fully, then execute it.
|
|
127
114
|
|
|
@@ -55,7 +55,7 @@ Load `{extractionPatternsData}` completely. Identify the strategy for the curren
|
|
|
55
55
|
|
|
56
56
|
From the brief, apply scope and pattern filters:
|
|
57
57
|
|
|
58
|
-
- `scope.type` — determines what to extract (e.g., `full-library`, `specific-modules`, `public-api`, `component-library`, `reference-app`, `docs-only`). Use `reference-app` when the source is a whole app and the skill's value is wiring patterns rather than public exports (embedded-sidecar reference apps, CLI-demo repos, integration-pattern demonstrators). `reference-app` triggers the compile-assembly overrides in `assets/compile-assembly-rules.md` that replace "Key API Summary" with a "Pattern Surface" section and make `stats.exports_documented` semantics pattern-oriented. Do
|
|
58
|
+
- `scope.type` — determines what to extract (e.g., `full-library`, `specific-modules`, `public-api`, `component-library`, `reference-app`, `docs-only`). Use `reference-app` when the source is a whole app and the skill's value is wiring patterns rather than public exports (embedded-sidecar reference apps, CLI-demo repos, integration-pattern demonstrators). `reference-app` triggers the compile-assembly overrides in `assets/compile-assembly-rules.md` that replace "Key API Summary" with a "Pattern Surface" section and make `stats.exports_documented` semantics pattern-oriented. Do not pick `full-library` for reference apps — downstream assembly will remap wiring onto export slots, producing fuzzy counts and an awkward SKILL.md.
|
|
59
59
|
- `scope.include` — file globs to include
|
|
60
60
|
- `scope.exclude` — file globs to exclude
|
|
61
61
|
|
|
@@ -65,7 +65,7 @@ Build the filtered file list from the source tree resolved in step 1. Record the
|
|
|
65
65
|
|
|
66
66
|
**Skip this section entirely if `source_type: "docs-only"`** — there is no source tree to scan.
|
|
67
67
|
|
|
68
|
-
Load `{authoritativeFilesProtocol}` and execute it. The full protocol (heuristic scan list, helper invocation, classification dispatch, prompt flow, P/S/U decision-apply, summary, provenance-map handoff, downstream consumption) lives there.
|
|
68
|
+
Load `{authoritativeFilesProtocol}` and execute it. The full protocol (heuristic scan list, helper invocation, classification dispatch, prompt flow, P/S/U decision-apply, summary, provenance-map handoff, downstream consumption) lives there.
|
|
69
69
|
|
|
70
70
|
Briefly: scan the source tree for authoritative AI documentation files (`llms.txt`, `AGENTS.md`, `.cursorrules`, etc.) that the brief's scope filters may have excluded. The `{resolveAuthoritativeFilesHelper}` helper does the deterministic work (walk, scope diff, amendment reconcile, preview load, hashing); the LLM applies the resulting `unresolved[]` prompt loop. Promoted decisions are persisted to the brief immediately so re-runs replay deterministically.
|
|
71
71
|
|
|
@@ -95,7 +95,7 @@ Then run CCC indexing and discovery on the resolved clone (workspace or ephemera
|
|
|
95
95
|
|
|
96
96
|
2. **Initialize index (first time only):** Run `cd {remote_clone_path} && ccc init`. If init exits non-zero with `A parent directory has a project marker` — the common case when the clone is nested under a ccc-indexed project (e.g. a `.forge-sources/` checkout inside this repo) — re-run as `cd {remote_clone_path} && ccc init -f` to initialize at the subtree anyway (same handling as step 7 §6b). If init fails for any other reason, or the `-f` retry also fails, set `{ccc_discovery: []}` and continue — this is not an error.
|
|
97
97
|
|
|
98
|
-
**Apply standard exclusions:** After `ccc init`, apply generic build/dependency exclusions to `{remote_clone_path}/.cocoindex_code/settings.yml`. These are standard artifact patterns,
|
|
98
|
+
**Apply standard exclusions:** After `ccc init`, apply generic build/dependency exclusions to `{remote_clone_path}/.cocoindex_code/settings.yml`. These are standard artifact patterns, not SKF-specific paths (the workspace checkout is a source repo, not an SKF project):
|
|
99
99
|
|
|
100
100
|
```
|
|
101
101
|
node_modules/, dist/, build/, .git/, vendor/, __pycache__/, .cache/, .next/, .nuxt/, target/, out/, .venv/, .tox/
|
|
@@ -103,7 +103,7 @@ Then run CCC indexing and discovery on the resolved clone (workspace or ephemera
|
|
|
103
103
|
|
|
104
104
|
Read `settings.yml`, append any patterns not already present to the `exclude_patterns` array, write back. **Reuse check:** if an existing `.cocoindex_code/settings.yml` was already present (workspace hit), read its `exclude_patterns` first and diff against the standard-exclusion list above. If ANY standard entry is missing from the existing list, append only the missing entries (preserving any user-added patterns) AND force a re-index by running `ccc index --force` (or the equivalent rebuild flag). If every standard entry is already present, skip the write and skip the forced re-index — the existing index is valid. Record `ccc_exclusions_augmented: {count}` in context for the evidence report.
|
|
105
105
|
|
|
106
|
-
**Note:** Brief-specific `include_patterns` and `exclude_patterns` are
|
|
106
|
+
**Note:** Brief-specific `include_patterns` and `exclude_patterns` are not written to `settings.yml`. The CCC index is general-purpose — it indexes everything (minus standard artifacts). Brief-specific filtering happens at search result time, not index time. This allows a single workspace CCC index to serve multiple briefs with different scope filters.
|
|
107
107
|
|
|
108
108
|
3. **Index the clone:** Run `cd {remote_clone_path} && ccc index` with an extended timeout or in background mode. Indexing can take several minutes on large codebases (1000+ files). Verify completion with `ccc status`, then **verify integrity**: a non-zero `Chunks`/`Files` total is not sufficient — read the `Languages:` breakdown and confirm the source's primary language (`{brief.language}`) reports a non-trivial chunk count. An index dominated by `markdown`/config chunks with the source language absent or near-zero means `ccc index` ran against degraded settings (a stale `.cocoindex_code/` inherited from a parent, or a no-op init over a prior partial index) and the source code was never indexed — searches over it return nothing useful. When the source language is absent, rebuild from a clean init: `cd {remote_clone_path} && ccc init -f` then `ccc index`, and re-check the `Languages:` breakdown. If indexing fails, or the source language is still missing after a forced re-init, set `{ccc_discovery: []}` and continue — this is not an error.
|
|
109
109
|
|
|
@@ -118,13 +118,13 @@ Then run CCC indexing and discovery on the resolved clone (workspace or ephemera
|
|
|
118
118
|
|
|
119
119
|
If `remote_clone_type == "workspace"` and an existing index was reused, append: "(reused workspace index)"
|
|
120
120
|
|
|
121
|
-
7. **On failure:** Set `{ccc_discovery: []}`. Display: "CCC discovery unavailable — proceeding with standard extraction." Do
|
|
121
|
+
7. **On failure:** Set `{ccc_discovery: []}`. Display: "CCC discovery unavailable — proceeding with standard extraction." Do not halt.
|
|
122
122
|
|
|
123
123
|
**CCC Discovery Integration (Forge+ and Deep with ccc only):**
|
|
124
124
|
|
|
125
125
|
If `{ccc_discovery}` is in context and non-empty (populated by step 2b or deferred discovery above):
|
|
126
126
|
- Sort the filtered file list by CCC relevance score: files appearing in `{ccc_discovery}` results move to the front of the extraction queue, sorted by their relevance score descending
|
|
127
|
-
- Files
|
|
127
|
+
- Files not in CCC results remain in the queue after ranked files — they are not excluded, only deprioritized
|
|
128
128
|
- Display: "**CCC discovery: {N} files pre-ranked by semantic relevance** — extraction will prioritize these first."
|
|
129
129
|
|
|
130
130
|
If `{ccc_discovery}` is empty or not in context: proceed with existing file ordering (no change to current behavior).
|
|
@@ -168,13 +168,13 @@ Source resolution, version reconciliation, and CCC discovery were completed in s
|
|
|
168
168
|
|
|
169
169
|
**Forge/Forge+/Deep Tier (AST available):**
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
Before executing AST extraction, load the **AST Extraction Protocol** section from `{extractionPatternsData}`. Follow the decision tree based on the file count from step 1's file tree — it determines whether to use the MCP tool, scoped YAML rules, or CLI streaming. Do not use `ast-grep --json` (without `=stream`) — it loads the entire result set into memory and fails on large codebases; use the explicit `run` subcommand with streaming: `ast-grep run -p '{pattern}' --json=stream`.
|
|
172
172
|
|
|
173
173
|
1. Detect language from brief or file extensions
|
|
174
174
|
2. Follow the AST Extraction Protocol decision tree from `{extractionPatternsData}`:
|
|
175
175
|
- ≤100 files: use `find_code()` MCP tool with `max_results` and `output_format="text"`
|
|
176
176
|
- ≤500 files: use `find_code_by_rule()` MCP tool with scoped YAML rules
|
|
177
|
-
- >500 files: use CLI `--json=stream` with line-by-line streaming Python —
|
|
177
|
+
- >500 files: use CLI `--json=stream` with line-by-line streaming Python — inject the brief's `scope.exclude` patterns into the Python filter's `EXCLUDES` list (use `[]` if absent) so excluded files are discarded before consuming `head -N` slots (see template in extraction patterns data)
|
|
178
178
|
3. For each export: extract function name, full signature, parameter types, return type, line number
|
|
179
179
|
4. Use `ast_bridge.detect_co_imports(path, libraries[])` to find integration points
|
|
180
180
|
5. Build extraction rules YAML data for reproducibility
|
|
@@ -274,13 +274,13 @@ Compile all extracted data into a structured inventory:
|
|
|
274
274
|
|
|
275
275
|
**Docs-only note:** If `docs_only_mode` is active (`extraction_mode: "docs-only"`), display a brief note explaining that T3 content will be added by the doc-fetcher step (step 3c), then auto-proceed past this gate. Example: "Docs-only mode: extraction inventory is empty. Documentation content will be fetched from `doc_urls` in step 3c. Auto-proceeding."
|
|
276
276
|
|
|
277
|
-
**Zero-export sanity check (source mode):** If `extraction_mode != "docs-only"` AND `export_count == 0` AND the brief declares no `doc_urls`, an empty extraction is almost always an error — a wrong branch/tag, an over-narrow `scope.include`, or a failed AST run — not a valid empty surface. Do
|
|
277
|
+
**Zero-export sanity check (source mode):** If `extraction_mode != "docs-only"` AND `export_count == 0` AND the brief declares no `doc_urls`, an empty extraction is almost always an error — a wrong branch/tag, an over-narrow `scope.include`, or a failed AST run — not a valid empty surface. Do not let this sail through to a green report. Surface a distinct warning at the gate:
|
|
278
278
|
|
|
279
279
|
"**⚠️ Zero public exports extracted.** A source-type brief produced no documented surface and declares no `doc_urls`. This usually means a scope/branch/tag mismatch (wrong `target_version`, over-narrow `scope.include`) or a failed AST run — the compiled skill would document nothing. Verify the brief's source ref and scope before continuing.
|
|
280
280
|
|
|
281
281
|
**[C] Continue anyway** — compile an empty surface (default)"
|
|
282
282
|
|
|
283
|
-
Under `{headless_mode}`, do
|
|
283
|
+
Under `{headless_mode}`, do not auto-pass silently: set `status: "partial"` and `summary.warning: "zero-exports"` on the result contract (carried to step 8's record), log `"headless: zero public exports extracted — likely scope/branch/tag mismatch, continuing"`, append a `headless_decisions[]` entry `{step: "extract", gate: "zero-exports", decision: "C", rationale: "headless mode — zero exports, no human to confirm scope/ref", timestamp: {ISO}}` and, the moment it lands, append the same object as a JSON line to the durable audit sink `{sidecar_path}/auto-decisions.jsonl` (the on-landing append established at step 1 §3), and proceed. The distinct warning string surfaces the worst kind of failure (looks green, isn't) where a human or automator can act on it.
|
|
284
284
|
|
|
285
285
|
Display the extraction findings for user confirmation:
|
|
286
286
|
|
|
@@ -299,26 +299,11 @@ Display the extraction findings for user confirmation:
|
|
|
299
299
|
|
|
300
300
|
{warnings if any files skipped or degraded}
|
|
301
301
|
|
|
302
|
-
Review the extraction summary above
|
|
302
|
+
Review the extraction summary above, then confirm to continue."
|
|
303
303
|
|
|
304
|
-
### 7.
|
|
304
|
+
### 7. Gate 2 — Confirm Extraction
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
Docs-only mode (`extraction_mode: "docs-only"`) needs no confirmation — auto-proceed to `{nextStepFile}`.
|
|
307
307
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
- IF docs-only mode (`extraction_mode: "docs-only"`): Auto-proceed immediately to `{nextStepFile}` — no user interaction required
|
|
311
|
-
- OTHERWISE: ALWAYS halt and wait for user input after presenting the extraction summary
|
|
312
|
-
- **GATE [default: C]** — If `{headless_mode}`: auto-proceed with [C] Continue, log: "headless: auto-approve extraction summary"
|
|
313
|
-
- This is Gate 2 — user must confirm before compilation proceeds (except docs-only mode)
|
|
314
|
-
- User may ask questions about the extraction results before continuing
|
|
315
|
-
|
|
316
|
-
#### Menu Handling Logic:
|
|
317
|
-
|
|
318
|
-
- IF C: Confirm extraction inventory is complete. Immediately load, read entire file, then execute `{nextStepFile}`
|
|
319
|
-
- IF Any other comments or queries: answer questions about the extraction results, then redisplay the menu
|
|
320
|
-
|
|
321
|
-
## CRITICAL STEP COMPLETION NOTE
|
|
322
|
-
|
|
323
|
-
ONLY WHEN the extraction inventory is built with provenance citations and the user has confirmed the extraction summary will you proceed to load `{nextStepFile}` for temporal context fetching.
|
|
308
|
+
Otherwise this is a confirmation gate: halt after the §6 summary and wait for the user to continue (they may ask about the results first). **GATE [default: continue]** — under `{headless_mode}`, auto-proceed and log "headless: auto-approve extraction summary". On continue, load `{nextStepFile}`, read it fully, then execute it.
|
|
324
309
|
|
|
@@ -13,7 +13,7 @@ After initial AST extraction, some top-level exports may resolve to **module imp
|
|
|
13
13
|
**Tracing protocol:**
|
|
14
14
|
|
|
15
15
|
1. Read the entry point file (e.g., `{package}/__init__.py`) and extract all `from .X import Y` statements
|
|
16
|
-
2. For each import where Y was
|
|
16
|
+
2. For each import where Y was not found by the initial AST scan:
|
|
17
17
|
- Check if the import path resolves to a directory (e.g., `{package}/api/v1/delete/` exists with `__init__.py`)
|
|
18
18
|
- If directory: read its `__init__.py` to find the actual re-exported symbol
|
|
19
19
|
- **Handle aliases:** Check for `from .module import A as B` patterns in the intermediate `__init__.py`. If the parent imports `B`, trace through to `A` in `.module`. If the parent imports `A` but the `__init__.py` only exports it as `B` (via `from .module import A as B`), match by original name `A` and note the alias
|
|
@@ -76,7 +76,7 @@ The discovery step stores `{ccc_discovery: [{file, score, snippet}]}` in context
|
|
|
76
76
|
When `{ccc_discovery}` is present and non-empty:
|
|
77
77
|
|
|
78
78
|
1. Files appearing in `{ccc_discovery}` results move to the front of the extraction queue, sorted by relevance score descending
|
|
79
|
-
2. Files
|
|
79
|
+
2. Files not in CCC results remain in the queue — they are not excluded, only deprioritized
|
|
80
80
|
3. If the CCC intersection with scoped files produces <10 files: include all scoped files (CCC results too narrow)
|
|
81
81
|
4. Proceed with the AST Extraction Protocol on the pre-ranked list
|
|
82
82
|
|
|
@@ -113,7 +113,7 @@ Same extraction as Forge tier. Deep tier adds enrichment in step 4, not extracti
|
|
|
113
113
|
|
|
114
114
|
When AST tools are available (Forge/Deep tier), follow this deterministic protocol to prevent output overflow on large codebases.
|
|
115
115
|
|
|
116
|
-
**"Files in scope"** = files remaining after applying `include_patterns` and `exclude_patterns` from the brief, filtered by the target language extension. This is
|
|
116
|
+
**"Files in scope"** = files remaining after applying `include_patterns` and `exclude_patterns` from the brief, filtered by the target language extension. This is not the total repository file count from step 1's tree listing. Use the filtered count from step 3 section 2 as the decision tree input.
|
|
117
117
|
|
|
118
118
|
### Decision Tree
|
|
119
119
|
|
|
@@ -166,7 +166,7 @@ find_code_by_rule(
|
|
|
166
166
|
|
|
167
167
|
### CLI Streaming Fallback
|
|
168
168
|
|
|
169
|
-
When MCP tools are unavailable or the repo exceeds 500 files in scope, use `--json=stream` (
|
|
169
|
+
When MCP tools are unavailable or the repo exceeds 500 files in scope, use `--json=stream` (not `--json` or `--json=pretty`, which load the whole result set into memory) with line-by-line Python processing:
|
|
170
170
|
|
|
171
171
|
**Head cap selection:** The `| head -N` cap at the end of the pipeline controls how many exports are captured. Select `N` based on scope and tier:
|
|
172
172
|
- **Default (Quick/Forge, any scope):** `N = 200`
|
|
@@ -205,11 +205,11 @@ for line in sys.stdin:
|
|
|
205
205
|
" | head -{HEAD_CAP}
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
**
|
|
208
|
+
**Streaming constraints (these prevent OOM on large result sets):**
|
|
209
209
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
210
|
+
- Use `--json=stream`, not `--json` — the latter loads the entire array into memory
|
|
211
|
+
- Process line-by-line (`for line in sys.stdin`), not `json.load(sys.stdin)`
|
|
212
|
+
- Cap output with `| head -N` as a safety valve
|
|
213
213
|
- For repos > 500 files, process in directory batches of 20-50 files each: split by top-level source directory, run the CLI streaming template per batch with the same head cap, then merge results and deduplicate by export name (keep the first occurrence if duplicates exist across batches)
|
|
214
214
|
|
|
215
215
|
### YAML Rule Recipes by Language
|
|
@@ -4,7 +4,7 @@ forgeTierConfig: '{sidecar_path}/forge-tier.yaml'
|
|
|
4
4
|
# Resolve `{atomicWriteHelper}` by probing `{atomicWriteProbeOrder}` in order
|
|
5
5
|
# (installed SKF module path first, src/ dev-checkout fallback); first existing
|
|
6
6
|
# path wins. HALT if neither resolves — the active-symlink flip and registry
|
|
7
|
-
# writes below
|
|
7
|
+
# writes below go through the atomic helper for concurrency safety.
|
|
8
8
|
atomicWriteProbeOrder:
|
|
9
9
|
- '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
|
|
10
10
|
- '{project-root}/src/shared/scripts/skf-atomic-write.py'
|
|
@@ -80,7 +80,7 @@ Write these 4 files from the compiled content:
|
|
|
80
80
|
|
|
81
81
|
**Note on `file_type: "doc"` entries** (promoted authoritative docs from step 3 §2a):
|
|
82
82
|
|
|
83
|
-
Promoted docs are tracked in `file_entries[]` with `file_type: "doc"` for drift detection but are **
|
|
83
|
+
Promoted docs are tracked in `file_entries[]` with `file_type: "doc"` for drift detection but are **not** copied into the skill package. The source file remains at its original location outside `{skill_package}`. Step-07 must skip any `file_entries[]` row where `file_type == "doc"` when iterating for file copy — these entries exist only for provenance tracking, not bundling. Step-07 verification (§5) also does not check for doc files in the skill package.
|
|
84
84
|
|
|
85
85
|
### 3. Write Workspace Artifacts to {forge_version}
|
|
86
86
|
|
|
@@ -108,7 +108,7 @@ python3 {atomicWriteHelper} flip-link \
|
|
|
108
108
|
|
|
109
109
|
The helper returns non-zero (exit 2) if `{skill_group}/active` already exists as a real directory or file rather than a symlink — in that case, halt with: "Refusing to flip `{skill_group}/active` — existing path is not a symlink. Investigate manually; expected a symlink pointing at a version directory."
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
Do not `rm` + `ln -s` the active link by hand. The bare-rm pattern has two failure modes: (1) a concurrent reader sees a missing `active` mid-flip, and (2) a bug or typo that replaces `{skill_group}/active` with a plain directory turns the next manual `rm -rf {skill_group}/active` into data loss. The helper encapsulates both guards.
|
|
112
112
|
|
|
113
113
|
### 5. Verify Write Completion
|
|
114
114
|
|
|
@@ -181,10 +181,10 @@ If an entry with `name: "{name}-extraction"` already exists, replace it. Otherwi
|
|
|
181
181
|
Write the updated forge-tier.yaml.
|
|
182
182
|
|
|
183
183
|
**Error handling:**
|
|
184
|
-
- If QMD collection creation fails: log the error, note that indexing can be retried via [SF] setup. Do
|
|
184
|
+
- If QMD collection creation fails: log the error, note that indexing can be retried via [SF] setup. Do not fail the workflow.
|
|
185
185
|
- If forge-tier.yaml update fails: log the error, continue. The collection exists in QMD even if the registry entry failed.
|
|
186
186
|
|
|
187
|
-
**IF forge tier is
|
|
187
|
+
**IF forge tier is not Deep:** Skip this section silently. No messaging.
|
|
188
188
|
|
|
189
189
|
### 6b. CCC Index Registry Registration (Forge+ and Deep with ccc)
|
|
190
190
|
|
|
@@ -211,27 +211,13 @@ echo '{"source_repo":"{brief.source_repo}","path":"{source_root}","skill_name":"
|
|
|
211
211
|
| uv run {forgeTierRwHelper} register-ccc-index --target {forgeTierConfig}
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
Deduplicates by `source_repo` + `skill_name` (
|
|
214
|
+
Deduplicates by `source_repo` + `skill_name` (not local `path`, which may be ephemeral). Release the lock after the command completes. If `flock` is unavailable, fall back to read-CAS-by-mtime.
|
|
215
215
|
|
|
216
|
-
**Error handling:** If ccc indexing or registry update fails, log and continue — do
|
|
216
|
+
**Error handling:** If ccc indexing or registry update fails, log and continue — do not fail the workflow.
|
|
217
217
|
|
|
218
218
|
**IF `tools.ccc` is false:** Skip this section silently.
|
|
219
219
|
|
|
220
|
-
### 7.
|
|
220
|
+
### 7. Auto-Proceed
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
After all artifacts are written, verified, and optionally indexed into QMD, immediately load, read entire file, then execute `{nextStepFile}`.
|
|
225
|
-
|
|
226
|
-
#### EXECUTION RULES:
|
|
227
|
-
|
|
228
|
-
- This is an auto-proceed file writing step with no user choices
|
|
229
|
-
- All 7 files must be written before proceeding
|
|
230
|
-
- QMD indexing failure does NOT block proceeding
|
|
231
|
-
- File write failures are real errors — halt, do not proceed with partial output
|
|
232
|
-
- Proceed directly to next step after successful generation
|
|
233
|
-
|
|
234
|
-
## CRITICAL STEP COMPLETION NOTE
|
|
235
|
-
|
|
236
|
-
ONLY WHEN all 7 artifact files are written, the active symlink is created, and verification is complete will you proceed to load `{nextStepFile}` for the compilation report.
|
|
222
|
+
No user interaction. Once all 7 files are written and verified (and optionally indexed into QMD), load `{nextStepFile}`, read it fully, then execute it. A QMD-indexing failure does not block; a file-write failure halts (§5) rather than proceeding with partial output.
|
|
237
223
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
# `shared/health-check.md` resolves relative to the SKF module root
|
|
3
3
|
# (`{project-root}/_bmad/skf/` when installed, `{project-root}/src/` during
|
|
4
|
-
# development),
|
|
4
|
+
# development), not relative to this step file.
|
|
5
5
|
nextStepFile: 'shared/health-check.md'
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -40,14 +40,14 @@ Extract and report:
|
|
|
40
40
|
- `tools`: which tools are available (gh, ast-grep, ccc, qmd)
|
|
41
41
|
- `ccc_index`: ccc index state (status, indexed_path, last_indexed) — needed by step 2b
|
|
42
42
|
|
|
43
|
-
**Apply tier override:** Read `{preferencesFile}`. If `tier_override` is set and is one of the exact valid tier values (`Quick`, `Forge`, `Forge+`, `Deep`), use it instead of the detected tier. **If `tier_override` is set but is
|
|
43
|
+
**Apply tier override:** Read `{preferencesFile}`. If `tier_override` is set and is one of the exact valid tier values (`Quick`, `Forge`, `Forge+`, `Deep`), use it instead of the detected tier. **If `tier_override` is set but is not one of those four values:** log a warning — "Unknown tier_override `{value}` in preferences.yaml; falling back to detected tier `{detected_tier}`. Valid values: Quick, Forge, Forge+, Deep." — and use the detected tier. Never silently apply an unknown override value, and never map it heuristically to a tier.
|
|
44
44
|
|
|
45
45
|
**Record the decision:** append an entry to the in-context `headless_decisions[]` buffer (initialize to `[]` at the start of this step if absent) whenever a non-interactive choice is made automatically — both the valid-override path AND the rejected-override path:
|
|
46
46
|
|
|
47
47
|
- Valid override applied: `{step: "load-brief", gate: "tier-override", decision: "apply", value: "{tier_override}", rationale: "explicit preferences.yaml tier_override", timestamp: {ISO}}`
|
|
48
48
|
- Invalid override rejected: `{step: "load-brief", gate: "tier-override", decision: "reject-invalid", value: "{tier_override}", fallback: "{detected_tier}", rationale: "tier_override not in {Quick,Forge,Forge+,Deep}", timestamp: {ISO}}`
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
These entries stay in the in-context buffer until §3 establishes the on-disk auto-decision sink and seeds it with the buffer-so-far; from then on every later gate's decision is appended to the sink as it lands (per the headless Workflow Rule). Step 5 §7 renders the sink into the evidence-report `## Auto-Decisions` table and step 6 §8 reconciles it, so reviewers can audit every silent choice even on a run long enough to compact the in-context buffer before step 5.
|
|
51
51
|
|
|
52
52
|
### 2. Discover Skill Brief
|
|
53
53
|
|
|
@@ -58,7 +58,7 @@ Step-05 §7 reads `headless_decisions[]` and emits an "Auto-Decisions" section i
|
|
|
58
58
|
|
|
59
59
|
**If user invoked with --batch flag:**
|
|
60
60
|
- Check `{sidecar_path}/batch-state.yaml` for an active batch checkpoint:
|
|
61
|
-
- If `batch_active: true`: validate the checkpoint before trusting it
|
|
61
|
+
- If `batch_active: true`: validate the checkpoint before trusting it — both conditions below must hold:
|
|
62
62
|
1. `0 <= current_index < len(brief_list)` — the index points inside the recorded list.
|
|
63
63
|
2. `os.path.exists(brief_list[current_index])` — the brief file is still on disk.
|
|
64
64
|
If both hold, load the brief at `brief_list[current_index]` (resuming a batch loop from step 8). If **either** check fails, the checkpoint is stale (briefs renamed, moved, or deleted between runs; index off the end after a partial failure). Log a warning — "Stale batch checkpoint — current_index={i}, brief_list length={n}, brief_exists={bool}. Resetting and re-discovering." — then set `batch_active: false` in `batch-state.yaml` and fall through to the no-checkpoint branch below.
|
|
@@ -95,9 +95,19 @@ The helper emits:
|
|
|
95
95
|
|
|
96
96
|
**If `valid` is true:** continue with `brief` (the parsed object) for downstream sections. Surface any `warnings[]` to the user but do not halt.
|
|
97
97
|
|
|
98
|
+
**Establish the auto-decision sink (durable headless audit).** The brief is now confirmed, so create the on-disk audit sink at `{sidecar_path}/auto-decisions.jsonl` — one compact JSON object per line — and seed it with whatever is already in the in-context `headless_decisions[]` buffer (the §1 tier-override row, or nothing if none fired). This truncates any stale sink a prior brief left behind:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
: > {sidecar_path}/auto-decisions.jsonl # truncate / create empty
|
|
102
|
+
# then, for each entry already in headless_decisions[], append its compact JSON:
|
|
103
|
+
printf '%s\n' '{decision-json}' >> {sidecar_path}/auto-decisions.jsonl
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
From here on, **every time a later gate appends an auto-decision to `headless_decisions[]`, append that same object as a line to this sink the moment it lands** (the on-landing append the headless Workflow Rule mandates). The array is tiny, so the append costs nothing and keeps a complete on-disk copy across the token-heavy step 3→5 extraction window — the point where a long component-library run can compact the in-context buffer. Step 5 §7 renders this sink into the evidence-report `## Auto-Decisions` table and step 6 §8 reconciles it, so the audit table and `auto_decision_count` stay complete even when the buffer is lost.
|
|
107
|
+
|
|
98
108
|
**Field reference (for human readers):**
|
|
99
109
|
|
|
100
|
-
The complete contract — required fields, optional fields, types, and rules — lives in `src/shared/scripts/schemas/skill-brief.v1.json` and the prose mirror at `src/skf-brief-skill/assets/skill-brief-schema.md`. Read those if you need to explain a specific field; do
|
|
110
|
+
The complete contract — required fields, optional fields, types, and rules — lives in `src/shared/scripts/schemas/skill-brief.v1.json` and the prose mirror at `src/skf-brief-skill/assets/skill-brief-schema.md`. Read those if you need to explain a specific field; do not restate the rules here.
|
|
101
111
|
|
|
102
112
|
### 4. Resolve Source Code Location
|
|
103
113
|
|
|
@@ -137,19 +147,7 @@ Where tier_description follows positive capability framing:
|
|
|
137
147
|
- Forge+: "Semantic-guided precision — ccc pre-ranks files before AST extraction"
|
|
138
148
|
- Deep: "Full intelligence — structural + contextual + QMD knowledge synthesis"
|
|
139
149
|
|
|
140
|
-
### 6.
|
|
141
|
-
|
|
142
|
-
**Auto-proceed step — no user interaction.**
|
|
143
|
-
|
|
144
|
-
After initialization is complete and all data is loaded (including `target_version` if present in the brief), immediately load, read entire file, then execute `{nextStepFile}`.
|
|
145
|
-
|
|
146
|
-
#### EXECUTION RULES:
|
|
147
|
-
|
|
148
|
-
- This is an auto-proceed initialization step with no user choices
|
|
149
|
-
- Proceed directly to next step after successful initialization
|
|
150
|
-
- If any prerequisite check fails, HALT with actionable error — do NOT proceed
|
|
151
|
-
|
|
152
|
-
## CRITICAL STEP COMPLETION NOTE
|
|
150
|
+
### 6. Auto-Proceed
|
|
153
151
|
|
|
154
|
-
|
|
152
|
+
No user interaction. After initialization completes and all data is loaded (including `target_version` if present), load `{nextStepFile}`, read it fully, then execute it. A failed prerequisite check above has already halted with an actionable error rather than reaching here.
|
|
155
153
|
|
|
@@ -20,7 +20,7 @@ To display the final compilation summary — skill name, version, source, export
|
|
|
20
20
|
|
|
21
21
|
- Focus only on reporting compilation results — do not modify any files
|
|
22
22
|
- Deliver structured report with confidence breakdown
|
|
23
|
-
- Chains to the local health-check step via `{nextStepFile}` after completion (non-batch mode, or after the final batch brief) — the user-facing report is
|
|
23
|
+
- Chains to the local health-check step via `{nextStepFile}` after completion (non-batch mode, or after the final batch brief) — the user-facing report is not the terminal step
|
|
24
24
|
|
|
25
25
|
## MANDATORY SEQUENCE
|
|
26
26
|
|
|
@@ -72,11 +72,6 @@ If there were warnings from extraction, validation, or enrichment, display them:
|
|
|
72
72
|
|
|
73
73
|
If no warnings, omit this section entirely.
|
|
74
74
|
|
|
75
|
-
**Next steps:** After reviewing the report, recommend the next workflow:
|
|
76
|
-
- **TS** (test skill) — verify completeness before export
|
|
77
|
-
- **EX** (export) — publish to your IDE's context system
|
|
78
|
-
- If issues were flagged, suggest **reviewing the SKILL.md** and re-running compilation
|
|
79
|
-
|
|
80
75
|
### 4. Suggest Next Steps
|
|
81
76
|
|
|
82
77
|
"**Recommended next steps:**
|
|
@@ -125,15 +120,23 @@ End workflow. No further steps.
|
|
|
125
120
|
|
|
126
121
|
**Resolve the schema reference:** before writing, verify that `{project-root}/src/shared/references/output-contract-schema.md` exists and is readable. Try in order: `{project-root}/src/shared/references/output-contract-schema.md`, then `{project-root}/_bmad/skf/shared/references/output-contract-schema.md` (installed-forge path).
|
|
127
122
|
|
|
128
|
-
- **If resolved:** write the result contract per the schema — the per-run record at `{forge_version}/create-skill-result-{YYYYMMDD-HHmmss}.json` (UTC timestamp, resolution to seconds) and a copy at `{forge_version}/create-skill-result-latest.json` (stable path for pipeline consumers — copy, not symlink). Include `SKILL.md`, `context-snippet.md`, `metadata.json`, **and `{forge_version}/evidence-report.md`** paths in `outputs` (the evidence report carries the `## Auto-Decisions` audit table where every silent auto-decision is recorded — pipeline consumers follow this path to audit the run) and confidence distribution in `summary`. Also set `summary.auto_decision_count` to `
|
|
123
|
+
- **If resolved:** write the result contract per the schema — the per-run record at `{forge_version}/create-skill-result-{YYYYMMDD-HHmmss}.json` (UTC timestamp, resolution to seconds) and a copy at `{forge_version}/create-skill-result-latest.json` (stable path for pipeline consumers — copy, not symlink). Include `SKILL.md`, `context-snippet.md`, `metadata.json`, **and `{forge_version}/evidence-report.md`** paths in `outputs` (the evidence report carries the `## Auto-Decisions` audit table where every silent auto-decision is recorded — pipeline consumers follow this path to audit the run) and confidence distribution in `summary`. Also set `summary.auto_decision_count` to the number of decision rows in the reconciled evidence-report `## Auto-Decisions` table (0 when the run was interactive and the section holds only the no-auto-decisions line) so a consumer can tell from the result JSON alone whether any gate auto-resolved. Count the persisted rows — the durable audit record step 6 §8 reconciled from disk — rather than the in-context `headless_decisions[]` length, so the count matches the table even if a long headless run compacted the buffer. Use `python3 {atomicWriteHelper} write --target {forge_version}/create-skill-result-{YYYYMMDD-HHmmss}.json` (stdin-piped JSON) for the per-run record, then the same helper for the `-latest.json` copy.
|
|
129
124
|
|
|
130
125
|
- **If neither candidate path resolves:** skip the result-contract write entirely. Append a warning to `evidence-report.md`: "Result contract skipped — `shared/references/output-contract-schema.md` could not be resolved at either candidate path." Then set `validation_status: 'schema-unavailable'` in `metadata.json` (and re-write metadata.json via `skf-atomic-write.py write`). Pipeline consumers will observe the missing `-latest.json` and the metadata flag.
|
|
131
126
|
|
|
127
|
+
**Post-completion hook (optional).** After the result JSON and `metadata.json` are finalized, if `{onCompleteCommand}` is non-empty (resolved at SKILL.md On Activation §3 from `workflow.on_complete`), invoke it:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
{onCompleteCommand} --result-path={forge_version}/create-skill-result-latest.json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Log success or failure to `workflow_warnings[]` but never fail the workflow on a hook error — the skill is already written and the result contract is final. The hook runs last so a git-add, registry registration, notifier, or downstream-skill chain sees a complete package. When `{onCompleteCommand}` is empty (bundled default), skip the invocation entirely.
|
|
134
|
+
|
|
132
135
|
### Result Contract on HARD HALT
|
|
133
136
|
|
|
134
137
|
The success-variant contract above is only reached at step 8. The ~10 HARD HALT conditions in steps 1–7 (forge-config missing, no brief, brief invalid, source not found, prerequisite failure in load-brief; atomic/detect/auth helper unresolved and the Tier-1 split-count drop in extract/validate; the non-symlink active-link refusal in generate-artifacts) otherwise print a human string and exit with **no machine-readable outcome** — a pipeline polling `create-skill-result-latest.json` cannot distinguish "halted at brief-invalid" from "still running" from "crashed". Mirror skf-quick-skill: **whenever `{headless_mode}` is true, every HARD HALT must surface an error-variant result before exiting.**
|
|
135
138
|
|
|
136
|
-
**
|
|
139
|
+
**For every HARD HALT under `{headless_mode}` (regardless of phase)** — emit a single line on **stderr** (one line, no pretty-print; matches the prefix-and-envelope convention used by `skf-emit-result-envelope.py`):
|
|
137
140
|
|
|
138
141
|
```
|
|
139
142
|
SKF_CREATE_SKILL_RESULT_JSON: {"status":"failed","phase":"<step-slug>","outputs":{},"summary":{"halt_reason":"<short class>","evidence_report":"<path-or-null>"},"skill_package":"<path-or-null>"}
|
|
@@ -149,13 +152,7 @@ When `{headless_mode}` is false, HARD HALTs display their human message only —
|
|
|
149
152
|
|
|
150
153
|
**If not batch mode (or all batch briefs complete):**
|
|
151
154
|
|
|
152
|
-
|
|
155
|
+
Only after the compilation report, warnings (if any), recommended next steps, and result contract have been handled do you load `{nextStepFile}`, read it fully, and execute it. The health-check step is the true terminal step — do not stop here even though the report reads as final.
|
|
153
156
|
|
|
154
157
|
**If batch mode with remaining briefs:** Skip the health-check chain — load and execute `references/load-brief.md` for the next brief instead. The health check runs only after the final brief in the batch.
|
|
155
158
|
|
|
156
|
-
## CRITICAL STEP COMPLETION NOTE
|
|
157
|
-
|
|
158
|
-
This step chains to the local health-check step (`{nextStepFile}`), which in turn delegates to `shared/health-check.md` (unless batch mode loops back to step 1). After the health check completes, the create-skill workflow is fully done.
|
|
159
|
-
|
|
160
|
-
For batch mode: load and execute `references/load-brief.md` for remaining briefs via sidecar checkpoint. Health check runs only after the last brief.
|
|
161
|
-
|
|
@@ -123,7 +123,7 @@ If `source_repo` is a remote URL (GitHub URL or owner/repo format) AND tier is F
|
|
|
123
123
|
|
|
124
124
|
If fetch or checkout fails, proceed to the **ephemeral fallback** (step 5).
|
|
125
125
|
|
|
126
|
-
**If `{workspace_repo_path}/.git/` does
|
|
126
|
+
**If `{workspace_repo_path}/.git/` does not exist (workspace miss):**
|
|
127
127
|
|
|
128
128
|
Clone the repository into the workspace for persistent reuse. Create the parent directory first (`{workspace_root}/repos/{host}/{owner}/`):
|
|
129
129
|
|
|
@@ -131,7 +131,7 @@ If `source_repo` is a remote URL (GitHub URL or owner/repo format) AND tier is F
|
|
|
131
131
|
mkdir -p "{workspace_root}/repos/{host}/{owner}/"
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
Clone with the appropriate branch flag — `--branch` is only valid for real branch/tag names, not for `HEAD`. **Do
|
|
134
|
+
Clone with the appropriate branch flag — `--branch` is only valid for real branch/tag names, not for `HEAD`. **Do not pass `--single-branch`** here: workspace clones are persistent and re-used for future forges with different `source_ref` values (a later run may target a different tag or branch). A single-branch workspace clone would force every re-forge with a new ref to fall through to ephemeral cloning, defeating the workspace cache:
|
|
135
135
|
|
|
136
136
|
```
|
|
137
137
|
# If source_ref is a real branch or tag (not HEAD/null):
|
|
@@ -216,7 +216,7 @@ Also store `source_ref` in context (from tag resolution above, or `HEAD` if no t
|
|
|
216
216
|
|
|
217
217
|
## Version Reconciliation (all tiers, source mode only)
|
|
218
218
|
|
|
219
|
-
**Target version override:** If `brief.target_version` is present, use it as the authoritative version for the skill. Do
|
|
219
|
+
**Target version override:** If `brief.target_version` is present, use it as the authoritative version for the skill. Do not warn about a brief-vs-source version mismatch — the user intentionally specified this version. Set the working version to `brief.target_version` and skip the rest of this reconciliation section. The `target_version` field indicates deliberate user intent (e.g., targeting an older version, or providing the version for a docs-only skill).
|
|
220
220
|
|
|
221
221
|
**If `source_type: "docs-only"`:** skip this section — no source files exist to reconcile.
|
|
222
222
|
|