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
package/src/{workflows/create-skill/data → skf-create-skill/references}/extraction-patterns.md
RENAMED
|
@@ -30,11 +30,11 @@ Structural extraction via ast-grep — verified exports with line-level citation
|
|
|
30
30
|
|
|
31
31
|
> **Note:** `ast_bridge.*`, `qmd_bridge.*`, and `ccc_bridge.*` references below are **conceptual interfaces**, not callable functions. Resolve them as follows:
|
|
32
32
|
> - `ast_bridge.*` → ast-grep MCP tools (`mcp__ast-grep__find_code`, `mcp__ast-grep__find_code_by_rule`) or `ast-grep` CLI
|
|
33
|
-
> - `qmd_bridge.*` → QMD MCP
|
|
33
|
+
> - `qmd_bridge.*` → QMD MCP `query` tool (`mcp__plugin_qmd-plugin_qmd__query`) taking `searches=[{type:'lex'|'vec'|'hyde', query, intent}]`, or `qmd` CLI (`qmd search` / `qmd vector-search`). The legacy `vector_search` MCP tool has been removed; if a client surfaces a tool-not-found error, degrade gracefully per the QMD step-04 tool-probe note — do not retry the stale name.
|
|
34
34
|
> - `ccc_bridge.*` → `/ccc` skill (Claude Code), ccc MCP server (Cursor), or `ccc` CLI
|
|
35
35
|
> - `gh_bridge.*` → `gh api` commands or direct file I/O for local sources
|
|
36
36
|
>
|
|
37
|
-
> See
|
|
37
|
+
> See `knowledge/tool-resolution.md` for the complete resolution table. Also see the AST Extraction Protocol section below and the TOOL/SUBPROCESS FALLBACK rule for dispatch details.
|
|
38
38
|
|
|
39
39
|
### Strategy
|
|
40
40
|
|
|
@@ -235,7 +235,8 @@ constraints:
|
|
|
235
235
|
id: python-public-classes
|
|
236
236
|
language: python
|
|
237
237
|
rule:
|
|
238
|
-
pattern: 'class $NAME
|
|
238
|
+
pattern: 'class $NAME'
|
|
239
|
+
kind: class_definition
|
|
239
240
|
inside:
|
|
240
241
|
kind: module
|
|
241
242
|
stopBy: end
|
|
@@ -244,6 +245,8 @@ constraints:
|
|
|
244
245
|
regex: '^[^_]'
|
|
245
246
|
```
|
|
246
247
|
|
|
248
|
+
> **Pattern note:** The minimal `class $NAME` pattern (with `kind: class_definition` to disambiguate the AST node) works on ast-grep 0.42.x via both MCP `find_code_by_rule` and CLI `--json=stream`. The previously documented `class $NAME($$$BASES)` and `class $NAME($$$BASES):` variants are known-broken on 0.42.x — see Known Limitations #7 below. For simple CLI extraction without a YAML rule, use `ast-grep run -p 'class $NAME' -l python --json=stream {path}` and post-filter names via the `^[^_]` regex in the Python processing step of the CLI streaming template.
|
|
249
|
+
|
|
247
250
|
**JavaScript/TypeScript — exported functions:**
|
|
248
251
|
|
|
249
252
|
> **Language selection:** Use `language: typescript` for `.ts` files and `language: tsx` for `.tsx` files. Patterns that work with `typescript` may return zero results with `tsx` and vice versa — they use different tree-sitter parsers. For mixed codebases, run each pattern twice (once per language) and merge results. Note: `export function` patterns may fail with `tsx` on ast-grep 0.41.x (see Known Limitations #5) — use source reading as fallback for those.
|
|
@@ -395,6 +398,8 @@ When using ast-grep for extraction, be aware of these documented limitations:
|
|
|
395
398
|
|
|
396
399
|
6. **CLI `--json=stream` may produce no output:** On ast-grep 0.41.x, `--json=stream` may produce empty output for certain patterns. The `--json=stream` flag requires the explicit `run` subcommand: use `ast-grep run -p '{pattern}' --json=stream` (not `ast-grep -p '{pattern}' --json=stream`). If streaming still produces no output, fall back to the MCP tool or source reading.
|
|
397
400
|
|
|
401
|
+
7. **Python class patterns with bases/colon return zero (ast-grep 0.42.x):** The patterns `class $NAME($$$BASES)` and `class $NAME($$$BASES):` return zero matches on real Python sources with ast-grep 0.42.0, even on files containing dozens of subclassed public classes. `find_code_by_rule` also rejects the bare inline rule without `kind` as `Rule must specify a set of AST kinds to match. Try adding \`kind\` rule.` **Workaround:** Use the minimal `class $NAME` pattern with `kind: class_definition` (YAML) or `ast-grep run -p 'class $NAME' -l python --json=stream` (CLI), then post-filter names via the `^[^_]` regex. The `^[^_]` constraint enforces the "public" filter since ast-grep's base-match rule is what's broken, not the name-match rule. See the Python — public classes recipe above.
|
|
402
|
+
|
|
398
403
|
### Component Library Demo/Example Auto-Exclusion
|
|
399
404
|
|
|
400
405
|
When `scope.type: "component-library"`, auto-detect and propose demo/example exclusions before extraction begins. **User confirmation is required before applying** — some `examples/` directories contain API-level code.
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Source Resolution Protocols
|
|
2
|
+
|
|
3
|
+
## Shell Path Quoting
|
|
4
|
+
|
|
5
|
+
Every shell snippet in this document uses `{...}` placeholders for paths. **Always wrap path interpolations in double quotes** when emitting the actual command — `git -C "{workspace_repo_path}"`, `rm -rf "{temp_path}"`, `cd "{project-root}"`. SKF's supported platforms are Linux and macOS; user home directories on macOS frequently contain spaces, which break unquoted shell. WSL2 users see the same. Native Windows is untested but the quoting convention is also required there.
|
|
6
|
+
|
|
7
|
+
## Tag Resolution
|
|
8
|
+
|
|
9
|
+
Tag resolution maps a declared version in the brief onto a concrete git ref before cloning, so the skill is built from code matching its declared version. Two paths trigger tag resolution: an **explicit** `brief.target_version` (deliberate user intent) or an **implicit** `brief.version` (auto-populated hint from `brief-skill`). Both apply only when `source_repo` is a remote URL.
|
|
10
|
+
|
|
11
|
+
**When neither `brief.target_version` nor `brief.version` is set:** skip tag resolution entirely. Set `source_ref` to `HEAD` (default branch).
|
|
12
|
+
|
|
13
|
+
### Explicit Tag Resolution (when target_version is set)
|
|
14
|
+
|
|
15
|
+
When `brief.target_version` is present AND `source_repo` is a remote URL, resolve the target version to a git tag before cloning:
|
|
16
|
+
|
|
17
|
+
1. **List available tags:**
|
|
18
|
+
- `gh api repos/{owner}/{repo}/tags --paginate --jq '.[].name'`
|
|
19
|
+
- Fallback: `git ls-remote --tags "{source_repo}" | sed 's|.*refs/tags/||'`
|
|
20
|
+
|
|
21
|
+
2. **Match `target_version` against tags** in priority order:
|
|
22
|
+
- **Exact match:** `{target_version}` (e.g., `0.5.0`)
|
|
23
|
+
- **With `v` prefix:** `v{target_version}` (e.g., `v0.5.0`)
|
|
24
|
+
- **With package scope (monorepos):** `{brief.name}@{target_version}` or `@{scope}/{brief.name}@{target_version}`
|
|
25
|
+
|
|
26
|
+
3. **Resolution outcomes:**
|
|
27
|
+
- **Single match:** Store the matched tag as `source_ref`. Use it as `{branch}` in all subsequent clone/API commands.
|
|
28
|
+
- **Multiple matches:** Present the matching tags to the user — "Multiple tags match version {target_version}: {list}. Which one should I use?" Wait for selection.
|
|
29
|
+
- **Zero matches:** ⚠️ Warn: "No git tag found matching version {target_version}. Closest available tags: {list 5 nearest by semver sort}. Falling back to default branch — **extracted code may not match target version.**" Set `source_ref` to `HEAD` and proceed with default branch.
|
|
30
|
+
|
|
31
|
+
4. **Store `source_ref`** in context. This value is written to metadata.json and provenance-map.json for downstream workflows (update-skill, audit-skill) to re-clone from the same ref.
|
|
32
|
+
|
|
33
|
+
### Implicit Tag Resolution (when only brief.version is set)
|
|
34
|
+
|
|
35
|
+
When `brief.target_version` is absent but `brief.version` is present AND `source_repo` is a remote URL, treat `brief.version` as an **implicit** target version and attempt tag resolution before cloning. This matches `brief-skill`'s behavior, which auto-populates `brief.version` from the latest non-prerelease release tag — so a tag matching `brief.version` is the common case, and silently cloning HEAD would produce a skill labeled with `brief.version` but built from an unrelated default-branch commit.
|
|
36
|
+
|
|
37
|
+
1. **List available tags** exactly as in Explicit Tag Resolution above.
|
|
38
|
+
|
|
39
|
+
2. **Match `brief.version` against tags** in this reduced priority order. Package-scoped monorepo variants are **not** tried — those require deliberate user intent via `target_version`, since implicit matching against a monorepo tag like `{brief.name}@{version}` could silently select a sibling package's ref:
|
|
40
|
+
- **Exact match:** `{brief.version}` (e.g., `0.3.37`)
|
|
41
|
+
- **With `v` prefix:** `v{brief.version}` (e.g., `v0.3.37`)
|
|
42
|
+
|
|
43
|
+
3. **Resolution outcomes:**
|
|
44
|
+
- **Single match:** Store the matched tag as `source_ref`. Use it as `{branch}` in all subsequent clone/API commands. Do not warn — this is the expected path.
|
|
45
|
+
- **Multiple matches:** Present the matching tags to the user — "Multiple tags match `brief.version` ({brief.version}): {list}. Which one should I use, or fall back to HEAD?" Wait for selection.
|
|
46
|
+
- **Zero matches:** ⚠️ Warn: "No git tag found matching `brief.version` ({brief.version}). Falling back to default branch — **extracted code may not match the declared version.** If you intended to pin a specific version, set `target_version` explicitly in the brief." Set `source_ref` to `HEAD` and proceed with default branch. Append `tag_resolution: {status: "fallback-head", requested: "{brief.version}", reason: "no-matching-tag"}` to the in-context evidence-report payload so step-05 §7 surfaces the fallback in the evidence report. This turns the warning into a persistent audit trail a reviewer can grep later, not just a one-shot stderr line.
|
|
47
|
+
|
|
48
|
+
4. **Do not halt on zero matches.** Unlike the explicit path, implicit resolution never blocks compilation — `brief.version` is an auto-populated hint, and some repositories simply do not tag releases. The warning is sufficient notice; the evidence report in step-08 will surface the HEAD fallback for reviewers.
|
|
49
|
+
|
|
50
|
+
5. **Store `source_ref`** in context exactly as in the explicit path. It flows through to metadata.json and provenance-map.json so downstream workflows (update-skill, audit-skill) can re-clone from the same ref.
|
|
51
|
+
|
|
52
|
+
**Interaction with Version Reconciliation (below):** When implicit tag resolution succeeds, the clone's source files should carry the same version as `brief.version` — so the Version Reconciliation section's source-vs-brief mismatch warning will not fire. When implicit resolution falls back to HEAD, Version Reconciliation runs normally against the default branch's version file and may produce its own mismatch warning.
|
|
53
|
+
|
|
54
|
+
### Local Source Warning
|
|
55
|
+
|
|
56
|
+
When `brief.target_version` is set AND `source_repo` is a local path:
|
|
57
|
+
|
|
58
|
+
⚠️ "**Local source may not match target version {target_version}.** Ensure you've checked out the correct version locally, or use a remote GitHub URL so SKF can clone from the git tag automatically."
|
|
59
|
+
|
|
60
|
+
Proceed with local files as-is. Set `source_ref` to `"local"`.
|
|
61
|
+
|
|
62
|
+
Implicit resolution via `brief.version` is **not applied to local sources** — local paths reflect whatever the user has checked out, and rewriting them from a tag would be out of scope for a local-source workflow.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Remote Source Resolution
|
|
67
|
+
|
|
68
|
+
**Note:** Quick-tier remote sources do not use the workspace/clone protocol described below. Quick tier accesses remote files via the `gh_bridge.read_file` path described in step-03 section 4.
|
|
69
|
+
|
|
70
|
+
If `source_repo` is a local path: proceed with the tier-appropriate strategy as normal.
|
|
71
|
+
|
|
72
|
+
If `source_repo` is a remote URL (GitHub URL or owner/repo format) AND tier is Forge, Forge+, or Deep:
|
|
73
|
+
|
|
74
|
+
1. **Check `git` availability:** Verify `git` is functional (`git --version`). If `git` is not available, skip to the fallback warning below.
|
|
75
|
+
|
|
76
|
+
2. **Compute workspace path:** Derive a persistent local path from the remote URL:
|
|
77
|
+
|
|
78
|
+
- **Parse the URL** to extract `{host}`, `{owner}`, `{repo}`:
|
|
79
|
+
- `https://github.com/facebook/react` or `https://github.com/facebook/react.git` → `github.com/facebook/react`
|
|
80
|
+
- `git@github.com:facebook/react.git` → `github.com/facebook/react`
|
|
81
|
+
- `facebook/react` (owner/repo shorthand) → `github.com/facebook/react`
|
|
82
|
+
- **Resolve workspace root:** Use environment variable `SKF_WORKSPACE` if set, otherwise `~/.skf/workspace/` (where `~` is the user's home directory on all platforms)
|
|
83
|
+
- **Workspace repo path:** `{workspace_root}/repos/{host}/{owner}/{repo}/`
|
|
84
|
+
|
|
85
|
+
3. **Workspace check — resolve the source locally:**
|
|
86
|
+
|
|
87
|
+
**Concurrency guard:** all of the operations below (fetch, checkout, rev-parse, and the extraction read that follows in step-03) must be wrapped in an exclusive `flock` on `{workspace_repo_path}/.skf-workspace.lock`. Acquire the lock before the workspace-hit check, hold it across fetch + checkout + rev-parse, AND keep holding it through the extraction-time read of the working tree. Two concurrent batch runs that target the same workspace clone but different `source_ref` values would otherwise race — one would `checkout` while the other was reading files mid-extraction, corrupting the inventory. The lock makes the per-workspace-repo unit of work serial. Use `flock -x {lockfile} -c "..."` or `fcntl.flock(LOCK_EX)`. If `flock` is unavailable, log a warning ("Concurrency guard unavailable — concurrent forges against the same workspace repo may produce inconsistent extraction inventories") and proceed.
|
|
88
|
+
|
|
89
|
+
**If `{workspace_repo_path}/.git/` exists (workspace hit):**
|
|
90
|
+
|
|
91
|
+
The repo was previously cloned into the workspace. Fetch updates and checkout the requested ref.
|
|
92
|
+
|
|
93
|
+
**Detect tag vs branch for `source_ref`** (skipped when `source_ref` is `HEAD` — in that case fetch default branch without a ref argument):
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
# Ask the remote whether source_ref exists as a tag
|
|
97
|
+
git -C "{workspace_repo_path}" ls-remote --tags origin {source_ref} | grep -q "refs/tags/{source_ref}$" && ref_kind=tag || ref_kind=branch
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Fetch using the ref-kind-appropriate invocation so tag refs are written into `refs/tags/*` rather than being dropped by a branch-only fetch:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
if ref_kind == tag:
|
|
104
|
+
git -C "{workspace_repo_path}" fetch origin tag {source_ref}
|
|
105
|
+
else:
|
|
106
|
+
git -C "{workspace_repo_path}" fetch origin {source_ref}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Check if checkout is needed — skip if the requested ref is already checked out:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
current_head = git -C "{workspace_repo_path}" rev-parse HEAD
|
|
113
|
+
fetched_head = git -C "{workspace_repo_path}" rev-parse FETCH_HEAD
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
If `current_head != fetched_head`:
|
|
117
|
+
```
|
|
118
|
+
git -C "{workspace_repo_path}" -c advice.detachedHead=false checkout FETCH_HEAD
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If fetch or checkout fails, proceed to the **ephemeral fallback** (step 5).
|
|
122
|
+
|
|
123
|
+
**If `{workspace_repo_path}/.git/` does NOT exist (workspace miss):**
|
|
124
|
+
|
|
125
|
+
Clone the repository into the workspace for persistent reuse. Create the parent directory first (`{workspace_root}/repos/{host}/{owner}/`):
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
mkdir -p "{workspace_root}/repos/{host}/{owner}/"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
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:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
# If source_ref is a real branch or tag (not HEAD/null):
|
|
135
|
+
git clone --depth 1 --branch {source_ref} "{source_repo}" "{workspace_repo_path}"
|
|
136
|
+
|
|
137
|
+
# If source_ref is HEAD or not set (default branch):
|
|
138
|
+
git clone --depth 1 "{source_repo}" "{workspace_repo_path}"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Note:** No `--filter=blob:none` — blobs for the current tree are needed for indexing and the cost is amortized across all future forges. No sparse-checkout — a full checkout serves all consumers (different briefs with different include/exclude patterns) without configuration conflicts. `--single-branch` is reserved for ephemeral clones (step 5); workspace clones keep all branches available so re-forges against different refs can fetch + checkout without re-cloning.
|
|
142
|
+
|
|
143
|
+
If this is the **first repo** in the workspace (workspace root was just created), print an informational message:
|
|
144
|
+
|
|
145
|
+
"Caching source at `{workspace_repo_path}` (saves time on re-forges). Override location with `SKF_WORKSPACE` env var."
|
|
146
|
+
|
|
147
|
+
If clone fails, proceed to the **ephemeral fallback** (step 5).
|
|
148
|
+
|
|
149
|
+
4. **If workspace resolution succeeds:** Set `source_root = {workspace_repo_path}` — this updates the working source path for all subsequent operations (AST extraction, CCC indexing, artifact generation). Capture the source commit: `git -C "{workspace_repo_path}" rev-parse HEAD` — store as `source_commit` in context. Proceed with the **Forge/Deep Tier** extraction strategy below. Set context:
|
|
150
|
+
- `source_root = {workspace_repo_path}`
|
|
151
|
+
- `remote_clone_path = {workspace_repo_path}`
|
|
152
|
+
- `remote_clone_type = "workspace"`
|
|
153
|
+
|
|
154
|
+
**Scope filtering:** Since the workspace uses a full checkout (no sparse-checkout), apply `include_patterns` and `exclude_patterns` from the brief as **file-level filters** when building the extraction file list. Always-included root files (`pyproject.toml`, `package.json`, `Cargo.toml`, `go.mod`, `setup.py`, `setup.cfg`, `VERSION`) are exempt from pattern filtering.
|
|
155
|
+
|
|
156
|
+
5. **Ephemeral fallback (on any workspace failure):**
|
|
157
|
+
|
|
158
|
+
If workspace clone or fetch fails for any reason (network error, auth failure, disk full, timeout), fall back to ephemeral cloning — the pre-workspace behavior that always works:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
temp_path = {system_temp}/skf-ephemeral-{skill-name}-{timestamp}/
|
|
162
|
+
|
|
163
|
+
# If source_ref is a real branch or tag (not HEAD/null):
|
|
164
|
+
git clone --depth 1 --branch {source_ref} --single-branch --filter=blob:none "{source_repo}" "{temp_path}"
|
|
165
|
+
|
|
166
|
+
# If source_ref is HEAD or not set (default branch):
|
|
167
|
+
git clone --depth 1 --single-branch --filter=blob:none "{source_repo}" "{temp_path}"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
If ephemeral clone succeeds: Set `source_root = {temp_path}`. Capture `source_commit`. Set context:
|
|
171
|
+
- `source_root = {temp_path}`
|
|
172
|
+
- `remote_clone_path = {temp_path}`
|
|
173
|
+
- `remote_clone_type = "ephemeral"`
|
|
174
|
+
|
|
175
|
+
Apply `include_patterns` and `exclude_patterns` from the brief as file-level filters when building the extraction file list.
|
|
176
|
+
|
|
177
|
+
6. **If all cloning fails (workspace AND ephemeral):**
|
|
178
|
+
|
|
179
|
+
⚠️ **Warn the user explicitly:**
|
|
180
|
+
|
|
181
|
+
"Clone of `{source_repo}` failed: {error}. Degrading to source reading (T1-low) for this run. For T1 (AST-verified) confidence, clone the repository locally and update `source_repo` in your brief to the local path."
|
|
182
|
+
|
|
183
|
+
Proceed with Quick tier extraction strategy below. Note the degradation reason in context for the evidence report.
|
|
184
|
+
|
|
185
|
+
**Remote clone cleanup:** After extraction is complete for all files in scope (whether successful or partially failed), before presenting the Gate 2 summary (Section 6):
|
|
186
|
+
|
|
187
|
+
- **If `remote_clone_type == "ephemeral"`:** Cleanup is required.
|
|
188
|
+
1. **Reset working directory first:** Run `cd "{project-root}"` using the **absolute path** captured at workflow start.
|
|
189
|
+
2. **Delete the clone:** `rm -rf "{temp_path}"`
|
|
190
|
+
3. **Log:** "Ephemeral source clone cleaned up."
|
|
191
|
+
|
|
192
|
+
This ensures cleanup runs even if some extractions failed. If any error halts the step before Gate 2, cleanup must still occur.
|
|
193
|
+
|
|
194
|
+
- **If `remote_clone_type == "workspace"`:** No cleanup. The workspace checkout persists for future forges.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Source Commit Capture (all tiers, source mode only)
|
|
199
|
+
|
|
200
|
+
**If `source_type: "docs-only"`:** skip — set `source_commit: null`.
|
|
201
|
+
|
|
202
|
+
After the source path is accessible, capture the current commit hash for provenance tracking:
|
|
203
|
+
|
|
204
|
+
- **Local path:** `git -C "{source_root}" rev-parse HEAD` — if the path is a git repo
|
|
205
|
+
- **Ephemeral clone (Forge/Deep):** already captured during clone (step 3 above)
|
|
206
|
+
- **Quick tier (remote, no clone):** `gh api repos/{owner}/{repo}/commits/{source_ref} --jq '.sha'`
|
|
207
|
+
|
|
208
|
+
Store the result as `source_commit` in context. If capture fails (not a git repo, API unavailable), set `source_commit: null` — this is not an error.
|
|
209
|
+
|
|
210
|
+
Also store `source_ref` in context (from tag resolution above, or `HEAD` if no tag was resolved, or `"local"` for local sources). This value is persisted to metadata.json and provenance-map.json so downstream workflows (update-skill, audit-skill) can re-access the same source ref.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Version Reconciliation (all tiers, source mode only)
|
|
215
|
+
|
|
216
|
+
**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).
|
|
217
|
+
|
|
218
|
+
**If `source_type: "docs-only"`:** skip this section — no source files exist to reconcile.
|
|
219
|
+
|
|
220
|
+
After the source path is accessible (local path from step-01, or workspace/ephemeral clone from above), check whether the source contains a version identifier and reconcile it with `brief.version`. Look for the first matching version file in the resolved source path:
|
|
221
|
+
|
|
222
|
+
- Python: `pyproject.toml` (`[project] version`), `setup.py` (`version=`), `__version__` in `__init__.py`
|
|
223
|
+
- JavaScript/TypeScript: `package.json` (`"version"`). **Monorepo resolution:** When multiple `package.json` files exist (workspace root + packages), resolve version using this priority:
|
|
224
|
+
1. Package whose `name` field matches `brief.name` (e.g., the skill's target library name)
|
|
225
|
+
2. Package with a `bin` field (CLI entry point — represents the published version)
|
|
226
|
+
3. Root workspace `package.json` version (if present)
|
|
227
|
+
4. Fall back to `brief.version` if no version found. For monorepos using workspace protocols (pnpm, yarn, npm workspaces), the root `package.json` often has no `version` field — this is expected, not an error.
|
|
228
|
+
- Rust: `Cargo.toml` (`[package] version`)
|
|
229
|
+
- Go: `go.mod` (module version if tagged)
|
|
230
|
+
|
|
231
|
+
**If a source version is found AND it differs from `brief.version`:**
|
|
232
|
+
|
|
233
|
+
⚠️ Warn the user: "Brief version ({brief.version}) differs from source version ({source_version}). Using source version ({source_version})."
|
|
234
|
+
|
|
235
|
+
Update the working version in context to the source version. Record the mismatch in context for the evidence report (step-08).
|
|
236
|
+
|
|
237
|
+
**If no version file is found or version cannot be extracted:** keep `brief.version` as-is. No warning needed.
|
|
238
|
+
|
|
239
|
+
**If source is remote and accessed via Quick tier (gh_bridge, no local files):** attempt to read the version file via `gh_bridge.read_file(owner, repo, "{version_file}")` — resolved as `gh api repos/{owner}/{repo}/contents/{version_file}` or direct file read if local (see `knowledge/tool-resolution.md`) — for the primary version file of the detected language. If the read fails, keep `brief.version`.
|
package/src/{workflows/create-skill/data → skf-create-skill/references}/tier-degradation-rules.md
RENAMED
|
@@ -6,21 +6,22 @@ When `source_repo` is a remote URL (GitHub URL or owner/repo format) and the tie
|
|
|
6
6
|
|
|
7
7
|
- **ast-grep requires local files** — it cannot operate on remote URLs
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**Workspace-first clone strategy (preferred):**
|
|
10
10
|
|
|
11
11
|
1. Check `git` availability (`git --version`). `git` is effectively guaranteed at Deep tier (via `gh` dependency) but NOT guaranteed at Forge tier.
|
|
12
|
-
2. If `git` is available:
|
|
13
|
-
3.
|
|
14
|
-
4. For update-skill:
|
|
15
|
-
5. If clone succeeds: use the
|
|
16
|
-
6.
|
|
12
|
+
2. If `git` is available: check for an existing workspace checkout at `{workspace_root}/repos/{host}/{owner}/{repo}/`. If found, `git fetch` to update. If not found, clone into the workspace path with `--depth 1 --single-branch`. See `source-resolution-protocols.md` for the full workspace resolution algorithm.
|
|
13
|
+
3. The workspace uses a full checkout (no sparse-checkout). Brief `include_patterns` and `exclude_patterns` are applied as file-level filters at extraction time, not at the git level. This allows a single workspace checkout to serve multiple briefs with different scope filters.
|
|
14
|
+
4. For update-skill: `changed_files_from_manifest` scoping is applied as file-level filters at extraction time on the full workspace checkout.
|
|
15
|
+
5. If workspace clone/fetch succeeds: use the workspace path for AST extraction. All results are T1 with `[AST:...]` citations.
|
|
16
|
+
6. If workspace fails: fall back to ephemeral clone (`{system_temp}/skf-ephemeral-{skill-name}-{timestamp}/`). If ephemeral succeeds, use it. Ephemeral clone is deleted after extraction.
|
|
17
|
+
7. Workspace checkouts persist across forges — CCC indexes, tool outputs, and the checkout itself are reused.
|
|
17
18
|
|
|
18
19
|
**Fallback (clone fails or `git` unavailable):**
|
|
19
20
|
|
|
20
21
|
- The extraction step MUST warn the user explicitly before degrading
|
|
21
22
|
- **create-skill:** Warning must include actionable guidance — clone locally and update `source_repo` in the brief to the local path
|
|
22
23
|
- **update-skill:** Warning must include actionable guidance — clone locally, re-run [CS] Create Skill with the local path to regenerate provenance data, then re-run the update
|
|
23
|
-
- Extraction proceeds using Quick tier strategy (source reading via gh_bridge — resolved as `gh api` commands or direct file I/O; see
|
|
24
|
+
- Extraction proceeds using Quick tier strategy (source reading via gh_bridge — resolved as `gh api` commands or direct file I/O; see `knowledge/tool-resolution.md`)
|
|
24
25
|
- All results labeled T1-low with `[SRC:...]` citations
|
|
25
26
|
- The degradation reason is recorded in the evidence report
|
|
26
27
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: 'step-01-load-brief'
|
|
3
|
-
description: 'Load skill-brief.yaml, validate structure, resolve source code location, load forge tier'
|
|
4
2
|
nextStepFile: './step-02-ecosystem-check.md'
|
|
5
3
|
forgeTierFile: '{sidecar_path}/forge-tier.yaml'
|
|
6
4
|
preferencesFile: '{sidecar_path}/preferences.yaml'
|
|
@@ -12,41 +10,10 @@ preferencesFile: '{sidecar_path}/preferences.yaml'
|
|
|
12
10
|
|
|
13
11
|
To load and validate the skill-brief.yaml compilation config, resolve the source code location, and load the forge tier from sidecar to determine available capabilities for the compilation pipeline.
|
|
14
12
|
|
|
15
|
-
##
|
|
13
|
+
## Rules
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
20
|
-
- 🎯 ALWAYS follow the exact instructions in the step file
|
|
21
|
-
- ⚙️ 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
|
|
22
|
-
- ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
23
|
-
|
|
24
|
-
### Role Reinforcement:
|
|
25
|
-
|
|
26
|
-
- ✅ You are a skill compilation engine performing initialization
|
|
27
|
-
- ✅ This is an autonomous init step — no user interaction needed
|
|
28
|
-
- ✅ Load data, validate structure, resolve paths, determine capabilities
|
|
29
|
-
|
|
30
|
-
### Step-Specific Rules:
|
|
31
|
-
|
|
32
|
-
- 🎯 Focus ONLY on loading brief, resolving source, and determining tier
|
|
33
|
-
- 🚫 FORBIDDEN to begin extraction or compilation — that's steps 03-05
|
|
34
|
-
- 🚫 FORBIDDEN to write any output files — this step only loads and validates
|
|
35
|
-
- 💬 Report initialization status clearly
|
|
36
|
-
|
|
37
|
-
## EXECUTION PROTOCOLS:
|
|
38
|
-
|
|
39
|
-
- 🎯 Follow MANDATORY SEQUENCE exactly
|
|
40
|
-
- 💾 All loaded data remains in context for subsequent steps
|
|
41
|
-
- 📖 Validate brief structure before proceeding
|
|
42
|
-
- 🚫 Halt with actionable error if prerequisites are missing
|
|
43
|
-
|
|
44
|
-
## CONTEXT BOUNDARIES:
|
|
45
|
-
|
|
46
|
-
- Available: User's skill name or brief path from Ferris menu invocation
|
|
47
|
-
- Focus: Loading inputs and determining capabilities
|
|
48
|
-
- Limits: Do NOT begin any extraction or compilation work
|
|
49
|
-
- Dependencies: forge-tier.yaml must exist (from setup-forge workflow)
|
|
15
|
+
- Focus only on loading brief, resolving source, and determining tier — do not begin extraction or compilation
|
|
16
|
+
- Do not write any output files — this step only loads and validates
|
|
50
17
|
|
|
51
18
|
## MANDATORY SEQUENCE
|
|
52
19
|
|
|
@@ -65,7 +32,14 @@ Extract and report:
|
|
|
65
32
|
- `tools`: which tools are available (gh, ast-grep, ccc, qmd)
|
|
66
33
|
- `ccc_index`: ccc index state (status, indexed_path, last_indexed) — needed by step-02b
|
|
67
34
|
|
|
68
|
-
**Apply tier override:** Read `{preferencesFile}`. If `tier_override` is set and is
|
|
35
|
+
**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.
|
|
36
|
+
|
|
37
|
+
**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:
|
|
38
|
+
|
|
39
|
+
- Valid override applied: `{step: "step-01-load-brief", gate: "tier-override", decision: "apply", value: "{tier_override}", rationale: "explicit preferences.yaml tier_override", timestamp: {ISO}}`
|
|
40
|
+
- Invalid override rejected: `{step: "step-01-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}}`
|
|
41
|
+
|
|
42
|
+
Step-05 §7 reads `headless_decisions[]` and emits an "Auto-Decisions" section into `evidence-report.md` so reviewers can audit every silent choice the workflow made.
|
|
69
43
|
|
|
70
44
|
### 2. Discover Skill Brief
|
|
71
45
|
|
|
@@ -76,7 +50,10 @@ Extract and report:
|
|
|
76
50
|
|
|
77
51
|
**If user invoked with --batch flag:**
|
|
78
52
|
- Check `{sidecar_path}/batch-state.yaml` for an active batch checkpoint:
|
|
79
|
-
- If `batch_active: true
|
|
53
|
+
- If `batch_active: true`: validate the checkpoint before trusting it. Both conditions below MUST hold:
|
|
54
|
+
1. `0 <= current_index < len(brief_list)` — the index points inside the recorded list.
|
|
55
|
+
2. `os.path.exists(brief_list[current_index])` — the brief file is still on disk.
|
|
56
|
+
If both hold, load the brief at `brief_list[current_index]` (resuming a batch loop from step-08). 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.
|
|
80
57
|
- If no checkpoint exists or `batch_active` is false: search specified directory for all `skill-brief.yaml` files, list discovered briefs with skill names, store list for batch loop processing, and load the FIRST brief
|
|
81
58
|
|
|
82
59
|
**If no brief found:**
|
|
@@ -91,13 +68,14 @@ Check that the loaded skill-brief.yaml contains required fields:
|
|
|
91
68
|
- `version` — source version to compile against
|
|
92
69
|
- `source_repo` — GitHub owner/repo or local path (**optional when `source_type: "docs-only"`**)
|
|
93
70
|
- `language` — primary source language
|
|
94
|
-
- `scope` — what to extract (e.g., "all public exports",
|
|
71
|
+
- `scope` — what to extract. Accepts either a string (simple scope description, e.g., "all public exports") or an object with sub-fields: `type` (e.g., `"component-library"`), `include`, `exclude`, `notes`, and optionally `demo_patterns`, `registry_path`, `ui_variants` for component libraries
|
|
95
72
|
|
|
96
73
|
**Optional fields:**
|
|
97
74
|
- `source_type` — `"source"` (default) or `"docs-only"` (external documentation only)
|
|
98
75
|
- `doc_urls` — array of `{url, label}` documentation URLs (required when `source_type: "docs-only"`)
|
|
99
76
|
- `source_branch` — branch to use (default: main/master)
|
|
100
77
|
- `source_authority` — official/community/internal (default: community; forced to `community` for docs-only)
|
|
78
|
+
- `target_version` — specific version to compile against (triggers **explicit** tag resolution for remote repos; see source-resolution-protocols.md). When absent, the workflow falls back to **implicit** tag resolution from `brief.version` for remote sources — see below.
|
|
101
79
|
- `include_patterns` — file glob patterns to include
|
|
102
80
|
- `exclude_patterns` — file glob patterns to exclude
|
|
103
81
|
- `description` — human description of the skill
|
|
@@ -109,14 +87,19 @@ Check that the loaded skill-brief.yaml contains required fields:
|
|
|
109
87
|
**If required fields missing:**
|
|
110
88
|
Halt with specific error: "Brief validation failed: missing required field `{field}`. Update your skill-brief.yaml and re-run."
|
|
111
89
|
|
|
90
|
+
**Name format check (run after required-field check, before any path creation):** validate `brief.name` against the regex `^[a-z0-9][a-z0-9-]{0,63}$` — 1-64 characters, lowercase alphanumeric plus hyphens, must start with a letter or digit, no leading hyphen, no uppercase, no underscores, no slashes. This matches the agentskills.io skill-name rule and the directory-name constraint that `skill-check`'s `frontmatter.name_matches_directory` rule will later enforce. If validation fails, halt BEFORE any directory is created or any path is resolved: "Brief validation failed: `name` field `{value}` does not match required pattern `^[a-z0-9][a-z0-9-]{0,63}$`. Skill names must be 1-64 chars, lowercase alphanumeric plus hyphens, no leading hyphen, no underscores, no slashes. Update your skill-brief.yaml and re-run."
|
|
91
|
+
|
|
92
|
+
**Version non-empty check:** reject `brief.version` if absent, empty, or whitespace-only (`version.strip() == ""`). Halt: "Brief validation failed: `version` field is required and must be non-empty. Update your skill-brief.yaml and re-run." This guards downstream directory resolution — an empty version would later create paths like `{skills_output_folder}/{name}//` with a stray double-slash, which is a nightmare to clean up.
|
|
93
|
+
|
|
112
94
|
### 4. Resolve Source Code Location
|
|
113
95
|
|
|
114
96
|
**If `source_type: "docs-only"`:** Skip source resolution. Set `source_root: null` in context. Proceed directly to section 5 (Report Initialization) — docs-only skills have no source to resolve.
|
|
115
97
|
|
|
116
98
|
**If source_repo is a GitHub URL or owner/repo format:**
|
|
117
|
-
- Verify repository exists via `gh_bridge.list_tree(owner, repo, branch)` — **Tool resolution:** `gh api repos/{owner}/{repo}/git/trees/{branch}?recursive=1` or direct file listing if local; see
|
|
99
|
+
- Verify repository exists via `gh_bridge.list_tree(owner, repo, branch)` — **Tool resolution:** `gh api repos/{owner}/{repo}/git/trees/{branch}?recursive=1` or direct file listing if local; see `knowledge/tool-resolution.md`
|
|
118
100
|
- If branch not specified, detect default branch
|
|
119
|
-
- Store resolved: owner, repo, branch, file tree — note: `source_root` for remote repos is set to the
|
|
101
|
+
- Store resolved: owner, repo, branch, file tree — note: `source_root` for remote repos is initially set to the remote URL (for detection and API access purposes) and then updated to the local workspace/clone path during step-03 source resolution
|
|
102
|
+
- **Version-to-tag pinning intent:** If `brief.target_version` is absent but `brief.version` is present, record the intent to apply **implicit tag resolution** from `brief.version` when step-03 resolves the source. Do not resolve the tag here — tag resolution runs in step-03 alongside the clone. This step only notes the pinning intent so step-03 knows to attempt it. See `references/source-resolution-protocols.md` → "Implicit Tag Resolution".
|
|
120
103
|
|
|
121
104
|
**If source_repo is a local path:**
|
|
122
105
|
- Verify path exists and contains source files
|
|
@@ -150,7 +133,7 @@ Where tier_description follows positive capability framing:
|
|
|
150
133
|
|
|
151
134
|
**Auto-proceed step — no user interaction.**
|
|
152
135
|
|
|
153
|
-
After initialization is complete and all data is loaded, immediately load, read entire file, then execute `{nextStepFile}`.
|
|
136
|
+
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}`.
|
|
154
137
|
|
|
155
138
|
#### EXECUTION RULES:
|
|
156
139
|
|
|
@@ -162,24 +145,3 @@ After initialization is complete and all data is loaded, immediately load, read
|
|
|
162
145
|
|
|
163
146
|
ONLY WHEN forge-tier.yaml is loaded, skill-brief.yaml is validated, and source code location is resolved will you proceed to load `{nextStepFile}` for ecosystem check.
|
|
164
147
|
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
168
|
-
|
|
169
|
-
### ✅ SUCCESS:
|
|
170
|
-
|
|
171
|
-
- Forge tier loaded from sidecar with tool availability
|
|
172
|
-
- Skill brief loaded and all required fields validated
|
|
173
|
-
- Source code location resolved and accessible (or `source_root: null` confirmed for docs-only skills)
|
|
174
|
-
- Initialization summary displayed with tier and capabilities
|
|
175
|
-
- Auto-proceeded to step-02
|
|
176
|
-
|
|
177
|
-
### ❌ SYSTEM FAILURE:
|
|
178
|
-
|
|
179
|
-
- Proceeding without forge-tier.yaml (missing prerequisite)
|
|
180
|
-
- Proceeding with invalid or incomplete brief
|
|
181
|
-
- Not resolving source code location before proceeding
|
|
182
|
-
- Beginning extraction or compilation work in this step
|
|
183
|
-
- Not displaying initialization summary
|
|
184
|
-
|
|
185
|
-
**Master Rule:** This step ONLY loads and validates. It does NOT extract, compile, or write files.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
description: 'Check agentskills.io ecosystem for existing official skill before compilation'
|
|
4
|
-
nextStepFile: './step-02b-ccc-discover.md'
|
|
2
|
+
nextStepFile: './sub/step-02b-ccc-discover.md'
|
|
5
3
|
---
|
|
6
4
|
|
|
7
5
|
# Step 2: Ecosystem Check
|
|
@@ -10,42 +8,11 @@ nextStepFile: './step-02b-ccc-discover.md'
|
|
|
10
8
|
|
|
11
9
|
To search the agentskills.io ecosystem for an existing official skill matching the brief, advise the user if one is found, and allow them to decide whether to proceed with compilation or install the existing skill.
|
|
12
10
|
|
|
13
|
-
##
|
|
11
|
+
## Rules
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
- 🎯 ALWAYS follow the exact instructions in the step file
|
|
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 performing ecosystem discovery
|
|
25
|
-
- ✅ This step is advisory — ecosystem check results never block compilation
|
|
26
|
-
- ✅ Tool unavailability is never an error — it's a graceful skip condition
|
|
27
|
-
|
|
28
|
-
### Step-Specific Rules:
|
|
29
|
-
|
|
30
|
-
- 🎯 Focus ONLY on ecosystem search and presenting findings
|
|
31
|
-
- 🚫 FORBIDDEN to begin any extraction or compilation work
|
|
32
|
-
- 🚫 FORBIDDEN to halt the workflow if the ecosystem check fails or times out
|
|
33
|
-
- 💬 If a match is found, present it factually — let the user decide
|
|
34
|
-
- ⏱️ Enforce 5-second timeout on ecosystem queries
|
|
35
|
-
|
|
36
|
-
## EXECUTION PROTOCOLS:
|
|
37
|
-
|
|
38
|
-
- 🎯 Follow MANDATORY SEQUENCE exactly
|
|
39
|
-
- 💾 All loaded data remains in context for subsequent steps
|
|
40
|
-
- 📖 Ecosystem check is advisory — never blocking
|
|
41
|
-
- 🚫 Do not modify any files — this step only queries and reports
|
|
42
|
-
|
|
43
|
-
## CONTEXT BOUNDARIES:
|
|
44
|
-
|
|
45
|
-
- Available: brief_data (name, version, source_repo, language, scope) and tier from step-01
|
|
46
|
-
- Focus: Searching for existing skills in the ecosystem
|
|
47
|
-
- Limits: Do NOT begin extraction, compilation, or file writing
|
|
48
|
-
- Dependencies: skill-brief.yaml must be loaded and validated from step-01
|
|
13
|
+
- Focus only on ecosystem search and presenting findings — do not begin extraction
|
|
14
|
+
- Do not halt the workflow if the ecosystem check fails or times out (5-second timeout)
|
|
15
|
+
- If a match is found, present it factually — let the user decide
|
|
49
16
|
|
|
50
17
|
## MANDATORY SEQUENCE
|
|
51
18
|
|
|
@@ -59,8 +26,8 @@ To search the agentskills.io ecosystem for an existing official skill matching t
|
|
|
59
26
|
|
|
60
27
|
Query the ecosystem using the skill name from the brief:
|
|
61
28
|
- Call the registry API with brief.name — check if an official skill already exists
|
|
62
|
-
- Enforce 5-second timeout — if the query does not return within 5 seconds, treat as no match
|
|
63
|
-
- Cache results for 24 hours (if re-running same skill)
|
|
29
|
+
- Enforce 5-second timeout — if the query does not return within 5 seconds, treat as no match. Rationale: ecosystem check is an opportunistic advisory; a slow or degraded registry must not stall the compilation pipeline, and 5s is well beyond any healthy registry's p99 latency.
|
|
30
|
+
- Cache results for 24 hours (if re-running same skill). Rationale: the agentskills.io registry publishes new official skills in daily batches; a 24-hour TTL balances freshness against redundant network calls during iterative brief refinement.
|
|
64
31
|
|
|
65
32
|
**If registry API is NOT available (current default):**
|
|
66
33
|
|
|
@@ -103,6 +70,7 @@ Display: "**Ecosystem match found — Select an Option:** [P] Proceed with compi
|
|
|
103
70
|
#### EXECUTION RULES:
|
|
104
71
|
|
|
105
72
|
- ALWAYS halt and wait for user input after presenting menu
|
|
73
|
+
- **GATE [default: P]** — If `{headless_mode}` and match found: auto-proceed with [P] Proceed, log: "headless: ecosystem match found, auto-proceeding", AND append an entry to the in-context `headless_decisions[]` list: `{step: "step-02-ecosystem-check", gate: "ecosystem-match", decision: "P", rationale: "headless mode — match found, auto-proceed with user's own compilation", timestamp: {ISO}}`. Step-05 §7 (evidence-report assembly) reads `headless_decisions[]` and emits an "Auto-Decisions" section into evidence-report.md.
|
|
106
74
|
- This menu ONLY appears when an ecosystem match is found
|
|
107
75
|
- If no match, timeout, or tool unavailable — auto-proceed with no menu
|
|
108
76
|
|
|
@@ -120,27 +88,3 @@ ONLY WHEN the ecosystem check is complete (match evaluated, user decision made i
|
|
|
120
88
|
|
|
121
89
|
If no match is found, this step auto-proceeds with no user interaction.
|
|
122
90
|
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
126
|
-
|
|
127
|
-
### ✅ SUCCESS:
|
|
128
|
-
|
|
129
|
-
- Ecosystem check attempted via registry API (or gracefully skipped if API unavailable)
|
|
130
|
-
- 5-second timeout enforced on ecosystem queries
|
|
131
|
-
- Match presented factually with clear options if found
|
|
132
|
-
- No-match case auto-proceeds silently
|
|
133
|
-
- User decision respected (Proceed/Install/Abort)
|
|
134
|
-
- Auto-proceeded to step-02b (when no match or user chose Proceed)
|
|
135
|
-
|
|
136
|
-
### ❌ SYSTEM FAILURE:
|
|
137
|
-
|
|
138
|
-
- Halting the workflow because ecosystem check failed or timed out
|
|
139
|
-
- Treating API unavailability as an error
|
|
140
|
-
- Confusing `npx skill-check check` (local validation) with ecosystem lookup
|
|
141
|
-
- Displaying "no match found" messages (absence should be silent)
|
|
142
|
-
- Beginning extraction or compilation work in this step
|
|
143
|
-
- Proceeding without user decision when a match IS found
|
|
144
|
-
- Not enforcing the 5-second timeout
|
|
145
|
-
|
|
146
|
-
**Master Rule:** This step is advisory. API unavailability and timeouts are silent skips, not errors. Only a confirmed match requires user interaction.
|