bmad-module-skill-forge 0.2.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/.nvmrc +1 -0
- package/LICENSE +26 -0
- package/README.md +213 -0
- package/docs/404.md +20 -0
- package/docs/agents.md +73 -0
- package/docs/architecture.md +301 -0
- package/docs/examples.md +144 -0
- package/docs/getting-started.md +198 -0
- package/docs/index.md +75 -0
- package/docs/workflows.md +190 -0
- package/package.json +109 -0
- package/src/agents/forger.agent.yaml +93 -0
- package/src/forger/README.md +17 -0
- package/src/forger/forge-tier.yaml +13 -0
- package/src/forger/preferences.yaml +10 -0
- package/src/knowledge/agentskills-spec.md +158 -0
- package/src/knowledge/confidence-tiers.md +153 -0
- package/src/knowledge/manual-section-integrity.md +156 -0
- package/src/knowledge/overview.md +56 -0
- package/src/knowledge/progressive-capability.md +120 -0
- package/src/knowledge/provenance-tracking.md +163 -0
- package/src/knowledge/skf-knowledge-index.csv +9 -0
- package/src/knowledge/skill-lifecycle.md +150 -0
- package/src/knowledge/zero-hallucination.md +101 -0
- package/src/module-help.csv +12 -0
- package/src/module.yaml +22 -0
- package/src/workflows/README.md +148 -0
- package/src/workflows/analyze-source/data/skill-brief-schema.md +75 -0
- package/src/workflows/analyze-source/data/unit-detection-heuristics.md +88 -0
- package/src/workflows/analyze-source/steps-c/step-01-init.md +191 -0
- package/src/workflows/analyze-source/steps-c/step-01b-continue.md +144 -0
- package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +208 -0
- package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +199 -0
- package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +222 -0
- package/src/workflows/analyze-source/steps-c/step-05-recommend.md +236 -0
- package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +239 -0
- package/src/workflows/analyze-source/templates/analysis-report-template.md +41 -0
- package/src/workflows/analyze-source/validation-report.md +657 -0
- package/src/workflows/analyze-source/workflow-plan-analyze-source.md +385 -0
- package/src/workflows/analyze-source/workflow.md +61 -0
- package/src/workflows/audit-skill/data/drift-report-template.md +62 -0
- package/src/workflows/audit-skill/data/severity-rules.md +52 -0
- package/src/workflows/audit-skill/steps-c/step-01-init.md +195 -0
- package/src/workflows/audit-skill/steps-c/step-02-re-index.md +191 -0
- package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +194 -0
- package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +199 -0
- package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +210 -0
- package/src/workflows/audit-skill/steps-c/step-06-report.md +217 -0
- package/src/workflows/audit-skill/validation-report.md +545 -0
- package/src/workflows/audit-skill/workflow-plan-audit-skill.md +318 -0
- package/src/workflows/audit-skill/workflow.md +63 -0
- package/src/workflows/brief-skill/data/skill-brief-schema.md +82 -0
- package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +184 -0
- package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +203 -0
- package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +225 -0
- package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +185 -0
- package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +156 -0
- package/src/workflows/brief-skill/validation-report.md +630 -0
- package/src/workflows/brief-skill/workflow-plan-brief-skill.md +360 -0
- package/src/workflows/brief-skill/workflow.md +57 -0
- package/src/workflows/create-skill/data/extraction-patterns.md +63 -0
- package/src/workflows/create-skill/data/skill-sections.md +166 -0
- package/src/workflows/create-skill/steps-c/step-01-load-brief.md +176 -0
- package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +143 -0
- package/src/workflows/create-skill/steps-c/step-03-extract.md +184 -0
- package/src/workflows/create-skill/steps-c/step-04-enrich.md +152 -0
- package/src/workflows/create-skill/steps-c/step-05-compile.md +198 -0
- package/src/workflows/create-skill/steps-c/step-06-validate.md +162 -0
- package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +165 -0
- package/src/workflows/create-skill/steps-c/step-08-report.md +160 -0
- package/src/workflows/create-skill/validation-report.md +189 -0
- package/src/workflows/create-skill/workflow-plan-create-skill.md +491 -0
- package/src/workflows/create-skill/workflow.md +52 -0
- package/src/workflows/create-stack-skill/data/integration-patterns.md +61 -0
- package/src/workflows/create-stack-skill/data/manifest-patterns.md +35 -0
- package/src/workflows/create-stack-skill/data/stack-skill-template.md +110 -0
- package/src/workflows/create-stack-skill/steps-c/step-01-init.md +142 -0
- package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +145 -0
- package/src/workflows/create-stack-skill/steps-c/step-03-rank-and-confirm.md +161 -0
- package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +155 -0
- package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +154 -0
- package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +160 -0
- package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +202 -0
- package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +193 -0
- package/src/workflows/create-stack-skill/steps-c/step-09-report.md +137 -0
- package/src/workflows/create-stack-skill/validation-report.md +401 -0
- package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +481 -0
- package/src/workflows/create-stack-skill/workflow.md +59 -0
- package/src/workflows/export-skill/data/managed-section-format.md +70 -0
- package/src/workflows/export-skill/data/snippet-format.md +32 -0
- package/src/workflows/export-skill/steps-c/step-01-load-skill.md +184 -0
- package/src/workflows/export-skill/steps-c/step-02-package.md +153 -0
- package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +166 -0
- package/src/workflows/export-skill/steps-c/step-04-update-context.md +222 -0
- package/src/workflows/export-skill/steps-c/step-05-token-report.md +126 -0
- package/src/workflows/export-skill/steps-c/step-06-summary.md +167 -0
- package/src/workflows/export-skill/validation-report.md +263 -0
- package/src/workflows/export-skill/workflow-plan-export-skill.md +369 -0
- package/src/workflows/export-skill/workflow.md +56 -0
- package/src/workflows/quick-skill/data/registry-resolution.md +91 -0
- package/src/workflows/quick-skill/data/skill-template.md +66 -0
- package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +165 -0
- package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +143 -0
- package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +177 -0
- package/src/workflows/quick-skill/steps-c/step-04-compile.md +180 -0
- package/src/workflows/quick-skill/steps-c/step-05-validate.md +150 -0
- package/src/workflows/quick-skill/steps-c/step-06-write.md +160 -0
- package/src/workflows/quick-skill/validation-report.md +543 -0
- package/src/workflows/quick-skill/workflow-plan-quick-skill.md +405 -0
- package/src/workflows/quick-skill/workflow.md +56 -0
- package/src/workflows/setup-forge/data/tier-rules.md +50 -0
- package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +140 -0
- package/src/workflows/setup-forge/steps-c/step-02-write-config.md +141 -0
- package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +116 -0
- package/src/workflows/setup-forge/steps-c/step-04-report.md +131 -0
- package/src/workflows/setup-forge/validation-report.md +504 -0
- package/src/workflows/setup-forge/workflow-plan-setup-forge.md +428 -0
- package/src/workflows/setup-forge/workflow.md +49 -0
- package/src/workflows/test-skill/data/output-section-formats.md +96 -0
- package/src/workflows/test-skill/data/scoring-rules.md +74 -0
- package/src/workflows/test-skill/steps-c/step-01-init.md +185 -0
- package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +162 -0
- package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +222 -0
- package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +249 -0
- package/src/workflows/test-skill/steps-c/step-05-score.md +222 -0
- package/src/workflows/test-skill/steps-c/step-06-report.md +175 -0
- package/src/workflows/test-skill/templates/test-report-template.md +24 -0
- package/src/workflows/test-skill/validation-report.md +390 -0
- package/src/workflows/test-skill/workflow-plan-test-skill.md +288 -0
- package/src/workflows/test-skill/workflow.md +57 -0
- package/src/workflows/update-skill/data/manual-section-rules.md +44 -0
- package/src/workflows/update-skill/data/merge-conflict-rules.md +62 -0
- package/src/workflows/update-skill/steps-c/step-01-init.md +208 -0
- package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +184 -0
- package/src/workflows/update-skill/steps-c/step-03-re-extract.md +187 -0
- package/src/workflows/update-skill/steps-c/step-04-merge.md +230 -0
- package/src/workflows/update-skill/steps-c/step-05-validate.md +187 -0
- package/src/workflows/update-skill/steps-c/step-06-write.md +204 -0
- package/src/workflows/update-skill/steps-c/step-07-report.md +201 -0
- package/src/workflows/update-skill/validation-report.md +559 -0
- package/src/workflows/update-skill/workflow-plan-update-skill.md +441 -0
- package/src/workflows/update-skill/workflow.md +56 -0
- package/tools/cli/commands/install.js +33 -0
- package/tools/cli/commands/status.js +195 -0
- package/tools/cli/commands/uninstall.js +226 -0
- package/tools/cli/commands/update.js +63 -0
- package/tools/cli/lib/compiler.js +306 -0
- package/tools/cli/lib/ide-commands.js +244 -0
- package/tools/cli/lib/installer.js +307 -0
- package/tools/cli/lib/manifest.js +109 -0
- package/tools/cli/lib/ui.js +277 -0
- package/tools/cli/lib/version-check.js +86 -0
- package/tools/cli/skf-cli.js +45 -0
- package/tools/skf-npx-wrapper.js +36 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-04-semantic-diff'
|
|
3
|
+
description: 'Compare QMD knowledge context for meaning-level changes (Deep tier only, skip at Quick/Forge)'
|
|
4
|
+
|
|
5
|
+
nextStepFile: './step-05-severity-classify.md'
|
|
6
|
+
outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Step 4: Semantic Diff
|
|
10
|
+
|
|
11
|
+
## STEP GOAL:
|
|
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.
|
|
14
|
+
|
|
15
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
16
|
+
|
|
17
|
+
### Universal Rules:
|
|
18
|
+
|
|
19
|
+
- 🛑 NEVER generate content without user input
|
|
20
|
+
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
21
|
+
- 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
|
|
22
|
+
- ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
|
|
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 auditor performing semantic analysis
|
|
28
|
+
- ✅ Semantic findings have T2 confidence — evidence-backed but not structurally absolute
|
|
29
|
+
- ✅ Distinguish clearly between structural facts (T1) and semantic observations (T2)
|
|
30
|
+
|
|
31
|
+
### Step-Specific Rules:
|
|
32
|
+
|
|
33
|
+
- 🎯 Focus only on semantic/meaning-level changes via QMD context
|
|
34
|
+
- 🚫 FORBIDDEN to classify severity — that happens in Step 05
|
|
35
|
+
- 🚫 FORBIDDEN to repeat structural findings from Step 03
|
|
36
|
+
- 💬 Use subprocess Pattern 3 (data operations) when available for QMD queries
|
|
37
|
+
- ⚙️ If subprocess unavailable, query QMD in main thread
|
|
38
|
+
- 🔀 CONDITIONAL: Skip entire analysis at Quick/Forge tier — append skip notice only
|
|
39
|
+
|
|
40
|
+
## EXECUTION PROTOCOLS:
|
|
41
|
+
|
|
42
|
+
- 🎯 Check forge tier FIRST — skip if not Deep
|
|
43
|
+
- 💾 Append ## Semantic Drift section (or skip notice) to {outputFile}
|
|
44
|
+
- 📖 Update {outputFile} frontmatter stepsCompleted when complete
|
|
45
|
+
- 🚫 Only semantic findings — no structural or severity analysis
|
|
46
|
+
|
|
47
|
+
## CONTEXT BOUNDARIES:
|
|
48
|
+
|
|
49
|
+
- Available: Forge tier, structural drift findings (from Step 03), QMD access (Deep tier only)
|
|
50
|
+
- Focus: Meaning-level changes that complement structural diff
|
|
51
|
+
- Limits: Do not re-analyze structural changes, do not classify severity
|
|
52
|
+
- Dependencies: Steps 01-03 must be complete; QMD collection must exist for Deep tier
|
|
53
|
+
|
|
54
|
+
## MANDATORY SEQUENCE
|
|
55
|
+
|
|
56
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
|
|
57
|
+
|
|
58
|
+
### 1. Check Forge Tier
|
|
59
|
+
|
|
60
|
+
**IF forge tier is Quick or Forge:**
|
|
61
|
+
|
|
62
|
+
Append to {outputFile}:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
## Semantic Drift
|
|
66
|
+
|
|
67
|
+
**Status:** Skipped — Semantic diff requires Deep tier (current tier: {tier})
|
|
68
|
+
|
|
69
|
+
Semantic analysis compares QMD knowledge context for meaning-level changes that structural diff cannot detect. To enable semantic diff, run setup-forge with QMD available to unlock Deep tier.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Update frontmatter: append `'step-04-semantic-diff'` to `stepsCompleted`
|
|
73
|
+
|
|
74
|
+
"**Semantic diff skipped (requires Deep tier). Proceeding to severity classification...**"
|
|
75
|
+
|
|
76
|
+
→ Auto-proceed to {nextStepFile}
|
|
77
|
+
|
|
78
|
+
**IF forge tier is Deep:**
|
|
79
|
+
|
|
80
|
+
Continue to section 2.
|
|
81
|
+
|
|
82
|
+
### 2. Query Original Knowledge Context
|
|
83
|
+
|
|
84
|
+
Launch a subprocess (Pattern 3 — data operations) that:
|
|
85
|
+
1. Loads the QMD collection for the project
|
|
86
|
+
2. Queries for knowledge context around each export documented in the skill
|
|
87
|
+
3. Retrieves: usage patterns, conventions, architectural context, dependency relationships
|
|
88
|
+
4. Returns structured findings to parent
|
|
89
|
+
|
|
90
|
+
**If subprocess unavailable:** Query QMD in main thread.
|
|
91
|
+
|
|
92
|
+
### 3. Compare Knowledge Context
|
|
93
|
+
|
|
94
|
+
For each export in the skill, compare original context (from skill creation) against current context (from QMD):
|
|
95
|
+
|
|
96
|
+
**Detect:**
|
|
97
|
+
- **New patterns:** Usage patterns that have emerged since skill was created
|
|
98
|
+
- **Changed conventions:** Project conventions that have shifted (e.g., new error handling pattern)
|
|
99
|
+
- **Dependency shifts:** Libraries or modules that exports now depend on differently
|
|
100
|
+
- **Architectural changes:** Structural reorganization affecting how exports relate to each other
|
|
101
|
+
- **Deprecated patterns:** Usage patterns documented in skill that are no longer followed
|
|
102
|
+
|
|
103
|
+
For each finding, record:
|
|
104
|
+
- What changed (description)
|
|
105
|
+
- Evidence (QMD reference or source citation)
|
|
106
|
+
- Affected exports
|
|
107
|
+
- Confidence: T2
|
|
108
|
+
|
|
109
|
+
### 4. Compile Semantic Drift Section
|
|
110
|
+
|
|
111
|
+
Append to {outputFile}:
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
## Semantic Drift
|
|
115
|
+
|
|
116
|
+
**Method:** QMD knowledge context comparison (Deep tier)
|
|
117
|
+
**QMD Collection:** {collection_name}
|
|
118
|
+
|
|
119
|
+
### New Patterns Detected ({count})
|
|
120
|
+
|
|
121
|
+
| Pattern | Description | Affected Exports | Evidence | Confidence |
|
|
122
|
+
|---------|------------|-----------------|----------|------------|
|
|
123
|
+
| {pattern} | {description} | {exports} | {evidence} | T2 |
|
|
124
|
+
|
|
125
|
+
### Changed Conventions ({count})
|
|
126
|
+
|
|
127
|
+
| Convention | Before | After | Affected Exports | Evidence | Confidence |
|
|
128
|
+
|-----------|--------|-------|-----------------|----------|------------|
|
|
129
|
+
| {convention} | {old} | {new} | {exports} | {evidence} | T2 |
|
|
130
|
+
|
|
131
|
+
### Dependency Shifts ({count})
|
|
132
|
+
|
|
133
|
+
| Export | Original Dependencies | Current Dependencies | Change | Confidence |
|
|
134
|
+
|--------|---------------------|---------------------|--------|------------|
|
|
135
|
+
| {export} | {old_deps} | {new_deps} | {description} | T2 |
|
|
136
|
+
|
|
137
|
+
### Deprecated Patterns ({count})
|
|
138
|
+
|
|
139
|
+
| Pattern | Documented In Skill | Current Status | Evidence | Confidence |
|
|
140
|
+
|---------|-------------------|----------------|----------|------------|
|
|
141
|
+
| {pattern} | {skill_reference} | {status} | {evidence} | T2 |
|
|
142
|
+
|
|
143
|
+
### Summary
|
|
144
|
+
|
|
145
|
+
| Category | Count |
|
|
146
|
+
|----------|-------|
|
|
147
|
+
| New patterns | {count} |
|
|
148
|
+
| Changed conventions | {count} |
|
|
149
|
+
| Dependency shifts | {count} |
|
|
150
|
+
| Deprecated patterns | {count} |
|
|
151
|
+
| **Total Semantic Items** | {total} |
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 5. Update Report and Auto-Proceed
|
|
155
|
+
|
|
156
|
+
Update {outputFile} frontmatter:
|
|
157
|
+
- Append `'step-04-semantic-diff'` to `stepsCompleted`
|
|
158
|
+
|
|
159
|
+
### 6. Present MENU OPTIONS
|
|
160
|
+
|
|
161
|
+
Display: "**Semantic diff complete. {total} semantic drift items found. Proceeding to severity classification...**"
|
|
162
|
+
|
|
163
|
+
#### Menu Handling Logic:
|
|
164
|
+
|
|
165
|
+
- After semantic diff section is appended and frontmatter updated, immediately load, read entire file, then execute {nextStepFile}
|
|
166
|
+
|
|
167
|
+
#### EXECUTION RULES:
|
|
168
|
+
|
|
169
|
+
- This is an auto-proceed analysis step with no user choices
|
|
170
|
+
- Proceed directly to next step after completion
|
|
171
|
+
|
|
172
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
173
|
+
|
|
174
|
+
ONLY WHEN the ## Semantic Drift section (or skip notice) has been appended to {outputFile} will you then load and read fully `{nextStepFile}` to execute and begin severity classification.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
179
|
+
|
|
180
|
+
### ✅ SUCCESS:
|
|
181
|
+
|
|
182
|
+
- Forge tier checked FIRST — skip gracefully at Quick/Forge
|
|
183
|
+
- Deep tier: QMD knowledge context queried and compared
|
|
184
|
+
- All semantic findings have T2 confidence labels
|
|
185
|
+
- Findings clearly distinguished from structural drift (T1)
|
|
186
|
+
- Skip notice includes explanation of what semantic diff provides
|
|
187
|
+
- Structured table format in drift report
|
|
188
|
+
- Frontmatter stepsCompleted updated
|
|
189
|
+
|
|
190
|
+
### ❌ SYSTEM FAILURE:
|
|
191
|
+
|
|
192
|
+
- Not checking tier before attempting QMD analysis
|
|
193
|
+
- Repeating structural findings from Step 03
|
|
194
|
+
- Missing confidence tier labels on findings
|
|
195
|
+
- Classifying severity in this step (severity is Step 05)
|
|
196
|
+
- Failing to skip gracefully at non-Deep tiers
|
|
197
|
+
- Hardcoded paths instead of frontmatter variables
|
|
198
|
+
|
|
199
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-05-severity-classify'
|
|
3
|
+
description: 'Grade every drift finding by severity using classification rules'
|
|
4
|
+
|
|
5
|
+
nextStepFile: './step-06-report.md'
|
|
6
|
+
outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
|
|
7
|
+
severityRulesFile: '../data/severity-rules.md'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Step 5: Severity Classification
|
|
11
|
+
|
|
12
|
+
## STEP GOAL:
|
|
13
|
+
|
|
14
|
+
Grade every drift finding from Steps 03 and 04 by severity level (CRITICAL/HIGH/MEDIUM/LOW) using the classification rules. Calculate the overall drift score and produce a categorized findings table with confidence tier labels.
|
|
15
|
+
|
|
16
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
17
|
+
|
|
18
|
+
### Universal Rules:
|
|
19
|
+
|
|
20
|
+
- 🛑 NEVER generate content without user input
|
|
21
|
+
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
22
|
+
- 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
|
|
23
|
+
- ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
|
|
24
|
+
- ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
25
|
+
|
|
26
|
+
### Role Reinforcement:
|
|
27
|
+
|
|
28
|
+
- ✅ You are a skill auditor performing severity assessment
|
|
29
|
+
- ✅ Classification must be deterministic — same finding always gets same severity
|
|
30
|
+
- ✅ Apply rules strictly — do not invent new severity categories or soften classifications
|
|
31
|
+
|
|
32
|
+
### Step-Specific Rules:
|
|
33
|
+
|
|
34
|
+
- 🎯 Focus only on classifying severity of existing findings
|
|
35
|
+
- 🚫 FORBIDDEN to discover new drift items — only classify what Steps 03-04 found
|
|
36
|
+
- 🚫 FORBIDDEN to suggest remediation — that happens in Step 06
|
|
37
|
+
- 💬 Use subprocess Pattern 3 (data operations) to load severity rules and classify
|
|
38
|
+
- ⚙️ If subprocess unavailable, load rules and classify in main thread
|
|
39
|
+
|
|
40
|
+
## EXECUTION PROTOCOLS:
|
|
41
|
+
|
|
42
|
+
- 🎯 Load {severityRulesFile} and apply to every finding
|
|
43
|
+
- 💾 Append ## Severity Classification section to {outputFile}
|
|
44
|
+
- 📖 Update {outputFile} frontmatter stepsCompleted when complete
|
|
45
|
+
- 🚫 Only classification — no new findings, no remediation
|
|
46
|
+
|
|
47
|
+
## CONTEXT BOUNDARIES:
|
|
48
|
+
|
|
49
|
+
- Available: Structural drift findings (Step 03), semantic drift findings (Step 04 if Deep), severity rules
|
|
50
|
+
- Focus: Applying deterministic severity classification to every finding
|
|
51
|
+
- Limits: Do not discover new drift, do not suggest fixes
|
|
52
|
+
- Dependencies: Steps 03 (and optionally 04) must be complete
|
|
53
|
+
|
|
54
|
+
## MANDATORY SEQUENCE
|
|
55
|
+
|
|
56
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
|
|
57
|
+
|
|
58
|
+
### 1. Load Severity Rules
|
|
59
|
+
|
|
60
|
+
Launch a subprocess (Pattern 3 — data operations) that:
|
|
61
|
+
1. Loads {severityRulesFile}
|
|
62
|
+
2. Extracts classification criteria for each severity level
|
|
63
|
+
3. Returns structured rules to parent
|
|
64
|
+
|
|
65
|
+
**If subprocess unavailable:** Load {severityRulesFile} directly in main thread.
|
|
66
|
+
|
|
67
|
+
**Rules summary:**
|
|
68
|
+
- **CRITICAL:** Removed/renamed exports, changed signatures (breaking changes)
|
|
69
|
+
- **HIGH:** New public API not in skill (>3), removed helpers used in patterns, deprecated APIs
|
|
70
|
+
- **MEDIUM:** Implementation changes behind stable API, 1-3 new exports, moved functions
|
|
71
|
+
- **LOW:** Style/convention changes, comments, whitespace, internal functions
|
|
72
|
+
|
|
73
|
+
### 2. Collect All Findings
|
|
74
|
+
|
|
75
|
+
Gather all drift items from the report:
|
|
76
|
+
|
|
77
|
+
**From ## Structural Drift (Step 03):**
|
|
78
|
+
- Added exports
|
|
79
|
+
- Removed exports
|
|
80
|
+
- Changed exports
|
|
81
|
+
|
|
82
|
+
**From ## Semantic Drift (Step 04, if Deep tier):**
|
|
83
|
+
- New patterns
|
|
84
|
+
- Changed conventions
|
|
85
|
+
- Dependency shifts
|
|
86
|
+
- Deprecated patterns
|
|
87
|
+
|
|
88
|
+
Count total findings to classify.
|
|
89
|
+
|
|
90
|
+
### 3. Apply Severity Classification
|
|
91
|
+
|
|
92
|
+
For EACH finding, apply the severity rules:
|
|
93
|
+
|
|
94
|
+
**Structural findings classification:**
|
|
95
|
+
- Removed export → CRITICAL (breaking: skill references something that no longer exists)
|
|
96
|
+
- Changed signature → CRITICAL (breaking: skill documents wrong parameters/return type)
|
|
97
|
+
- Renamed export → CRITICAL (breaking: skill references old name)
|
|
98
|
+
- Moved export (same signature) → MEDIUM (non-breaking but location in skill is wrong)
|
|
99
|
+
- Added export (>3 total) → HIGH (significant API surface not documented)
|
|
100
|
+
- Added export (1-3 total) → MEDIUM (minor gap in coverage)
|
|
101
|
+
|
|
102
|
+
**Semantic findings classification:**
|
|
103
|
+
- Deprecated pattern still in skill → HIGH (skill teaches outdated approach)
|
|
104
|
+
- Changed convention → MEDIUM (skill may use old style)
|
|
105
|
+
- New pattern detected → MEDIUM (skill doesn't cover new approach)
|
|
106
|
+
- Dependency shift → MEDIUM (skill may reference wrong dependencies)
|
|
107
|
+
|
|
108
|
+
Record for each finding: original finding + assigned severity level.
|
|
109
|
+
|
|
110
|
+
### 4. Calculate Overall Drift Score
|
|
111
|
+
|
|
112
|
+
Apply scoring rules from {severityRulesFile}:
|
|
113
|
+
|
|
114
|
+
| Score | Criteria |
|
|
115
|
+
|-------|----------|
|
|
116
|
+
| **CLEAN** | 0 findings at any level |
|
|
117
|
+
| **MINOR** | LOW findings only, no MEDIUM+ |
|
|
118
|
+
| **SIGNIFICANT** | Any MEDIUM or HIGH findings, no CRITICAL |
|
|
119
|
+
| **CRITICAL** | Any CRITICAL findings present |
|
|
120
|
+
|
|
121
|
+
### 5. Compile Severity Classification Section
|
|
122
|
+
|
|
123
|
+
Append to {outputFile}:
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
## Severity Classification
|
|
127
|
+
|
|
128
|
+
**Overall Drift Score: {CLEAN / MINOR / SIGNIFICANT / CRITICAL}**
|
|
129
|
+
|
|
130
|
+
### CRITICAL ({count})
|
|
131
|
+
|
|
132
|
+
| # | Finding | Type | Detail | Location | Confidence |
|
|
133
|
+
|---|---------|------|--------|----------|------------|
|
|
134
|
+
| 1 | {finding} | {structural/semantic} | {detail} | {file}:{line} | {T1/T2} |
|
|
135
|
+
|
|
136
|
+
### HIGH ({count})
|
|
137
|
+
|
|
138
|
+
| # | Finding | Type | Detail | Location | Confidence |
|
|
139
|
+
|---|---------|------|--------|----------|------------|
|
|
140
|
+
| 1 | {finding} | {structural/semantic} | {detail} | {file}:{line} | {T1/T2} |
|
|
141
|
+
|
|
142
|
+
### MEDIUM ({count})
|
|
143
|
+
|
|
144
|
+
| # | Finding | Type | Detail | Location | Confidence |
|
|
145
|
+
|---|---------|------|--------|----------|------------|
|
|
146
|
+
| 1 | {finding} | {structural/semantic} | {detail} | {file}:{line} | {T1/T2} |
|
|
147
|
+
|
|
148
|
+
### LOW ({count})
|
|
149
|
+
|
|
150
|
+
| # | Finding | Type | Detail | Location | Confidence |
|
|
151
|
+
|---|---------|------|--------|----------|------------|
|
|
152
|
+
| 1 | {finding} | {structural/semantic} | {detail} | {file}:{line} | {T1/T2} |
|
|
153
|
+
|
|
154
|
+
### Classification Summary
|
|
155
|
+
|
|
156
|
+
| Severity | Count | Source |
|
|
157
|
+
|----------|-------|--------|
|
|
158
|
+
| CRITICAL | {count} | {structural: N, semantic: N} |
|
|
159
|
+
| HIGH | {count} | {structural: N, semantic: N} |
|
|
160
|
+
| MEDIUM | {count} | {structural: N, semantic: N} |
|
|
161
|
+
| LOW | {count} | {structural: N, semantic: N} |
|
|
162
|
+
| **Total** | {total} | |
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 6. Update Report and Auto-Proceed
|
|
166
|
+
|
|
167
|
+
Update {outputFile} frontmatter:
|
|
168
|
+
- Append `'step-05-severity-classify'` to `stepsCompleted`
|
|
169
|
+
- Set `drift_score` to calculated overall score
|
|
170
|
+
|
|
171
|
+
### 7. Present MENU OPTIONS
|
|
172
|
+
|
|
173
|
+
Display: "**Severity classification complete. Overall drift score: {score}. Proceeding to report generation...**"
|
|
174
|
+
|
|
175
|
+
#### Menu Handling Logic:
|
|
176
|
+
|
|
177
|
+
- After severity classification section is appended and frontmatter updated, immediately load, read entire file, then execute {nextStepFile}
|
|
178
|
+
|
|
179
|
+
#### EXECUTION RULES:
|
|
180
|
+
|
|
181
|
+
- This is an auto-proceed analysis step with no user choices
|
|
182
|
+
- Proceed directly to next step after completion
|
|
183
|
+
|
|
184
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
185
|
+
|
|
186
|
+
ONLY WHEN the ## Severity Classification section has been appended to {outputFile} with all findings classified will you then load and read fully `{nextStepFile}` to execute and begin final report generation.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
191
|
+
|
|
192
|
+
### ✅ SUCCESS:
|
|
193
|
+
|
|
194
|
+
- Severity rules loaded from {severityRulesFile}
|
|
195
|
+
- Every finding from Steps 03-04 classified (none missed)
|
|
196
|
+
- Classification is deterministic — follows rules strictly
|
|
197
|
+
- Overall drift score calculated correctly
|
|
198
|
+
- Structured tables with severity, source type, and confidence
|
|
199
|
+
- Frontmatter drift_score and stepsCompleted updated
|
|
200
|
+
|
|
201
|
+
### ❌ SYSTEM FAILURE:
|
|
202
|
+
|
|
203
|
+
- Inventing new severity categories beyond CRITICAL/HIGH/MEDIUM/LOW
|
|
204
|
+
- Missing any finding from classification (incomplete coverage)
|
|
205
|
+
- Softening classifications that should be CRITICAL
|
|
206
|
+
- Discovering new drift items (classification only, not discovery)
|
|
207
|
+
- Suggesting remediation (that is Step 06)
|
|
208
|
+
- Hardcoded paths instead of frontmatter variables
|
|
209
|
+
|
|
210
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-06-report'
|
|
3
|
+
description: 'Finalize drift report with audit summary, remediation suggestions, and provenance metadata'
|
|
4
|
+
|
|
5
|
+
outputFile: '{forge_data_folder}/{skill_name}/drift-report-{timestamp}.md'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 6: Generate Report
|
|
9
|
+
|
|
10
|
+
## STEP GOAL:
|
|
11
|
+
|
|
12
|
+
Finalize the drift report by completing the Audit Summary with calculated metrics, generating actionable remediation suggestions for each drift finding, and adding provenance metadata. Present the final report to the user with a next-workflow recommendation.
|
|
13
|
+
|
|
14
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
15
|
+
|
|
16
|
+
### Universal Rules:
|
|
17
|
+
|
|
18
|
+
- 🛑 NEVER generate content without user input
|
|
19
|
+
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
20
|
+
- ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
|
|
21
|
+
- ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
22
|
+
|
|
23
|
+
### Role Reinforcement:
|
|
24
|
+
|
|
25
|
+
- ✅ You are a skill auditor delivering the final audit report
|
|
26
|
+
- ✅ Remediation suggestions must be specific and actionable
|
|
27
|
+
- ✅ Every suggestion must reference the specific drift finding it addresses
|
|
28
|
+
|
|
29
|
+
### Step-Specific Rules:
|
|
30
|
+
|
|
31
|
+
- 🎯 Focus on completing the report — summary, remediation, provenance
|
|
32
|
+
- 🚫 FORBIDDEN to discover new drift items or reclassify severity
|
|
33
|
+
- 💬 Remediation suggestions must be practical: what to change, where, and why
|
|
34
|
+
- 📋 This is the FINAL step — no nextStepFile
|
|
35
|
+
|
|
36
|
+
## EXECUTION PROTOCOLS:
|
|
37
|
+
|
|
38
|
+
- 🎯 Complete all remaining sections in {outputFile}
|
|
39
|
+
- 💾 Update {outputFile} frontmatter to mark workflow complete
|
|
40
|
+
- 📖 Present final summary to user
|
|
41
|
+
- 🚫 Do not re-analyze — only synthesize and present
|
|
42
|
+
|
|
43
|
+
## CONTEXT BOUNDARIES:
|
|
44
|
+
|
|
45
|
+
- Available: Complete drift report with structural diff, semantic diff, severity classification
|
|
46
|
+
- Focus: Synthesis, remediation guidance, and presentation
|
|
47
|
+
- Limits: Do not add new findings or reclassify — only complete the report
|
|
48
|
+
- Dependencies: Steps 01-05 must be complete
|
|
49
|
+
|
|
50
|
+
## MANDATORY SEQUENCE
|
|
51
|
+
|
|
52
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
|
|
53
|
+
|
|
54
|
+
### 1. Complete Audit Summary
|
|
55
|
+
|
|
56
|
+
Update the ## Audit Summary section at the top of {outputFile} with final calculated values:
|
|
57
|
+
|
|
58
|
+
- Fill in severity count table from Step 05 classification summary
|
|
59
|
+
- Set overall drift score
|
|
60
|
+
- Add total findings count
|
|
61
|
+
|
|
62
|
+
### 2. Generate Remediation Suggestions
|
|
63
|
+
|
|
64
|
+
For EACH classified drift finding, generate a specific remediation suggestion:
|
|
65
|
+
|
|
66
|
+
**CRITICAL findings remediation:**
|
|
67
|
+
- Removed export → "Remove reference to `{export_name}` from SKILL.md section {section}. Export no longer exists at `{file}:{line}`."
|
|
68
|
+
- Changed signature → "Update `{export_name}` signature in SKILL.md from `{old_signature}` to `{new_signature}`. See `{file}:{line}`."
|
|
69
|
+
- Renamed export → "Replace `{old_name}` with `{new_name}` throughout SKILL.md. Renamed at `{file}:{line}`."
|
|
70
|
+
|
|
71
|
+
**HIGH findings remediation:**
|
|
72
|
+
- New public API (>3) → "Add documentation for {count} new exports to SKILL.md: {export_list}. Consider running update-skill workflow."
|
|
73
|
+
- Deprecated API → "Mark `{export_name}` as deprecated in SKILL.md. Current replacement: `{replacement}` at `{file}:{line}`."
|
|
74
|
+
|
|
75
|
+
**MEDIUM findings remediation:**
|
|
76
|
+
- Moved function → "Update file reference for `{export_name}` from `{old_file}` to `{new_file}:{line}`."
|
|
77
|
+
- New exports (1-3) → "Consider adding `{export_names}` to SKILL.md for completeness."
|
|
78
|
+
- Changed convention → "Review convention documentation in SKILL.md for currency."
|
|
79
|
+
|
|
80
|
+
**LOW findings remediation:**
|
|
81
|
+
- Style changes → "Optional: Update style references in SKILL.md to reflect current conventions."
|
|
82
|
+
|
|
83
|
+
Append to {outputFile}:
|
|
84
|
+
|
|
85
|
+
```markdown
|
|
86
|
+
## Remediation Suggestions
|
|
87
|
+
|
|
88
|
+
### Priority Actions (CRITICAL + HIGH)
|
|
89
|
+
|
|
90
|
+
| # | Severity | Finding | Remediation | Effort |
|
|
91
|
+
|---|----------|---------|-------------|--------|
|
|
92
|
+
| 1 | {severity} | {finding} | {specific action} | {low/medium/high} |
|
|
93
|
+
|
|
94
|
+
### Recommended Updates (MEDIUM)
|
|
95
|
+
|
|
96
|
+
| # | Finding | Remediation | Effort |
|
|
97
|
+
|---|---------|-------------|--------|
|
|
98
|
+
| 1 | {finding} | {specific action} | {low/medium} |
|
|
99
|
+
|
|
100
|
+
### Optional Improvements (LOW)
|
|
101
|
+
|
|
102
|
+
| # | Finding | Remediation |
|
|
103
|
+
|---|---------|-------------|
|
|
104
|
+
| 1 | {finding} | {specific action} |
|
|
105
|
+
|
|
106
|
+
### Workflow Recommendation
|
|
107
|
+
|
|
108
|
+
{IF any CRITICAL or HIGH findings:}
|
|
109
|
+
**Recommended:** Run `[US] Update Skill` workflow to apply priority remediations automatically.
|
|
110
|
+
|
|
111
|
+
{IF only MEDIUM or LOW findings:}
|
|
112
|
+
**Optional:** Minor drift detected. Manual updates sufficient, or run `[US] Update Skill` for automated remediation.
|
|
113
|
+
|
|
114
|
+
{IF CLEAN:}
|
|
115
|
+
**No action needed.** Skill is current with source code.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 3. Add Provenance Section
|
|
119
|
+
|
|
120
|
+
Append to {outputFile}:
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
## Provenance
|
|
124
|
+
|
|
125
|
+
| Field | Value |
|
|
126
|
+
|-------|-------|
|
|
127
|
+
| **Audit Date** | {current_date} |
|
|
128
|
+
| **Audited By** | Ferris (Audit mode) |
|
|
129
|
+
| **Forge Tier** | {tier} |
|
|
130
|
+
| **Tools Used** | {tool_list based on tier} |
|
|
131
|
+
| **Source Path** | {source_path} |
|
|
132
|
+
| **Skill Path** | {skill_path} |
|
|
133
|
+
| **Provenance Map** | {provenance_map_path} |
|
|
134
|
+
| **Provenance Age** | {days} days |
|
|
135
|
+
| **Mode** | {normal / degraded} |
|
|
136
|
+
|
|
137
|
+
**Confidence Legend:**
|
|
138
|
+
- **T1:** AST extraction — high reliability, structural truth
|
|
139
|
+
- **T1-low:** Text pattern matching — moderate reliability
|
|
140
|
+
- **T2:** QMD temporal context — evidence-backed semantic analysis
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 4. Update Report Frontmatter
|
|
144
|
+
|
|
145
|
+
Update {outputFile} frontmatter:
|
|
146
|
+
- Append `'step-06-report'` to `stepsCompleted`
|
|
147
|
+
- Set `drift_score` to final calculated score
|
|
148
|
+
- Set `nextWorkflow` to `'update-skill'` if CRITICAL or HIGH findings, otherwise leave empty
|
|
149
|
+
|
|
150
|
+
### 5. Present Final Report Summary
|
|
151
|
+
|
|
152
|
+
"**Audit Complete: {skill_name}**
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
**Overall Drift Score: {CLEAN / MINOR / SIGNIFICANT / CRITICAL}**
|
|
157
|
+
|
|
158
|
+
| Severity | Count |
|
|
159
|
+
|----------|-------|
|
|
160
|
+
| CRITICAL | {count} |
|
|
161
|
+
| HIGH | {count} |
|
|
162
|
+
| MEDIUM | {count} |
|
|
163
|
+
| LOW | {count} |
|
|
164
|
+
| **Total** | {total} |
|
|
165
|
+
|
|
166
|
+
**Report saved to:** `{outputFile}`
|
|
167
|
+
|
|
168
|
+
{IF CRITICAL/HIGH findings:}
|
|
169
|
+
**Action Required:** {count} priority items need remediation. Recommend running `[US] Update Skill` workflow.
|
|
170
|
+
|
|
171
|
+
{IF MEDIUM/LOW only:}
|
|
172
|
+
**Minor Drift:** Skill is functional but could benefit from updates. See report for details.
|
|
173
|
+
|
|
174
|
+
{IF CLEAN:}
|
|
175
|
+
**All Clear:** No drift detected. Skill accurately reflects current source code.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
**Next Steps:**
|
|
180
|
+
{IF findings exist:}
|
|
181
|
+
1. **[US] Update Skill** — Automatically apply remediations from this drift report
|
|
182
|
+
2. **Review report** — Manual review at `{outputFile}`
|
|
183
|
+
|
|
184
|
+
{IF CLEAN:}
|
|
185
|
+
1. **No action needed** — Skill is current
|
|
186
|
+
2. **[EX] Export Skill** — Skill is ready for distribution
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
**Audit workflow complete.**"
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
195
|
+
|
|
196
|
+
### ✅ SUCCESS:
|
|
197
|
+
|
|
198
|
+
- Audit Summary completed with accurate metrics
|
|
199
|
+
- Remediation suggestion for every CRITICAL and HIGH finding
|
|
200
|
+
- Each remediation is specific: what to change, where, and why
|
|
201
|
+
- Provenance section documents complete audit trail
|
|
202
|
+
- Overall drift score correctly reflects findings
|
|
203
|
+
- Frontmatter updated with completion status and nextWorkflow
|
|
204
|
+
- Final summary presented clearly to user
|
|
205
|
+
- Report saved to correct output path
|
|
206
|
+
|
|
207
|
+
### ❌ SYSTEM FAILURE:
|
|
208
|
+
|
|
209
|
+
- Missing remediation for any CRITICAL or HIGH finding
|
|
210
|
+
- Vague remediation suggestions (e.g., "update the skill" without specifics)
|
|
211
|
+
- Discovering new findings in this step
|
|
212
|
+
- Reclassifying severity
|
|
213
|
+
- Not presenting final summary to user
|
|
214
|
+
- Missing provenance section
|
|
215
|
+
- Hardcoded paths instead of frontmatter variables
|
|
216
|
+
|
|
217
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|