bmad-module-skill-forge 0.9.0 → 0.10.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +39 -0
- package/.gitattributes +16 -0
- package/README.md +105 -38
- package/docs/404.md +13 -10
- package/docs/RELEASING.md +185 -0
- package/docs/STABILITY.md +123 -0
- package/docs/_data/pinned.yaml +98 -0
- package/docs/agents.md +16 -11
- package/docs/architecture.md +221 -0
- package/docs/bmad-synergy.md +11 -13
- package/docs/concepts.md +18 -108
- package/docs/examples.md +121 -80
- package/docs/getting-started.md +85 -147
- package/docs/how-it-works.md +25 -536
- package/docs/index.md +44 -27
- package/docs/skill-model.md +328 -0
- package/docs/troubleshooting.md +39 -0
- package/docs/verifying-a-skill.md +232 -0
- package/docs/why-skf.md +93 -0
- package/docs/workflows.md +119 -13
- package/package.json +25 -4
- package/src/README.md +23 -25
- package/src/forger/forge-tier.yaml +4 -2
- package/src/forger/preferences.yaml +7 -1
- package/src/knowledge/agentskills-spec.md +1 -1
- package/src/knowledge/architecture-verification.md +1 -1
- package/src/knowledge/ccc-bridge.md +16 -15
- package/src/knowledge/overview.md +11 -11
- package/src/knowledge/progressive-capability.md +3 -3
- package/src/knowledge/provenance-tracking.md +9 -3
- package/src/knowledge/qmd-registry.md +8 -8
- package/src/knowledge/skf-knowledge-index.csv +2 -2
- package/src/knowledge/skill-lifecycle.md +16 -1
- package/src/knowledge/split-body-strategy.md +1 -1
- package/src/knowledge/version-paths.md +17 -12
- package/src/module-help.csv +18 -17
- package/src/module.yaml +4 -0
- package/src/shared/health-check.md +372 -0
- package/src/shared/references/feasibility-report-schema.md +86 -0
- package/src/shared/references/headless-gate-convention.md +62 -0
- package/src/shared/references/output-contract-schema.md +35 -0
- package/src/shared/references/pipeline-contracts.md +102 -0
- package/src/shared/scripts/skf-atomic-write.py +370 -0
- package/src/shared/scripts/skf-manifest-ops.py +236 -0
- package/src/shared/scripts/skf-preflight.py +164 -0
- package/src/shared/scripts/skf-rebuild-managed-sections.py +201 -0
- package/src/shared/scripts/skf-severity-classify.py +163 -0
- package/src/shared/scripts/skf-skill-inventory.py +210 -0
- package/src/shared/scripts/skf-structural-diff.py +257 -0
- package/src/shared/scripts/skf-validate-frontmatter.py +318 -0
- package/src/shared/scripts/skf-validate-output.py +247 -0
- package/src/skf-analyze-source/SKILL.md +57 -0
- package/src/skf-analyze-source/assets/skill-brief-schema.md +125 -0
- package/src/skf-analyze-source/references/unit-detection-heuristics.md +124 -0
- package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-01-init.md +6 -66
- package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-01b-continue.md +4 -59
- package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-02-scan-project.md +7 -68
- package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-03-identify-units.md +6 -66
- package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-04-map-and-detect.md +7 -68
- package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-05-recommend.md +6 -66
- package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-06-generate-briefs.md +14 -66
- package/src/skf-analyze-source/steps-c/step-07-health-check.md +22 -0
- package/src/skf-audit-skill/SKILL.md +59 -0
- package/src/{workflows/audit-skill/data → skf-audit-skill/assets}/drift-report-template.md +7 -7
- package/src/{workflows/audit-skill/data → skf-audit-skill/references}/severity-rules.md +11 -11
- package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-01-init.md +24 -68
- package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-02-re-index.md +36 -71
- package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-03-structural-diff.md +21 -63
- package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-04-semantic-diff.md +6 -65
- package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-05-severity-classify.md +5 -63
- package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-06-report.md +10 -59
- package/src/skf-audit-skill/steps-c/step-07-health-check.md +22 -0
- package/src/skf-brief-skill/SKILL.md +53 -0
- package/src/{workflows/brief-skill/data → skf-brief-skill/assets}/scope-templates.md +23 -0
- package/src/skf-brief-skill/assets/skill-brief-schema.md +206 -0
- package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-01-gather-intent.md +6 -67
- package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-02-analyze-target.md +6 -66
- package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-03-scope-definition.md +12 -68
- package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-04-confirm-brief.md +5 -63
- package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-05-write-brief.md +10 -69
- package/src/skf-brief-skill/steps-c/step-06-health-check.md +22 -0
- package/src/skf-create-skill/SKILL.md +63 -0
- package/src/{workflows/create-skill/data → skf-create-skill/assets}/compile-assembly-rules.md +60 -0
- package/src/{workflows/create-skill/data → skf-create-skill/assets}/skill-sections.md +92 -23
- package/src/skf-create-skill/assets/tessl-dismissal-rules.md +102 -0
- package/src/{workflows/create-skill/data → skf-create-skill/references}/extraction-patterns-tracing.md +13 -13
- package/src/{workflows/create-skill/data → skf-create-skill/references}/extraction-patterns.md +8 -3
- package/src/skf-create-skill/references/source-resolution-protocols.md +239 -0
- package/src/{workflows/create-skill/data → skf-create-skill/references}/tier-degradation-rules.md +8 -7
- package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-01-load-brief.md +25 -63
- package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-02-ecosystem-check.md +8 -64
- package/src/skf-create-skill/steps-c/step-03-extract.md +379 -0
- package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-03d-component-extraction.md +18 -35
- package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-04-enrich.md +12 -69
- package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-05-compile.md +71 -75
- package/src/skf-create-skill/steps-c/step-06-validate.md +267 -0
- package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-07-generate-artifacts.md +30 -74
- package/src/skf-create-skill/steps-c/step-08-report.md +145 -0
- package/src/skf-create-skill/steps-c/step-09-health-check.md +23 -0
- package/src/{workflows/create-skill/steps-c → skf-create-skill/steps-c/sub}/step-02b-ccc-discover.md +8 -66
- package/src/skf-create-skill/steps-c/sub/step-03b-fetch-temporal.md +229 -0
- package/src/{workflows/create-skill/steps-c → skf-create-skill/steps-c/sub}/step-03c-fetch-docs.md +18 -42
- package/src/skf-create-stack-skill/SKILL.md +64 -0
- package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/assets}/stack-skill-template.md +2 -1
- package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/compose-mode-rules.md +19 -5
- package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/integration-patterns.md +1 -1
- package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/manifest-patterns.md +10 -10
- package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-01-init.md +14 -55
- package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-02-detect-manifests.md +29 -63
- package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-03-rank-and-confirm.md +9 -59
- package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-04-parallel-extract.md +29 -64
- package/src/skf-create-stack-skill/steps-c/step-05-detect-integrations.md +164 -0
- package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-06-compile-stack.md +7 -60
- package/src/skf-create-stack-skill/steps-c/step-07-generate-output.md +328 -0
- package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-08-validate.md +17 -63
- package/src/skf-create-stack-skill/steps-c/step-09-report.md +128 -0
- package/src/skf-create-stack-skill/steps-c/step-10-health-check.md +22 -0
- package/src/skf-drop-skill/SKILL.md +57 -0
- package/src/{workflows/drop-skill → skf-drop-skill}/steps-c/step-01-select.md +9 -69
- package/src/{workflows/drop-skill → skf-drop-skill}/steps-c/step-02-execute.md +30 -106
- package/src/skf-drop-skill/steps-c/step-03-report.md +83 -0
- package/src/skf-drop-skill/steps-c/step-04-health-check.md +22 -0
- package/src/skf-export-skill/SKILL.md +57 -0
- package/src/skf-export-skill/assets/managed-section-format.md +138 -0
- package/src/{workflows/export-skill/data → skf-export-skill/assets}/snippet-format.md +8 -12
- package/src/skf-export-skill/steps-c/step-01-load-skill.md +247 -0
- package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-02-package.md +5 -58
- package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-03-generate-snippet.md +15 -77
- package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-04-update-context.md +59 -133
- package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-05-token-report.md +4 -58
- package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-06-summary.md +20 -64
- package/src/skf-export-skill/steps-c/step-07-health-check.md +22 -0
- package/src/skf-forger/SKILL.md +110 -0
- package/src/skf-forger/bmad-skill-manifest.yaml +11 -0
- package/src/skf-quick-skill/SKILL.md +56 -0
- package/src/{workflows/quick-skill/data → skf-quick-skill/references}/registry-resolution.md +6 -6
- package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-01-resolve-target.md +9 -62
- package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-02-ecosystem-check.md +5 -59
- package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-03-quick-extract.md +18 -61
- package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-04-compile.md +6 -60
- package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-05-validate.md +58 -78
- package/src/skf-quick-skill/steps-c/step-06-write.md +73 -0
- package/src/skf-quick-skill/steps-c/step-07-health-check.md +22 -0
- package/src/skf-refine-architecture/SKILL.md +57 -0
- package/src/{workflows/refine-architecture/data → skf-refine-architecture/references}/refinement-rules.md +16 -16
- package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-01-init.md +6 -63
- package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-02-gap-analysis.md +29 -71
- package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-03-issue-detection.md +5 -65
- package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-04-improvements.md +5 -64
- package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-05-compile.md +5 -56
- package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-06-report.md +14 -64
- package/src/skf-refine-architecture/steps-c/step-07-health-check.md +22 -0
- package/src/skf-rename-skill/SKILL.md +58 -0
- package/src/{workflows/rename-skill → skf-rename-skill}/steps-c/step-01-select.md +12 -73
- package/src/{workflows/rename-skill → skf-rename-skill}/steps-c/step-02-execute.md +32 -113
- package/src/skf-rename-skill/steps-c/step-03-report.md +83 -0
- package/src/skf-rename-skill/steps-c/step-04-health-check.md +22 -0
- package/src/skf-setup/SKILL.md +55 -0
- package/src/{workflows/setup-forge → skf-setup}/steps-c/step-01-detect-and-tier.md +6 -62
- package/src/{workflows/setup-forge → skf-setup}/steps-c/step-01b-ccc-index.md +9 -65
- package/src/{workflows/setup-forge → skf-setup}/steps-c/step-02-write-config.md +15 -60
- package/src/{workflows/setup-forge → skf-setup}/steps-c/step-03-auto-index.md +7 -66
- package/src/skf-setup/steps-c/step-04-report.md +92 -0
- package/src/skf-setup/steps-c/step-05-health-check.md +22 -0
- package/src/skf-test-skill/SKILL.md +59 -0
- package/src/skf-test-skill/references/migration-section-rules.md +114 -0
- package/src/skf-test-skill/references/scoring-rules.md +207 -0
- package/src/skf-test-skill/references/source-access-protocol.md +109 -0
- package/src/skf-test-skill/scripts/compute-score.py +310 -0
- package/src/skf-test-skill/steps-c/step-01-init.md +238 -0
- package/src/{workflows/test-skill → skf-test-skill}/steps-c/step-02-detect-mode.md +4 -62
- package/src/skf-test-skill/steps-c/step-03-coverage-check.md +347 -0
- package/src/skf-test-skill/steps-c/step-04-coherence-check.md +239 -0
- package/src/{workflows/test-skill → skf-test-skill}/steps-c/step-04b-external-validators.md +42 -77
- package/src/skf-test-skill/steps-c/step-05-score.md +266 -0
- package/src/skf-test-skill/steps-c/step-06-report.md +290 -0
- package/src/skf-test-skill/steps-c/step-07-health-check.md +25 -0
- package/src/skf-test-skill/templates/test-report-template.md +58 -0
- package/src/skf-update-skill/SKILL.md +58 -0
- package/src/{workflows/update-skill/data → skf-update-skill/references}/manual-section-rules.md +6 -6
- package/src/{workflows/update-skill/data → skf-update-skill/references}/merge-conflict-rules.md +5 -5
- package/src/skf-update-skill/references/remote-source-resolution.md +94 -0
- package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-01-init.md +22 -69
- package/src/skf-update-skill/steps-c/step-02-detect-changes.md +255 -0
- package/src/skf-update-skill/steps-c/step-03-re-extract.md +336 -0
- package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-04-merge.md +60 -72
- package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-05-validate.md +5 -62
- package/src/skf-update-skill/steps-c/step-06-write.md +278 -0
- package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-07-report.md +11 -66
- package/src/skf-update-skill/steps-c/step-08-health-check.md +22 -0
- package/src/skf-verify-stack/SKILL.md +60 -0
- package/src/skf-verify-stack/assets/feasibility-report-template.md +76 -0
- package/src/{workflows/verify-stack/data → skf-verify-stack/references}/coverage-patterns.md +12 -4
- package/src/skf-verify-stack/references/integration-verification-rules.md +78 -0
- package/src/skf-verify-stack/steps-c/step-01-init.md +178 -0
- package/src/{workflows/verify-stack → skf-verify-stack}/steps-c/step-02-coverage.md +27 -72
- package/src/skf-verify-stack/steps-c/step-03-integrations.md +179 -0
- package/src/{workflows/verify-stack → skf-verify-stack}/steps-c/step-04-requirements.md +14 -67
- package/src/skf-verify-stack/steps-c/step-05-synthesize.md +147 -0
- package/src/skf-verify-stack/steps-c/step-06-report.md +156 -0
- package/src/skf-verify-stack/steps-c/step-07-health-check.md +25 -0
- package/tools/cli/commands/install.js +1 -1
- package/tools/cli/commands/status.js +21 -23
- package/tools/cli/commands/uninstall.js +11 -19
- package/tools/cli/commands/update.js +2 -2
- package/tools/cli/lib/ide-skills.js +216 -0
- package/tools/cli/lib/installer.js +29 -52
- package/tools/cli/lib/manifest.js +11 -5
- package/tools/cli/lib/platform-codes.yaml +223 -0
- package/tools/cli/lib/ui.js +76 -47
- package/tools/validate-docs-drift.js +193 -0
- package/src/agents/forger.agent.yaml +0 -114
- package/src/workflows/README.md +0 -174
- package/src/workflows/analyze-source/data/skill-brief-schema.md +0 -125
- package/src/workflows/analyze-source/data/unit-detection-heuristics.md +0 -124
- package/src/workflows/analyze-source/workflow.md +0 -61
- package/src/workflows/audit-skill/workflow.md +0 -64
- package/src/workflows/brief-skill/data/skill-brief-schema.md +0 -159
- package/src/workflows/brief-skill/workflow.md +0 -58
- package/src/workflows/create-skill/data/source-resolution-protocols.md +0 -200
- package/src/workflows/create-skill/steps-c/step-03-extract.md +0 -301
- package/src/workflows/create-skill/steps-c/step-03b-fetch-temporal.md +0 -253
- package/src/workflows/create-skill/steps-c/step-06-validate.md +0 -254
- package/src/workflows/create-skill/steps-c/step-08-report.md +0 -176
- package/src/workflows/create-skill/workflow.md +0 -53
- package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +0 -196
- package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +0 -270
- package/src/workflows/create-stack-skill/steps-c/step-09-report.md +0 -145
- package/src/workflows/create-stack-skill/workflow.md +0 -59
- package/src/workflows/drop-skill/steps-c/step-03-report.md +0 -135
- package/src/workflows/drop-skill/workflow.md +0 -63
- package/src/workflows/export-skill/data/managed-section-format.md +0 -103
- package/src/workflows/export-skill/steps-c/step-01-load-skill.md +0 -237
- package/src/workflows/export-skill/workflow.md +0 -58
- package/src/workflows/quick-skill/steps-c/step-06-write.md +0 -179
- package/src/workflows/quick-skill/workflow.md +0 -58
- package/src/workflows/refine-architecture/workflow.md +0 -61
- package/src/workflows/rename-skill/steps-c/step-03-report.md +0 -132
- package/src/workflows/rename-skill/workflow.md +0 -64
- package/src/workflows/setup-forge/steps-c/step-04-report.md +0 -156
- package/src/workflows/setup-forge/workflow.md +0 -51
- package/src/workflows/test-skill/data/scoring-rules.md +0 -123
- package/src/workflows/test-skill/data/source-access-protocol.md +0 -51
- package/src/workflows/test-skill/steps-c/step-01-init.md +0 -217
- package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +0 -280
- package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +0 -271
- package/src/workflows/test-skill/steps-c/step-05-score.md +0 -222
- package/src/workflows/test-skill/steps-c/step-06-report.md +0 -207
- package/src/workflows/test-skill/templates/test-report-template.md +0 -28
- package/src/workflows/test-skill/workflow.md +0 -57
- package/src/workflows/update-skill/data/remote-source-resolution.md +0 -57
- package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +0 -221
- package/src/workflows/update-skill/steps-c/step-03-re-extract.md +0 -256
- package/src/workflows/update-skill/steps-c/step-06-write.md +0 -265
- package/src/workflows/update-skill/workflow.md +0 -56
- package/src/workflows/verify-stack/data/feasibility-report-template.md +0 -63
- package/src/workflows/verify-stack/data/integration-verification-rules.md +0 -73
- package/src/workflows/verify-stack/steps-c/step-01-init.md +0 -179
- package/src/workflows/verify-stack/steps-c/step-03-integrations.md +0 -195
- package/src/workflows/verify-stack/steps-c/step-05-synthesize.md +0 -191
- package/src/workflows/verify-stack/steps-c/step-06-report.md +0 -197
- package/src/workflows/verify-stack/workflow.md +0 -61
- package/tools/cli/lib/compiler.js +0 -306
- package/tools/cli/lib/ide-commands.js +0 -244
- /package/src/{workflows/analyze-source → skf-analyze-source}/templates/analysis-report-template.md +0 -0
- /package/src/{workflows/quick-skill/data → skf-quick-skill/assets}/skill-template.md +0 -0
- /package/src/{workflows/setup-forge/data → skf-setup/references}/tier-rules.md +0 -0
- /package/src/{workflows/test-skill/data → skf-test-skill/assets}/output-section-formats.md +0 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
nextStepFile: './step-03c-fetch-docs.md'
|
|
3
|
+
# Resolve `{atomicWriteHelper}` by probing `{atomicWriteProbeOrder}` in order
|
|
4
|
+
# (installed SKF module path first, src/ dev-checkout fallback); first existing
|
|
5
|
+
# path wins. HALT if neither resolves.
|
|
6
|
+
atomicWriteProbeOrder:
|
|
7
|
+
- '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
|
|
8
|
+
- '{project-root}/src/shared/scripts/skf-atomic-write.py'
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Step 3b: Fetch Temporal Context
|
|
12
|
+
|
|
13
|
+
## STEP GOAL:
|
|
14
|
+
|
|
15
|
+
To fetch temporal context (issues, PRs, changelogs, release notes) from the source repository and index it into a QMD collection for Deep tier enrichment. This ensures step-04 has historical data to search when annotating extracted functions with T2 provenance.
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
|
|
19
|
+
- Deep tier only — Quick, Forge, and Forge+ tiers skip this step entirely and silently
|
|
20
|
+
- GitHub repositories only — other source types degrade gracefully
|
|
21
|
+
- Do not halt the workflow if fetching or indexing fails
|
|
22
|
+
- Do not modify extraction data from step-03 — this step only creates QMD collections
|
|
23
|
+
|
|
24
|
+
## MANDATORY SEQUENCE
|
|
25
|
+
|
|
26
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
|
|
27
|
+
|
|
28
|
+
### 1. Check Eligibility
|
|
29
|
+
|
|
30
|
+
Evaluate the following conditions sequentially. **If ANY condition fails, skip silently to section 5 (auto-proceed) with no output:**
|
|
31
|
+
|
|
32
|
+
1. **Tier is Deep:** If tier is Quick, Forge, or Forge+, skip silently.
|
|
33
|
+
2. **Source is GitHub:** Verify `source_repo` is a GitHub URL (`https://github.com/...`) or `owner/repo` format. If the source is a local path, a non-GitHub URL, or any other format, attempt GitHub remote detection (section 1b) before skipping.
|
|
34
|
+
3. **`gh` CLI is available:** Run `timeout 10s gh auth status` to verify the CLI is installed and authenticated (the short timeout protects against a misconfigured network or hung auth helper blocking the workflow). If it fails or times out, skip silently.
|
|
35
|
+
|
|
36
|
+
All three conditions must pass to proceed to section 2.
|
|
37
|
+
|
|
38
|
+
### 1b. GitHub Remote Detection for Local Sources
|
|
39
|
+
|
|
40
|
+
**Only runs when condition 2 above fails because `source_repo` is a local path.**
|
|
41
|
+
|
|
42
|
+
Local repositories that are clones of GitHub repos contain temporal context (issues, PRs, releases) accessible via `gh`. Detect this automatically:
|
|
43
|
+
|
|
44
|
+
1. Check if the local path is a git repository: `git -C "{source_repo}" rev-parse --is-inside-work-tree`
|
|
45
|
+
2. If not a git repo: skip silently to section 5 (current behavior).
|
|
46
|
+
3. Extract the origin remote: `git -C "{source_repo}" remote get-url origin`
|
|
47
|
+
4. If the remote URL contains `github.com`:
|
|
48
|
+
- Extract `owner/repo` from the remote URL (strip `.git` suffix, handle both HTTPS and SSH formats)
|
|
49
|
+
- Log: "**Local source with GitHub remote detected:** {owner}/{repo} — fetching temporal context."
|
|
50
|
+
- Use the extracted `owner/repo` for all `gh` API calls in sections 3-4. Continue to condition 3 (gh CLI check).
|
|
51
|
+
5. If no remote, or remote is not GitHub: skip silently to section 5 (current behavior).
|
|
52
|
+
|
|
53
|
+
### 2. Check Cache (Skip If Fresh)
|
|
54
|
+
|
|
55
|
+
Read `forge-tier.yaml` from the sidecar path.
|
|
56
|
+
|
|
57
|
+
- Look for a `qmd_collections` entry where `skill_name` matches the current brief AND `type` is `"temporal"`.
|
|
58
|
+
- If found AND `created_at` is within the last **7 days** (rationale: temporal context — issues, PRs, changelogs — rarely changes meaningfully on shorter horizons; a 7-day window balances freshness against re-fetch cost and GitHub rate limits): the temporal collection is fresh. Display:
|
|
59
|
+
|
|
60
|
+
"**Temporal context: cached.** Collection `{skill-name}-temporal` is fresh ({days} days old). Skipping re-fetch."
|
|
61
|
+
|
|
62
|
+
Skip to section 5 (auto-proceed).
|
|
63
|
+
|
|
64
|
+
- If not found OR `created_at` is older than 7 days: continue to section 3.
|
|
65
|
+
|
|
66
|
+
### 3. Fetch Temporal Context
|
|
67
|
+
|
|
68
|
+
Create a staging directory: `_bmad-output/{skill-name}-temporal/`
|
|
69
|
+
|
|
70
|
+
Resolve the `owner` and `repo` from `source_repo` (e.g., `acme/toolkit` from `https://github.com/acme/toolkit`).
|
|
71
|
+
|
|
72
|
+
Execute the following fetches, writing output as markdown files to the staging directory. **If any individual fetch fails, log a warning and continue with the others:**
|
|
73
|
+
|
|
74
|
+
1. **Issues (last 100):** (rationale: 100 is `gh issue list`'s default max-per-page; a single paginated call captures recent activity without extra round trips or rate-limit pressure)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
gh issue list -R {owner}/{repo} --state all --limit 100 --json number,title,state,labels,createdAt,closedAt,body | ...
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Write to `{staging}/issues.md` — format as a markdown document with one section per issue (number, title, state, labels, body summary).
|
|
81
|
+
|
|
82
|
+
2. **Merged PRs (last 100):** (rationale: same 100-per-page convention as issues — captures the most recent merges in one API call)
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
gh pr list -R {owner}/{repo} --state merged --limit 100 --json number,title,mergedAt,labels,body | ...
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Write to `{staging}/prs.md` — format as a markdown document with one section per PR.
|
|
89
|
+
|
|
90
|
+
3. **Releases (last 10):** (rationale: release notes accumulate slowly relative to issues/PRs; the most recent 10 tags cover roughly the last 6-18 months of changelog-relevant history for typical OSS projects, which is enough context for T2-past annotations without fanning out to dozens of `gh release view` calls)
|
|
91
|
+
|
|
92
|
+
**Note:** `gh release list --json` does **not** support the `body` field. Use a two-step approach: list tags first, then fetch each release individually with `--json` (which IS supported on `gh release view`).
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Step 1: Get release tags (body NOT available here)
|
|
96
|
+
gh release list -R {owner}/{repo} --limit 10 --json tagName,name,publishedAt
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
If Step 1 returns an empty array (no releases), skip Step 2 and omit the releases section entirely.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Step 2: For EACH tagName from Step 1, fetch the full release
|
|
103
|
+
gh release view {tagName} -R {owner}/{repo} --json tagName,name,publishedAt,body
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Iterate over every `tagName` from Step 1's JSON array. **Append each release to `{staging}/releases.md` immediately after its `gh release view` call returns** — do not buffer the entire loop in memory and write once at the end. The append-per-release pattern guarantees that a mid-loop abort (rate limit, network drop, user interrupt) leaves a partial but well-formed `releases.md` with every release fetched so far, rather than discarding all of them because the loop didn't reach its final write.
|
|
107
|
+
|
|
108
|
+
Write an empty `{staging}/releases.md` with a header (`# Releases (partial if interrupted)`) before the loop, then append one `## {tagName} — {name} ({publishedAt})` section per successful fetch. Failed individual fetches get a one-line placeholder: `## {tagName} — fetch failed: {error}`.
|
|
109
|
+
|
|
110
|
+
If `gh release view` fails for a specific tag, log a warning and skip that release — continue with remaining tags. If a rate limit (HTTP 429) is hit, stop the release loop, keep the partial `releases.md` file in place (do NOT delete it), and log: "Release fetch stopped at tag {N}/{total} due to rate limiting — partial releases.md retained."
|
|
111
|
+
|
|
112
|
+
Format each section as a markdown block with tag, name, date, and body.
|
|
113
|
+
|
|
114
|
+
4. **Changelog (if exists):**
|
|
115
|
+
|
|
116
|
+
Check if `CHANGELOG.md` or `RELEASES.md` exists in the repository root:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
gh api repos/{owner}/{repo}/contents/CHANGELOG.md --jq '.content' | base64 -d
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
If found, write to `{staging}/changelog.md`. If not found (404), skip silently.
|
|
123
|
+
|
|
124
|
+
#### 3b. Targeted Function Searches (Uses Extraction Inventory)
|
|
125
|
+
|
|
126
|
+
After the generic fetches above, perform **targeted searches** using the top-level public API function names from `extraction_inventory.top_exports[]`. This produces high-signal results that generic list fetches miss.
|
|
127
|
+
|
|
128
|
+
**Short-circuit on empty `top_exports`:** If `extraction_inventory.top_exports` is missing or `== []` (docs-only mode, or a source extraction that produced zero public exports), skip this sub-section entirely with a one-line log: "No exports in inventory — skipping targeted function searches." The generic fetches from §3 remain in place and continue to provide baseline temporal context.
|
|
129
|
+
|
|
130
|
+
**Limit:** Search the top **10 function names** maximum to control API call volume and avoid `gh` rate limiting. (rationale: 10 targeted searches + generic fetches from §3 stays well under GitHub's unauthenticated search rate limit of 10 requests/minute and authenticated 30/minute; matches the `top_exports[]` size emitted by step-03 §5 so every tracked export gets one search.)
|
|
131
|
+
|
|
132
|
+
For each function name in `top_exports[]` (up to 10), **sanitize first**: strip every character that is not in `[A-Za-z0-9_]` from `function_name` to produce `safe_name`. This prevents shell injection and `gh` query parser errors when an export name contains punctuation (e.g., `<T>`, `.method`, `::namespace`, quotes). If `safe_name` is empty after sanitization (the original was entirely punctuation — rare but possible for symbol exports), fall back to piping the original name through stdin via `--query-from-file -`-style indirection if your `gh` version supports it; otherwise skip that one entry with a log line — never substitute the unsanitized name back into the shell command.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# safe_name = re.sub(r'[^A-Za-z0-9_]', '', function_name); skip if empty
|
|
136
|
+
# --limit 5: top-5 issues per function keeps signal-to-noise high (most matches
|
|
137
|
+
# below rank 5 are typically keyword coincidences, not targeted discussions) and
|
|
138
|
+
# caps the total response size across 10 function fan-outs at 50 issues.
|
|
139
|
+
gh search issues --repo {owner}/{repo} "{safe_name}" --limit 5 --json number,title,state,body
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Aggregate all targeted search results into a single file: `{staging}/targeted-issues.md`. Format as a markdown document with one section per function name, listing the matching issues/PRs found.
|
|
143
|
+
|
|
144
|
+
**If `gh search` is unavailable** (older `gh` CLI versions): skip targeted searches silently. The generic fetches from section 3 still provide baseline temporal context.
|
|
145
|
+
|
|
146
|
+
**If rate limiting occurs** (HTTP 429 or similar): stop targeted searches immediately, keep results collected so far. Log: "Targeted search stopped at function {N}/{total} due to rate limiting."
|
|
147
|
+
|
|
148
|
+
**After all fetching,** verify at least one file was written to the staging directory. If the staging directory is empty (all fetches failed), log a warning and skip to section 5.
|
|
149
|
+
|
|
150
|
+
### 4. Index Into QMD & Register
|
|
151
|
+
|
|
152
|
+
**Index the staging directory:**
|
|
153
|
+
|
|
154
|
+
If a `{skill-name}-temporal` collection already exists, remove and recreate for atomic replace. **Wrap the remove + add pair with rollback on `add` failure** — a `remove` that succeeds followed by an `add` that fails must not leave the registry claiming a collection that no longer exists in QMD:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
qmd collection remove {skill-name}-temporal
|
|
158
|
+
if ! qmd collection add {project-root}/_bmad-output/{skill-name}-temporal/ --name {skill-name}-temporal --mask "*.md"; then
|
|
159
|
+
# add failed after remove succeeded — the collection is gone from QMD. Clean the registry too.
|
|
160
|
+
# Remove any {skill-name}-temporal entry from forge-tier.yaml qmd_collections[].
|
|
161
|
+
# Warn the user, do not fail the workflow (temporal enrichment degrades gracefully).
|
|
162
|
+
echo "WARN: qmd add failed after remove — registry entry for {skill-name}-temporal removed to keep forge-tier.yaml consistent with QMD state."
|
|
163
|
+
# [skip the embed step]
|
|
164
|
+
else
|
|
165
|
+
qmd embed --collection {skill-name}-temporal
|
|
166
|
+
fi
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Rollback rule:** if the `qmd collection add` step fails (non-zero exit, network error, parse error) AND the prior `remove` succeeded, the canonical registry entry in `forge-tier.yaml` MUST be removed to match QMD's actual state. A dangling registry entry that points at a non-existent QMD collection poisons subsequent cache-hit checks in §2. Emit a warning in evidence-report and skip the embed — enrichment degrades to no-QMD for this run.
|
|
170
|
+
|
|
171
|
+
**Scope the embed:** Always pass `--collection {skill-name}-temporal` to `qmd embed`. An unscoped `qmd embed` re-embeds every collection in the QMD store, which can take minutes per run in batch mode and generates wasteful GPU/API cost. If the installed `qmd` CLI does not accept `--collection` (older upstream versions), gate the embed behind a per-skill check: if a previous `{skill-name}-temporal` entry already exists in `qmd_collections` and its `created_at` is within 24 hours, skip the embed entirely and warn "qmd embed skipped — upstream qmd lacks --collection scope; re-embedding all collections would be wasteful in batch mode". Log the skip in the evidence report.
|
|
172
|
+
|
|
173
|
+
**Note:** `qmd embed` generates vector embeddings required for semantic (`type:'vec'`) and HyDE (`type:'hyde'`) sub-queries inside the QMD `query` tool. Without embeddings, only BM25 (`type:'lex'`) keyword search works. Run `qmd embed` after every `qmd collection add`.
|
|
174
|
+
|
|
175
|
+
**Update the registry** in `forge-tier.yaml` under a file lock to prevent concurrent batch runs from clobbering each other's entries:
|
|
176
|
+
|
|
177
|
+
1. Acquire an exclusive `flock` on `{sidecar_path}/forge-tier.yaml.lock` (create the lock file if absent). Use `flock -x {lockfile} -c "..."` or an equivalent `fcntl.flock(LOCK_EX)` guard.
|
|
178
|
+
2. Read the current `forge-tier.yaml`, capturing its `st_mtime` as `mtime_before`.
|
|
179
|
+
3. Perform the read-modify-write below.
|
|
180
|
+
4. Write via `python3 {atomicWriteHelper} write --target {sidecar_path}/forge-tier.yaml`.
|
|
181
|
+
5. Release the flock.
|
|
182
|
+
|
|
183
|
+
**Fallback when `flock` is unavailable:** re-stat the file after the write; if the on-disk `st_mtime` is newer than `mtime_before` by more than this run's own write timestamp, halt with "forge-tier.yaml modified mid-update by another process — refusing to clobber. Re-run after the other run completes." This read-CAS-by-mtime is the belt-and-braces safety net for environments without `flock`.
|
|
184
|
+
|
|
185
|
+
If an entry with `name: "{skill-name}-temporal"` already exists in `qmd_collections`, replace it. Otherwise, append:
|
|
186
|
+
|
|
187
|
+
```yaml
|
|
188
|
+
- name: "{skill-name}-temporal"
|
|
189
|
+
type: "temporal"
|
|
190
|
+
source_workflow: "create-skill"
|
|
191
|
+
skill_name: "{skill-name}"
|
|
192
|
+
created_at: "{current ISO date}"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Clean up** the staging directory after successful indexing:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
rm -rf {project-root}/_bmad-output/{skill-name}-temporal/
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Error handling:**
|
|
202
|
+
|
|
203
|
+
- If QMD indexing fails: log the error, note that temporal enrichment will be unavailable. Do NOT fail the workflow.
|
|
204
|
+
- If registry update fails: log the error, continue. The collection may exist in QMD even if the registry entry failed.
|
|
205
|
+
- If cleanup fails: log a warning and continue.
|
|
206
|
+
|
|
207
|
+
Display brief confirmation:
|
|
208
|
+
|
|
209
|
+
"**Temporal context indexed.** Collection `{skill-name}-temporal` created ({file_count} files: {list files}). Proceeding to enrichment..."
|
|
210
|
+
|
|
211
|
+
### 5. Menu Handling Logic
|
|
212
|
+
|
|
213
|
+
**Auto-proceed step — no user interaction.**
|
|
214
|
+
|
|
215
|
+
After temporal context is fetched and indexed (or skipped for any reason), immediately load, read entire file, then execute `{nextStepFile}`.
|
|
216
|
+
|
|
217
|
+
#### EXECUTION RULES:
|
|
218
|
+
|
|
219
|
+
- This is an auto-proceed step with no user choices
|
|
220
|
+
- Quick/Forge/Forge+ tiers skip directly to next step with no output
|
|
221
|
+
- Non-GitHub sources skip directly to next step with no output
|
|
222
|
+
- Cached collections (< 7 days old) skip with brief cache-hit message
|
|
223
|
+
- Deep tier with fresh fetch displays brief confirmation then auto-proceeds
|
|
224
|
+
- All failures degrade gracefully — skip and auto-proceed
|
|
225
|
+
|
|
226
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
227
|
+
|
|
228
|
+
ONLY WHEN temporal context is indexed into QMD (or the step is skipped due to eligibility, cache, or failure) will you proceed to load `{nextStepFile}` for documentation fetch.
|
|
229
|
+
|
package/src/{workflows/create-skill/steps-c → skf-create-skill/steps-c/sub}/step-03c-fetch-docs.md
RENAMED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
nextStepFile: '../step-04-enrich.md'
|
|
3
|
+
# Resolve `{atomicWriteHelper}` by probing `{atomicWriteProbeOrder}` in order
|
|
4
|
+
# (installed SKF module path first, src/ dev-checkout fallback); first existing
|
|
5
|
+
# path wins. HALT if neither resolves.
|
|
6
|
+
atomicWriteProbeOrder:
|
|
7
|
+
- '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
|
|
8
|
+
- '{project-root}/src/shared/scripts/skf-atomic-write.py'
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
# Step 3c: Fetch Remote Documentation
|
|
@@ -10,42 +14,12 @@ nextStepFile: './step-04-enrich.md'
|
|
|
10
14
|
|
|
11
15
|
Fetch remote documentation from brief-specified URLs using whatever web fetching capability is available in the agent's environment, extract API information, and add T3-confidence content to the extraction inventory. Tool-agnostic — the agent uses Firecrawl, WebFetch, web-reader, curl, or any available web tool.
|
|
12
16
|
|
|
13
|
-
##
|
|
17
|
+
## Rules
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- TOOL/SUBPROCESS FALLBACK: If any instruction references a tool you do not have access to, you MUST still achieve the outcome in your main context thread
|
|
20
|
-
- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
21
|
-
|
|
22
|
-
### Role Reinforcement:
|
|
23
|
-
|
|
24
|
-
- You are a skill compilation engine fetching external documentation for T3 enrichment
|
|
25
|
-
- Doc fetching is best-effort — individual URL failures never block the workflow
|
|
26
|
-
- Graceful degradation is paramount — if no web fetching tools are available, skip with a warning and proceed
|
|
27
|
-
|
|
28
|
-
### Step-Specific Rules:
|
|
29
|
-
|
|
30
|
-
- No tier gate — this step runs at any tier when `doc_urls` are present in the brief
|
|
31
|
-
- Tool-agnostic — use whatever web fetching capability is available (Firecrawl, WebFetch, web-reader, curl, browser tools, etc.)
|
|
32
|
-
- FORBIDDEN to halt the workflow if web fetching is unavailable or fails
|
|
33
|
-
- FORBIDDEN to override existing T1, T1-low, or T2 extraction data with T3 content
|
|
34
|
-
- FORBIDDEN to begin compilation — that is step-05
|
|
35
|
-
|
|
36
|
-
## EXECUTION PROTOCOLS:
|
|
37
|
-
|
|
38
|
-
- Follow MANDATORY SEQUENCE exactly
|
|
39
|
-
- Every extracted item receives a T3 confidence citation: `[EXT:{url}]`
|
|
40
|
-
- Merge doc-fetch results into the extraction inventory per the conflict rule in section 5
|
|
41
|
-
- Do NOT hallucinate content — if information is not in the fetched text, exclude it
|
|
42
|
-
|
|
43
|
-
## CONTEXT BOUNDARIES:
|
|
44
|
-
|
|
45
|
-
- Available: brief_data (including `doc_urls`, `source_type`), tier, extraction_inventory from step-03
|
|
46
|
-
- Focus: Fetching external documentation and producing T3-confidence extraction items
|
|
47
|
-
- Limits: Do NOT modify existing T1/T1-low/T2 items, begin enrichment, or compile content
|
|
48
|
-
- Dependencies: Step-03 extraction must be complete (even if inventory is empty for docs-only briefs)
|
|
19
|
+
- No tier gate — runs at any tier when `doc_urls` are present in the brief
|
|
20
|
+
- Tool-agnostic — use whatever web fetching capability is available
|
|
21
|
+
- Do not halt the workflow if web fetching is unavailable or fails
|
|
22
|
+
- Do not override existing T1, T1-low, or T2 extraction data with T3 content
|
|
49
23
|
|
|
50
24
|
## MANDATORY SEQUENCE
|
|
51
25
|
|
|
@@ -108,7 +82,7 @@ If neither trigger fires, keep the page content as-is and do NOT trigger subpage
|
|
|
108
82
|
- Crawl: if a crawl tool is available, use it with depth=1 on the root URL
|
|
109
83
|
- If no discovery tool is available, keep the root page content as-is and continue
|
|
110
84
|
|
|
111
|
-
2. **Filter discovered URLs by relevance:** From the
|
|
85
|
+
2. **Filter discovered URLs by relevance and origin:** Restrict candidates to the same **registrable domain** as the root URL — strip the URL down to its eTLD+1 (e.g., for root `https://docs.example.com/intro`, accept any subdomain of `example.com` such as `api.example.com` or `docs.example.com`, but reject `example.org` or `cdn.partner.io`). Cross-origin links must be discarded before any fetch. The same-registrable-domain rule prevents Mintlify/Docusaurus link clouds from pulling in tracking pixels, doc-site CDNs, or third-party embeds as if they were canonical docs. From the surviving same-domain candidates, select the most relevant pages by searching for API-related terms in the URL path or title (e.g., `api`, `reference`, `quickstart`, `setup`, `config`, `getting-started`, `guide`, `sdk`, `methods`, `functions`). Exclude pages that are clearly non-API content (e.g., `blog`, `changelog`, `pricing`, `about`, `careers`).
|
|
112
86
|
|
|
113
87
|
3. **Fetch top subpages:** Fetch up to **10** of the most relevant subpages. For each:
|
|
114
88
|
- Use the same web fetching tool as the root URL
|
|
@@ -141,6 +115,8 @@ Parse the successfully fetched markdown for:
|
|
|
141
115
|
|
|
142
116
|
**Conflict rule:** T3 items NEVER override existing T1, T1-low, or T2 items for the same export. When an export already has a higher-confidence entry, the T3 item is discarded. T3 has the lowest priority.
|
|
143
117
|
|
|
118
|
+
**Edge case — T1-zero supplemental mode:** If T1 extraction produced zero results and `doc_urls` are present in supplemental mode, T3 items should be used as the primary inventory since no T1 data exists to conflict with.
|
|
119
|
+
|
|
144
120
|
**Aggregate totals for reporting:**
|
|
145
121
|
- URLs fetched successfully vs. total
|
|
146
122
|
- URLs that failed
|
|
@@ -153,9 +129,9 @@ Parse the successfully fetched markdown for:
|
|
|
153
129
|
**If tier is Deep and at least one URL was fetched successfully:**
|
|
154
130
|
|
|
155
131
|
1. Write fetched markdown files to a staging directory: `_bmad-output/{skill-name}-docs/`
|
|
156
|
-
2. Index into QMD: `qmd collection add {project-root}/_bmad-output/{skill-name}-docs/ --name {skill-name}-docs --mask "*.md"`
|
|
157
|
-
3. Generate embeddings: `qmd embed` (required for `
|
|
158
|
-
4. Register in forge-tier.yaml `qmd_collections` array
|
|
132
|
+
2. Index into QMD with atomic replace + rollback: if a `{skill-name}-docs` collection already exists, run `qmd collection remove {skill-name}-docs` first, then `qmd collection add {project-root}/_bmad-output/{skill-name}-docs/ --name {skill-name}-docs --mask "*.md"`. **If `qmd collection add` fails after a successful `remove`:** remove any matching `{skill-name}-docs` entry from `forge-tier.yaml` → `qmd_collections[]` to keep the registry consistent with QMD's actual state, warn in evidence-report, and skip the embed — docs enrichment degrades gracefully.
|
|
133
|
+
3. Generate embeddings scoped to this collection (only if step 2 `add` succeeded): `qmd embed --collection {skill-name}-docs` (required for semantic `type:'vec'` and HyDE `type:'hyde'` sub-queries within the QMD `query` tool). If the installed `qmd` CLI does not accept `--collection`, gate the embed behind a freshness check: skip re-embedding if the existing `{skill-name}-docs` registry entry is within 24 hours, and log the skip in the evidence report to prevent unbounded batch-mode re-embedding.
|
|
134
|
+
4. Register in forge-tier.yaml `qmd_collections` array — **acquire an exclusive `flock` on `{sidecar_path}/forge-tier.yaml.lock` for the read-modify-write** (see the locking pattern documented in step-03b §4). Write via `python3 {atomicWriteHelper} write --target {sidecar_path}/forge-tier.yaml`. If `flock` is unavailable, fall back to read-CAS-by-mtime (capture `st_mtime` before, re-check after; refuse to clobber if a concurrent run wrote in between).
|
|
159
135
|
|
|
160
136
|
```yaml
|
|
161
137
|
- name: "{skill-name}-docs"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skf-create-stack-skill
|
|
3
|
+
description: Consolidated project stack skill with integration patterns — code-mode (analyzes manifests) or compose-mode (synthesizes from existing skills + architecture doc). Use when the user requests to "create a stack skill."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create Stack Skill
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Produces a consolidated stack skill documenting how libraries connect. **Code-mode** analyzes dependency manifests and co-import patterns from actual source code. **Compose-mode** synthesizes from pre-generated individual skills and architecture documents when no codebase exists yet. Every finding must trace to actual code with file:line citations; in compose-mode, inferred integrations are permitted but must be labeled `[inferred from shared domain]`.
|
|
11
|
+
|
|
12
|
+
## Role
|
|
13
|
+
|
|
14
|
+
You are a dependency analyst and integration architect operating in Ferris Architect mode. You bring expertise in dependency analysis, cross-library integration patterns, and compositional architecture, while the user brings their project knowledge and scope preferences.
|
|
15
|
+
|
|
16
|
+
## Workflow Rules
|
|
17
|
+
|
|
18
|
+
These rules apply to every step in this workflow:
|
|
19
|
+
|
|
20
|
+
- Zero hallucination — all extracted content must trace to actual source code (compose-mode inferences must be labeled)
|
|
21
|
+
- Read each step file completely before taking any action
|
|
22
|
+
- Follow the mandatory sequence in each step exactly — do not skip, reorder, or optimize
|
|
23
|
+
- Only load one step file at a time — never preload future steps
|
|
24
|
+
- If any instruction references a subprocess or tool you lack, achieve the outcome in your main context thread
|
|
25
|
+
- Always communicate in `{communication_language}`
|
|
26
|
+
- If `{headless_mode}` is true, auto-proceed through confirmation gates with their default action and log each auto-decision
|
|
27
|
+
- **Workflow state contract — `workflow_warnings[]` accumulator (M4):** every step that emits a warning ("log a warning", "record in workflow state for the evidence report", "Warning: ...", etc.) MUST append a structured entry to a single in-memory list named `workflow_warnings[]`. Each entry has the shape `{step: "step-NN", severity: "info|warn|error", code: "<short-slug>", message: "<human text>", context: {<optional fields>}}`. Step-07 surfaces these in `evidence-report.md`; step-08 may add validation findings; step-09 §5 reads the accumulated list and renders the user-facing "Warnings" section. Do not invent a per-step warning channel — there is exactly one accumulator for the whole workflow.
|
|
28
|
+
|
|
29
|
+
## Stages
|
|
30
|
+
|
|
31
|
+
| # | Step | File | Auto-proceed |
|
|
32
|
+
|---|------|------|--------------|
|
|
33
|
+
| 1 | Initialize & Mode Detection | steps-c/step-01-init.md | No (confirm) |
|
|
34
|
+
| 2 | Detect Manifests | steps-c/step-02-detect-manifests.md | Yes |
|
|
35
|
+
| 3 | Rank & Confirm Libraries | steps-c/step-03-rank-and-confirm.md | No (confirm) |
|
|
36
|
+
| 4 | Parallel Extract | steps-c/step-04-parallel-extract.md | Yes |
|
|
37
|
+
| 5 | Detect Integrations | steps-c/step-05-detect-integrations.md | Yes |
|
|
38
|
+
| 6 | Compile Stack | steps-c/step-06-compile-stack.md | No (review) |
|
|
39
|
+
| 7 | Generate Output | steps-c/step-07-generate-output.md | Yes |
|
|
40
|
+
| 8 | Validate | steps-c/step-08-validate.md | Yes |
|
|
41
|
+
| 9 | Report | steps-c/step-09-report.md | Yes |
|
|
42
|
+
| 10 | Workflow Health Check | steps-c/step-10-health-check.md | Yes |
|
|
43
|
+
|
|
44
|
+
## Invocation Contract
|
|
45
|
+
|
|
46
|
+
| Aspect | Detail |
|
|
47
|
+
|--------|--------|
|
|
48
|
+
| **Inputs** | project_path [required], mode (code/compose) [auto-detected] |
|
|
49
|
+
| **Gates** | step-03: Confirm Gate [C] | step-06: Review Gate [C] |
|
|
50
|
+
| **Outputs** | SKILL.md (stack), context-snippet.md, metadata.json |
|
|
51
|
+
| **Headless** | All gates auto-resolve with default action when `{headless_mode}` is true |
|
|
52
|
+
|
|
53
|
+
## On Activation
|
|
54
|
+
|
|
55
|
+
1. Load config from `{project-root}/_bmad/skf/config.yaml` and resolve:
|
|
56
|
+
- `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`, `skills_output_folder`, `forge_data_folder`, `sidecar_path`
|
|
57
|
+
|
|
58
|
+
2. **Resolve `{headless_mode}`** with explicit precedence (B2):
|
|
59
|
+
1. **Explicit disable wins.** If `--headless=false` or `--no-headless` was passed, `{headless_mode}` is `false` regardless of any preference.
|
|
60
|
+
2. **Explicit enable next.** If `--headless` or `-H` was passed (without `=false`), `{headless_mode}` is `true`.
|
|
61
|
+
3. **Preferences fallback.** Otherwise, read `headless_mode` from `{sidecar_path}/preferences.yaml` (`true` or `false`).
|
|
62
|
+
4. **Default:** `false`.
|
|
63
|
+
|
|
64
|
+
3. Load, read the full file, and then execute `./steps-c/step-01-init.md` to begin the workflow.
|
|
@@ -69,7 +69,8 @@ Indexed format targeting ~80-120 tokens per stack:
|
|
|
69
69
|
"name": "{project}-stack",
|
|
70
70
|
"version": "1.0.0",
|
|
71
71
|
"generation_date": "{ISO-8601}",
|
|
72
|
-
"
|
|
72
|
+
"forge_tier": "{Quick|Forge|Forge+|Deep}",
|
|
73
|
+
"confidence_tier": "{T1|T1-low|T2|T3}",
|
|
73
74
|
"spec_version": "1.3",
|
|
74
75
|
"source_authority": "{official|community|internal}",
|
|
75
76
|
"generated_by": "create-stack-skill",
|
|
@@ -4,7 +4,7 @@ Rules for synthesizing a stack skill from pre-generated individual skills and an
|
|
|
4
4
|
|
|
5
5
|
## Skill Loading
|
|
6
6
|
|
|
7
|
-
Skills use version-nested directories — see
|
|
7
|
+
Skills use version-nested directories — see `knowledge/version-paths.md` for the full path templates and resolution rules.
|
|
8
8
|
|
|
9
9
|
**Version-aware skill enumeration:**
|
|
10
10
|
|
|
@@ -17,6 +17,16 @@ Skills use version-nested directories — see [knowledge/version-paths.md](../..
|
|
|
17
17
|
7. Store the resolved package path as `skill_package_path` for use in later steps (extraction, integration detection)
|
|
18
18
|
8. Store loaded skills as `raw_dependencies` with `source: "existing_skill"`
|
|
19
19
|
|
|
20
|
+
## Compose-mode Co-mention Precision
|
|
21
|
+
|
|
22
|
+
Prose co-mention detection is heuristic — it can only provide `Plausible`-class evidence (compared to code-mode's co-imports, which are literal). To reduce false positives the matcher in step-05 §2 applies three guards:
|
|
23
|
+
|
|
24
|
+
1. **Word-boundary matching** (`\b{skill_name}\b`, case-insensitive). Substring matches are rejected (no `react` inside `reactive`).
|
|
25
|
+
2. **Section filtering.** Paragraphs under H1/H2 headers that normalise to `introduction`, `overview`, `glossary`, `table of contents`, `references`, `appendix`, or `index` are excluded — they typically enumerate all libraries without describing integration. Headings themselves are also excluded as co-mention sources.
|
|
26
|
+
3. **Two-paragraph minimum.** A pair `(A, B)` requires at least two distinct body paragraphs co-mentioning both names. A single paragraph can be coincidental.
|
|
27
|
+
|
|
28
|
+
**Known limitations:** even with these guards, a co-mention only witnesses that two libraries are discussed together; it does not prove an integration exists. Downstream consumers should prefer stack manifests (`skf-create-stack-skill` output) to prose-derived evidence when both are available.
|
|
29
|
+
|
|
20
30
|
## Architecture Integration Mapping
|
|
21
31
|
|
|
22
32
|
**If `{architecture_doc_path}` is null or the file does not exist:** Skip this section and proceed to [Inferred Integrations (No Architecture Document)](#inferred-integrations-no-architecture-document) below.
|
|
@@ -57,10 +67,14 @@ Each integration entry must cite both source skills by name with function signat
|
|
|
57
67
|
|
|
58
68
|
## Feasibility Report Integration
|
|
59
69
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
70
|
+
The feasibility report contract is defined by the shared schema at `src/shared/references/feasibility-report-schema.md` (single source of truth — `skf-verify-stack` is the producer, this skill is the consumer). Consumers MUST follow the schema verbatim:
|
|
71
|
+
|
|
72
|
+
- **Filename pattern:** `{forge_data_folder}/feasibility-report-{project_slug}-{YYYYMMDD-HHmmss}.md`, with a stable `feasibility-report-{project_slug}-latest.md` copy at the same location. Use `{project_slug}` (slugified `project_name`), not raw `{project_name}`.
|
|
73
|
+
- **Schema version guard:** Parse frontmatter and confirm `schemaVersion == "1.0"`. On mismatch, HALT with an explicit error; never silently proceed with an unknown version.
|
|
74
|
+
- **Overall verdict tokens** (frontmatter `overallVerdict`, case-sensitive): exactly one of `FEASIBLE | CONDITIONALLY_FEASIBLE | NOT_FEASIBLE`.
|
|
75
|
+
- **Per-pair verdict tokens** (in the `## Integration Verdicts` table, case-sensitive): exactly one of `Verified | Plausible | Risky | Blocked`. Any unknown token is a hard error.
|
|
76
|
+
- Include the verdict in the integration evidence: `VS overall: {overallVerdict}`, `VS pair: {verdict}`.
|
|
77
|
+
- Flag pairs where VS reported `Risky` or `Blocked`.
|
|
64
78
|
|
|
65
79
|
## Inferred Integrations (No Architecture Document)
|
|
66
80
|
|
|
@@ -57,5 +57,5 @@ Library A + Library B
|
|
|
57
57
|
Files: [count] files with co-imports
|
|
58
58
|
Key files: [top 3 files by integration density]
|
|
59
59
|
Pattern: [brief description of how they integrate]
|
|
60
|
-
Confidence: [T1
|
|
60
|
+
Confidence: [weaker of the two libraries' tiers from per_library_extractions[], with detection-method qualifier in parens — e.g., `T1-low (grep-co-import)`, `T1 (ccc-augmented)`, `T1-low (architecture-co-mention) [composed]`. Integration detection is grep + co-import, never AST — do not label integrations "AST-verified".]
|
|
61
61
|
```
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Supported Ecosystems
|
|
4
4
|
|
|
5
|
-
| Ecosystem
|
|
6
|
-
|
|
7
|
-
| JavaScript/TypeScript | package.json
|
|
8
|
-
| Python
|
|
9
|
-
| Rust
|
|
10
|
-
| Go
|
|
11
|
-
| Java
|
|
12
|
-
| Ruby
|
|
13
|
-
| PHP
|
|
14
|
-
| .NET
|
|
5
|
+
| Ecosystem | Manifest File(s) | Dependency Key | Import Pattern |
|
|
6
|
+
|-----------------------|-----------------------------------------------------|------------------------------------------|-------------------------------------------|
|
|
7
|
+
| JavaScript/TypeScript | package.json | dependencies, devDependencies | `import ... from '...'`, `require('...')` |
|
|
8
|
+
| Python | requirements.txt, setup.py, pyproject.toml, Pipfile | install_requires, [project.dependencies] | `import ...`, `from ... import` |
|
|
9
|
+
| Rust | Cargo.toml | [dependencies] | `use ...`, `extern crate` |
|
|
10
|
+
| Go | go.mod | require | `import "..."` |
|
|
11
|
+
| Java | pom.xml, build.gradle | dependencies | `import ...` |
|
|
12
|
+
| Ruby | Gemfile | gem | `require '...'`, `require_relative` |
|
|
13
|
+
| PHP | composer.json | require, require-dev | `use ...`, `require_once` |
|
|
14
|
+
| .NET | *.csproj | PackageReference | `using ...` |
|
|
15
15
|
|
|
16
16
|
## Detection Priority
|
|
17
17
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: 'step-01-init'
|
|
3
|
-
description: 'Initialize stack skill workflow by loading forge tier and validating prerequisites'
|
|
4
|
-
|
|
5
2
|
nextStepFile: './step-02-detect-manifests.md'
|
|
6
3
|
forgeTierFile: '{sidecar_path}/forge-tier.yaml'
|
|
7
4
|
---
|
|
@@ -12,43 +9,25 @@ forgeTierFile: '{sidecar_path}/forge-tier.yaml'
|
|
|
12
9
|
|
|
13
10
|
Load forge tier configuration, validate prerequisites, and prepare the stack skill workflow for execution.
|
|
14
11
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
### Universal Rules:
|
|
18
|
-
|
|
19
|
-
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
20
|
-
- ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
|
|
21
|
-
- ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
12
|
+
## Rules
|
|
22
13
|
|
|
23
|
-
|
|
14
|
+
- Focus only on loading configuration and validating prerequisites — do not start analyzing dependencies
|
|
24
15
|
|
|
25
|
-
|
|
26
|
-
- ✅ Execute with prescriptive precision — every finding must trace to actual code
|
|
27
|
-
- ✅ Speed-first approach with zero hallucination
|
|
28
|
-
|
|
29
|
-
### Step-Specific Rules:
|
|
16
|
+
## MANDATORY SEQUENCE
|
|
30
17
|
|
|
31
|
-
|
|
32
|
-
- 🚫 FORBIDDEN to start detecting manifests or analyzing dependencies
|
|
33
|
-
- 🚫 No A/P menu — this is an auto-proceed init step
|
|
18
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
|
|
34
19
|
|
|
35
|
-
|
|
20
|
+
### 0. Validate Project Config
|
|
36
21
|
|
|
37
|
-
-
|
|
38
|
-
- 💾 Store tier, tools, and optional inputs as workflow state
|
|
39
|
-
- 📖 Auto-proceed to next step after successful initialization
|
|
40
|
-
- 🚫 HALT with actionable error if prerequisites missing
|
|
22
|
+
Before anything else, load `{project-root}/_bmad/skf/config.yaml`. If the file is missing OR fails YAML parse OR lacks the required top-level keys (`project_name`, `output_folder`, `skills_output_folder`, `forge_data_folder`, `sidecar_path`), HALT with:
|
|
41
23
|
|
|
42
|
-
|
|
24
|
+
"**Cannot proceed.** SKF is not initialized for this project (config.yaml missing or malformed).
|
|
43
25
|
|
|
44
|
-
|
|
45
|
-
- Requires setup-forge to have been completed (forge-tier.yaml)
|
|
46
|
-
- User may provide optional explicit dependency list or scope overrides
|
|
47
|
-
- No dependencies on brief-skill or create-skill outputs
|
|
26
|
+
**Required:** Run `skf init` first.
|
|
48
27
|
|
|
49
|
-
|
|
28
|
+
**Halting workflow.**"
|
|
50
29
|
|
|
51
|
-
|
|
30
|
+
STOP — do not proceed.
|
|
52
31
|
|
|
53
32
|
### 1. Load Forge Tier Configuration
|
|
54
33
|
|
|
@@ -56,9 +35,9 @@ Load `{forgeTierFile}` from the Ferris sidecar.
|
|
|
56
35
|
|
|
57
36
|
**If forge-tier.yaml does not exist:**
|
|
58
37
|
|
|
59
|
-
"**Cannot proceed.** The setup
|
|
38
|
+
"**Cannot proceed.** The setup workflow has not been run for this project.
|
|
60
39
|
|
|
61
|
-
**Required:** Run `setup
|
|
40
|
+
**Required:** Run `setup` first to detect available tools and determine your forge tier.
|
|
62
41
|
|
|
63
42
|
**Halting workflow.**"
|
|
64
43
|
|
|
@@ -84,7 +63,7 @@ Extract:
|
|
|
84
63
|
- **Forge+:** ast_bridge + ccc_bridge (ccc semantic co-import augmentation) — ccc available for step-05
|
|
85
64
|
- **Deep:** qmd_bridge (QMD temporal enrichment) — required for Deep tier
|
|
86
65
|
|
|
87
|
-
See
|
|
66
|
+
See `knowledge/tool-resolution.md` for how each bridge name resolves to concrete tools per IDE environment.
|
|
88
67
|
|
|
89
68
|
Report tool availability. If a tier-required tool is missing, downgrade tier and note:
|
|
90
69
|
|
|
@@ -106,7 +85,7 @@ Check if the user provided:
|
|
|
106
85
|
|
|
107
86
|
Set `compose_mode: false` as the default.
|
|
108
87
|
|
|
109
|
-
Skills use version-nested directories — see
|
|
88
|
+
Skills use version-nested directories — see `knowledge/version-paths.md` for the full path templates and resolution rules.
|
|
110
89
|
|
|
111
90
|
- If user provides an architecture document path for composition or explicitly requests compose mode → set `compose_mode: true` and store `architecture_doc_path`
|
|
112
91
|
- If no manifest files exist in project root AND at least one skill is discoverable in `{skills_output_folder}` → suggest compose mode to the user and ask for optional architecture document path
|
|
@@ -142,23 +121,3 @@ Where tier_description follows positive capability framing:
|
|
|
142
121
|
|
|
143
122
|
Load, read the full file and then execute `{nextStepFile}`.
|
|
144
123
|
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
148
|
-
|
|
149
|
-
### ✅ SUCCESS:
|
|
150
|
-
|
|
151
|
-
- Forge tier loaded and validated
|
|
152
|
-
- Tool availability confirmed with tier adjustment if needed
|
|
153
|
-
- Optional inputs accepted and stored
|
|
154
|
-
- Initialization summary displayed with positive capability framing
|
|
155
|
-
- Auto-proceeded to step 02
|
|
156
|
-
|
|
157
|
-
### ❌ SYSTEM FAILURE:
|
|
158
|
-
|
|
159
|
-
- Proceeding without forge-tier.yaml
|
|
160
|
-
- Not reporting tier adjustments when tools missing
|
|
161
|
-
- Starting manifest detection in this step
|
|
162
|
-
- Displaying A/P menu (this is auto-proceed)
|
|
163
|
-
|
|
164
|
-
**Master Rule:** This step validates prerequisites and initializes state. No analysis, no detection, no extraction.
|