specweave 0.23.18 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +93 -49
- package/CLAUDE.md +137 -4
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
- package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
- package/dist/src/cli/helpers/smart-filter.js +265 -0
- package/dist/src/cli/helpers/smart-filter.js.map +1 -0
- package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
- package/dist/src/core/qa/quality-gate-decider.js +2 -2
- package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts +2 -2
- package/dist/src/core/qa/risk-calculator.js +2 -2
- package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
- package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
- package/dist/src/core/validators/ac-presence-validator.js +149 -0
- package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
- package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
- package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
- package/dist/src/integrations/ado/area-path-mapper.js +267 -0
- package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
- package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
- package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
- package/dist/src/integrations/jira/filter-processor.js +207 -0
- package/dist/src/integrations/jira/filter-processor.js.map +1 -0
- package/dist/src/integrations/jira/jira-client.d.ts +13 -0
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-client.js +33 -0
- package/dist/src/integrations/jira/jira-client.js.map +1 -1
- package/dist/src/utils/ac-embedder.d.ts +63 -0
- package/dist/src/utils/ac-embedder.d.ts.map +1 -0
- package/dist/src/utils/ac-embedder.js +217 -0
- package/dist/src/utils/ac-embedder.js.map +1 -0
- package/dist/src/utils/env-manager.d.ts +86 -0
- package/dist/src/utils/env-manager.d.ts.map +1 -0
- package/dist/src/utils/env-manager.js +188 -0
- package/dist/src/utils/env-manager.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
- package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
- package/plugins/specweave/commands/specweave-do.md +37 -0
- package/plugins/specweave/commands/specweave-done.md +159 -0
- package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
- package/plugins/specweave/commands/specweave-next.md +148 -3
- package/plugins/specweave/commands/specweave-qa.md +2 -2
- package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
- package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
- package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
- package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
- package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
- package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
- package/plugins/specweave-backend/commands/crud-generate.md +109 -0
- package/plugins/specweave-backend/commands/migration-generate.md +139 -0
- package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
- package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
- package/plugins/specweave-confluent/commands/schema-register.md +123 -0
- package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-core/commands/architecture-review.md +288 -0
- package/plugins/specweave-core/commands/code-review.md +213 -0
- package/plugins/specweave-core/commands/refactor-plan.md +249 -0
- package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
- package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
- package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
- package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
- package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
- package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
- package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
- package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
- package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-docs/commands/docs-generate.md +441 -0
- package/plugins/specweave-docs/commands/docs-init.md +334 -0
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
- package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
- package/plugins/specweave-figma/commands/figma-import.md +690 -0
- package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
- package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
- package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
- package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
- package/plugins/specweave-frontend/commands/component-generate.md +510 -0
- package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
- package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
- package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
- package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
- package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
- package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/commands/import-projects.js +183 -0
- package/plugins/specweave-jira/commands/import-projects.md +97 -0
- package/plugins/specweave-jira/commands/import-projects.ts +288 -0
- package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
- package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
- package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
- package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
- package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
- package/plugins/specweave-mobile/commands/build-config.md +256 -0
- package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
- package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
- package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
- package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
- package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
- package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
- package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
- package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
- package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
- package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
- package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
- package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
- package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
- package/plugins/specweave-testing/commands/test-coverage.md +979 -0
- package/plugins/specweave-testing/commands/test-generate.md +1156 -0
- package/plugins/specweave-testing/commands/test-init.md +409 -0
- package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
- package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
- package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
- package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-ui/commands/ui-automate.md +199 -0
- package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
- package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
- package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
- package/plugins/specweave/commands/check-hooks.md +0 -257
- package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
- package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
- /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Validate hook health and display performance metrics (Tier 2 monitoring)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# /specweave:check-hooks - Hook Health Dashboard
|
|
6
|
-
|
|
7
|
-
**Purpose:** Display comprehensive hook performance metrics, detection rates, and health status.
|
|
8
|
-
|
|
9
|
-
**Tier 2 Feature:** This command validates the PreToolUse coordination layer is working correctly.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Instructions for Claude
|
|
14
|
-
|
|
15
|
-
When this command is executed, perform the following analysis:
|
|
16
|
-
|
|
17
|
-
### 1. **Read Hook Metrics File**
|
|
18
|
-
|
|
19
|
-
Location: `.specweave/state/hook-metrics.jsonl`
|
|
20
|
-
|
|
21
|
-
The metrics file contains JSONL (JSON Lines) format - one JSON object per line.
|
|
22
|
-
|
|
23
|
-
Each entry has:
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"timestamp": "2025-11-22T01:30:00Z",
|
|
27
|
-
"hook": "pre-edit-spec|post-edit-spec|pre-write-spec|post-write-spec",
|
|
28
|
-
"event": "file_detected|tier2_success|tier1_fallback",
|
|
29
|
-
"file_path": "/path/to/file.md",
|
|
30
|
-
"method": "pretooluse|env_content|env_result|env_args|mtime"
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### 2. **Calculate Key Metrics**
|
|
35
|
-
|
|
36
|
-
**Tier 2 Success Rate:**
|
|
37
|
-
```
|
|
38
|
-
Tier 2 Rate = (tier2_success events) / (total post-tool events) * 100%
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Target:** >95% (Tier 2 should handle most cases)
|
|
42
|
-
|
|
43
|
-
**Detection Method Breakdown:**
|
|
44
|
-
- `pretooluse`: Tier 2 PreToolUse coordination (best)
|
|
45
|
-
- `env_content`: Environment variable (TOOL_USE_CONTENT)
|
|
46
|
-
- `env_result`: Environment variable (TOOL_RESULT)
|
|
47
|
-
- `env_args`: Environment variable (TOOL_USE_ARGS)
|
|
48
|
-
- `mtime`: File modification time fallback (Tier 1)
|
|
49
|
-
|
|
50
|
-
**Fallback Rate:**
|
|
51
|
-
```
|
|
52
|
-
Fallback Rate = (mtime detections) / (total detections) * 100%
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Target:** <5% (should rarely need mtime fallback)
|
|
56
|
-
|
|
57
|
-
### 3. **Check Hook Health Status**
|
|
58
|
-
|
|
59
|
-
**Circuit Breaker Status:**
|
|
60
|
-
- File: `.specweave/state/.hook-circuit-breaker`
|
|
61
|
-
- If exists: Read failure count
|
|
62
|
-
- If count ≥ 3: ⚠️ CIRCUIT BREAKER OPEN (hooks disabled)
|
|
63
|
-
- If count < 3: ✅ Circuit breaker OK
|
|
64
|
-
- If doesn't exist: ✅ No failures detected
|
|
65
|
-
|
|
66
|
-
**Kill Switch Status:**
|
|
67
|
-
- Check environment variable: `SPECWEAVE_DISABLE_HOOKS`
|
|
68
|
-
- If set to "1": ⚠️ HOOKS MANUALLY DISABLED
|
|
69
|
-
- If not set or "0": ✅ Hooks enabled
|
|
70
|
-
|
|
71
|
-
**Lock Files Status:**
|
|
72
|
-
- Check for stale locks:
|
|
73
|
-
- `.specweave/state/.hook-post-edit.lock`
|
|
74
|
-
- `.specweave/state/.hook-post-write.lock`
|
|
75
|
-
- If older than 10 seconds: ⚠️ Stale lock detected
|
|
76
|
-
- If not present: ✅ No locks
|
|
77
|
-
|
|
78
|
-
### 4. **Read Recent Hook Logs**
|
|
79
|
-
|
|
80
|
-
Location: `.specweave/logs/hooks-debug.log`
|
|
81
|
-
|
|
82
|
-
**Look for:**
|
|
83
|
-
- Recent errors or warnings
|
|
84
|
-
- Debounce effectiveness (count "Debounced" messages)
|
|
85
|
-
- PreToolUse signal messages
|
|
86
|
-
- Circuit breaker trips
|
|
87
|
-
|
|
88
|
-
**Time window:** Last 100 lines or last 1 hour
|
|
89
|
-
|
|
90
|
-
### 5. **Output Format**
|
|
91
|
-
|
|
92
|
-
Display results in this format:
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
🔍 SpecWeave Hook Health Dashboard (Tier 2)
|
|
96
|
-
═══════════════════════════════════════════════════════════
|
|
97
|
-
|
|
98
|
-
📊 DETECTION METRICS (Last 24 hours)
|
|
99
|
-
────────────────────────────────────
|
|
100
|
-
Total Hook Executions: 156
|
|
101
|
-
Tier 2 Success (PreToolUse): 149 (95.5%) ✅
|
|
102
|
-
Tier 1 Fallback (env vars): 5 (3.2%)
|
|
103
|
-
Tier 1 Fallback (mtime): 2 (1.3%)
|
|
104
|
-
|
|
105
|
-
Detection Method Breakdown:
|
|
106
|
-
• pretooluse: 149 (95.5%) ✅ Target: >95%
|
|
107
|
-
• env_content: 3 (1.9%)
|
|
108
|
-
• env_args: 2 (1.3%)
|
|
109
|
-
• mtime: 2 (1.3%) ✅ Target: <5%
|
|
110
|
-
|
|
111
|
-
🏥 HEALTH STATUS
|
|
112
|
-
────────────────────────────────────
|
|
113
|
-
Circuit Breaker: ✅ OK (0 failures)
|
|
114
|
-
Kill Switch: ✅ Hooks enabled
|
|
115
|
-
Stale Locks: ✅ None detected
|
|
116
|
-
Debounce Efficiency: 87% (136/156 skipped)
|
|
117
|
-
|
|
118
|
-
⚡ PERFORMANCE
|
|
119
|
-
────────────────────────────────────
|
|
120
|
-
Average Hook Latency: ~3ms
|
|
121
|
-
Debounce Window: 5 seconds
|
|
122
|
-
Background Updates: Active
|
|
123
|
-
Metrics Collection: Active
|
|
124
|
-
|
|
125
|
-
📝 RECENT ACTIVITY (Last 10 events)
|
|
126
|
-
────────────────────────────────────
|
|
127
|
-
[2025-11-22 01:30:15] post-edit-spec: File from PreToolUse signal: /path/to/spec.md
|
|
128
|
-
[2025-11-22 01:30:10] pre-edit-spec: Signaled PostToolUse for: /path/to/spec.md
|
|
129
|
-
[2025-11-22 01:29:45] post-edit-spec: Debounced (2s since last update)
|
|
130
|
-
...
|
|
131
|
-
|
|
132
|
-
✅ SUMMARY
|
|
133
|
-
────────────────────────────────────
|
|
134
|
-
Status: HEALTHY ✅
|
|
135
|
-
|
|
136
|
-
Tier 2 coordination is working correctly (95.5% success rate).
|
|
137
|
-
Fallback rate is within acceptable range (<5%).
|
|
138
|
-
No health issues detected.
|
|
139
|
-
|
|
140
|
-
Recommendations:
|
|
141
|
-
• None - system performing optimally
|
|
142
|
-
|
|
143
|
-
To disable hooks temporarily:
|
|
144
|
-
export SPECWEAVE_DISABLE_HOOKS=1
|
|
145
|
-
|
|
146
|
-
To reset circuit breaker:
|
|
147
|
-
rm .specweave/state/.hook-circuit-breaker
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### 6. **Health Assessment Logic**
|
|
151
|
-
|
|
152
|
-
**Determine overall status:**
|
|
153
|
-
|
|
154
|
-
- ✅ **HEALTHY** if:
|
|
155
|
-
- Tier 2 success rate >90%
|
|
156
|
-
- Fallback rate <10%
|
|
157
|
-
- No circuit breaker trips
|
|
158
|
-
- Hooks enabled
|
|
159
|
-
|
|
160
|
-
- ⚠️ **WARNING** if:
|
|
161
|
-
- Tier 2 success rate 70-90%
|
|
162
|
-
- Fallback rate 10-30%
|
|
163
|
-
- Circuit breaker count 1-2
|
|
164
|
-
|
|
165
|
-
- ❌ **CRITICAL** if:
|
|
166
|
-
- Tier 2 success rate <70%
|
|
167
|
-
- Fallback rate >30%
|
|
168
|
-
- Circuit breaker open (count ≥ 3)
|
|
169
|
-
- Hooks manually disabled
|
|
170
|
-
|
|
171
|
-
### 7. **Troubleshooting Recommendations**
|
|
172
|
-
|
|
173
|
-
Based on status, provide targeted recommendations:
|
|
174
|
-
|
|
175
|
-
**If Tier 2 success rate <95%:**
|
|
176
|
-
```
|
|
177
|
-
⚠️ PreToolUse coordination not working optimally
|
|
178
|
-
|
|
179
|
-
Recommendations:
|
|
180
|
-
1. Check if PreToolUse hooks are registered in plugin.json
|
|
181
|
-
2. Verify hook files are executable (chmod +x)
|
|
182
|
-
3. Review .specweave/logs/hooks-debug.log for PreToolUse errors
|
|
183
|
-
4. Consider filing bug with Anthropic (environment variable passing)
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
**If fallback rate >10%:**
|
|
187
|
-
```
|
|
188
|
-
⚠️ High fallback rate detected
|
|
189
|
-
|
|
190
|
-
Recommendations:
|
|
191
|
-
1. Tier 2 coordination may not be working
|
|
192
|
-
2. Environment variables still not being passed
|
|
193
|
-
3. Consider Tier 3 implementation (filesystem watcher)
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
**If circuit breaker open:**
|
|
197
|
-
```
|
|
198
|
-
❌ Hooks disabled due to consecutive failures
|
|
199
|
-
|
|
200
|
-
Immediate actions:
|
|
201
|
-
1. Review .specweave/logs/hooks-debug.log for errors
|
|
202
|
-
2. Fix underlying issues
|
|
203
|
-
3. Reset circuit breaker: rm .specweave/state/.hook-circuit-breaker
|
|
204
|
-
4. Restart Claude Code
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### 8. **Error Handling**
|
|
208
|
-
|
|
209
|
-
If metrics file doesn't exist:
|
|
210
|
-
```
|
|
211
|
-
⚠️ No metrics data available
|
|
212
|
-
|
|
213
|
-
This is normal for:
|
|
214
|
-
• New SpecWeave installation
|
|
215
|
-
• First run after Tier 2 upgrade
|
|
216
|
-
|
|
217
|
-
Metrics will be collected automatically as you work.
|
|
218
|
-
Run this command again after a few Edit/Write operations.
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
If logs not accessible:
|
|
222
|
-
```
|
|
223
|
-
⚠️ Could not read hook logs
|
|
224
|
-
|
|
225
|
-
Check file permissions:
|
|
226
|
-
.specweave/logs/hooks-debug.log
|
|
227
|
-
.specweave/state/hook-metrics.jsonl
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
## Implementation Notes
|
|
233
|
-
|
|
234
|
-
**For Claude:**
|
|
235
|
-
1. Parse JSONL file line by line (each line is a JSON object)
|
|
236
|
-
2. Calculate metrics using simple counting
|
|
237
|
-
3. Display results using the template above
|
|
238
|
-
4. Adjust recommendations based on actual metrics
|
|
239
|
-
5. Keep output concise but informative
|
|
240
|
-
|
|
241
|
-
**Time-based filtering:**
|
|
242
|
-
- Default: Last 24 hours
|
|
243
|
-
- Option: All time (if user requests)
|
|
244
|
-
- Filter by comparing timestamp field
|
|
245
|
-
|
|
246
|
-
**Edge cases:**
|
|
247
|
-
- Empty metrics file → Show "waiting for data" message
|
|
248
|
-
- Corrupted JSONL → Skip invalid lines, report count
|
|
249
|
-
- Missing state directory → Create it, show initialization message
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
## Related Documentation
|
|
254
|
-
|
|
255
|
-
- ADR-0060: Hook Performance Optimization
|
|
256
|
-
- `.specweave/increments/0050-*/reports/hook-crash-analysis.md`
|
|
257
|
-
- CLAUDE.md: "Hook Performance Best Practices"
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: specweave:archive-increments
|
|
3
|
-
description: Archive completed increments to keep workspace clean
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Archive Increments Command
|
|
7
|
-
|
|
8
|
-
Archives completed increments to `_archive/` folder, keeping only the most recent N increments in the main folder.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
# Interactive mode - prompts for options
|
|
14
|
-
/specweave:archive-increments
|
|
15
|
-
|
|
16
|
-
# Keep last 5 increments, archive the rest
|
|
17
|
-
/specweave:archive-increments --keep-last 5
|
|
18
|
-
|
|
19
|
-
# Archive specific increments
|
|
20
|
-
/specweave:archive-increments --increments 0001,0002,0003
|
|
21
|
-
|
|
22
|
-
# Dry run - see what would be archived without moving
|
|
23
|
-
/specweave:archive-increments --dry-run
|
|
24
|
-
|
|
25
|
-
# Archive all completed increments older than 30 days
|
|
26
|
-
/specweave:archive-increments --older-than 30d
|
|
27
|
-
|
|
28
|
-
# Keep only active/paused, archive all completed
|
|
29
|
-
/specweave:archive-increments --archive-completed
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Default Behavior
|
|
33
|
-
|
|
34
|
-
- Keeps last 10 increments by default
|
|
35
|
-
- Preserves all active/paused increments
|
|
36
|
-
- Never archives abandoned increments (they stay in `_abandoned/`)
|
|
37
|
-
- Creates `_archive/` folder if it doesn't exist
|
|
38
|
-
- Preserves increment structure and all contents
|
|
39
|
-
|
|
40
|
-
## Smart Detection
|
|
41
|
-
|
|
42
|
-
The command intelligently:
|
|
43
|
-
- Checks increment status from metadata.json
|
|
44
|
-
- Preserves increments with active GitHub/JIRA/ADO issues
|
|
45
|
-
- Warns before archiving increments with uncommitted changes
|
|
46
|
-
- Groups related increments (e.g., all v0.8.0 stabilization increments)
|
|
47
|
-
|
|
48
|
-
## Configuration
|
|
49
|
-
|
|
50
|
-
Set defaults in `.specweave/config.json`:
|
|
51
|
-
|
|
52
|
-
```json
|
|
53
|
-
{
|
|
54
|
-
"archiving": {
|
|
55
|
-
"keepLast": 10,
|
|
56
|
-
"autoArchive": true,
|
|
57
|
-
"archiveAfterDays": 60,
|
|
58
|
-
"preserveActive": true,
|
|
59
|
-
"archiveCompleted": true
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Examples
|
|
65
|
-
|
|
66
|
-
### Keep workspace clean
|
|
67
|
-
```bash
|
|
68
|
-
# Archive all but last 5 increments
|
|
69
|
-
/specweave:archive-increments --keep-last 5
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Prepare for release
|
|
73
|
-
```bash
|
|
74
|
-
# Archive all v0.7.x increments after v0.8.0 release
|
|
75
|
-
/specweave:archive-increments --pattern "v0.7"
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Clean old work
|
|
79
|
-
```bash
|
|
80
|
-
# Archive increments older than 2 months
|
|
81
|
-
/specweave:archive-increments --older-than 60d
|
|
82
|
-
```
|