bmad-module-skill-forge 0.7.3 → 0.8.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/package.json +1 -1
- package/src/agents/forger.agent.yaml +1 -1
- package/src/knowledge/ccc-bridge.md +34 -2
- package/src/knowledge/tool-resolution.md +3 -3
- package/src/module.yaml +5 -3
- package/src/workflows/analyze-source/data/skill-brief-schema.md +11 -2
- package/src/workflows/analyze-source/data/unit-detection-heuristics.md +9 -0
- 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 -1
- package/src/workflows/brief-skill/data/scope-templates.md +41 -0
- package/src/workflows/brief-skill/data/skill-brief-schema.md +11 -3
- package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +1 -1
- package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +6 -6
- package/src/workflows/create-skill/data/compile-assembly-rules.md +108 -0
- package/src/workflows/create-skill/data/extraction-patterns.md +94 -3
- package/src/workflows/create-skill/data/skill-sections.md +76 -0
- package/src/workflows/create-skill/data/source-resolution-protocols.md +21 -9
- package/src/workflows/create-skill/steps-c/step-02b-ccc-discover.md +6 -4
- package/src/workflows/create-skill/steps-c/step-03-extract.md +48 -12
- package/src/workflows/create-skill/steps-c/step-03d-component-extraction.md +292 -0
- package/src/workflows/create-skill/steps-c/step-05-compile.md +9 -0
- package/src/workflows/setup-forge/steps-c/step-01b-ccc-index.md +65 -13
- package/src/workflows/setup-forge/steps-c/step-02-write-config.md +5 -3
- package/src/workflows/update-skill/steps-c/step-03-re-extract.md +2 -0
|
@@ -9,7 +9,7 @@ nextStepFile: './step-02-write-config.md'
|
|
|
9
9
|
|
|
10
10
|
## STEP GOAL:
|
|
11
11
|
|
|
12
|
-
If ccc is available (`{ccc: true}` from step-01), verify that the ccc index exists for the project root
|
|
12
|
+
If ccc is available (`{ccc: true}` from step-01), configure CCC exclusion patterns for SKF infrastructure directories, verify that the ccc index exists for the project root, and create or refresh it if needed. Store index state and exclusion patterns in context for step-02 to write into forge-tier.yaml.
|
|
13
13
|
|
|
14
14
|
For Quick and Forge tiers, or when ccc is unavailable, skip silently and proceed.
|
|
15
15
|
|
|
@@ -32,7 +32,7 @@ For Quick and Forge tiers, or when ccc is unavailable, skip silently and proceed
|
|
|
32
32
|
- 🎯 Focus only on ccc index verification and creation
|
|
33
33
|
- 🚫 FORBIDDEN to display skip messages for Quick/Forge tiers
|
|
34
34
|
- 🚫 FORBIDDEN to fail the workflow if ccc indexing fails
|
|
35
|
-
- 🚫 FORBIDDEN to re-index if ccc index already exists and is fresh (< staleness threshold)
|
|
35
|
+
- 🚫 FORBIDDEN to re-index if ccc index already exists and is fresh (< staleness threshold) UNLESS new exclusion patterns were applied to settings.yml
|
|
36
36
|
|
|
37
37
|
## EXECUTION PROTOCOLS:
|
|
38
38
|
|
|
@@ -56,7 +56,7 @@ For Quick and Forge tiers, or when ccc is unavailable, skip silently and proceed
|
|
|
56
56
|
|
|
57
57
|
Read `{ccc}` from step-01 context.
|
|
58
58
|
|
|
59
|
-
**If `{ccc}` is false:** Set `{ccc_index_result: "none", ccc_indexed_path: null, ccc_last_indexed: null}`. Proceed directly to section 4 (Auto-Proceed) — no output, no messaging.
|
|
59
|
+
**If `{ccc}` is false:** Set `{ccc_index_result: "none", ccc_indexed_path: null, ccc_last_indexed: null, ccc_exclude_patterns: []}`. Proceed directly to section 4 (Auto-Proceed) — no output, no messaging.
|
|
60
60
|
|
|
61
61
|
**If `{ccc}` is true:** Continue to section 2.
|
|
62
62
|
|
|
@@ -64,17 +64,58 @@ Read `{ccc}` from step-01 context.
|
|
|
64
64
|
|
|
65
65
|
Read existing forge-tier.yaml at `{project-root}/_bmad/_memory/forger-sidecar/forge-tier.yaml` (if it exists from a previous run).
|
|
66
66
|
|
|
67
|
+
Read `staleness_threshold_hours` from `ccc_index.staleness_threshold_hours` in the existing forge-tier.yaml (default: 24 if not present or not a number). Use this value for the freshness check below.
|
|
68
|
+
|
|
67
69
|
Check the `ccc_index` section:
|
|
68
|
-
- If `ccc_index.indexed_path` matches `{project-root}` AND `ccc_index.status` is `"fresh"`:
|
|
69
|
-
- Check freshness: if `ccc_index.last_indexed` is within `staleness_threshold_hours`
|
|
70
|
+
- If `ccc_index.indexed_path` matches `{project-root}` AND `ccc_index.status` is `"fresh"` or `"created"`:
|
|
71
|
+
- Check freshness: if `ccc_index.last_indexed` is within `staleness_threshold_hours` of now → index is fresh
|
|
70
72
|
- Store `{ccc_index_result: "fresh", ccc_indexed_path: {project-root}, ccc_last_indexed: {existing timestamp}}`
|
|
71
|
-
-
|
|
73
|
+
- Set `{needs_reindex: false}` — proceed to section 2b (exclusions must still be configured)
|
|
72
74
|
|
|
73
75
|
- If `ccc_index.indexed_path` matches `{project-root}` but timestamp is older than threshold:
|
|
74
|
-
-
|
|
76
|
+
- Set `{needs_reindex: true}` — proceed to section 2b then section 3
|
|
75
77
|
|
|
76
78
|
- If `ccc_index` is missing, has null values, or path doesn't match:
|
|
77
|
-
-
|
|
79
|
+
- Set `{needs_reindex: true}` — proceed to section 2b then section 3
|
|
80
|
+
|
|
81
|
+
### 2b. Configure CCC Exclusions
|
|
82
|
+
|
|
83
|
+
SKF infrastructure and output directories must be excluded from the CCC index — they contain workflow instructions, build artifacts, and generated skills that pollute semantic search results with zero extraction value.
|
|
84
|
+
|
|
85
|
+
**Build the SKF exclusion list:**
|
|
86
|
+
|
|
87
|
+
1. Read `{project-root}/_bmad/_config/skf-manifest.yaml` to resolve configurable paths:
|
|
88
|
+
- `skills_output_folder` (default: `skills` if manifest is missing or field is absent)
|
|
89
|
+
- `forge_data_folder` (default: `forge-data` if manifest is missing or field is absent)
|
|
90
|
+
|
|
91
|
+
2. Assemble the exclusion patterns using `**/` prefix format (matching `.cocoindex_code/settings.yml` convention — e.g., `**/node_modules`):
|
|
92
|
+
- `**/_bmad` — SKF framework module (workflows, agents, knowledge files)
|
|
93
|
+
- `**/_bmad-output` — Build output artifacts
|
|
94
|
+
- `**/.claude` — Claude Code configuration
|
|
95
|
+
- `**/_skf-learn` — SKF learning materials
|
|
96
|
+
- `**/{skills_output_folder}` — Generated skill files (resolved from manifest)
|
|
97
|
+
- `**/{forge_data_folder}` — Compilation workspace (resolved from manifest)
|
|
98
|
+
|
|
99
|
+
3. Store `{ccc_exclude_patterns}` in context for step-02 to write into forge-tier.yaml.
|
|
100
|
+
|
|
101
|
+
**Apply exclusions to settings.yml:**
|
|
102
|
+
|
|
103
|
+
Check if `{project-root}/.cocoindex_code/settings.yml` exists. Set `{settings_yml_existed: true}` if it does, `{settings_yml_existed: false}` if not.
|
|
104
|
+
|
|
105
|
+
If `{settings_yml_existed}` is true (from a previous `ccc init` run):
|
|
106
|
+
|
|
107
|
+
1. Read `settings.yml`
|
|
108
|
+
2. For each pattern in `{ccc_exclude_patterns}`: if the pattern is NOT already present in `exclude_patterns`, append it and set `{exclusions_changed: true}`
|
|
109
|
+
3. If `{exclusions_changed}`: write the updated `settings.yml` back, set `{needs_reindex: true}` (new exclusions require re-indexing), display: "**CCC exclusions configured:** {count} SKF patterns applied to .cocoindex_code/settings.yml"
|
|
110
|
+
4. If no new patterns needed: display nothing (exclusions already configured)
|
|
111
|
+
|
|
112
|
+
This preserves any existing user customizations and default exclusions while ensuring SKF directories are filtered out.
|
|
113
|
+
|
|
114
|
+
If `{settings_yml_existed}` is false: the exclusions will be applied after `ccc init` in section 3.
|
|
115
|
+
|
|
116
|
+
**Flow decision:**
|
|
117
|
+
- If `{needs_reindex}` is true: proceed to section 3
|
|
118
|
+
- If `{needs_reindex}` is false: proceed to section 4 (Auto-Proceed)
|
|
78
119
|
|
|
79
120
|
### 3. Create or Refresh CCC Index
|
|
80
121
|
|
|
@@ -93,6 +134,15 @@ ccc init
|
|
|
93
134
|
|
|
94
135
|
**If init fails** (project may already be initialized): continue — this is not an error.
|
|
95
136
|
|
|
137
|
+
**Apply SKF exclusion patterns (if not already applied in section 2b):**
|
|
138
|
+
|
|
139
|
+
If `{settings_yml_existed}` is false (first-time setup — `ccc init` just created it), apply exclusions now:
|
|
140
|
+
|
|
141
|
+
1. Read `{project-root}/.cocoindex_code/settings.yml` (created by `ccc init`)
|
|
142
|
+
2. For each pattern in `{ccc_exclude_patterns}`: if the pattern is NOT already present in `exclude_patterns`, append it
|
|
143
|
+
3. Write the updated `settings.yml` back
|
|
144
|
+
4. Display: "**CCC exclusions configured:** {count} SKF patterns applied to .cocoindex_code/settings.yml"
|
|
145
|
+
|
|
96
146
|
Then run:
|
|
97
147
|
```bash
|
|
98
148
|
ccc index
|
|
@@ -102,8 +152,8 @@ ccc index
|
|
|
102
152
|
|
|
103
153
|
**If succeeds:**
|
|
104
154
|
- Run `ccc status` to get file count
|
|
105
|
-
- Store `{ccc_index_result: "created", ccc_indexed_path: {project-root}, ccc_last_indexed: {current ISO timestamp}, ccc_file_count: {count from status}}`
|
|
106
|
-
- Display: "**CCC index created.** {
|
|
155
|
+
- Store `{ccc_index_result: "created", ccc_indexed_path: {project-root}, ccc_last_indexed: {current ISO timestamp}, ccc_file_count: {count from ccc status}}`
|
|
156
|
+
- Display: "**CCC index created.** {ccc_file_count} files indexed for semantic discovery."
|
|
107
157
|
|
|
108
158
|
**If fails:**
|
|
109
159
|
- Store `{ccc_index_result: "failed", ccc_indexed_path: null, ccc_last_indexed: null}`
|
|
@@ -134,8 +184,8 @@ ONLY WHEN ccc index verification is complete (or step is skipped for ccc unavail
|
|
|
134
184
|
### ✅ SUCCESS:
|
|
135
185
|
|
|
136
186
|
- ccc unavailable: skipped silently with no output, context variables set to null/none
|
|
137
|
-
- ccc available with fresh index: verified freshness, skipped re-index, context variables set
|
|
138
|
-
- ccc available with stale/missing index: index created, context variables set with fresh timestamp
|
|
187
|
+
- ccc available with fresh index: verified freshness, exclusions configured, skipped re-index, context variables set
|
|
188
|
+
- ccc available with stale/missing index: exclusions configured, index created, context variables set with fresh timestamp
|
|
139
189
|
- ccc indexing fails: logged gracefully, workflow continues, context variables set to failed/null
|
|
140
190
|
- Auto-proceeded to step-02
|
|
141
191
|
|
|
@@ -143,8 +193,10 @@ ONLY WHEN ccc index verification is complete (or step is skipped for ccc unavail
|
|
|
143
193
|
|
|
144
194
|
- Displaying skip messages when ccc is unavailable
|
|
145
195
|
- Halting the workflow on ccc index failure
|
|
146
|
-
- Re-indexing when index is already fresh and path matches
|
|
196
|
+
- Re-indexing when index is already fresh and path matches (unless exclusion patterns changed)
|
|
147
197
|
- Writing forge-tier.yaml (that is step-02's responsibility)
|
|
148
198
|
- Not storing ccc index context variables for step-02
|
|
199
|
+
- Indexing without configuring SKF exclusion patterns in `.cocoindex_code/settings.yml`
|
|
200
|
+
- Overwriting user customizations in `.cocoindex_code/settings.yml` instead of appending
|
|
149
201
|
|
|
150
202
|
**Master Rule:** CCC indexing is always best-effort. Failures degrade gracefully. The workflow never halts over ccc issues.
|
|
@@ -41,7 +41,7 @@ Write the detected tool availability and calculated tier to forge-tier.yaml, cre
|
|
|
41
41
|
|
|
42
42
|
## CONTEXT BOUNDARIES:
|
|
43
43
|
|
|
44
|
-
- Available: {detected_tools}, {calculated_tier}, {previous_tier} from step-01; {ccc_index_result}, {ccc_indexed_path}, {ccc_last_indexed} from step-01b
|
|
44
|
+
- Available: {detected_tools}, {calculated_tier}, {previous_tier} from step-01; {ccc_index_result}, {ccc_indexed_path}, {ccc_last_indexed}, {ccc_file_count}, {ccc_exclude_patterns} from step-01b
|
|
45
45
|
- Focus: file I/O operations only
|
|
46
46
|
- Limits: do not modify preferences.yaml if it exists
|
|
47
47
|
- Dependencies: step-01 and step-01b must have completed with tool detection and CCC index results
|
|
@@ -78,6 +78,8 @@ ccc_index:
|
|
|
78
78
|
last_indexed: {ccc_last_indexed from step-01b, or ~}
|
|
79
79
|
status: {ccc_index_result from step-01b: "fresh"|"created"|"none"|"failed"}
|
|
80
80
|
staleness_threshold_hours: 24
|
|
81
|
+
file_count: {ccc_file_count from step-01b, or ~}
|
|
82
|
+
exclude_patterns: {ccc_exclude_patterns from step-01b, or []}
|
|
81
83
|
|
|
82
84
|
# CCC index registry (tracks which source paths have been indexed for skill workflows)
|
|
83
85
|
# PRESERVE existing entries on re-runs — see Note below
|
|
@@ -88,7 +90,7 @@ ccc_index_registry: {preserved from existing forge-tier.yaml, or [] if first run
|
|
|
88
90
|
qmd_collections: {preserved from existing forge-tier.yaml, or [] if first run}
|
|
89
91
|
```
|
|
90
92
|
|
|
91
|
-
**Note on re-runs:** The `qmd_collections`, `ccc_index_registry` arrays, and `staleness_threshold_hours` value must be preserved across re-runs. Before overwriting forge-tier.yaml, read these existing values and re-inject them into the new write. These values are populated by create-skill workflows or customized by users and must not be reset.
|
|
93
|
+
**Note on re-runs:** The `qmd_collections`, `ccc_index_registry` arrays, and `staleness_threshold_hours` value must be preserved across re-runs. Before overwriting forge-tier.yaml, read these existing values and re-inject them into the new write. These values are populated by create-skill workflows or customized by users and must not be reset. Note: `exclude_patterns` is NOT preserved — it is always written fresh from `{ccc_exclude_patterns}` computed by step-01b.
|
|
92
94
|
|
|
93
95
|
**This file is ALWAYS overwritten** on every run — it reflects current tool state.
|
|
94
96
|
|
|
@@ -150,7 +152,7 @@ ONLY WHEN forge-tier.yaml has been written successfully and preferences.yaml exi
|
|
|
150
152
|
|
|
151
153
|
### ✅ SUCCESS:
|
|
152
154
|
|
|
153
|
-
- forge-tier.yaml written with accurate tool booleans (including ccc), tier, timestamp, ccc_index state, and preserved qmd_collections/ccc_index_registry arrays
|
|
155
|
+
- forge-tier.yaml written with accurate tool booleans (including ccc), tier, timestamp, ccc_index state (including exclude_patterns), and preserved qmd_collections/ccc_index_registry arrays
|
|
154
156
|
- preferences.yaml exists (created with defaults on first run, preserved on re-run)
|
|
155
157
|
- forge-data/ directory exists (created or pre-existing)
|
|
156
158
|
- Auto-proceeded to step-03
|
|
@@ -139,6 +139,8 @@ This helps the merge step (section 4) prioritize which changes are most likely t
|
|
|
139
139
|
|
|
140
140
|
CCC failures: skip ranking silently, all changes treated equally.
|
|
141
141
|
|
|
142
|
+
**Note on remote sources:** If `source_root` is an ephemeral clone (remote source), the clone path is not indexed by CCC. The search will return empty results and semantic ranking will be skipped. This is expected — deferred CCC indexing is implemented in create-skill step-03 but not in update-skill. All changes are treated equally for remote sources.
|
|
143
|
+
|
|
142
144
|
**IF `tools.ccc` is false:** Skip this section silently.
|
|
143
145
|
|
|
144
146
|
### 3. Deep Tier QMD Enrichment (Conditional)
|