bmad-module-skill-forge 0.4.0 → 0.6.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.
Files changed (110) hide show
  1. package/README.md +3 -2
  2. package/docs/agents.md +3 -0
  3. package/docs/concepts.md +24 -6
  4. package/docs/examples.md +31 -2
  5. package/docs/getting-started.md +11 -0
  6. package/docs/{architecture.md → how-it-works.md} +49 -25
  7. package/docs/index.md +2 -2
  8. package/docs/workflows.md +6 -6
  9. package/package.json +2 -2
  10. package/src/agents/forger.agent.yaml +1 -1
  11. package/src/forger/forge-tier.yaml +17 -1
  12. package/src/forger/preferences.yaml +1 -1
  13. package/src/knowledge/agentskills-spec.md +25 -0
  14. package/src/knowledge/ccc-bridge.md +110 -0
  15. package/src/knowledge/confidence-tiers.md +3 -3
  16. package/src/knowledge/manual-section-integrity.md +8 -0
  17. package/src/knowledge/overview.md +4 -2
  18. package/src/knowledge/progressive-capability.md +12 -4
  19. package/src/knowledge/provenance-tracking.md +13 -0
  20. package/src/knowledge/qmd-registry.md +14 -0
  21. package/src/knowledge/skf-knowledge-index.csv +5 -3
  22. package/src/knowledge/skill-lifecycle.md +2 -2
  23. package/src/knowledge/split-body-strategy.md +41 -0
  24. package/src/module-help.csv +1 -1
  25. package/src/module.yaml +1 -1
  26. package/src/workflows/README.md +1 -1
  27. package/src/workflows/analyze-source/data/skill-brief-schema.md +3 -1
  28. package/src/workflows/analyze-source/data/unit-detection-heuristics.md +27 -0
  29. package/src/workflows/analyze-source/steps-c/step-01-init.md +2 -2
  30. package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +1 -1
  31. package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +1 -1
  32. package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +9 -4
  33. package/src/workflows/analyze-source/steps-c/step-05-recommend.md +1 -1
  34. package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +1 -1
  35. package/src/workflows/analyze-source/validation-report.md +2 -2
  36. package/src/workflows/analyze-source/workflow-plan-analyze-source.md +1 -1
  37. package/src/workflows/audit-skill/data/drift-report-template.md +6 -6
  38. package/src/workflows/audit-skill/steps-c/step-01-init.md +4 -2
  39. package/src/workflows/audit-skill/steps-c/step-02-re-index.md +18 -1
  40. package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +14 -0
  41. package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +5 -5
  42. package/src/workflows/audit-skill/validation-report.md +3 -3
  43. package/src/workflows/audit-skill/workflow-plan-audit-skill.md +2 -2
  44. package/src/workflows/audit-skill/workflow.md +1 -1
  45. package/src/workflows/brief-skill/data/scope-templates.md +4 -0
  46. package/src/workflows/brief-skill/data/skill-brief-schema.md +7 -3
  47. package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +3 -3
  48. package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +15 -0
  49. package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +12 -0
  50. package/src/workflows/create-skill/data/compile-assembly-rules.md +43 -2
  51. package/src/workflows/create-skill/data/extraction-patterns-tracing.md +110 -0
  52. package/src/workflows/create-skill/data/extraction-patterns.md +41 -39
  53. package/src/workflows/create-skill/data/skill-sections.md +31 -5
  54. package/src/workflows/create-skill/steps-c/step-01-load-brief.md +5 -3
  55. package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +2 -2
  56. package/src/workflows/create-skill/steps-c/step-02b-ccc-discover.md +157 -0
  57. package/src/workflows/create-skill/steps-c/step-03-extract.md +32 -2
  58. package/src/workflows/create-skill/steps-c/step-03b-fetch-temporal.md +5 -5
  59. package/src/workflows/create-skill/steps-c/step-04-enrich.md +8 -8
  60. package/src/workflows/create-skill/steps-c/step-05-compile.md +6 -2
  61. package/src/workflows/create-skill/steps-c/step-06-validate.md +8 -9
  62. package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +46 -1
  63. package/src/workflows/create-skill/steps-c/step-08-report.md +1 -0
  64. package/src/workflows/create-skill/validation-report.md +1 -1
  65. package/src/workflows/create-skill/workflow-plan-create-skill.md +4 -2
  66. package/src/workflows/create-skill/workflow.md +1 -1
  67. package/src/workflows/create-stack-skill/data/stack-skill-template.md +1 -1
  68. package/src/workflows/create-stack-skill/steps-c/step-01-init.md +3 -2
  69. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +10 -0
  70. package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +2 -2
  71. package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +1 -1
  72. package/src/workflows/create-stack-skill/validation-report.md +1 -1
  73. package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +2 -2
  74. package/src/workflows/create-stack-skill/workflow.md +1 -1
  75. package/src/workflows/export-skill/data/snippet-format.md +1 -1
  76. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +1 -1
  77. package/src/workflows/export-skill/steps-c/step-02-package.md +8 -4
  78. package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +3 -1
  79. package/src/workflows/export-skill/workflow-plan-export-skill.md +1 -1
  80. package/src/workflows/quick-skill/data/skill-template.md +8 -0
  81. package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +1 -3
  82. package/src/workflows/quick-skill/steps-c/step-04-compile.md +3 -2
  83. package/src/workflows/setup-forge/data/tier-rules.md +16 -6
  84. package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +32 -15
  85. package/src/workflows/setup-forge/steps-c/step-01b-ccc-index.md +148 -0
  86. package/src/workflows/setup-forge/steps-c/step-02-write-config.md +24 -6
  87. package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +29 -6
  88. package/src/workflows/setup-forge/steps-c/step-04-report.md +14 -2
  89. package/src/workflows/setup-forge/validation-report.md +1 -1
  90. package/src/workflows/setup-forge/workflow-plan-setup-forge.md +11 -9
  91. package/src/workflows/setup-forge/workflow.md +1 -1
  92. package/src/workflows/test-skill/data/scoring-rules.md +14 -0
  93. package/src/workflows/test-skill/steps-c/step-01-init.md +2 -2
  94. package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +3 -1
  95. package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +4 -1
  96. package/src/workflows/test-skill/steps-c/step-04b-external-validators.md +7 -3
  97. package/src/workflows/test-skill/steps-c/step-05-score.md +1 -1
  98. package/src/workflows/test-skill/steps-c/step-06-report.md +27 -0
  99. package/src/workflows/test-skill/templates/test-report-template.md +3 -0
  100. package/src/workflows/test-skill/validation-report.md +2 -2
  101. package/src/workflows/test-skill/workflow-plan-test-skill.md +2 -2
  102. package/src/workflows/update-skill/steps-c/step-01-init.md +3 -2
  103. package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +11 -0
  104. package/src/workflows/update-skill/steps-c/step-03-re-extract.md +19 -2
  105. package/src/workflows/update-skill/steps-c/step-04-merge.md +8 -0
  106. package/src/workflows/update-skill/steps-c/step-05-validate.md +1 -1
  107. package/src/workflows/update-skill/steps-c/step-06-write.md +7 -2
  108. package/src/workflows/update-skill/validation-report.md +1 -1
  109. package/src/workflows/update-skill/workflow-plan-update-skill.md +1 -1
  110. package/tools/cli/commands/status.js +2 -1
@@ -71,6 +71,16 @@ For each library pair (A, B):
71
71
 
72
72
  **Threshold:** A pair must have 2+ co-import files to qualify as an integration pattern (single file co-imports may be incidental).
73
73
 
74
+ **CCC Semantic Augmentation (Forge+ and Deep with ccc):**
75
+
76
+ If `tools.ccc` is true AND `ccc_index.status` is `"fresh"` or `"stale"` in forge-tier.yaml, augment co-import detection with semantic search (max 1 query per library pair):
77
+
78
+ For each library pair that has exactly 1 co-import file (below the 2-file threshold), run `ccc_bridge.search("{libA} {libB}", source_root, top_k=10)` to find files where the two libraries interact semantically — even without explicit import co-location. If CCC returns additional files where both libraries appear, add them to the pair's co-import candidate list and re-evaluate against the 2-file threshold.
79
+
80
+ For pairs that already qualify (2+ files), CCC is not needed for detection — but the CCC results may surface additional integration files for richer classification in section 3.
81
+
82
+ CCC failures: skip augmentation silently, proceed with grep-only results.
83
+
74
84
  ### 3. Classify Integration Types
75
85
 
76
86
  Load `{integrationPatterns}` for classification rules.
@@ -72,8 +72,8 @@ description: >
72
72
 
73
73
  **Frontmatter rules:**
74
74
 
75
- - `name`: lowercase alphanumeric + hyphens only, must match skill output directory name
76
- - `description`: non-empty, max 1024 chars, trigger-optimized for agent discovery
75
+ - `name`: lowercase alphanumeric + hyphens only, must match skill output directory name. Prefer gerund form (`processing-pdfs`) for clarity.
76
+ - `description`: non-empty, max 1024 chars, trigger-optimized for agent discovery. MUST use third-person voice ("Processes..." not "I can..." or "You can...").
77
77
  - No other frontmatter fields — only `name`, `description`, `license`, `compatibility`, `metadata`, `allowed-tools` are permitted by spec
78
78
 
79
79
  ### 3. Compile Integration Layer
@@ -83,7 +83,7 @@ Run: `npx skill-check -h`
83
83
 
84
84
  This validates frontmatter, description, body limits, links, formatting — and auto-fixes deterministic issues. Parse JSON for `qualityScore`, `diagnostics[]`, `fixed[]`.
85
85
 
86
- **If `body.max_lines` reported**, run: `npx skill-check split-body <skill-dir> --write`, then re-validate.
86
+ **If `body.max_lines` reported**, prefer selective split: extract only the largest Tier 2 section(s) to `references/`, keeping Tier 1 content inline (inline passive context achieves 100% task accuracy vs 79% for on-demand retrieval). Fall back to `npx skill-check split-body <skill-dir> --write` if not feasible. Verify `#quick-start` and `#key-types` anchors still resolve after split. Then re-validate.
87
87
 
88
88
  **If unavailable**, perform manual frontmatter check:
89
89
  - [ ] Frontmatter present with `---` delimiters
@@ -309,7 +309,7 @@ The workflow progresses logically from initialization through discovery, confirm
309
309
  **Strengths:**
310
310
  - Integration layer as primary value — not just concatenated library docs
311
311
  - Confidence tier system (T1/T1-low/T2) throughout all outputs
312
- - Forge-tier dependent extraction (Quick/Forge/Deep)
312
+ - Forge-tier dependent extraction (Quick/Forge/Forge+/Deep)
313
313
  - Workspace artifacts (provenance-map.json, evidence-report.md) for traceability
314
314
  - Graceful degradation (single library failure doesn't halt; zero integrations is valid)
315
315
 
@@ -111,7 +111,7 @@ Multi-file document-producing workflow:
111
111
  ### Address (gaps identified from memory)
112
112
 
113
113
  - `manifest_reader` does not exist — needs self-contained dependency detection with fallback chain (npm/PyPI/crates.io/Cargo registry APIs → file parsing → web search)
114
- - No forge-tier awareness — must implement Quick/Forge/Deep tier behavior matching create-skill, quick-skill, test-skill, export-skill patterns
114
+ - No forge-tier awareness — must implement Quick/Forge/Forge+/Deep tier behavior matching create-skill, quick-skill, test-skill, export-skill patterns
115
115
  - No tool bridge specifications — needs gh_bridge (all tiers), ast_bridge (Forge/Deep), qmd_bridge (Deep only)
116
116
  - No error handling matrix — needs hard halt / graceful degradation / silent skip / advisory categories
117
117
  - "Absorbs analyze-stack internally" undefined — must define concrete analyze-stack functionality within steps 01-05
@@ -273,7 +273,7 @@ create-stack-skill/
273
273
 
274
274
  **Step 01 (init):**
275
275
  - Load SKF module config from `_bmad/skf/config.yaml`
276
- - Load forge-tier.yaml from sidecar: determine Quick/Forge/Deep tier and available tools
276
+ - Load forge-tier.yaml from sidecar: determine Quick/Forge/Forge+/Deep tier and available tools
277
277
  - Validate prerequisites: forge-tier.yaml exists, project root accessible
278
278
  - Accept optional explicit dependency list (skip auto-detection if provided)
279
279
  - Accept optional scope overrides per library
@@ -2,7 +2,7 @@
2
2
  name: create-stack-skill
3
3
  description: Consolidated project stack skill with integration patterns
4
4
  web_bundle: true
5
- installed_path: '{project-root}/_bmad/skf/workflows/create-stack-skill'
5
+ installed_path: '{project-root}/_bmad/skf/workflows/skillforge/create-stack-skill'
6
6
  ---
7
7
 
8
8
  # Create Stack Skill
@@ -47,5 +47,5 @@
47
47
  - **integrations line**: Co-import patterns from metadata.json `integrations` for stack skills
48
48
  - If fewer exports than the limit, list all available
49
49
  - If no exports data available, omit the api line
50
- - Section anchors must be verified against actual SKILL.md headings during generation
50
+ - Section anchors must be verified against actual SKILL.md headings during generation. For split-body skills (where `references/` exists and `## Full` headings are stubs), if a heading is missing from SKILL.md, rewrite the anchor to point to the reference file path (preferred). Omit the anchor line only if the heading cannot be found in either SKILL.md or `references/*.md`
51
51
  - Skill path is relative to project root
@@ -103,7 +103,7 @@ Extract from `metadata.json`:
103
103
  - `source_authority` — `official`, `internal`, or `community`
104
104
  - `exports` — Array of exported functions/types
105
105
  - `generation_date` — When the skill was last generated
106
- - `confidence_tier` — Quick/Forge/Deep
106
+ - `confidence_tier` — Quick/Forge/Forge+/Deep
107
107
 
108
108
  **For stack skills, also extract:**
109
109
  - `components` — Array of dependencies with versions
@@ -59,9 +59,11 @@ Verify the skill directory contains the expected agentskills.io package layout:
59
59
  ├── SKILL.md ← Required: Active skill document
60
60
  ├── metadata.json ← Required: Machine-readable metadata
61
61
  ├── context-snippet.md ← Will be generated/updated in step-03
62
- └── references/ ← Optional: Progressive disclosure
63
- ├── {function-a}.md
64
- └── {function-b}.md
62
+ ├── references/ ← Optional: Progressive disclosure
63
+ ├── {function-a}.md
64
+ └── {function-b}.md
65
+ ├── scripts/ ← Optional: Executable automation
66
+ └── assets/ ← Optional: Templates, schemas, configs
65
67
  ```
66
68
 
67
69
  **Check each component:**
@@ -73,8 +75,10 @@ Verify the skill directory contains the expected agentskills.io package layout:
73
75
  - `source_authority` ("official", "internal", or "community")
74
76
  - `exports` (array)
75
77
  - `generation_date` (ISO date string)
76
- - `confidence_tier` ("Quick", "Forge", or "Deep")
78
+ - `confidence_tier` ("Quick", "Forge", "Forge+", or "Deep")
77
79
  3. `references/` — If exists, check at least one .md file present
80
+ 4. `scripts/` — If exists, verify at least one file present and each file referenced in SKILL.md Section 7b exists. Warn for orphaned scripts (present but not referenced).
81
+ 5. `assets/` — If exists, verify at least one file present and each file referenced in SKILL.md Section 7b exists. Warn for orphaned assets (present but not referenced).
78
82
 
79
83
  ### 2. Validate Metadata Completeness
80
84
 
@@ -73,7 +73,8 @@ Load {snippetFormatData} and read the format template for the skill type.
73
73
  1. Read metadata.json for `version`, `exports` array
74
74
  2. Select top exports (up to 10 for Deep tier, 5 otherwise). Append `()` to function names.
75
75
  3. Read SKILL.md to extract: heading slugs for `#quick-start` and `#key-types`, inline summary of key types (~10 words)
76
- 4. Derive gotchas from: T2-future annotations in evidence report (breaking changes), async requirements, version-specific behavior. If no gotchas, omit the gotchas line.
76
+ 4. **Anchor verification (split-body awareness):** For each section anchor (`#quick-start`, `#key-types`), verify the heading exists in SKILL.md. If a `references/` directory exists and `## Full` headings in SKILL.md are absent or stubs (indicating split-body, not a stack skill's structural references), rewrite the anchor to point to the reference file path (e.g., `references/{file}.md#key-types`). If the heading cannot be resolved in either location, omit that anchor line from the snippet.
77
+ 5. Derive gotchas from: T2-future annotations in evidence report (breaking changes), async requirements, version-specific behavior. If no gotchas, omit the gotchas line.
77
78
 
78
79
  Generate:
79
80
  ```
@@ -157,6 +158,7 @@ ONLY WHEN snippet generation is complete (or skipped due to passive_context opt-
157
158
 
158
159
  - Snippet format loaded from {snippetFormatData}
159
160
  - Content generated matching exact Vercel-aligned format
161
+ - Section anchors verified against SKILL.md headings (split-body anchors rewritten or omitted)
160
162
  - Token count estimated and within target
161
163
  - File written (or previewed in dry-run)
162
164
  - Passive context opt-out correctly handled (skip when disabled)
@@ -174,7 +174,7 @@ Three CLAUDE.md cases:
174
174
  **Output Specifications:**
175
175
  - Type: Action-based (file writes + console output)
176
176
  - Files written:
177
- 1. `{skills_output_folder}/{name}/context-snippet.md` — ADR-L v2 format (~50-80 tokens/skill)
177
+ 1. `{skills_output_folder}/{name}/context-snippet.md` — ADR-L v2 format (~80-120 tokens/skill)
178
178
  2. CLAUDE.md or AGENTS.md — managed `<!-- SKF:BEGIN/END -->` section per ADR-J (3 cases: create/append/regenerate)
179
179
  3. agentskills.io package structure — ready for `npx skills publish`
180
180
  - Console output: Token count report + export summary with distribution instructions
@@ -73,7 +73,15 @@ Indexed format targeting ~80-120 tokens per skill:
73
73
  "generated_by": "quick-skill",
74
74
  "generation_date": "{date}",
75
75
  "confidence_tier": "Quick",
76
+ "extraction_tier": "quick",
77
+ "spec_version": "1.3",
76
78
  "exports": ["{export_1}", "{export_2}"],
79
+ "confidence_distribution": {
80
+ "t1": 0,
81
+ "t1_low": "{exports_count}",
82
+ "t2": 0,
83
+ "t3": 0
84
+ },
77
85
  "stats": {
78
86
  "exports_documented": "{number}",
79
87
  "exports_public_api": "{number}",
@@ -71,9 +71,7 @@ Search for an existing official skill matching `{repo_name}` in the agentskills.
71
71
 
72
72
  **If no match found:**
73
73
  - Set `ecosystem_status: no-match`
74
- - Auto-proceed to step 3:
75
-
76
- "**No existing official skill found for {repo_name}. Proceeding to extraction...**"
74
+ - Auto-proceed silently to step 3. Do not display any message — absence of a match is the expected case.
77
75
 
78
76
  **If match found:**
79
77
  - Set `ecosystem_status: match`
@@ -79,8 +79,8 @@ description: >
79
79
  ```
80
80
 
81
81
  **Frontmatter rules:**
82
- - `name`: lowercase alphanumeric + hyphens only, must match the skill output directory name
83
- - `description`: non-empty, max 1024 chars, optimized for agent discovery
82
+ - `name`: lowercase alphanumeric + hyphens only, must match the skill output directory name. Prefer gerund form (`processing-pdfs`) for clarity.
83
+ - `description`: non-empty, max 1024 chars, optimized for agent discovery. MUST use third-person voice ("Processes..." not "I can..." or "You can...").
84
84
  - No other frontmatter fields — only `name` and `description` for community skills
85
85
 
86
86
  **Required sections (after frontmatter):**
@@ -93,6 +93,7 @@ description: >
93
93
  - **Configuration:** If configuration options were found in source
94
94
  - **Dependencies:** Key dependencies from manifest
95
95
  - **Notes:** Caveats, limitations, extraction confidence level
96
+ - **Scripts & Assets Note** (if source contains `scripts/`, `bin/`, `assets/`, `templates/`, or `schemas/` directories): "This package may include scripts and assets. Run create-skill for full extraction with provenance tracking."
96
97
 
97
98
  **If confidence is low:**
98
99
  - Include a note: "This skill was generated with limited source data. Consider running create-skill for a more thorough compilation."
@@ -7,16 +7,20 @@
7
7
  | ast-grep | `ast-grep --version` | Returns version string without error |
8
8
  | gh | `gh --version` | Returns version string without error |
9
9
  | qmd | `qmd status` | Returns status indicating initialized and operational |
10
+ | ccc | Step A: `ccc --help` Step B: `ccc doctor` | Step A: exits 0 (binary exists). Step B: daemon running, version string, model check OK |
10
11
 
11
- **Important:** Use verification commands, not existence checks (`which`, `command -v`). A tool must be functional, not just present on PATH.
12
+ **Important:** Use verification commands, not existence checks (`which`, `command -v`). A tool must be functional, not just present on PATH. For daemon-based tools (ccc), verify both binary existence and daemon health.
12
13
 
13
14
  ## Tier Calculation
14
15
 
15
- | Tier | Required Tools | Rule |
16
- |------|---------------|------|
17
- | Quick | None | Default when no tools are available |
18
- | Forge | ast-grep | ast-grep available, regardless of gh/qmd |
19
- | Deep | ast-grep + gh + qmd | All three tools available and functional |
16
+ | Priority | Tier | Required Tools | Rule |
17
+ |----------|------|---------------|------|
18
+ | 1 (highest) | Deep | ast-grep + gh + qmd | All three core tools available and functional |
19
+ | 2 | Forge+ | ast-grep + ccc | ast-grep AND ccc available, regardless of gh/qmd |
20
+ | 3 | Forge | ast-grep | ast-grep available, without ccc/gh/qmd |
21
+ | 4 (default) | Quick | None | Default when no tools are available |
22
+
23
+ **Evaluation order:** Check Deep first, then Forge+, then Forge. The first match wins. This ensures Deep always takes priority when all tools are present.
20
24
 
21
25
  **Override:** If `tier_override` is set in preferences.yaml, use that value instead of calculated tier.
22
26
 
@@ -24,6 +28,9 @@
24
28
  - gh available but no ast-grep → Quick (gh alone doesn't unlock Forge)
25
29
  - ast-grep + gh but no qmd → Forge (qmd required for Deep)
26
30
  - ast-grep + qmd but no gh → Forge (gh required for Deep)
31
+ - ccc available but no ast-grep → Quick (ccc alone doesn't unlock Forge+)
32
+ - ast-grep + ccc + gh but no qmd → Forge+ (qmd required for Deep)
33
+ - ast-grep + gh + qmd + ccc → Deep (Deep subsumes Forge+; ccc enhances transparently)
27
34
 
28
35
  ## Tier Capability Descriptions
29
36
 
@@ -35,6 +42,9 @@ Use these for positive-framing in the report step. Describe what the tier GIVES,
35
42
  ### Forge Tier
36
43
  "Forge tier active. You have AST-backed structural code analysis with line-level citations, plus template-driven generation. Every skill instruction traces to verified source code."
37
44
 
45
+ ### Forge+ Tier
46
+ "Forge+ tier active. Semantic-guided precision compilation — cocoindex-code maps the codebase semantically before AST extraction runs. Every skill begins with a ranked discovery pass that surfaces the most relevant source regions, then AST-backed verification gives each export its line-level citation."
47
+
38
48
  ### Deep Tier
39
49
  "Deep tier active. Full capability unlocked — AST-backed code analysis, GitHub repository exploration, and QMD knowledge search with cross-repository synthesis. Maximum provenance and intelligence."
40
50
 
@@ -2,7 +2,7 @@
2
2
  name: 'step-01-detect-and-tier'
3
3
  description: 'Detect available tools and determine forge capability tier'
4
4
 
5
- nextStepFile: './step-02-write-config.md'
5
+ nextStepFile: './step-01b-ccc-index.md'
6
6
  tierRulesData: '../data/tier-rules.md'
7
7
  ---
8
8
 
@@ -10,7 +10,7 @@ tierRulesData: '../data/tier-rules.md'
10
10
 
11
11
  ## STEP GOAL:
12
12
 
13
- Verify availability of the three forge tools (ast-grep, gh, qmd), read any existing configuration for re-run comparison, check for tier override, and calculate the capability tier.
13
+ Verify availability of the four forge tools (ast-grep, gh, qmd, ccc), read any existing configuration for re-run comparison, check for tier override, and calculate the capability tier.
14
14
 
15
15
  ## MANDATORY EXECUTION RULES (READ FIRST):
16
16
 
@@ -30,7 +30,7 @@ Verify availability of the three forge tools (ast-grep, gh, qmd), read any exist
30
30
 
31
31
  - 🎯 Focus only on tool detection and tier calculation
32
32
  - 🚫 FORBIDDEN to write any files — that is step-02's job
33
- - 🚫 FORBIDDEN to skip any tool check — all 3 must be verified
33
+ - 🚫 FORBIDDEN to skip any tool check — all 4 must be verified
34
34
  - 💬 Tool command failures are NOT errors — they indicate unavailability
35
35
 
36
36
  ## EXECUTION PROTOCOLS:
@@ -38,7 +38,7 @@ Verify availability of the three forge tools (ast-grep, gh, qmd), read any exist
38
38
  - 🎯 Follow the MANDATORY SEQUENCE exactly
39
39
  - 💾 Store all results in memory for step-02
40
40
  - 📖 Load tier-rules.md for calculation reference
41
- - 🚫 FORBIDDEN to proceed without checking all 3 tools
41
+ - 🚫 FORBIDDEN to proceed without checking all 4 tools
42
42
 
43
43
  ## CONTEXT BOUNDARIES:
44
44
 
@@ -95,22 +95,38 @@ Check if the `SNYK_TOKEN` environment variable is set:
95
95
 
96
96
  This is informational only — security scan availability does NOT affect the tier level. It is recorded in forge-tier.yaml so that create-skill's validation step can report actionable guidance when security scanning is unavailable.
97
97
 
98
- ### 7. Calculate Tier
98
+ ### 7. Verify Tool: ccc (cocoindex-code)
99
99
 
100
- **If `{tier_override}` is set and valid (Quick, Forge, or Deep):**
100
+ **Step A Binary existence:** Run `ccc --help`
101
+
102
+ - If exits 0: binary confirmed. Continue to Step B.
103
+ - If fails (command not found or error): record `{ccc: false}`. Skip Step B.
104
+
105
+ **Step B — Daemon health:** Run `ccc doctor`
106
+
107
+ - If daemon is running and model check OK: record `{ccc: true}` and store version string from output
108
+ - If daemon is not running: record `{ccc: true, ccc_daemon: "stopped"}` — binary available, daemon needs starting. Step-01b will handle this.
109
+ - If error or timeout: record `{ccc: true, ccc_daemon: "error"}` — binary works but daemon has issues.
110
+
111
+ ccc availability gates the Forge+ tier and enhances Deep tier when present.
112
+
113
+ ### 8. Calculate Tier
114
+
115
+ **If `{tier_override}` is set and valid (Quick, Forge, Forge+, or Deep):**
101
116
  - Use `{tier_override}` as `{calculated_tier}`
102
117
  - Note that override is active for the report step
103
118
 
104
- **If no override, apply tier rules from {tierRulesData}:**
119
+ **If no override, apply tier rules from {tierRulesData} in order — the first matching rule wins. Do not continue checking once a match is found:**
105
120
  - `{ast_grep}` AND `{gh_cli}` AND `{qmd}` all true → **Deep**
106
- - `{ast_grep}` true (regardless of gh/qmd) → **Forge**
121
+ - `{ast_grep}` AND `{ccc}` both true (regardless of gh/qmd) → **Forge+**
122
+ - `{ast_grep}` true (regardless of ccc/gh/qmd) → **Forge**
107
123
  - Otherwise → **Quick**
108
124
 
109
125
  **If `{tier_override}` is set but invalid:** ignore it, use detected tier, flag for warning in report.
110
126
 
111
- ### 8. Auto-Proceed
127
+ ### 9. Auto-Proceed
112
128
 
113
- "**Proceeding to write configuration...**"
129
+ "**Proceeding to CCC index check...**"
114
130
 
115
131
  #### Menu Handling Logic:
116
132
 
@@ -123,7 +139,7 @@ This is informational only — security scan availability does NOT affect the ti
123
139
 
124
140
  ## CRITICAL STEP COMPLETION NOTE
125
141
 
126
- ONLY WHEN all 3 core tools have been verified, optional security scan checked, and the tier calculated will you load and read fully `{nextStepFile}` to execute the configuration write step.
142
+ ONLY WHEN all 4 core tools have been verified, optional security scan checked, and the tier calculated will you load and read fully `{nextStepFile}` to execute the CCC index check step.
127
143
 
128
144
  ---
129
145
 
@@ -131,19 +147,20 @@ ONLY WHEN all 3 core tools have been verified, optional security scan checked, a
131
147
 
132
148
  ### ✅ SUCCESS:
133
149
 
134
- - All 3 tools checked via verification commands (not existence checks)
150
+ - All 4 tools checked via verification commands (not existence checks)
135
151
  - Existing forge-tier.yaml read for re-run comparison (if present)
136
152
  - Existing preferences.yaml read for tier_override (if present)
137
153
  - Tier correctly calculated from tool results or override applied
138
- - All results stored in context for step-02
139
- - Auto-proceeded to step-02
154
+ - All results stored in context for step-01b and step-02
155
+ - Auto-proceeded to step-01b
140
156
 
141
157
  ### ❌ SYSTEM FAILURE:
142
158
 
143
- - Skipping any tool verification
159
+ - Skipping any tool verification (ast-grep, gh, qmd, ccc — all 4 must be checked)
144
160
  - Using `which` or `command -v` instead of verification commands
145
161
  - Assuming tool availability without running the command
146
162
  - Writing files in this step (that is step-02)
147
163
  - Not checking for existing configuration on re-runs
164
+ - Not checking ccc availability (both binary and daemon health)
148
165
 
149
166
  **Master Rule:** Every tool MUST be verified empirically. No assumptions, no shortcuts.
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: 'step-01b-ccc-index'
3
+ description: 'Ensure ccc project index exists — Forge+ and Deep tiers when ccc is available'
4
+
5
+ nextStepFile: './step-02-write-config.md'
6
+ ---
7
+
8
+ # Step 1b: CCC Index Verification
9
+
10
+ ## STEP GOAL:
11
+
12
+ If ccc is available (`{ccc: true}` from step-01), verify that the ccc index exists for the project root. If no index exists, create it. Store index state in context for step-02 to write into forge-tier.yaml.
13
+
14
+ For Quick and Forge tiers, or when ccc is unavailable, skip silently and proceed.
15
+
16
+ ## MANDATORY EXECUTION RULES (READ FIRST):
17
+
18
+ ### Universal Rules:
19
+
20
+ - 📖 CRITICAL: Read the complete step file before taking any action
21
+ - 🔄 CRITICAL: When loading next step, ensure entire file is read
22
+ - 🎯 Execute all operations autonomously — no user interaction
23
+
24
+ ### Role Reinforcement:
25
+
26
+ - ✅ You are a system executor verifying the ccc index state
27
+ - ✅ ccc indexing failure is never a workflow error — degrade gracefully
28
+ - ✅ No negative messaging for tiers that skip this step
29
+
30
+ ### Step-Specific Rules:
31
+
32
+ - 🎯 Focus only on ccc index verification and creation
33
+ - 🚫 FORBIDDEN to display skip messages for Quick/Forge tiers
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)
36
+
37
+ ## EXECUTION PROTOCOLS:
38
+
39
+ - 🎯 Follow the MANDATORY SEQUENCE exactly
40
+ - 💾 Store ccc index state in context for step-02
41
+ - 🚫 FORBIDDEN to write forge-tier.yaml — that is step-02's job
42
+
43
+ ## CONTEXT BOUNDARIES:
44
+
45
+ - Available: {ccc} boolean and {ccc_daemon} status from step-01
46
+ - Available: {calculated_tier} from step-01
47
+ - Available: existing forge-tier.yaml may contain prior `ccc_index` state
48
+ - Focus: ccc index state verification and creation only
49
+ - Dependencies: step-01 must have completed with tool detection results
50
+
51
+ ## MANDATORY SEQUENCE
52
+
53
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
54
+
55
+ ### 1. Check Eligibility
56
+
57
+ Read `{ccc}` from step-01 context.
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.
60
+
61
+ **If `{ccc}` is true:** Continue to section 2.
62
+
63
+ ### 2. Check Existing Index State
64
+
65
+ Read existing forge-tier.yaml at `{project-root}/_bmad/_memory/forger-sidecar/forge-tier.yaml` (if it exists from a previous run).
66
+
67
+ 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` (default 24h) of now → index is fresh
70
+ - Store `{ccc_index_result: "fresh", ccc_indexed_path: {project-root}, ccc_last_indexed: {existing timestamp}}`
71
+ - Proceed to section 4
72
+
73
+ - If `ccc_index.indexed_path` matches `{project-root}` but timestamp is older than threshold:
74
+ - Store `{ccc_index_result: "stale", ccc_indexed_path: {existing path}, ccc_last_indexed: {existing timestamp}}` — proceed to section 3 for re-index
75
+
76
+ - If `ccc_index` is missing, has null values, or path doesn't match:
77
+ - Proceed to section 3 for initial index
78
+
79
+ ### 3. Create or Refresh CCC Index
80
+
81
+ **If `{ccc_daemon}` is `"stopped"` or undefined (healthy daemon where no explicit state was recorded):**
82
+
83
+ The `ccc index` command auto-starts the daemon when needed. Proceed with indexing below.
84
+
85
+ **If `{ccc_daemon}` is `"error"`:**
86
+
87
+ Attempt indexing anyway — errors will be caught below.
88
+
89
+ Run:
90
+ ```bash
91
+ ccc init {project-root}
92
+ ```
93
+
94
+ **If init fails** (project may already be initialized): continue — this is not an error.
95
+
96
+ Then run:
97
+ ```bash
98
+ ccc index
99
+ ```
100
+
101
+ **If succeeds:**
102
+ - Run `ccc status` to get file count
103
+ - Store `{ccc_index_result: "created", ccc_indexed_path: {project-root}, ccc_last_indexed: {current ISO timestamp}, ccc_file_count: {count from status}}`
104
+ - Display: "**CCC index created.** {file_count} files indexed for semantic discovery."
105
+
106
+ **If fails:**
107
+ - Store `{ccc_index_result: "failed", ccc_indexed_path: null, ccc_last_indexed: null}`
108
+ - Display: "CCC indexing failed: {error}. Extraction will use direct AST scanning — semantic pre-ranking unavailable this session."
109
+ - Continue — this is NOT a workflow error
110
+
111
+ ### 4. Auto-Proceed
112
+
113
+ "**Proceeding to write configuration...**"
114
+
115
+ #### Menu Handling Logic:
116
+
117
+ - After ccc index check completes (or is skipped), immediately load, read entire file, then execute {nextStepFile}
118
+
119
+ #### EXECUTION RULES:
120
+
121
+ - This is an auto-proceed step with no user choices
122
+ - Proceed directly to next step after ccc index verification
123
+
124
+ ## CRITICAL STEP COMPLETION NOTE
125
+
126
+ ONLY WHEN ccc index verification is complete (or step is skipped for ccc unavailable) will you load and read fully `{nextStepFile}` to execute the configuration write step.
127
+
128
+ ---
129
+
130
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
131
+
132
+ ### ✅ SUCCESS:
133
+
134
+ - ccc unavailable: skipped silently with no output, context variables set to null/none
135
+ - ccc available with fresh index: verified freshness, skipped re-index, context variables set
136
+ - ccc available with stale/missing index: index created, context variables set with fresh timestamp
137
+ - ccc indexing fails: logged gracefully, workflow continues, context variables set to failed/null
138
+ - Auto-proceeded to step-02
139
+
140
+ ### ❌ SYSTEM FAILURE:
141
+
142
+ - Displaying skip messages when ccc is unavailable
143
+ - Halting the workflow on ccc index failure
144
+ - Re-indexing when index is already fresh and path matches
145
+ - Writing forge-tier.yaml (that is step-02's responsibility)
146
+ - Not storing ccc index context variables for step-02
147
+
148
+ **Master Rule:** CCC indexing is always best-effort. Failures degrade gracefully. The workflow never halts over ccc issues.
@@ -63,18 +63,32 @@ tools:
63
63
  ast_grep: {true/false from detection}
64
64
  gh_cli: {true/false from detection}
65
65
  qmd: {true/false from detection}
66
+ ccc: {true/false from detection}
67
+ ccc_daemon: {ccc_daemon from step-01 if available: "healthy"|"stopped"|"error", or ~}
66
68
  security_scan: {true/false — true when SNYK_TOKEN is set}
67
69
 
68
70
  # Capability tier (derived from tool availability)
69
- # Quick = no tools required | Forge = + ast-grep | Deep = + ast-grep + gh + QMD
71
+ # Quick = no tools | Forge = + ast-grep | Forge+ = + ast-grep + ccc | Deep = + ast-grep + gh + QMD
70
72
  tier: {calculated_tier}
71
73
  tier_detected_at: {current ISO timestamp}
72
74
 
75
+ # CCC semantic index state (managed by setup-forge step-01b and extraction workflows)
76
+ ccc_index:
77
+ indexed_path: {ccc_indexed_path from step-01b, or ~}
78
+ last_indexed: {ccc_last_indexed from step-01b, or ~}
79
+ status: {ccc_index_status from step-01b: "fresh"|"created"|"none"|"failed"}
80
+ staleness_threshold_hours: 24
81
+
82
+ # CCC index registry (tracks which source paths have been indexed for skill workflows)
83
+ ccc_index_registry: []
84
+
73
85
  # QMD collection registry (populated by create-skill, consumed by audit/update-skill)
74
86
  # Each entry tracks a QMD collection created during skill workflows
75
87
  qmd_collections: []
76
88
  ```
77
89
 
90
+ **Note on re-runs:** The `qmd_collections` and `ccc_index_registry` arrays must be preserved across re-runs. Before overwriting forge-tier.yaml, read the existing `qmd_collections` and `ccc_index_registry` arrays and re-inject them into the new write. These arrays are populated by create-skill workflows and must not be reset.
91
+
78
92
  **This file is ALWAYS overwritten** on every run — it reflects current tool state.
79
93
 
80
94
  If the write fails, report the error and halt the workflow.
@@ -90,15 +104,19 @@ Check if `{project-root}/_bmad/_memory/forger-sidecar/preferences.yaml` exists:
90
104
  # Created by setup-forge workflow on first run
91
105
  # Edit this file to customize Ferris behavior
92
106
 
93
- # Override detected tier (set to Quick, Forge, or Deep to force a tier)
107
+ # Override detected tier (set to Quick, Forge, Forge+, or Deep to force a tier)
94
108
  tier_override: ~
95
109
 
96
110
  # Passive context injection (set to false to skip snippet generation and CLAUDE.md updates during export)
97
111
  passive_context: true
98
112
 
99
- # Skill generation defaults
100
- default_source_authority: community
101
- default_confidence_threshold: 0.7
113
+ # Language defaults
114
+ output_language: ~
115
+ skill_format_version: ~
116
+
117
+ # Output preferences
118
+ citation_style: ~
119
+ confidence_display: ~
102
120
  ```
103
121
 
104
122
  **If it DOES exist:** Do not modify. Preserve entirely.
@@ -133,7 +151,7 @@ ONLY WHEN forge-tier.yaml has been written successfully and preferences.yaml exi
133
151
 
134
152
  ### ✅ SUCCESS:
135
153
 
136
- - forge-tier.yaml written with accurate tool booleans, tier, timestamp, and empty qmd_collections registry
154
+ - forge-tier.yaml written with accurate tool booleans (including ccc), tier, timestamp, ccc_index state, and preserved qmd_collections/ccc_index_registry arrays
137
155
  - preferences.yaml exists (created with defaults on first run, preserved on re-run)
138
156
  - forge-data/ directory exists (created or pre-existing)
139
157
  - Auto-proceeded to step-03