bmad-module-skill-forge 0.5.0 → 0.7.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/README.md +4 -3
- package/docs/agents.md +12 -5
- package/docs/concepts.md +37 -15
- package/docs/examples.md +49 -5
- package/docs/getting-started.md +43 -17
- package/docs/how-it-works.md +115 -90
- package/docs/index.md +2 -2
- package/docs/workflows.md +89 -41
- package/package.json +2 -2
- package/src/agents/forger.agent.yaml +18 -6
- package/src/forger/README.md +1 -1
- package/src/forger/forge-tier.yaml +18 -1
- package/src/forger/preferences.yaml +6 -8
- package/src/knowledge/agentskills-spec.md +1 -1
- package/src/knowledge/architecture-verification.md +102 -0
- package/src/knowledge/ccc-bridge.md +110 -0
- package/src/knowledge/confidence-tiers.md +14 -3
- package/src/knowledge/doc-fetcher.md +1 -1
- package/src/knowledge/manual-section-integrity.md +2 -2
- package/src/knowledge/overview.md +10 -6
- package/src/knowledge/progressive-capability.md +15 -6
- package/src/knowledge/qmd-registry.md +18 -1
- package/src/knowledge/skf-knowledge-index.csv +3 -1
- package/src/knowledge/skill-lifecycle.md +26 -2
- package/src/knowledge/split-body-strategy.md +16 -2
- package/src/knowledge/zero-hallucination.md +11 -8
- package/src/module-help.csv +9 -6
- package/src/module.yaml +4 -1
- package/src/workflows/README.md +36 -18
- package/src/workflows/analyze-source/data/skill-brief-schema.md +18 -5
- package/src/workflows/analyze-source/data/unit-detection-heuristics.md +1 -0
- package/src/workflows/analyze-source/steps-c/step-01-init.md +4 -4
- package/src/workflows/analyze-source/steps-c/step-01b-continue.md +1 -1
- package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +1 -1
- package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +1 -1
- package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +8 -4
- package/src/workflows/analyze-source/steps-c/step-05-recommend.md +1 -1
- package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +2 -2
- package/src/workflows/analyze-source/workflow.md +2 -2
- package/src/workflows/audit-skill/data/drift-report-template.md +6 -6
- package/src/workflows/audit-skill/data/severity-rules.md +1 -1
- package/src/workflows/audit-skill/steps-c/step-01-init.md +3 -2
- package/src/workflows/audit-skill/steps-c/step-02-re-index.md +23 -1
- package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +6 -6
- package/src/workflows/audit-skill/workflow.md +3 -2
- package/src/workflows/brief-skill/data/scope-templates.md +10 -0
- package/src/workflows/brief-skill/data/skill-brief-schema.md +25 -23
- package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +4 -4
- package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +15 -0
- package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +3 -0
- package/src/workflows/create-skill/data/extraction-patterns.md +37 -1
- package/src/workflows/create-skill/data/skill-sections.md +14 -13
- package/src/workflows/create-skill/data/source-resolution-protocols.md +1 -1
- package/src/workflows/create-skill/steps-c/step-01-load-brief.md +18 -12
- package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +2 -2
- package/src/workflows/create-skill/steps-c/step-02b-ccc-discover.md +157 -0
- package/src/workflows/create-skill/steps-c/step-03-extract.md +25 -20
- package/src/workflows/create-skill/steps-c/step-03b-fetch-temporal.md +8 -8
- package/src/workflows/create-skill/steps-c/step-03c-fetch-docs.md +3 -1
- package/src/workflows/create-skill/steps-c/step-04-enrich.md +9 -9
- package/src/workflows/create-skill/steps-c/step-05-compile.md +4 -3
- package/src/workflows/create-skill/steps-c/step-06-validate.md +3 -3
- package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +60 -39
- package/src/workflows/create-skill/steps-c/step-08-report.md +26 -11
- package/src/workflows/create-skill/workflow.md +3 -3
- package/src/workflows/create-stack-skill/data/compose-mode-rules.md +65 -0
- package/src/workflows/create-stack-skill/data/stack-skill-template.md +29 -7
- package/src/workflows/create-stack-skill/steps-c/step-01-init.md +25 -8
- package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +35 -2
- package/src/workflows/create-stack-skill/steps-c/step-03-rank-and-confirm.md +26 -2
- package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +24 -0
- package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +40 -2
- package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +5 -1
- package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +53 -5
- package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +4 -4
- package/src/workflows/create-stack-skill/steps-c/step-09-report.md +8 -2
- package/src/workflows/create-stack-skill/workflow.md +3 -3
- package/src/workflows/export-skill/data/managed-section-format.md +8 -1
- package/src/workflows/export-skill/data/snippet-format.md +1 -1
- package/src/workflows/export-skill/steps-c/step-01-load-skill.md +1 -1
- package/src/workflows/export-skill/steps-c/step-02-package.md +1 -1
- package/src/workflows/export-skill/steps-c/step-04-update-context.md +7 -2
- package/src/workflows/export-skill/steps-c/step-05-token-report.md +1 -1
- package/src/workflows/export-skill/workflow.md +3 -1
- package/src/workflows/quick-skill/data/skill-template.md +24 -4
- package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +1 -3
- package/src/workflows/quick-skill/steps-c/step-04-compile.md +26 -6
- package/src/workflows/quick-skill/steps-c/step-05-validate.md +1 -1
- package/src/workflows/quick-skill/steps-c/step-06-write.md +3 -0
- package/src/workflows/quick-skill/workflow.md +1 -1
- package/src/workflows/refine-architecture/data/refinement-rules.md +102 -0
- package/src/workflows/refine-architecture/steps-c/step-01-init.md +188 -0
- package/src/workflows/refine-architecture/steps-c/step-02-gap-analysis.md +179 -0
- package/src/workflows/refine-architecture/steps-c/step-03-issue-detection.md +182 -0
- package/src/workflows/refine-architecture/steps-c/step-04-improvements.md +169 -0
- package/src/workflows/refine-architecture/steps-c/step-05-compile.md +200 -0
- package/src/workflows/refine-architecture/steps-c/step-06-report.md +147 -0
- package/src/workflows/refine-architecture/workflow.md +61 -0
- package/src/workflows/setup-forge/data/tier-rules.md +16 -6
- package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +33 -15
- package/src/workflows/setup-forge/steps-c/step-01b-ccc-index.md +148 -0
- package/src/workflows/setup-forge/steps-c/step-02-write-config.md +29 -12
- package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +29 -6
- package/src/workflows/setup-forge/steps-c/step-04-report.md +16 -4
- package/src/workflows/setup-forge/workflow.md +4 -3
- package/src/workflows/test-skill/data/scoring-rules.md +8 -0
- package/src/workflows/test-skill/data/source-access-protocol.md +1 -1
- package/src/workflows/test-skill/steps-c/step-01-init.md +3 -2
- package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +2 -0
- package/src/workflows/test-skill/templates/test-report-template.md +3 -0
- package/src/workflows/test-skill/workflow.md +2 -2
- package/src/workflows/update-skill/steps-c/step-01-init.md +3 -2
- package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +2 -2
- package/src/workflows/update-skill/steps-c/step-03-re-extract.md +24 -4
- package/src/workflows/update-skill/steps-c/step-05-validate.md +7 -11
- package/src/workflows/update-skill/steps-c/step-06-write.md +7 -4
- package/src/workflows/update-skill/workflow.md +1 -1
- package/src/workflows/verify-stack/data/coverage-patterns.md +45 -0
- package/src/workflows/verify-stack/data/feasibility-report-template.md +63 -0
- package/src/workflows/verify-stack/data/integration-verification-rules.md +73 -0
- package/src/workflows/verify-stack/steps-c/step-01-init.md +174 -0
- package/src/workflows/verify-stack/steps-c/step-02-coverage.md +181 -0
- package/src/workflows/verify-stack/steps-c/step-03-integrations.md +195 -0
- package/src/workflows/verify-stack/steps-c/step-04-requirements.md +168 -0
- package/src/workflows/verify-stack/steps-c/step-05-synthesize.md +191 -0
- package/src/workflows/verify-stack/steps-c/step-06-report.md +197 -0
- package/src/workflows/verify-stack/workflow.md +61 -0
- package/tools/cli/commands/status.js +2 -1
- package/src/workflows/analyze-source/validation-report.md +0 -657
- package/src/workflows/analyze-source/workflow-plan-analyze-source.md +0 -385
- package/src/workflows/audit-skill/validation-report.md +0 -545
- package/src/workflows/audit-skill/workflow-plan-audit-skill.md +0 -318
- package/src/workflows/brief-skill/validation-report.md +0 -630
- package/src/workflows/brief-skill/workflow-plan-brief-skill.md +0 -360
- package/src/workflows/create-skill/validation-report.md +0 -189
- package/src/workflows/create-skill/workflow-plan-create-skill.md +0 -523
- package/src/workflows/create-stack-skill/validation-report.md +0 -401
- package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +0 -481
- package/src/workflows/export-skill/validation-report.md +0 -263
- package/src/workflows/export-skill/workflow-plan-export-skill.md +0 -369
- package/src/workflows/quick-skill/validation-report.md +0 -543
- package/src/workflows/quick-skill/workflow-plan-quick-skill.md +0 -405
- package/src/workflows/setup-forge/validation-report.md +0 -504
- package/src/workflows/setup-forge/workflow-plan-setup-forge.md +0 -428
- package/src/workflows/test-skill/validation-report.md +0 -390
- package/src/workflows/test-skill/workflow-plan-test-skill.md +0 -292
- package/src/workflows/update-skill/data/tier-degradation-rules.md +0 -46
- package/src/workflows/update-skill/validation-report.md +0 -559
- package/src/workflows/update-skill/workflow-plan-update-skill.md +0 -441
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: 'step-04-semantic-diff'
|
|
3
|
-
description: 'Compare QMD knowledge context for meaning-level changes (Deep tier only, skip at Quick/Forge)'
|
|
3
|
+
description: 'Compare QMD knowledge context for meaning-level changes (Deep tier only, skip at Quick/Forge/Forge+)'
|
|
4
4
|
|
|
5
5
|
nextStepFile: './step-05-severity-classify.md'
|
|
6
6
|
outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
|
|
@@ -10,7 +10,7 @@ outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
|
|
|
10
10
|
|
|
11
11
|
## STEP GOAL:
|
|
12
12
|
|
|
13
|
-
Compare QMD knowledge context between the original skill creation and current state to detect meaning-level changes that structural diff cannot catch. This step executes ONLY at Deep tier — at Quick and Forge tiers, it appends a skip notice and auto-proceeds.
|
|
13
|
+
Compare QMD knowledge context between the original skill creation and current state to detect meaning-level changes that structural diff cannot catch. This step executes ONLY at Deep tier — at Quick, Forge, and Forge+ tiers, it appends a skip notice and auto-proceeds.
|
|
14
14
|
|
|
15
15
|
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
16
16
|
|
|
@@ -35,7 +35,7 @@ Compare QMD knowledge context between the original skill creation and current st
|
|
|
35
35
|
- 🚫 FORBIDDEN to repeat structural findings from Step 03
|
|
36
36
|
- 💬 Use subprocess Pattern 3 (data operations) when available for QMD queries
|
|
37
37
|
- ⚙️ If subprocess unavailable, query QMD in main thread
|
|
38
|
-
- 🔀 CONDITIONAL: Skip entire analysis at Quick/Forge tier — append skip notice only
|
|
38
|
+
- 🔀 CONDITIONAL: Skip entire analysis at Quick/Forge/Forge+ tier — append skip notice only
|
|
39
39
|
|
|
40
40
|
## EXECUTION PROTOCOLS:
|
|
41
41
|
|
|
@@ -57,7 +57,7 @@ Compare QMD knowledge context between the original skill creation and current st
|
|
|
57
57
|
|
|
58
58
|
### 1. Check Forge Tier
|
|
59
59
|
|
|
60
|
-
**IF forge tier is Quick or Forge
|
|
60
|
+
**IF forge tier is Quick, Forge, or Forge+:**
|
|
61
61
|
|
|
62
62
|
Append to {outputFile}:
|
|
63
63
|
|
|
@@ -82,7 +82,7 @@ Continue to section 2.
|
|
|
82
82
|
### 2. Query Original Knowledge Context
|
|
83
83
|
|
|
84
84
|
Launch a subprocess (Pattern 3 — data operations) that:
|
|
85
|
-
1.
|
|
85
|
+
1. Read the `qmd_collections` registry from `{sidecar_path}/forge-tier.yaml`. Find the entry where `skill_name` matches `{skill_name}` AND `type` is `"extraction"`. Use the `name` field from that entry as the collection to query. If no matching entry exists, log: "No QMD extraction collection found for {skill_name}. Semantic diff skipped." → Auto-proceed to {nextStepFile}.
|
|
86
86
|
2. Queries for knowledge context around each export documented in the skill
|
|
87
87
|
3. Retrieves: usage patterns, conventions, architectural context, dependency relationships
|
|
88
88
|
4. Returns structured findings to parent
|
|
@@ -179,7 +179,7 @@ ONLY WHEN the ## Semantic Drift section (or skip notice) has been appended to {o
|
|
|
179
179
|
|
|
180
180
|
### ✅ SUCCESS:
|
|
181
181
|
|
|
182
|
-
- Forge tier checked FIRST — skip gracefully at Quick/Forge
|
|
182
|
+
- Forge tier checked FIRST — skip gracefully at Quick/Forge/Forge+
|
|
183
183
|
- Deep tier: QMD knowledge context queried and compared
|
|
184
184
|
- All semantic findings have T2 confidence labels
|
|
185
185
|
- Findings clearly distinguished from structural drift (T1)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: audit-skill
|
|
3
3
|
description: "Drift detection. Forge tier: structural. Deep tier: full."
|
|
4
4
|
web_bundle: true
|
|
5
|
-
installed_path: '{project-root}/_bmad/skf/workflows/audit-skill'
|
|
5
|
+
installed_path: '{project-root}/_bmad/skf/workflows/skillforge/audit-skill'
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Audit Skill
|
|
@@ -24,7 +24,7 @@ This uses **step-file architecture** for disciplined execution:
|
|
|
24
24
|
- **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed
|
|
25
25
|
- **State Tracking**: Document progress in output file frontmatter using `stepsCompleted` array
|
|
26
26
|
- **Append-Only Building**: Build the drift report by appending sections as directed to the output file
|
|
27
|
-
- **Tier-Aware Execution**: Adapt analysis depth based on detected forge tier (Quick/Forge/Deep) with graceful degradation
|
|
27
|
+
- **Tier-Aware Execution**: Adapt analysis depth based on detected forge tier (Quick/Forge/Forge+/Deep) with graceful degradation
|
|
28
28
|
|
|
29
29
|
### Step Processing Rules
|
|
30
30
|
|
|
@@ -57,6 +57,7 @@ Load and read full config from {project-root}/_bmad/skf/config.yaml and resolve:
|
|
|
57
57
|
|
|
58
58
|
- `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`
|
|
59
59
|
- `skills_output_folder`, `forge_data_folder`, `sidecar_path`
|
|
60
|
+
- Generate and store `timestamp` as the current date-time in `YYYYMMDD-HHmmss` format. This value is fixed for the entire workflow run and must not be regenerated in subsequent steps.
|
|
60
61
|
|
|
61
62
|
### 2. First Step Execution
|
|
62
63
|
|
|
@@ -59,6 +59,16 @@ Prompt: "Which of these would you like to include? (Enter numbers, or 'all'):"
|
|
|
59
59
|
Exclusions will include all internal implementation files, tests, and utilities.
|
|
60
60
|
Prompt: "Any additional items you'd like to include or exclude?"
|
|
61
61
|
|
|
62
|
+
### Docs-Only Boundaries
|
|
63
|
+
|
|
64
|
+
**No source code access.** Scope is defined by the `doc_urls` collected during intent gathering.
|
|
65
|
+
|
|
66
|
+
- All content derived from external documentation
|
|
67
|
+
- No include/exclude patterns — coverage determined by fetched documentation
|
|
68
|
+
- All extractions labeled T3 (`[EXT:{url}]` citations)
|
|
69
|
+
|
|
70
|
+
Prompt: "Any additional documentation URLs to include? Or URLs to exclude from the ones collected?"
|
|
71
|
+
|
|
62
72
|
## Scripts & Assets Detection (Optional Refinement)
|
|
63
73
|
|
|
64
74
|
When `scripts_intent` or `assets_intent` is `detect` (default), SKF auto-detects from source directories matching: `scripts/`, `bin/`, `tools/`, `cli/` (for scripts) and `assets/`, `templates/`, `schemas/`, `configs/`, `examples/` (for assets). Detection applies to all scope types except `docs-only`.
|
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## Required Fields
|
|
4
4
|
|
|
5
|
-
| Field | Type |
|
|
6
|
-
|
|
7
|
-
| name | string |
|
|
8
|
-
| version | string | Semantic
|
|
9
|
-
| source_repo | string | GitHub URL or local path |
|
|
10
|
-
| language | string |
|
|
11
|
-
| scope | object |
|
|
12
|
-
| description | string | What
|
|
13
|
-
| forge_tier | string |
|
|
14
|
-
| created | string |
|
|
15
|
-
| created_by | string |
|
|
5
|
+
| Field | Type | Constraint | Description |
|
|
6
|
+
|-------|------|------------|-------------|
|
|
7
|
+
| name | string | kebab-case `[a-z0-9-]+` | Unique skill identifier |
|
|
8
|
+
| version | string | Semantic `X.Y.Z` | Auto-detect from source (see Version Detection below), fall back to `1.0.0` |
|
|
9
|
+
| source_repo | string | GitHub URL or local path | Repository or project root (optional when `source_type: "docs-only"`) |
|
|
10
|
+
| language | string | Recognized language | Primary programming language |
|
|
11
|
+
| scope | object | See Scope Object below | Boundary definition |
|
|
12
|
+
| description | string | 1-3 sentences | What the skill covers |
|
|
13
|
+
| forge_tier | string | `Quick` / `Forge` / `Forge+` / `Deep` | Inherited from forge-tier.yaml (Title Case) |
|
|
14
|
+
| created | string | ISO date `YYYY-MM-DD` | Generation date |
|
|
15
|
+
| created_by | string | user_name from config | Who generated the brief |
|
|
16
16
|
|
|
17
17
|
## Optional Fields
|
|
18
18
|
|
|
19
|
-
| Field | Type |
|
|
20
|
-
|
|
21
|
-
| source_type | string |
|
|
22
|
-
| doc_urls | array | Documentation URLs for T3 content
|
|
23
|
-
| `scripts_intent` | string | Describes whether scripts should be extracted. Values: `detect` (auto-detect from source — default when absent), `none` (skip scripts), or a free-text description of expected scripts (e.g., "CLI validation tools in bin/"). |
|
|
24
|
-
| `assets_intent` | string | Describes whether assets should be extracted. Values: `detect` (auto-detect from source — default when absent), `none` (skip assets), or a free-text description of expected assets (e.g., "JSON schemas in schemas/"). |
|
|
19
|
+
| Field | Type | Constraint | Description |
|
|
20
|
+
|-------|------|------------|-------------|
|
|
21
|
+
| source_type | string | `source` or `docs-only` | Default `source`. When `docs-only`: `source_repo` optional, `doc_urls` required |
|
|
22
|
+
| doc_urls | array | `{url, label}` objects | Documentation URLs for T3 content. Required when `source_type: "docs-only"` |
|
|
23
|
+
| `scripts_intent` | string | `detect` / `none` / free-text | Describes whether scripts should be extracted. Values: `detect` (auto-detect from source — default when absent), `none` (skip scripts), or a free-text description of expected scripts (e.g., "CLI validation tools in bin/"). |
|
|
24
|
+
| `assets_intent` | string | `detect` / `none` / free-text | Describes whether assets should be extracted. Values: `detect` (auto-detect from source — default when absent), `none` (skip assets), or a free-text description of expected assets (e.g., "JSON schemas in schemas/"). |
|
|
25
|
+
| `source_authority` | string | `official` / `community` / `internal` | Default `community`. Set to `official` only when the skill creator is the library maintainer. Forced to `community` when `source_type: "docs-only"`. |
|
|
25
26
|
|
|
26
27
|
When `source_type: "docs-only"`:
|
|
27
28
|
- `source_repo` becomes optional (set to doc site URL for reference)
|
|
@@ -48,7 +49,7 @@ The create-skill workflow (step-03-extract) also performs version reconciliation
|
|
|
48
49
|
|
|
49
50
|
```yaml
|
|
50
51
|
scope:
|
|
51
|
-
type: full-library | specific-modules | public-api
|
|
52
|
+
type: full-library | specific-modules | public-api | docs-only
|
|
52
53
|
include:
|
|
53
54
|
- "src/**/*.ts" # Glob patterns for included files/directories
|
|
54
55
|
exclude:
|
|
@@ -67,7 +68,7 @@ source_type: "source" # "source" (default) or "docs-only"
|
|
|
67
68
|
source_repo: "{github-url-or-local-path}"
|
|
68
69
|
language: "{detected-language}"
|
|
69
70
|
description: "{brief-description}"
|
|
70
|
-
forge_tier: "{
|
|
71
|
+
forge_tier: "{Quick|Forge|Forge+|Deep}"
|
|
71
72
|
created: "{date}"
|
|
72
73
|
created_by: "{user_name}"
|
|
73
74
|
scope:
|
|
@@ -83,12 +84,13 @@ scope:
|
|
|
83
84
|
# label: "API Reference"
|
|
84
85
|
# scripts_intent: detect # Optional: detect | none | description
|
|
85
86
|
# assets_intent: detect # Optional: detect | none | description
|
|
87
|
+
# source_authority: community # Optional: official | community | internal
|
|
86
88
|
---
|
|
87
89
|
```
|
|
88
90
|
|
|
89
91
|
## Human-Readable Presentation Format
|
|
90
92
|
|
|
91
|
-
When presenting the brief for confirmation (step 04), display as:
|
|
93
|
+
When presenting the brief for confirmation (brief-skill step 04 only — not applicable to analyze-source batch generation), display as:
|
|
92
94
|
|
|
93
95
|
```
|
|
94
96
|
Skill Brief: {name}
|
|
@@ -114,8 +116,8 @@ Created by: {created_by}
|
|
|
114
116
|
1. `name` must be unique within {forge_data_folder}
|
|
115
117
|
2. `source_repo` must be accessible (gh api for GitHub, path exists for local)
|
|
116
118
|
3. `language` must be a recognized programming language
|
|
117
|
-
4. `scope.type` must be one of the
|
|
118
|
-
5. `scope.include` must have at least one pattern
|
|
119
|
-
6. `forge_tier` must match the tier from forge-tier.yaml
|
|
119
|
+
4. `scope.type` must be one of the four defined types
|
|
120
|
+
5. `scope.include` must have at least one pattern (exception: `docs-only` scope, where include patterns are optional since no source code is available)
|
|
121
|
+
6. `forge_tier` must be one of: Quick, Forge, Forge+, Deep (Title Case, must match the tier from forge-tier.yaml, or default to Quick)
|
|
120
122
|
7. When `source_type: "docs-only"`: `doc_urls` must have >= 1 entry, `source_repo` becomes optional
|
|
121
123
|
8. Each `doc_urls` entry must have a valid `url` field
|
|
@@ -3,7 +3,7 @@ name: 'step-01-gather-intent'
|
|
|
3
3
|
description: 'Initialize brief-skill workflow, discover forge tier, and gather user intent for skill creation'
|
|
4
4
|
|
|
5
5
|
nextStepFile: './step-02-analyze-target.md'
|
|
6
|
-
forgeTierFile: '{
|
|
6
|
+
forgeTierFile: '{sidecar_path}/forge-tier.yaml'
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Step 1: Gather Intent
|
|
@@ -61,14 +61,14 @@ To initialize the brief-skill workflow by discovering the forge tier configurati
|
|
|
61
61
|
Attempt to load `{forgeTierFile}`:
|
|
62
62
|
|
|
63
63
|
**If found:**
|
|
64
|
-
- Read the tier level (quick, forge, or deep)
|
|
64
|
+
- Read the tier level (quick, forge, forge+, or deep)
|
|
65
65
|
- Note available tools for scoping guidance later
|
|
66
66
|
|
|
67
|
-
**Apply tier override:** Read `{sidecar_path}/preferences.yaml`. If `tier_override` is set and is a valid tier value (Quick, Forge, or Deep), use it instead of the detected tier.
|
|
67
|
+
**Apply tier override:** Read `{sidecar_path}/preferences.yaml`. If `tier_override` is set and is a valid tier value (Quick, Forge, Forge+, or Deep), use it instead of the detected tier.
|
|
68
68
|
|
|
69
69
|
**If not found:**
|
|
70
70
|
- Display: "**Note:** No forge tier configuration found. Defaulting to Quick tier. Run **setup-forge** first for full capabilities."
|
|
71
|
-
- Default to: `forge_tier:
|
|
71
|
+
- Default to: `forge_tier: Quick`
|
|
72
72
|
|
|
73
73
|
### 2. Welcome and Explain
|
|
74
74
|
|
|
@@ -131,6 +131,21 @@ Based on detected language, identify public API surface:
|
|
|
131
131
|
**Detected Exports/Entry Points:**
|
|
132
132
|
{numbered list of public-facing items found}"
|
|
133
133
|
|
|
134
|
+
**Semantic Signals (Forge+ and Deep with ccc only):**
|
|
135
|
+
|
|
136
|
+
If `tools.ccc` is true in forge-tier.yaml, supplement the module listing with a semantic discovery pass:
|
|
137
|
+
|
|
138
|
+
Run `ccc_bridge.search("{repo_name} public API exports modules", source_path, top_k=10)`.
|
|
139
|
+
|
|
140
|
+
If results are returned, display:
|
|
141
|
+
|
|
142
|
+
"**Semantic Signals (ccc):**
|
|
143
|
+
{numbered list of file:snippet pairs from CCC results — top 5 most relevant}"
|
|
144
|
+
|
|
145
|
+
This supplements — never replaces — the explicit module list above. CCC may surface non-obvious entry points (dynamically constructed exports, re-export chains) that static directory analysis misses.
|
|
146
|
+
|
|
147
|
+
If CCC is unavailable or returns no results: skip this subsection silently.
|
|
148
|
+
|
|
134
149
|
### 5. Report Analysis Summary
|
|
135
150
|
|
|
136
151
|
Present the complete analysis:
|
|
@@ -91,6 +91,9 @@ scope:
|
|
|
91
91
|
# doc_urls:
|
|
92
92
|
# - url: "{documentation URL}"
|
|
93
93
|
# label: "{page label}"
|
|
94
|
+
# scripts_intent: detect # Optional: detect | none | description of expected scripts
|
|
95
|
+
# assets_intent: detect # Optional: detect | none | description of expected assets
|
|
96
|
+
# source_authority: community # Optional: official | community | internal
|
|
94
97
|
---
|
|
95
98
|
```
|
|
96
99
|
|
|
@@ -28,7 +28,7 @@ Source reading via gh_bridge — infer exports from file structure and content.
|
|
|
28
28
|
|
|
29
29
|
Structural extraction via ast-grep — verified exports with line-level citations.
|
|
30
30
|
|
|
31
|
-
> **Note:** `ast_bridge
|
|
31
|
+
> **Note:** `ast_bridge.*`, `qmd_bridge.*`, and `ccc_bridge.*` references below are **conceptual interfaces**, not callable functions. They describe the operation to perform. Use ast-grep (MCP tool or CLI) for `ast_bridge.*` operations, QMD (MCP tool or CLI) for `qmd_bridge.*` operations, and ccc CLI or MCP for `ccc_bridge.*` operations. See the AST Extraction Protocol section below and the TOOL/SUBPROCESS FALLBACK rule for dispatch details.
|
|
32
32
|
|
|
33
33
|
### Strategy
|
|
34
34
|
|
|
@@ -52,6 +52,42 @@ Structural extraction via ast-grep — verified exports with line-level citation
|
|
|
52
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
55
|
+
## Forge+ Tier (AST + CCC)
|
|
56
|
+
|
|
57
|
+
Identical extraction to Forge tier. CCC adds an upstream semantic discovery step that pre-ranks the file extraction queue.
|
|
58
|
+
|
|
59
|
+
### When CCC Pre-Discovery Applies
|
|
60
|
+
|
|
61
|
+
CCC pre-discovery runs in step-02b-ccc-discover (before this extraction step) when ALL of the following are true:
|
|
62
|
+
- Tier is Forge+ or Deep
|
|
63
|
+
- `tools.ccc: true` in forge-tier.yaml
|
|
64
|
+
- `ccc_index.status` is `"fresh"`, `"stale"`, `"created"`, or `"none"`/`"failed"` (step-02b attempts lazy indexing for the latter two)
|
|
65
|
+
|
|
66
|
+
The discovery step stores `{ccc_discovery: [{file, score, snippet}]}` in context. This extraction step consumes those results to pre-rank the file list.
|
|
67
|
+
|
|
68
|
+
### CCC Pre-Ranking Strategy
|
|
69
|
+
|
|
70
|
+
When `{ccc_discovery}` is present and non-empty:
|
|
71
|
+
|
|
72
|
+
1. Files appearing in `{ccc_discovery}` results move to the front of the extraction queue, sorted by relevance score descending
|
|
73
|
+
2. Files NOT in CCC results remain in the queue — they are not excluded, only deprioritized
|
|
74
|
+
3. If the CCC intersection with scoped files produces <10 files: include all scoped files (CCC results too narrow)
|
|
75
|
+
4. Proceed with the AST Extraction Protocol on the pre-ranked list
|
|
76
|
+
|
|
77
|
+
### ast-grep Patterns
|
|
78
|
+
|
|
79
|
+
Same patterns as Forge tier — see Forge tier section above. CCC pre-ranking does not change which AST patterns are used, only which files are processed first.
|
|
80
|
+
|
|
81
|
+
### Confidence
|
|
82
|
+
|
|
83
|
+
All results: T1 (AST-verified) — identical to Forge tier. CCC is upstream discovery only and is invisible in the output artifact.
|
|
84
|
+
|
|
85
|
+
### Important
|
|
86
|
+
|
|
87
|
+
CCC pre-discovery failures (ccc unavailable, command error, empty results) always result in standard Forge extraction behavior. This is not reported to the user as a problem — it is normal behavior when ccc has no relevant results for the skill's scope.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
55
91
|
## Deep Tier (AST + QMD)
|
|
56
92
|
|
|
57
93
|
Same extraction as Forge tier. Deep tier adds enrichment in step-04, not extraction.
|
|
@@ -56,7 +56,7 @@ SKILL.md uses a two-tier structure to ensure actionable content survives `split-
|
|
|
56
56
|
- Tier 1 sections are kept short enough that `split-body` targets the larger Tier 2 sections (`## Full` headings) into `references/`
|
|
57
57
|
- After split-body, SKILL.md retains all Tier 1 content — actionable without loading references
|
|
58
58
|
- An agent loading only SKILL.md (no references) must get enough to act
|
|
59
|
-
- **Section 4b (Migration & Deprecation Warnings)** is conditional: only emitted for Deep tier when T2-future annotations exist. Quick/Forge tiers and Deep tiers without T2-future annotations omit it entirely (no empty section). Parsers and validators must treat this section as optional.
|
|
59
|
+
- **Section 4b (Migration & Deprecation Warnings)** is conditional: only emitted for Deep tier when T2-future annotations exist. Quick/Forge/Forge+ tiers and Deep tiers without T2-future annotations omit it entirely (no empty section). Parsers and validators must treat this section as optional.
|
|
60
60
|
- **Section 7b (Scripts & Assets)** is conditional: only emitted when `scripts_inventory` or `assets_inventory` is non-empty. Omitted entirely when no scripts or assets are detected. Parsers and validators must treat this section as optional.
|
|
61
61
|
|
|
62
62
|
### Provenance Citation Format
|
|
@@ -120,7 +120,7 @@ Indexed pipe-delimited format for CLAUDE.md managed section (~80-120 tokens per
|
|
|
120
120
|
"source_repo": "{github-url}",
|
|
121
121
|
"source_root": "{resolved-source-path}",
|
|
122
122
|
"source_commit": "{commit-hash}",
|
|
123
|
-
"confidence_tier": "{Quick|Forge|Deep}",
|
|
123
|
+
"confidence_tier": "{Quick|Forge|Forge+|Deep}",
|
|
124
124
|
"spec_version": "1.3",
|
|
125
125
|
"generation_date": "{ISO-8601}",
|
|
126
126
|
"description": "{SKILL.md frontmatter description}",
|
|
@@ -132,6 +132,12 @@ Indexed pipe-delimited format for CLAUDE.md managed section (~80-120 tokens per
|
|
|
132
132
|
"qmd": "{version-or-null}",
|
|
133
133
|
"skf": "{skf_version}"
|
|
134
134
|
},
|
|
135
|
+
"confidence_distribution": {
|
|
136
|
+
"t1": 0,
|
|
137
|
+
"t1_low": 0,
|
|
138
|
+
"t2": 0,
|
|
139
|
+
"t3": 0
|
|
140
|
+
},
|
|
135
141
|
"stats": {
|
|
136
142
|
"exports_documented": 0,
|
|
137
143
|
"exports_public_api": 0,
|
|
@@ -139,18 +145,13 @@ Indexed pipe-delimited format for CLAUDE.md managed section (~80-120 tokens per
|
|
|
139
145
|
"exports_total": 0,
|
|
140
146
|
"public_api_coverage": 0.0,
|
|
141
147
|
"total_coverage": 0.0,
|
|
142
|
-
"confidence_t1": 0,
|
|
143
|
-
"confidence_t2": 0,
|
|
144
|
-
"confidence_t3": 0,
|
|
145
148
|
"scripts_count": 0,
|
|
146
149
|
"assets_count": 0
|
|
147
150
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
],
|
|
151
|
-
"
|
|
152
|
-
{ "file": "assets/{name}", "purpose": "{description}", "source_file": "{source-path}", "confidence": "T1-low" }
|
|
153
|
-
],
|
|
151
|
+
// scripts[] and assets[] — include ONLY when inventories are non-empty; omit entirely otherwise
|
|
152
|
+
// "scripts": [{ "file": "scripts/{name}", "purpose": "{description}", "source_file": "{source-path}", "confidence": "T1-low" }],
|
|
153
|
+
// "assets": [{ "file": "assets/{name}", "purpose": "{description}", "source_file": "{source-path}", "confidence": "T1-low" }],
|
|
154
|
+
"generated_by": "{quick-skill|create-skill}",
|
|
154
155
|
"dependencies": [],
|
|
155
156
|
"compatibility": "{semver-range}"
|
|
156
157
|
}
|
|
@@ -197,7 +198,7 @@ Each reference file includes:
|
|
|
197
198
|
"source_file": "src/auth/index.ts",
|
|
198
199
|
"source_line": 42,
|
|
199
200
|
"confidence": "T1",
|
|
200
|
-
"extraction_method": "
|
|
201
|
+
"extraction_method": "ast-grep",
|
|
201
202
|
"ast_node_type": "export_function_declaration"
|
|
202
203
|
}
|
|
203
204
|
],
|
|
@@ -235,7 +236,7 @@ Each reference file includes:
|
|
|
235
236
|
## Extraction Summary
|
|
236
237
|
- Files scanned: {count}
|
|
237
238
|
- Exports found: {count}
|
|
238
|
-
- Confidence: T1={n}, T2={n}, T3={n}
|
|
239
|
+
- Confidence: T1={n}, T1-low={n}, T2={n}, T3={n}
|
|
239
240
|
|
|
240
241
|
## Validation Results
|
|
241
242
|
- Schema: {pass/fail}
|
|
@@ -112,7 +112,7 @@ If `source_repo` is a remote URL (GitHub URL or owner/repo format) AND tier is F
|
|
|
112
112
|
|
|
113
113
|
Proceed with Quick tier extraction strategy below. Note the degradation reason in context for the evidence report.
|
|
114
114
|
|
|
115
|
-
**Ephemeral clone cleanup:** After extraction is complete for all files in scope (whether successful or partially failed), before presenting the Gate 2 summary (Section 6), if `ephemeral_clone_active`, delete the `{temp_path}` directory. Log: "Ephemeral source clone cleaned up." This ensures cleanup runs even if some extractions failed, as long as the step itself is still executing.
|
|
115
|
+
**Ephemeral clone cleanup:** After extraction is complete for all files in scope (whether successful or partially failed), before presenting the Gate 2 summary (Section 6), if `ephemeral_clone_active`, delete the `{temp_path}` directory. Log: "Ephemeral source clone cleaned up." This ensures cleanup runs even if some extractions failed, as long as the step itself is still executing. **If any error halts the extraction step before Gate 2 is reached**, cleanup must still occur: attempt to delete `{temp_path}` before halting. Log the cleanup attempt regardless of success.
|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
name: 'step-01-load-brief'
|
|
3
3
|
description: 'Load skill-brief.yaml, validate structure, resolve source code location, load forge tier'
|
|
4
4
|
nextStepFile: './step-02-ecosystem-check.md'
|
|
5
|
-
forgeTierFile: '{
|
|
6
|
-
preferencesFile: '{
|
|
5
|
+
forgeTierFile: '{sidecar_path}/forge-tier.yaml'
|
|
6
|
+
preferencesFile: '{sidecar_path}/preferences.yaml'
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Step 1: Load Brief
|
|
@@ -61,22 +61,23 @@ Halt with: "Forge halted: No forge configuration found. Run [SF] Setup Forge fir
|
|
|
61
61
|
|
|
62
62
|
**If file exists:**
|
|
63
63
|
Extract and report:
|
|
64
|
-
- `tier`: Quick, Forge, or Deep
|
|
65
|
-
- `tools`: which tools are available (gh, ast-grep, qmd)
|
|
64
|
+
- `tier`: Quick, Forge, Forge+, or Deep
|
|
65
|
+
- `tools`: which tools are available (gh, ast-grep, ccc, qmd)
|
|
66
|
+
- `ccc_index`: ccc index state (status, indexed_path, last_indexed) — needed by step-02b
|
|
66
67
|
|
|
67
|
-
**Apply tier override:** Read `{preferencesFile}`. If `tier_override` is set and is a valid tier value (Quick, Forge, or Deep), use it instead of the detected tier.
|
|
68
|
+
**Apply tier override:** Read `{preferencesFile}`. If `tier_override` is set and is a valid tier value (Quick, Forge, Forge+, or Deep), use it instead of the detected tier.
|
|
68
69
|
|
|
69
70
|
### 2. Discover Skill Brief
|
|
70
71
|
|
|
71
72
|
**If user provided a specific brief path or skill name:**
|
|
72
|
-
-
|
|
73
|
+
- If the value looks like a file path (starts with `/`, `./`, `~`, or contains path separators): treat it as a direct file path and load it
|
|
74
|
+
- Otherwise, treat it as a skill name and search `{forge_data_folder}/{skill-name}/skill-brief.yaml`
|
|
73
75
|
- If found, load it completely
|
|
74
76
|
|
|
75
77
|
**If user invoked with --batch flag:**
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
- For this run, load the FIRST brief (batch loops back for remaining)
|
|
78
|
+
- Check `{sidecar_path}/batch-state.yaml` for an active batch checkpoint:
|
|
79
|
+
- If `batch_active: true` and `current_index` is valid: load the brief at `brief_list[current_index]` (resuming a batch loop from step-08)
|
|
80
|
+
- 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
|
|
80
81
|
|
|
81
82
|
**If no brief found:**
|
|
82
83
|
Halt with: "No skill brief found. Run [BS] Brief Skill to create one, or use [QS] Quick Skill for brief-less generation."
|
|
@@ -100,6 +101,8 @@ Check that the loaded skill-brief.yaml contains required fields:
|
|
|
100
101
|
- `include_patterns` — file glob patterns to include
|
|
101
102
|
- `exclude_patterns` — file glob patterns to exclude
|
|
102
103
|
- `description` — human description of the skill
|
|
104
|
+
- `scripts_intent` — `"none"` to skip scripts detection, omit for default auto-detection
|
|
105
|
+
- `assets_intent` — `"none"` to skip assets detection, omit for default auto-detection
|
|
103
106
|
|
|
104
107
|
**Docs-only validation:** When `source_type: "docs-only"`, `source_repo` is not required but `doc_urls` must have at least one entry. `source_authority` is forced to `community`.
|
|
105
108
|
|
|
@@ -108,6 +111,8 @@ Halt with specific error: "Brief validation failed: missing required field `{fie
|
|
|
108
111
|
|
|
109
112
|
### 4. Resolve Source Code Location
|
|
110
113
|
|
|
114
|
+
**If `source_type: "docs-only"`:** Skip source resolution. Set `source_location: null` in context. Proceed directly to section 5 (Report Initialization) — docs-only skills have no source to resolve.
|
|
115
|
+
|
|
111
116
|
**If source_repo is a GitHub URL or owner/repo format:**
|
|
112
117
|
- Verify repository exists via `gh_bridge.list_tree(owner, repo, branch)`
|
|
113
118
|
- If branch not specified, detect default branch
|
|
@@ -138,7 +143,8 @@ Proceeding to ecosystem check..."
|
|
|
138
143
|
Where tier_description follows positive capability framing:
|
|
139
144
|
- Quick: "Source reading and spec validation"
|
|
140
145
|
- Forge: "AST-backed structural extraction"
|
|
141
|
-
-
|
|
146
|
+
- Forge+: "Semantic-guided precision — ccc pre-ranks files before AST extraction"
|
|
147
|
+
- Deep: "Full intelligence — structural + contextual + QMD knowledge synthesis"
|
|
142
148
|
|
|
143
149
|
### 6. Menu Handling Logic
|
|
144
150
|
|
|
@@ -164,7 +170,7 @@ ONLY WHEN forge-tier.yaml is loaded, skill-brief.yaml is validated, and source c
|
|
|
164
170
|
|
|
165
171
|
- Forge tier loaded from sidecar with tool availability
|
|
166
172
|
- Skill brief loaded and all required fields validated
|
|
167
|
-
- Source code location resolved and accessible
|
|
173
|
+
- Source code location resolved and accessible (or `source_location: null` confirmed for docs-only skills)
|
|
168
174
|
- Initialization summary displayed with tier and capabilities
|
|
169
175
|
- Auto-proceeded to step-02
|
|
170
176
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: 'step-02-ecosystem-check'
|
|
3
3
|
description: 'Check agentskills.io ecosystem for existing official skill before compilation'
|
|
4
|
-
nextStepFile: './step-
|
|
4
|
+
nextStepFile: './step-02b-ccc-discover.md'
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Step 2: Ecosystem Check
|
|
@@ -131,7 +131,7 @@ If no match is found, this step auto-proceeds with no user interaction.
|
|
|
131
131
|
- Match presented factually with clear options if found
|
|
132
132
|
- No-match case auto-proceeds silently
|
|
133
133
|
- User decision respected (Proceed/Install/Abort)
|
|
134
|
-
- Auto-proceeded to step-
|
|
134
|
+
- Auto-proceeded to step-02b (when no match or user chose Proceed)
|
|
135
135
|
|
|
136
136
|
### ❌ SYSTEM FAILURE:
|
|
137
137
|
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-02b-ccc-discover'
|
|
3
|
+
description: 'CCC semantic discovery pass — Forge+ and Deep tiers when ccc is available, skip for Quick/Forge'
|
|
4
|
+
nextStepFile: './step-03-extract.md'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 2b: CCC Semantic Discovery
|
|
8
|
+
|
|
9
|
+
## STEP GOAL:
|
|
10
|
+
|
|
11
|
+
If tier is Forge+ or Deep AND ccc is available, perform a semantic discovery pass over the source code to identify the most relevant files for the skill being created. Store ranked discovery results in context to pre-rank the file extraction queue in step-03.
|
|
12
|
+
|
|
13
|
+
For Quick and Forge tiers, or when ccc is unavailable, skip silently and proceed.
|
|
14
|
+
|
|
15
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
16
|
+
|
|
17
|
+
### Universal Rules:
|
|
18
|
+
|
|
19
|
+
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
20
|
+
- 🎯 ALWAYS follow the exact instructions in the step file
|
|
21
|
+
- 🔄 CRITICAL: When loading next step, ensure entire file is read
|
|
22
|
+
- ⚙️ 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
|
|
23
|
+
- ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
24
|
+
|
|
25
|
+
### Role Reinforcement:
|
|
26
|
+
|
|
27
|
+
- ✅ You are a skill compilation engine performing semantic pre-discovery
|
|
28
|
+
- ✅ CCC discovery is a hint layer — it guides extraction, it does not replace it
|
|
29
|
+
- ✅ Discovery failure is graceful degradation, not an error
|
|
30
|
+
|
|
31
|
+
### Step-Specific Rules:
|
|
32
|
+
|
|
33
|
+
- 🎯 Focus ONLY on running ccc semantic search and storing results
|
|
34
|
+
- 🚫 FORBIDDEN to extract exports — that is step-03
|
|
35
|
+
- 🚫 FORBIDDEN to modify brief data or source resolution
|
|
36
|
+
- 🚫 FORBIDDEN to block the workflow if ccc fails
|
|
37
|
+
- ⏱️ Quick and Forge tiers: skip this step entirely and silently
|
|
38
|
+
|
|
39
|
+
## EXECUTION PROTOCOLS:
|
|
40
|
+
|
|
41
|
+
- 🎯 Follow MANDATORY SEQUENCE exactly
|
|
42
|
+
- 💾 Discovery results stored in context as `{ccc_discovery}`
|
|
43
|
+
- 📖 Results are consumed by step-03 to pre-rank the file extraction queue
|
|
44
|
+
- 🚫 Never treat ccc results as verified extractions
|
|
45
|
+
|
|
46
|
+
## CONTEXT BOUNDARIES:
|
|
47
|
+
|
|
48
|
+
- Available: tier, tools.ccc, ccc_index from forge-tier.yaml (loaded in step-01)
|
|
49
|
+
- Available: brief_data (name, scope, description) from step-01
|
|
50
|
+
- Available: source_root (resolved source path) from step-01
|
|
51
|
+
- Focus: Semantic discovery only — no extraction, no compilation
|
|
52
|
+
- Dependencies: step-02 must have completed
|
|
53
|
+
|
|
54
|
+
## MANDATORY SEQUENCE
|
|
55
|
+
|
|
56
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
|
|
57
|
+
|
|
58
|
+
### 1. Check Tier Eligibility
|
|
59
|
+
|
|
60
|
+
**If tier is Quick or Forge:**
|
|
61
|
+
|
|
62
|
+
Set `{ccc_discovery: []}` in context. Auto-proceed silently. Display no message. Immediately load, read entire file, then execute `{nextStepFile}`.
|
|
63
|
+
|
|
64
|
+
**If tier is Forge+ or Deep:**
|
|
65
|
+
|
|
66
|
+
Check `tools.ccc` from forge-tier.yaml. If `tools.ccc` is false, set `{ccc_discovery: []}` in context and auto-proceed to section 5.
|
|
67
|
+
|
|
68
|
+
If `tools.ccc` is true, continue to section 2.
|
|
69
|
+
|
|
70
|
+
### 2. Check CCC Index State
|
|
71
|
+
|
|
72
|
+
Read `ccc_index` from forge-tier.yaml:
|
|
73
|
+
|
|
74
|
+
- If `ccc_index.status` is `"fresh"`: continue to section 3.
|
|
75
|
+
- If `ccc_index.status` is `"stale"`: display brief note — "CCC index is stale — discovery results may miss recent changes." Continue to section 3.
|
|
76
|
+
- If `ccc_index.status` is `"none"` or `"failed"`: attempt lazy indexing via `ccc_bridge.ensure_index(source_root)`. If indexing succeeds, continue to section 3. If indexing fails, set `{ccc_discovery: []}` and auto-proceed to section 5.
|
|
77
|
+
|
|
78
|
+
### 3. Construct Semantic Query
|
|
79
|
+
|
|
80
|
+
Build the discovery query from the brief data:
|
|
81
|
+
|
|
82
|
+
**Primary query:** `"{brief.name} {brief.scope}"`
|
|
83
|
+
|
|
84
|
+
Where:
|
|
85
|
+
- `brief.name` is the skill name from the brief
|
|
86
|
+
- `brief.scope` is the scope field (e.g., "Full library", "Public API", or specific module names)
|
|
87
|
+
|
|
88
|
+
**Query length cap:** Truncate to 80 characters if longer — ccc semantic search is sensitive to overly long queries. When truncating, keep the full skill name and trim `brief.scope` from the end. If `brief.scope` is very short (< 10 chars), append terms from `brief.description` to fill the remaining space.
|
|
89
|
+
|
|
90
|
+
### 4. Execute CCC Semantic Search
|
|
91
|
+
|
|
92
|
+
Run `ccc_bridge.search(query, source_root, top_k=20)`:
|
|
93
|
+
|
|
94
|
+
**If search succeeds:**
|
|
95
|
+
|
|
96
|
+
Store results as `{ccc_discovery: [{file, score, snippet}]}` in context.
|
|
97
|
+
|
|
98
|
+
Display brief discovery summary:
|
|
99
|
+
|
|
100
|
+
"**CCC semantic discovery: {N} relevant regions identified across {M} unique files.**"
|
|
101
|
+
|
|
102
|
+
Where:
|
|
103
|
+
- `{N}` is the total result count
|
|
104
|
+
- `{M}` is the count of unique file paths in results
|
|
105
|
+
|
|
106
|
+
**If search fails (any error):**
|
|
107
|
+
|
|
108
|
+
Set `{ccc_discovery: []}` in context.
|
|
109
|
+
|
|
110
|
+
Display: "CCC discovery unavailable — proceeding with standard extraction."
|
|
111
|
+
|
|
112
|
+
Do NOT halt. This is not an error.
|
|
113
|
+
|
|
114
|
+
**If search returns empty results:**
|
|
115
|
+
|
|
116
|
+
Set `{ccc_discovery: []}` in context.
|
|
117
|
+
|
|
118
|
+
No message needed — empty results are normal for small or highly focused libraries.
|
|
119
|
+
|
|
120
|
+
### 5. Auto-Proceed
|
|
121
|
+
|
|
122
|
+
Immediately load, read entire file, then execute `{nextStepFile}`.
|
|
123
|
+
|
|
124
|
+
#### EXECUTION RULES:
|
|
125
|
+
|
|
126
|
+
- This is an auto-proceed step with no user choices
|
|
127
|
+
- Quick/Forge tiers skip directly with no output
|
|
128
|
+
- Forge+/Deep with ccc displays brief discovery summary then auto-proceeds
|
|
129
|
+
- CCC failures do not halt — degrade and proceed
|
|
130
|
+
|
|
131
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
132
|
+
|
|
133
|
+
ONLY WHEN discovery is complete (Forge+/Deep with ccc) or the step is skipped (Quick/Forge or ccc unavailable) will you proceed to load `{nextStepFile}` for AST extraction.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
138
|
+
|
|
139
|
+
### ✅ SUCCESS:
|
|
140
|
+
|
|
141
|
+
- Quick/Forge tiers: skipped silently with no output, auto-proceeded
|
|
142
|
+
- Forge+/Deep with ccc: semantic query constructed from brief data
|
|
143
|
+
- Forge+/Deep with ccc: ccc_bridge.search executed, results stored as `{ccc_discovery}` in context
|
|
144
|
+
- Discovery summary displayed (count of regions and unique files)
|
|
145
|
+
- CCC failures handled gracefully (empty discovery, continue)
|
|
146
|
+
- Auto-proceeded to step-03
|
|
147
|
+
|
|
148
|
+
### ❌ SYSTEM FAILURE:
|
|
149
|
+
|
|
150
|
+
- Halting on CCC unavailability or search failures
|
|
151
|
+
- Extracting exports or signatures (that is step-03)
|
|
152
|
+
- Displaying skip messages for Quick/Forge tiers
|
|
153
|
+
- Treating CCC discovery results as verified extractions
|
|
154
|
+
- Not storing `{ccc_discovery}` in context (even if empty)
|
|
155
|
+
- Beginning compilation or SKILL.md assembly in this step
|
|
156
|
+
|
|
157
|
+
**Master Rule:** CCC discovery is a hint layer. It improves extraction coverage but never replaces structural verification. Failures degrade gracefully.
|