specweave 1.0.253 → 1.0.255
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.md +24 -24
- package/README.md +163 -1
- package/dist/src/adapters/agents-md-generator.d.ts.map +1 -1
- package/dist/src/adapters/agents-md-generator.js +0 -1
- package/dist/src/adapters/agents-md-generator.js.map +1 -1
- package/dist/src/adapters/claude/README.md +0 -1
- package/dist/src/adapters/claude-md-generator.d.ts.map +1 -1
- package/dist/src/adapters/claude-md-generator.js +0 -1
- package/dist/src/adapters/claude-md-generator.js.map +1 -1
- package/dist/src/cli/commands/docs.d.ts.map +1 -1
- package/dist/src/cli/commands/docs.js +59 -55
- package/dist/src/cli/commands/docs.js.map +1 -1
- package/dist/src/cli/helpers/init/smart-defaults.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/smart-defaults.js +7 -1
- package/dist/src/cli/helpers/init/smart-defaults.js.map +1 -1
- package/dist/src/core/config/types.d.ts +2 -0
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts.map +1 -1
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js +5 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +21 -0
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js +61 -107
- package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
- package/dist/src/core/living-docs/enterprise/history-analyzer.d.ts.map +1 -1
- package/dist/src/core/living-docs/enterprise/history-analyzer.js +1 -3
- package/dist/src/core/living-docs/enterprise/history-analyzer.js.map +1 -1
- package/dist/src/core/living-docs/governance/java-standards-parser.d.ts.map +1 -1
- package/dist/src/core/living-docs/governance/java-standards-parser.js +37 -18
- package/dist/src/core/living-docs/governance/java-standards-parser.js.map +1 -1
- package/dist/src/core/living-docs/operations/ops-generator.js +2 -2
- package/dist/src/core/living-docs/operations/ops-generator.js.map +1 -1
- package/dist/src/core/reflection/index.d.ts +1 -1
- package/dist/src/core/reflection/index.d.ts.map +1 -1
- package/dist/src/core/reflection/index.js +1 -1
- package/dist/src/core/reflection/index.js.map +1 -1
- package/dist/src/core/reflection/reflect-handler.d.ts.map +1 -1
- package/dist/src/core/reflection/reflect-handler.js +1 -2
- package/dist/src/core/reflection/reflect-handler.js.map +1 -1
- package/dist/src/core/reflection/skill-memories.d.ts +13 -1
- package/dist/src/core/reflection/skill-memories.d.ts.map +1 -1
- package/dist/src/core/reflection/skill-memories.js +55 -10
- package/dist/src/core/reflection/skill-memories.js.map +1 -1
- package/dist/src/core/repo-structure/prefix-validator.d.ts +25 -0
- package/dist/src/core/repo-structure/prefix-validator.d.ts.map +1 -0
- package/dist/src/core/repo-structure/prefix-validator.js +47 -0
- package/dist/src/core/repo-structure/prefix-validator.js.map +1 -0
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts +4 -0
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/repo-structure/role-prefix-collector.d.ts +45 -0
- package/dist/src/core/repo-structure/role-prefix-collector.d.ts.map +1 -0
- package/dist/src/core/repo-structure/role-prefix-collector.js +106 -0
- package/dist/src/core/repo-structure/role-prefix-collector.js.map +1 -0
- package/dist/src/hooks/session-start.js +7 -0
- package/dist/src/hooks/session-start.js.map +1 -1
- package/dist/src/sync/story-router.d.ts +36 -0
- package/dist/src/sync/story-router.d.ts.map +1 -0
- package/dist/src/sync/story-router.js +56 -0
- package/dist/src/sync/story-router.js.map +1 -0
- package/dist/src/utils/agents-md-compiler.d.ts.map +1 -1
- package/dist/src/utils/agents-md-compiler.js +0 -1
- package/dist/src/utils/agents-md-compiler.js.map +1 -1
- package/dist/src/utils/state-cleanup.d.ts +19 -0
- package/dist/src/utils/state-cleanup.d.ts.map +1 -0
- package/dist/src/utils/state-cleanup.js +61 -0
- package/dist/src/utils/state-cleanup.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/PLUGIN.md +0 -1
- package/plugins/specweave/commands/brownfield-analyzer.md +0 -10
- package/plugins/specweave/commands/brownfield-onboarder.md +0 -10
- package/plugins/specweave/commands/export-skills.md +0 -10
- package/plugins/specweave/commands/plugin-validator.md +0 -10
- package/plugins/specweave/hooks/stop-reflect.sh +4 -2
- package/plugins/specweave/hooks/user-prompt-submit.sh +29 -68
- package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +0 -3
- package/plugins/specweave/skills/architect/SKILL.md +2 -6
- package/plugins/specweave/skills/archive-increments/SKILL.md +0 -10
- package/plugins/specweave/skills/auto/SKILL.md +4 -0
- package/plugins/specweave/skills/cancel-auto/SKILL.md +5 -1
- package/plugins/specweave/skills/code-review/SKILL.md +1 -11
- package/plugins/specweave/skills/code-simplifier/SKILL.md +3 -7
- package/plugins/specweave/skills/do/SKILL.md +6 -2
- package/plugins/specweave/skills/docs/SKILL.md +5 -8
- package/plugins/specweave/skills/docs-updater/SKILL.md +4 -10
- package/plugins/specweave/skills/done/SKILL.md +6 -3
- package/plugins/specweave/skills/framework/SKILL.md +4 -10
- package/plugins/specweave/skills/grill/SKILL.md +7 -12
- package/plugins/specweave/skills/increment/SKILL.md +5 -0
- package/plugins/specweave/skills/increment-planner/SKILL.md +4 -7
- package/plugins/specweave/skills/increment-work-router/SKILL.md +0 -10
- package/plugins/specweave/skills/judge-llm/SKILL.md +0 -11
- package/plugins/specweave/skills/lsp/SKILL.md +4 -10
- package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +0 -10
- package/plugins/specweave/skills/next/SKILL.md +1 -1
- package/plugins/specweave/skills/plan/SKILL.md +1 -1
- package/plugins/specweave/skills/pm/SKILL.md +6 -11
- package/plugins/specweave/skills/pm-closure-validation/SKILL.md +0 -10
- package/plugins/specweave/skills/progress/SKILL.md +5 -1
- package/plugins/specweave/skills/progress-sync/SKILL.md +2 -11
- package/plugins/specweave/skills/save/SKILL.md +6 -1
- package/plugins/specweave/skills/security/SKILL.md +2 -6
- package/plugins/specweave/skills/security-patterns/SKILL.md +4 -10
- package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +0 -10
- package/plugins/specweave/skills/spec-generator/SKILL.md +0 -10
- package/plugins/specweave/skills/tdd-cycle/SKILL.md +5 -1
- package/plugins/specweave/skills/tdd-green/SKILL.md +5 -1
- package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +4 -10
- package/plugins/specweave/skills/tdd-red/SKILL.md +5 -1
- package/plugins/specweave/skills/tdd-refactor/SKILL.md +1 -1
- package/plugins/specweave/skills/team-build/SKILL.md +1 -1
- package/plugins/specweave/skills/team-lead/SKILL.md +3 -3
- package/plugins/specweave/skills/test-aware-planner/SKILL.md +0 -10
- package/plugins/specweave/skills/umbrella-repo-detector/SKILL.md +0 -10
- package/plugins/specweave/skills/update-instructions/SKILL.md +0 -10
- package/plugins/specweave/skills/validate/SKILL.md +6 -1
- package/plugins/specweave-github/commands/close.md +2 -2
- package/src/templates/CLAUDE.md.template +1 -1
- package/src/templates/docs/adr-template.md +1 -1
- package/src/templates/docs/hld-template.md +1 -1
- package/src/templates/docs/lld-template.md +2 -2
- package/src/templates/docs/rfc-template.md +1 -1
- package/src/templates/docs/spec-template.md +1 -1
- package/dist/src/core/reflection/skill-memory-injector.d.ts +0 -42
- package/dist/src/core/reflection/skill-memory-injector.d.ts.map +0 -1
- package/dist/src/core/reflection/skill-memory-injector.js +0 -67
- package/dist/src/core/reflection/skill-memory-injector.js.map +0 -1
- package/plugins/specweave/commands/skill.md +0 -620
- package/plugins/specweave/skills/tech-lead/SKILL.md +0 -25
- package/plugins/specweave/templates/coding-standards.md.template +0 -535
- package/plugins/specweave/templates/hookify/README.md +0 -47
- package/plugins/specweave/templates/hookify/hookify.block-force-push.local.md +0 -19
- package/plugins/specweave/templates/hookify/hookify.block-metadata-status.local.md +0 -18
- package/plugins/specweave/templates/hookify/hookify.block-secrets.local.md +0 -26
- package/plugins/specweave/templates/hookify/hookify.require-tests.local.md +0 -22
- package/plugins/specweave/templates/hookify/hookify.warn-dangerous-rm.local.md +0 -23
- package/plugins/specweave/templates/hookify/hookify.warn-root-files.local.md +0 -21
|
@@ -1,535 +0,0 @@
|
|
|
1
|
-
# Coding Standards
|
|
2
|
-
|
|
3
|
-
**Auto-Generated**: {{timestamp}}
|
|
4
|
-
**Codebase**: {{project_name}}
|
|
5
|
-
**Analysis**: {{file_count}} files, {{line_count}} lines of code
|
|
6
|
-
**Overall Confidence**: {{overall_confidence}}%
|
|
7
|
-
|
|
8
|
-
> 📊 This document combines:
|
|
9
|
-
> - ✅ **Explicit Standards** - Declared in ESLint, Prettier, CLAUDE.md
|
|
10
|
-
> - 📈 **Implicit Standards** - Detected from codebase analysis ({{file_count}} files)
|
|
11
|
-
> - 🚨 **Issues** - Anti-patterns and security concerns
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Table of Contents
|
|
16
|
-
|
|
17
|
-
1. [Summary](#summary)
|
|
18
|
-
2. [Naming Conventions](#naming-conventions)
|
|
19
|
-
3. [Import Patterns](#import-patterns)
|
|
20
|
-
4. [Function Guidelines](#function-guidelines)
|
|
21
|
-
5. [Type Safety](#type-safety)
|
|
22
|
-
6. [Error Handling](#error-handling)
|
|
23
|
-
7. [Security](#security)
|
|
24
|
-
8. [Performance](#performance)
|
|
25
|
-
9. [SpecWeave-Specific Rules](#specweave-specific-rules)
|
|
26
|
-
10. [Anti-Patterns & Issues](#anti-patterns--issues)
|
|
27
|
-
11. [Next Steps](#next-steps)
|
|
28
|
-
12. [Appendix](#appendix)
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Summary
|
|
33
|
-
|
|
34
|
-
### Confidence Levels
|
|
35
|
-
|
|
36
|
-
| Level | Criteria | Meaning |
|
|
37
|
-
|-------|----------|---------|
|
|
38
|
-
| **ENFORCED** | 100% | Linter/compiler enforced |
|
|
39
|
-
| **HIGH** | 90%+ | Overwhelming compliance |
|
|
40
|
-
| **MEDIUM** | 70-89% | Majority compliance |
|
|
41
|
-
| **LOW** | 50-69% | Weak pattern |
|
|
42
|
-
| **CONFLICT** | <50% | Inconsistent, needs decision |
|
|
43
|
-
|
|
44
|
-
### Overall Health
|
|
45
|
-
|
|
46
|
-
{{overall_health_summary}}
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## 1. Naming Conventions
|
|
51
|
-
|
|
52
|
-
### Variables
|
|
53
|
-
|
|
54
|
-
**Standard**: {{variable_naming_standard}}
|
|
55
|
-
**Confidence**: {{variable_naming_confidence}}
|
|
56
|
-
**Compliance**: {{variable_naming_compliance}}%
|
|
57
|
-
**Samples**: {{variable_naming_samples}}
|
|
58
|
-
|
|
59
|
-
**Enforced by**: {{variable_naming_enforcement}}
|
|
60
|
-
|
|
61
|
-
**Examples**:
|
|
62
|
-
```typescript
|
|
63
|
-
// ✅ Good ({{variable_naming_good_percent}}% of codebase)
|
|
64
|
-
{{variable_naming_good_examples}}
|
|
65
|
-
|
|
66
|
-
// ❌ Bad ({{variable_naming_bad_percent}}% of codebase)
|
|
67
|
-
{{variable_naming_bad_examples}}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
**Recommendation**: {{variable_naming_recommendation}}
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
### Functions
|
|
75
|
-
|
|
76
|
-
**Standard**: {{function_naming_standard}}
|
|
77
|
-
**Confidence**: {{function_naming_confidence}}
|
|
78
|
-
**Compliance**: {{function_naming_compliance}}%
|
|
79
|
-
**Samples**: {{function_naming_samples}}
|
|
80
|
-
|
|
81
|
-
**Examples**:
|
|
82
|
-
```typescript
|
|
83
|
-
// ✅ Good
|
|
84
|
-
{{function_naming_good_examples}}
|
|
85
|
-
|
|
86
|
-
// ❌ Bad
|
|
87
|
-
{{function_naming_bad_examples}}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**Recommendation**: {{function_naming_recommendation}}
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
### Classes
|
|
95
|
-
|
|
96
|
-
**Standard**: {{class_naming_standard}}
|
|
97
|
-
**Confidence**: {{class_naming_confidence}}
|
|
98
|
-
**Compliance**: {{class_naming_compliance}}%
|
|
99
|
-
**Samples**: {{class_naming_samples}}
|
|
100
|
-
|
|
101
|
-
**Examples**:
|
|
102
|
-
```typescript
|
|
103
|
-
// ✅ Good
|
|
104
|
-
{{class_naming_good_examples}}
|
|
105
|
-
|
|
106
|
-
// ❌ Bad (if any)
|
|
107
|
-
{{class_naming_bad_examples}}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
**Recommendation**: {{class_naming_recommendation}}
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
### Constants
|
|
115
|
-
|
|
116
|
-
**Standard**: {{constant_naming_standard}}
|
|
117
|
-
**Confidence**: {{constant_naming_confidence}}
|
|
118
|
-
**Compliance**: {{constant_naming_compliance}}%
|
|
119
|
-
**Samples**: {{constant_naming_samples}}
|
|
120
|
-
|
|
121
|
-
**Examples**:
|
|
122
|
-
```typescript
|
|
123
|
-
// ✅ Good
|
|
124
|
-
{{constant_naming_good_examples}}
|
|
125
|
-
|
|
126
|
-
// ⚠️ Inconsistent ({{constant_naming_bad_percent}}% use different convention)
|
|
127
|
-
{{constant_naming_bad_examples}}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
**Recommendation**: {{constant_naming_recommendation}}
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## 2. Import Patterns
|
|
135
|
-
|
|
136
|
-
### File Extensions
|
|
137
|
-
|
|
138
|
-
**Standard**: {{import_extension_standard}}
|
|
139
|
-
**Confidence**: {{import_extension_confidence}}
|
|
140
|
-
**Compliance**: {{import_extension_compliance}}%
|
|
141
|
-
|
|
142
|
-
**Enforced by**: {{import_extension_enforcement}}
|
|
143
|
-
|
|
144
|
-
**Examples**:
|
|
145
|
-
```typescript
|
|
146
|
-
// ✅ Good ({{import_extension_good_percent}}% compliance)
|
|
147
|
-
{{import_extension_good_examples}}
|
|
148
|
-
|
|
149
|
-
// ❌ Bad ({{import_extension_bad_percent}}% if any)
|
|
150
|
-
{{import_extension_bad_examples}}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
**Recommendation**: {{import_extension_recommendation}}
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
### Import Ordering
|
|
158
|
-
|
|
159
|
-
**Standard**: {{import_ordering_standard}}
|
|
160
|
-
**Confidence**: {{import_ordering_confidence}}
|
|
161
|
-
**Compliance**: {{import_ordering_compliance}}%
|
|
162
|
-
|
|
163
|
-
**Examples**:
|
|
164
|
-
```typescript
|
|
165
|
-
// ✅ Good ({{import_ordering_good_percent}}% of files)
|
|
166
|
-
{{import_ordering_good_examples}}
|
|
167
|
-
|
|
168
|
-
// ⚠️ Not followed ({{import_ordering_bad_percent}}% of files)
|
|
169
|
-
{{import_ordering_bad_examples}}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**Recommendation**: {{import_ordering_recommendation}}
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## 3. Function Guidelines
|
|
177
|
-
|
|
178
|
-
### Function Length
|
|
179
|
-
|
|
180
|
-
**Detected Pattern**:
|
|
181
|
-
- **Average**: {{function_length_avg}} lines
|
|
182
|
-
- **Median**: {{function_length_median}} lines
|
|
183
|
-
- **90th percentile**: {{function_length_p90}} lines
|
|
184
|
-
- **Max**: {{function_length_max}} lines ({{function_length_max_location}})
|
|
185
|
-
|
|
186
|
-
**Recommended**: <50 lines (ideal), <100 lines (max)
|
|
187
|
-
|
|
188
|
-
**Violations** ({{function_length_violations}} functions >100 lines):
|
|
189
|
-
{{function_length_violations_list}}
|
|
190
|
-
|
|
191
|
-
**Recommendation**: {{function_length_recommendation}}
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
### File Size Limits
|
|
196
|
-
|
|
197
|
-
**Critical for AI-assisted development** - Large files cause context overflow crashes.
|
|
198
|
-
|
|
199
|
-
| Lines | Status | Action Required |
|
|
200
|
-
|-------|--------|-----------------|
|
|
201
|
-
| 0-500 | ✅ OK | Normal development |
|
|
202
|
-
| 500-1000 | ⚠️ Watch | Review before adding major features |
|
|
203
|
-
| 1000-1500 | 🔶 Large | Extract modules before adding 100+ lines |
|
|
204
|
-
| 1500-2000 | 🔴 Critical | **MUST SPLIT** before any changes |
|
|
205
|
-
| 2000+ | ⛔ Forbidden | Immediate refactor required |
|
|
206
|
-
|
|
207
|
-
**Current Large Files** ({{large_file_count}} files >1000 lines):
|
|
208
|
-
{{large_files_list}}
|
|
209
|
-
|
|
210
|
-
**How to Split Large Files**:
|
|
211
|
-
```
|
|
212
|
-
src/feature/module.ts ← Orchestrator only (300-500 lines)
|
|
213
|
-
src/feature/module/
|
|
214
|
-
├── index.ts ← Barrel exports (re-export public API)
|
|
215
|
-
├── types.ts ← Interfaces and types
|
|
216
|
-
├── domain-logic-a.ts ← Single responsibility
|
|
217
|
-
├── domain-logic-b.ts ← Single responsibility
|
|
218
|
-
└── internal-utils.ts ← Private helpers
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
**Split Triggers**:
|
|
222
|
-
- File has 3+ distinct responsibilities
|
|
223
|
-
- Multiple unrelated import groups
|
|
224
|
-
- Testing requires mocking large portions
|
|
225
|
-
- Functions within file don't share state
|
|
226
|
-
|
|
227
|
-
**Recommendation**: {{file_size_recommendation}}
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
|
-
### Function Style
|
|
232
|
-
|
|
233
|
-
**Detected Pattern**:
|
|
234
|
-
- Arrow functions: {{arrow_function_percent}}%
|
|
235
|
-
- Regular functions: {{regular_function_percent}}%
|
|
236
|
-
|
|
237
|
-
**Examples**:
|
|
238
|
-
```typescript
|
|
239
|
-
// Preferred ({{arrow_function_percent}}% of codebase)
|
|
240
|
-
{{arrow_function_examples}}
|
|
241
|
-
|
|
242
|
-
// Also acceptable ({{regular_function_percent}}% of codebase)
|
|
243
|
-
{{regular_function_examples}}
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
**Recommendation**: {{function_style_recommendation}}
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
## 4. Type Safety
|
|
251
|
-
|
|
252
|
-
### Avoid `any` Type
|
|
253
|
-
|
|
254
|
-
**Detected**: {{any_type_count}} instances of `any` type
|
|
255
|
-
|
|
256
|
-
**Enforced by**: {{any_type_enforcement}}
|
|
257
|
-
|
|
258
|
-
**Violations**:
|
|
259
|
-
{{any_type_violations_list}}
|
|
260
|
-
|
|
261
|
-
**Recommendation**: {{any_type_recommendation}}
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
### Interface vs Type
|
|
266
|
-
|
|
267
|
-
**Detected Pattern**:
|
|
268
|
-
- Interfaces: {{interface_percent}}%
|
|
269
|
-
- Types: {{type_percent}}%
|
|
270
|
-
|
|
271
|
-
**Examples**:
|
|
272
|
-
```typescript
|
|
273
|
-
// Preferred for objects ({{interface_percent}}% of codebase)
|
|
274
|
-
{{interface_examples}}
|
|
275
|
-
|
|
276
|
-
// Preferred for unions/aliases ({{type_percent}}% of codebase)
|
|
277
|
-
{{type_examples}}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
**Recommendation**: {{interface_type_recommendation}}
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## 5. Error Handling
|
|
285
|
-
|
|
286
|
-
### Custom Error Types
|
|
287
|
-
|
|
288
|
-
**Detected**: {{custom_error_count}} custom error classes
|
|
289
|
-
|
|
290
|
-
**Examples**:
|
|
291
|
-
```typescript
|
|
292
|
-
{{custom_error_examples}}
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
**Recommendation**: {{custom_error_recommendation}}
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
### Try/Catch Usage
|
|
300
|
-
|
|
301
|
-
**Detected**: {{try_catch_percent}}% of async functions have try/catch
|
|
302
|
-
|
|
303
|
-
**Examples**:
|
|
304
|
-
```typescript
|
|
305
|
-
// ✅ Good ({{try_catch_good_count}} functions)
|
|
306
|
-
{{try_catch_good_examples}}
|
|
307
|
-
|
|
308
|
-
// ⚠️ Missing error handling ({{try_catch_missing_count}} functions)
|
|
309
|
-
{{try_catch_missing_list}}
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
**Recommendation**: {{try_catch_recommendation}}
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
## 6. Security
|
|
317
|
-
|
|
318
|
-
### No Hardcoded Secrets
|
|
319
|
-
|
|
320
|
-
**Status**: {{hardcoded_secrets_status}}
|
|
321
|
-
|
|
322
|
-
**Violations** ({{hardcoded_secrets_count}} instances):
|
|
323
|
-
{{hardcoded_secrets_list}}
|
|
324
|
-
|
|
325
|
-
**Recommendation**: {{hardcoded_secrets_recommendation}}
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
### No console.* in Production
|
|
330
|
-
|
|
331
|
-
**Status**: {{console_usage_status}}
|
|
332
|
-
|
|
333
|
-
**Violations** ({{console_usage_count}} instances):
|
|
334
|
-
{{console_usage_list}}
|
|
335
|
-
|
|
336
|
-
**Recommendation**: {{console_usage_recommendation}}
|
|
337
|
-
|
|
338
|
-
---
|
|
339
|
-
|
|
340
|
-
## 7. Performance
|
|
341
|
-
|
|
342
|
-
### No N+1 Queries
|
|
343
|
-
|
|
344
|
-
**Status**: {{n_plus_one_status}}
|
|
345
|
-
|
|
346
|
-
{{n_plus_one_details}}
|
|
347
|
-
|
|
348
|
-
**Recommendation**: {{n_plus_one_recommendation}}
|
|
349
|
-
|
|
350
|
-
---
|
|
351
|
-
|
|
352
|
-
## 8. SpecWeave-Specific Rules
|
|
353
|
-
|
|
354
|
-
### 1. Logger Abstraction
|
|
355
|
-
|
|
356
|
-
**Rule**: NEVER use console.* in src/
|
|
357
|
-
|
|
358
|
-
**Compliance**: {{logger_compliance}}%
|
|
359
|
-
|
|
360
|
-
**Violations**: {{logger_violations_count}} instances
|
|
361
|
-
|
|
362
|
-
**Correct usage**:
|
|
363
|
-
```typescript
|
|
364
|
-
import { logger } from '../utils/logger.js';
|
|
365
|
-
logger.info('Message');
|
|
366
|
-
logger.error('Error', error);
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
### 2. Test File Naming
|
|
372
|
-
|
|
373
|
-
**Rule**: Use .test.ts suffix (NEVER .spec.ts)
|
|
374
|
-
|
|
375
|
-
**Compliance**: {{test_naming_compliance}}%
|
|
376
|
-
|
|
377
|
-
---
|
|
378
|
-
|
|
379
|
-
### 3. Import Extensions
|
|
380
|
-
|
|
381
|
-
**Rule**: ALWAYS use .js extensions for ESM compatibility
|
|
382
|
-
|
|
383
|
-
**Compliance**: {{import_extension_compliance}}%
|
|
384
|
-
|
|
385
|
-
---
|
|
386
|
-
|
|
387
|
-
### 4. Root Directory Cleanliness
|
|
388
|
-
|
|
389
|
-
**Rule**: NEVER create files in project root - use increment folders
|
|
390
|
-
|
|
391
|
-
**Critical**: Project root MUST stay clean. All AI-generated files belong in increment folders.
|
|
392
|
-
|
|
393
|
-
**Allowed root files ONLY**:
|
|
394
|
-
- `README.md`, `CLAUDE.md`, `AGENTS.md`, `CHANGELOG.md`
|
|
395
|
-
- `LICENSE`, `CODE_OF_CONDUCT.md`, `SECURITY.md`
|
|
396
|
-
- `IMPLEMENTATION-SUMMARY.md`, `IMPLEMENTATION-COMPLETE.md` (project docs only)
|
|
397
|
-
- `package.json`, `tsconfig*.json`, config files
|
|
398
|
-
|
|
399
|
-
**Increment folder structure**:
|
|
400
|
-
```
|
|
401
|
-
✅ CORRECT - organized increment folder
|
|
402
|
-
.specweave/increments/0001-feature/
|
|
403
|
-
├── metadata.json # REQUIRED
|
|
404
|
-
├── spec.md # WHAT & WHY
|
|
405
|
-
├── plan.md # HOW (optional)
|
|
406
|
-
├── tasks.md # Task checklist
|
|
407
|
-
├── reports/ # ALL other .md files
|
|
408
|
-
│ ├── analysis.md
|
|
409
|
-
│ ├── validation-report.md
|
|
410
|
-
│ └── completion-report.md
|
|
411
|
-
├── scripts/ # Helper scripts
|
|
412
|
-
└── logs/ # Execution logs
|
|
413
|
-
└── 2026-01-04/
|
|
414
|
-
|
|
415
|
-
❌ WRONG - polluted increment folder
|
|
416
|
-
.specweave/increments/0001-feature/
|
|
417
|
-
├── metadata.json
|
|
418
|
-
├── spec.md
|
|
419
|
-
├── tasks.md
|
|
420
|
-
├── analysis.md # WRONG! → reports/
|
|
421
|
-
├── some-report.md # WRONG! → reports/
|
|
422
|
-
└── helper.sh # WRONG! → scripts/
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
**File destination rules**:
|
|
426
|
-
| File Type | Destination |
|
|
427
|
-
|-----------|-------------|
|
|
428
|
-
| Reports, analysis, summaries (*.md) | `reports/` |
|
|
429
|
-
| Validation/QA/completion reports | `reports/` |
|
|
430
|
-
| Auto-session summaries | `reports/` |
|
|
431
|
-
| Logs, execution output | `logs/{YYYY-MM-DD}/` |
|
|
432
|
-
| Helper scripts | `scripts/` |
|
|
433
|
-
| Domain docs | `docs/domain/` |
|
|
434
|
-
|
|
435
|
-
**Enforcement**: Pre-commit hook #13 blocks staging root pollution files
|
|
436
|
-
|
|
437
|
-
---
|
|
438
|
-
|
|
439
|
-
## 9. Anti-Patterns & Issues
|
|
440
|
-
|
|
441
|
-
### 🔴 CRITICAL ({{critical_issues_count}} issues)
|
|
442
|
-
|
|
443
|
-
{{critical_issues_list}}
|
|
444
|
-
|
|
445
|
-
---
|
|
446
|
-
|
|
447
|
-
### 🟠 HIGH ({{high_issues_count}} issues)
|
|
448
|
-
|
|
449
|
-
{{high_issues_list}}
|
|
450
|
-
|
|
451
|
-
---
|
|
452
|
-
|
|
453
|
-
### 🟡 MEDIUM ({{medium_issues_count}} issues)
|
|
454
|
-
|
|
455
|
-
{{medium_issues_list}}
|
|
456
|
-
|
|
457
|
-
---
|
|
458
|
-
|
|
459
|
-
### 🟢 LOW
|
|
460
|
-
|
|
461
|
-
{{low_issues_summary}}
|
|
462
|
-
|
|
463
|
-
---
|
|
464
|
-
|
|
465
|
-
## 10. Next Steps
|
|
466
|
-
|
|
467
|
-
### Critical (Fix Immediately)
|
|
468
|
-
{{critical_next_steps}}
|
|
469
|
-
|
|
470
|
-
### High Priority (This Sprint)
|
|
471
|
-
{{high_priority_next_steps}}
|
|
472
|
-
|
|
473
|
-
### Medium Priority (Next Sprint)
|
|
474
|
-
{{medium_priority_next_steps}}
|
|
475
|
-
|
|
476
|
-
### Documentation
|
|
477
|
-
{{documentation_next_steps}}
|
|
478
|
-
|
|
479
|
-
---
|
|
480
|
-
|
|
481
|
-
## 11. Appendix
|
|
482
|
-
|
|
483
|
-
### Configuration Files
|
|
484
|
-
|
|
485
|
-
#### .eslintrc.json
|
|
486
|
-
```json
|
|
487
|
-
{{eslint_config}}
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
#### .prettierrc
|
|
491
|
-
```json
|
|
492
|
-
{{prettier_config}}
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
#### tsconfig.json (relevant sections)
|
|
496
|
-
```json
|
|
497
|
-
{{tsconfig_config}}
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
---
|
|
501
|
-
|
|
502
|
-
### Statistics
|
|
503
|
-
|
|
504
|
-
| Metric | Value |
|
|
505
|
-
|--------|-------|
|
|
506
|
-
| Total Files | {{file_count}} |
|
|
507
|
-
| Total LOC | {{line_count}} |
|
|
508
|
-
| Variables Analyzed | {{variable_count}} |
|
|
509
|
-
| Functions Analyzed | {{function_count}} |
|
|
510
|
-
| Classes Analyzed | {{class_count}} |
|
|
511
|
-
| Imports Analyzed | {{import_count}} |
|
|
512
|
-
| Analysis Duration | {{analysis_duration}} |
|
|
513
|
-
|
|
514
|
-
---
|
|
515
|
-
|
|
516
|
-
### Change Log
|
|
517
|
-
|
|
518
|
-
**Previous Analysis**: {{previous_analysis_date}}
|
|
519
|
-
**This Analysis**: {{current_analysis_date}}
|
|
520
|
-
|
|
521
|
-
**Changes Since Last Analysis**:
|
|
522
|
-
{{change_log}}
|
|
523
|
-
|
|
524
|
-
---
|
|
525
|
-
|
|
526
|
-
## Metadata
|
|
527
|
-
|
|
528
|
-
**Generated by**: SpecWeave code-standards-detective agent
|
|
529
|
-
**Version**: {{specweave_version}}
|
|
530
|
-
**Analysis Date**: {{analysis_date}}
|
|
531
|
-
**Next Review**: {{next_review_date}} (recommended: quarterly)
|
|
532
|
-
|
|
533
|
-
---
|
|
534
|
-
|
|
535
|
-
*This document is auto-generated. For questions or updates, consult the development team.*
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# SpecWeave Hookify Templates
|
|
2
|
-
|
|
3
|
-
Pre-configured [Hookify](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify) rules for SpecWeave conventions.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Copy desired templates to your project's `.claude/` directory:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# Copy all templates
|
|
11
|
-
cp plugins/specweave/templates/hookify/*.local.md .claude/
|
|
12
|
-
|
|
13
|
-
# Or copy specific templates
|
|
14
|
-
cp plugins/specweave/templates/hookify/hookify.block-metadata-status.local.md .claude/
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Available Templates
|
|
18
|
-
|
|
19
|
-
| Template | Action | Purpose |
|
|
20
|
-
|----------|--------|---------|
|
|
21
|
-
| `hookify.block-metadata-status.local.md` | block | Prevents direct metadata.json edits to status |
|
|
22
|
-
| `hookify.warn-root-files.local.md` | warn | Warns when creating markdown files at project root |
|
|
23
|
-
| `hookify.block-force-push.local.md` | block | Blocks force push to main/master branches |
|
|
24
|
-
| `hookify.block-secrets.local.md` | block | Blocks hardcoded API keys and tokens |
|
|
25
|
-
| `hookify.warn-dangerous-rm.local.md` | warn | Warns on dangerous rm -rf commands |
|
|
26
|
-
| `hookify.require-tests.local.md` | warn | Reminds to run tests before commit (disabled by default) |
|
|
27
|
-
|
|
28
|
-
## Customization
|
|
29
|
-
|
|
30
|
-
Edit any template to adjust:
|
|
31
|
-
- `enabled: true/false` - Turn rule on/off
|
|
32
|
-
- `action: warn/block` - Warning vs hard block
|
|
33
|
-
- `pattern:` - Regex pattern to match
|
|
34
|
-
|
|
35
|
-
## Hookify Commands
|
|
36
|
-
|
|
37
|
-
| Command | Purpose |
|
|
38
|
-
|---------|---------|
|
|
39
|
-
| `/hookify` | Analyze conversation for patterns to create rules |
|
|
40
|
-
| `/hookify [description]` | Create rule from description |
|
|
41
|
-
| `/hookify:list` | List all active rules |
|
|
42
|
-
| `/hookify:configure` | Enable/disable rules interactively |
|
|
43
|
-
|
|
44
|
-
## Learn More
|
|
45
|
-
|
|
46
|
-
- [Hookify Plugin Documentation](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify)
|
|
47
|
-
- [ADR-0226: Claude Code Plugin Integration](../../.specweave/docs/internal/architecture/adr/0226-claude-code-official-plugin-integration.md)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: block-force-push-main
|
|
3
|
-
enabled: true
|
|
4
|
-
event: bash
|
|
5
|
-
action: block
|
|
6
|
-
conditions:
|
|
7
|
-
- field: command
|
|
8
|
-
operator: regex_match
|
|
9
|
-
pattern: git\s+push.*--force.*main|git\s+push.*-f.*main|git\s+push.*--force.*master|git\s+push.*-f.*master
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
**Force push to main/master branch blocked!**
|
|
13
|
-
|
|
14
|
-
This is a destructive operation that can cause data loss.
|
|
15
|
-
|
|
16
|
-
If you really need to force push:
|
|
17
|
-
1. Create a backup branch first: `git branch backup-$(date +%Y%m%d)`
|
|
18
|
-
2. Get explicit user confirmation
|
|
19
|
-
3. Consider using `--force-with-lease` instead (safer)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: block-metadata-status
|
|
3
|
-
enabled: true
|
|
4
|
-
event: file
|
|
5
|
-
action: block
|
|
6
|
-
conditions:
|
|
7
|
-
- field: file_path
|
|
8
|
-
operator: regex_match
|
|
9
|
-
pattern: metadata\.json$
|
|
10
|
-
- field: new_text
|
|
11
|
-
operator: regex_match
|
|
12
|
-
pattern: "status":\s*"completed"
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
**Direct metadata.json status edit blocked!**
|
|
16
|
-
|
|
17
|
-
Use `/sw:done <increment-id>` to properly close increments.
|
|
18
|
-
This ensures all quality gates are validated before marking complete.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: block-hardcoded-secrets
|
|
3
|
-
enabled: true
|
|
4
|
-
event: file
|
|
5
|
-
action: block
|
|
6
|
-
conditions:
|
|
7
|
-
- field: file_path
|
|
8
|
-
operator: not_contains
|
|
9
|
-
pattern: \.env
|
|
10
|
-
- field: new_text
|
|
11
|
-
operator: regex_match
|
|
12
|
-
pattern: (sk-[a-zA-Z0-9]{20,}|ghp_[a-zA-Z0-9]{36}|AKIA[A-Z0-9]{16}|xox[baprs]-[a-zA-Z0-9-]+)
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
**Potential secret detected in code!**
|
|
16
|
-
|
|
17
|
-
Never hardcode API keys or tokens in source files. Use:
|
|
18
|
-
- `.env` files (ensure added to .gitignore)
|
|
19
|
-
- Environment variables
|
|
20
|
-
- Secret management services (Vault, AWS Secrets Manager, etc.)
|
|
21
|
-
|
|
22
|
-
Detected patterns:
|
|
23
|
-
- OpenAI API keys (sk-...)
|
|
24
|
-
- GitHub Personal Access Tokens (ghp_...)
|
|
25
|
-
- AWS Access Key IDs (AKIA...)
|
|
26
|
-
- Slack tokens (xox...)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: require-tests-before-commit
|
|
3
|
-
enabled: false
|
|
4
|
-
event: bash
|
|
5
|
-
action: warn
|
|
6
|
-
conditions:
|
|
7
|
-
- field: command
|
|
8
|
-
operator: regex_match
|
|
9
|
-
pattern: git\s+commit
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
**Committing without running tests?**
|
|
13
|
-
|
|
14
|
-
Best practice is to run tests before committing:
|
|
15
|
-
- `npm test` - Unit tests
|
|
16
|
-
- `npx vitest run` - Vitest
|
|
17
|
-
- `npx playwright test` - E2E tests
|
|
18
|
-
|
|
19
|
-
To enable strict enforcement:
|
|
20
|
-
1. Edit this file
|
|
21
|
-
2. Change `enabled: false` to `enabled: true`
|
|
22
|
-
3. Change `action: warn` to `action: block`
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: warn-dangerous-rm
|
|
3
|
-
enabled: true
|
|
4
|
-
event: bash
|
|
5
|
-
action: warn
|
|
6
|
-
conditions:
|
|
7
|
-
- field: command
|
|
8
|
-
operator: regex_match
|
|
9
|
-
pattern: rm\s+-rf\s+(/|~|\$HOME|\*|\.\./)
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
**Dangerous rm command detected!**
|
|
13
|
-
|
|
14
|
-
This command could delete important files or entire directories.
|
|
15
|
-
|
|
16
|
-
Please verify:
|
|
17
|
-
- The path is correct
|
|
18
|
-
- You have backups if needed
|
|
19
|
-
- This is intentional
|
|
20
|
-
|
|
21
|
-
Consider using safer alternatives:
|
|
22
|
-
- `trash` command (moves to trash instead of permanent delete)
|
|
23
|
-
- `rm -i` (interactive mode, confirms each file)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: warn-root-files
|
|
3
|
-
enabled: true
|
|
4
|
-
event: file
|
|
5
|
-
action: warn
|
|
6
|
-
conditions:
|
|
7
|
-
- field: file_path
|
|
8
|
-
operator: regex_match
|
|
9
|
-
pattern: ^[^/]+\.md$
|
|
10
|
-
- field: file_path
|
|
11
|
-
operator: not_contains
|
|
12
|
-
pattern: README|CLAUDE|AGENTS|CHANGELOG|LICENSE|CODE_OF_CONDUCT|SECURITY
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
**Root-level markdown file detected!**
|
|
16
|
-
|
|
17
|
-
SpecWeave files should go in:
|
|
18
|
-
- `.specweave/increments/<id>/` for increment docs
|
|
19
|
-
- `.specweave/docs/internal/` for living docs
|
|
20
|
-
|
|
21
|
-
Only README.md, CLAUDE.md, AGENTS.md, CHANGELOG.md allowed at root.
|