musubi-sdd 0.1.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/LICENSE +21 -0
- package/README.ja.md +531 -0
- package/README.md +531 -0
- package/bin/musubi-init.js +321 -0
- package/bin/musubi.js +359 -0
- package/package.json +55 -0
- package/src/agents/registry.js +242 -0
- package/src/templates/agents/claude-code/CLAUDE.md +232 -0
- package/src/templates/agents/claude-code/commands/sdd-design.md +673 -0
- package/src/templates/agents/claude-code/commands/sdd-implement.md +777 -0
- package/src/templates/agents/claude-code/commands/sdd-requirements.md +438 -0
- package/src/templates/agents/claude-code/commands/sdd-steering.md +334 -0
- package/src/templates/agents/claude-code/commands/sdd-tasks.md +582 -0
- package/src/templates/agents/claude-code/commands/sdd-validate.md +710 -0
- package/src/templates/agents/claude-code/skills/ai-ml-engineer/SKILL.md +3055 -0
- package/src/templates/agents/claude-code/skills/api-designer/SKILL.md +1364 -0
- package/src/templates/agents/claude-code/skills/bug-hunter/SKILL.md +482 -0
- package/src/templates/agents/claude-code/skills/change-impact-analyzer/SKILL.md +397 -0
- package/src/templates/agents/claude-code/skills/cloud-architect/SKILL.md +1468 -0
- package/src/templates/agents/claude-code/skills/code-reviewer/SKILL.md +906 -0
- package/src/templates/agents/claude-code/skills/constitution-enforcer/SKILL.md +466 -0
- package/src/templates/agents/claude-code/skills/database-administrator/SKILL.md +3522 -0
- package/src/templates/agents/claude-code/skills/database-schema-designer/SKILL.md +1158 -0
- package/src/templates/agents/claude-code/skills/devops-engineer/SKILL.md +647 -0
- package/src/templates/agents/claude-code/skills/orchestrator/SKILL.md +574 -0
- package/src/templates/agents/claude-code/skills/performance-optimizer/SKILL.md +464 -0
- package/src/templates/agents/claude-code/skills/project-manager/SKILL.md +769 -0
- package/src/templates/agents/claude-code/skills/quality-assurance/SKILL.md +1059 -0
- package/src/templates/agents/claude-code/skills/release-coordinator/SKILL.md +653 -0
- package/src/templates/agents/claude-code/skills/requirements-analyst/SKILL.md +1287 -0
- package/src/templates/agents/claude-code/skills/security-auditor/SKILL.md +1107 -0
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/SKILL.md +404 -0
- package/src/templates/agents/claude-code/skills/software-developer/SKILL.md +1254 -0
- package/src/templates/agents/claude-code/skills/steering/SKILL.md +383 -0
- package/src/templates/agents/claude-code/skills/system-architect/SKILL.md +1288 -0
- package/src/templates/agents/claude-code/skills/technical-writer/SKILL.md +712 -0
- package/src/templates/agents/claude-code/skills/test-engineer/SKILL.md +1262 -0
- package/src/templates/agents/claude-code/skills/traceability-auditor/SKILL.md +298 -0
- package/src/templates/agents/claude-code/skills/ui-ux-designer/SKILL.md +1009 -0
- package/src/templates/agents/codex/AGENTS.md +138 -0
- package/src/templates/agents/codex/commands/sdd-design.md +673 -0
- package/src/templates/agents/codex/commands/sdd-implement.md +777 -0
- package/src/templates/agents/codex/commands/sdd-requirements.md +438 -0
- package/src/templates/agents/codex/commands/sdd-steering.md +334 -0
- package/src/templates/agents/codex/commands/sdd-tasks.md +582 -0
- package/src/templates/agents/codex/commands/sdd-validate.md +710 -0
- package/src/templates/agents/cursor/AGENTS.md +138 -0
- package/src/templates/agents/cursor/commands/sdd-design.md +673 -0
- package/src/templates/agents/cursor/commands/sdd-implement.md +777 -0
- package/src/templates/agents/cursor/commands/sdd-requirements.md +438 -0
- package/src/templates/agents/cursor/commands/sdd-steering.md +334 -0
- package/src/templates/agents/cursor/commands/sdd-tasks.md +582 -0
- package/src/templates/agents/cursor/commands/sdd-validate.md +710 -0
- package/src/templates/agents/gemini-cli/GEMINI.md +128 -0
- package/src/templates/agents/gemini-cli/commands/sdd-design.toml +359 -0
- package/src/templates/agents/gemini-cli/commands/sdd-implement.toml +484 -0
- package/src/templates/agents/gemini-cli/commands/sdd-requirements.toml +291 -0
- package/src/templates/agents/gemini-cli/commands/sdd-steering.toml +209 -0
- package/src/templates/agents/gemini-cli/commands/sdd-tasks.toml +441 -0
- package/src/templates/agents/gemini-cli/commands/sdd-validate.toml +553 -0
- package/src/templates/agents/github-copilot/AGENTS.md +138 -0
- package/src/templates/agents/github-copilot/commands/sdd-design.md +673 -0
- package/src/templates/agents/github-copilot/commands/sdd-implement.md +777 -0
- package/src/templates/agents/github-copilot/commands/sdd-requirements.md +438 -0
- package/src/templates/agents/github-copilot/commands/sdd-steering.md +334 -0
- package/src/templates/agents/github-copilot/commands/sdd-tasks.md +582 -0
- package/src/templates/agents/github-copilot/commands/sdd-validate.md +710 -0
- package/src/templates/agents/qwen-code/QWEN.md +128 -0
- package/src/templates/agents/qwen-code/commands/sdd-design.md +673 -0
- package/src/templates/agents/qwen-code/commands/sdd-implement.md +777 -0
- package/src/templates/agents/qwen-code/commands/sdd-requirements.md +438 -0
- package/src/templates/agents/qwen-code/commands/sdd-steering.md +334 -0
- package/src/templates/agents/qwen-code/commands/sdd-tasks.md +582 -0
- package/src/templates/agents/qwen-code/commands/sdd-validate.md +710 -0
- package/src/templates/agents/windsurf/AGENTS.md +138 -0
- package/src/templates/agents/windsurf/commands/sdd-design.md +673 -0
- package/src/templates/agents/windsurf/commands/sdd-implement.md +777 -0
- package/src/templates/agents/windsurf/commands/sdd-requirements.md +438 -0
- package/src/templates/agents/windsurf/commands/sdd-steering.md +334 -0
- package/src/templates/agents/windsurf/commands/sdd-tasks.md +582 -0
- package/src/templates/agents/windsurf/commands/sdd-validate.md +710 -0
- package/src/templates/shared/constitution/constitution.md +408 -0
- package/src/templates/shared/constitution/ears-format.md +613 -0
- package/src/templates/shared/constitution/workflow.md +653 -0
- package/src/templates/shared/documents/design.md +737 -0
- package/src/templates/shared/documents/requirements.md +329 -0
- package/src/templates/shared/documents/research.md +494 -0
- package/src/templates/shared/documents/tasks.md +781 -0
- package/src/templates/shared/steering/product.md +544 -0
- package/src/templates/shared/steering/structure.md +405 -0
- package/src/templates/shared/steering/tech.md +537 -0
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
name = "sdd-validate"
|
|
2
|
+
description = "Validate constitutional compliance and requirements coverage"
|
|
3
|
+
|
|
4
|
+
[[instructions]]
|
|
5
|
+
role = "system"
|
|
6
|
+
content = """
|
|
7
|
+
You are executing the /sdd-validate command to validate constitutional compliance.
|
|
8
|
+
|
|
9
|
+
# Command Format
|
|
10
|
+
|
|
11
|
+
/sdd-validate <feature-name>
|
|
12
|
+
|
|
13
|
+
Example: /sdd-validate authentication
|
|
14
|
+
|
|
15
|
+
# Your Task
|
|
16
|
+
|
|
17
|
+
Validate that the implementation follows all Constitutional Articles and meets requirements.
|
|
18
|
+
|
|
19
|
+
# Step 1: Read All Context
|
|
20
|
+
|
|
21
|
+
**IMPORTANT: Read these files FIRST (English versions only):**
|
|
22
|
+
|
|
23
|
+
1. **Constitutional Governance**:
|
|
24
|
+
- `steering/rules/constitution.md` - 9 Constitutional Articles
|
|
25
|
+
|
|
26
|
+
2. **Steering Context**:
|
|
27
|
+
- `steering/structure.md` - Architecture patterns
|
|
28
|
+
- `steering/tech.md` - Technology stack
|
|
29
|
+
|
|
30
|
+
3. **Feature Documentation**:
|
|
31
|
+
- `storage/specs/{{feature-name}}-requirements.md`
|
|
32
|
+
- `storage/specs/{{feature-name}}-design.md`
|
|
33
|
+
- `storage/specs/{{feature-name}}-tasks.md`
|
|
34
|
+
|
|
35
|
+
4. **Implementation**:
|
|
36
|
+
- Read lib/{{feature-name}}/ directory
|
|
37
|
+
- Read app/api/{{feature-name}}/ directory (if applicable)
|
|
38
|
+
- Read test files
|
|
39
|
+
|
|
40
|
+
**Note**: Always read English versions (.md), not Japanese translations (.ja.md)
|
|
41
|
+
|
|
42
|
+
# Step 2: Validation Checklist
|
|
43
|
+
|
|
44
|
+
## Article I: Library-First Principle
|
|
45
|
+
|
|
46
|
+
**Rule**: Features start as libraries in lib/ directory
|
|
47
|
+
|
|
48
|
+
**Validation**:
|
|
49
|
+
- [ ] Core implementation in `lib/{{feature-name}}/`
|
|
50
|
+
- [ ] Library is framework-agnostic
|
|
51
|
+
- [ ] No framework coupling in lib/
|
|
52
|
+
- [ ] Exports clean public API
|
|
53
|
+
|
|
54
|
+
**Evidence to Check**:
|
|
55
|
+
```bash
|
|
56
|
+
# Directory structure
|
|
57
|
+
ls lib/{{feature-name}}/
|
|
58
|
+
|
|
59
|
+
# Check for framework imports in lib/
|
|
60
|
+
grep -r "from 'next" lib/{{feature-name}}/
|
|
61
|
+
grep -r "from 'react" lib/{{feature-name}}/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Pass Criteria**: No framework dependencies in lib/
|
|
65
|
+
|
|
66
|
+
## Article II: CLI Interface Mandate
|
|
67
|
+
|
|
68
|
+
**Rule**: All libraries expose CLI interfaces
|
|
69
|
+
|
|
70
|
+
**Validation**:
|
|
71
|
+
- [ ] `lib/{{feature-name}}/cli.ts` exists
|
|
72
|
+
- [ ] CLI exposes major functions
|
|
73
|
+
- [ ] Help text provided
|
|
74
|
+
- [ ] Can be invoked from command line
|
|
75
|
+
|
|
76
|
+
**Evidence to Check**:
|
|
77
|
+
```bash
|
|
78
|
+
# CLI file exists
|
|
79
|
+
ls lib/{{feature-name}}/cli.ts
|
|
80
|
+
|
|
81
|
+
# CLI can be invoked
|
|
82
|
+
node lib/{{feature-name}}/cli.ts --help
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Pass Criteria**: CLI interface complete and functional
|
|
86
|
+
|
|
87
|
+
## Article III: Test-First Imperative
|
|
88
|
+
|
|
89
|
+
**Rule**: Tests before code (RED-GREEN-BLUE)
|
|
90
|
+
|
|
91
|
+
**Validation**:
|
|
92
|
+
- [ ] Test files exist for all modules
|
|
93
|
+
- [ ] Test coverage >= 80%
|
|
94
|
+
- [ ] Tests written before implementation (check git history)
|
|
95
|
+
- [ ] RED-GREEN-BLUE pattern followed
|
|
96
|
+
|
|
97
|
+
**Evidence to Check**:
|
|
98
|
+
```bash
|
|
99
|
+
# Test files exist
|
|
100
|
+
find lib/{{feature-name}} -name "*.test.ts"
|
|
101
|
+
|
|
102
|
+
# Coverage report
|
|
103
|
+
npm test -- --coverage
|
|
104
|
+
|
|
105
|
+
# Git history shows test-first
|
|
106
|
+
git log --oneline lib/{{feature-name}}/ | grep "test:"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Pass Criteria**: 80%+ coverage, test-first followed
|
|
110
|
+
|
|
111
|
+
## Article IV: EARS Requirements Format
|
|
112
|
+
|
|
113
|
+
**Rule**: All requirements use EARS patterns
|
|
114
|
+
|
|
115
|
+
**Validation**:
|
|
116
|
+
- [ ] All requirements in requirements.md use EARS
|
|
117
|
+
- [ ] Keywords present: WHEN, SHALL, IF, THEN, WHERE, WHILE
|
|
118
|
+
- [ ] Requirements are unambiguous
|
|
119
|
+
- [ ] Each requirement testable
|
|
120
|
+
|
|
121
|
+
**Evidence to Check**:
|
|
122
|
+
```bash
|
|
123
|
+
# Check for EARS keywords
|
|
124
|
+
grep -E "(WHEN|SHALL|IF|THEN|WHERE|WHILE)" storage/specs/{{feature-name}}-requirements.md
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Pass Criteria**: All requirements use EARS format
|
|
128
|
+
|
|
129
|
+
## Article V: Traceability Mandate
|
|
130
|
+
|
|
131
|
+
**Rule**: 100% requirements → design → code → tests traceability
|
|
132
|
+
|
|
133
|
+
**Validation**:
|
|
134
|
+
- [ ] Every requirement has design
|
|
135
|
+
- [ ] Every design has code
|
|
136
|
+
- [ ] Every code has tests
|
|
137
|
+
- [ ] Requirement IDs in code comments
|
|
138
|
+
- [ ] Traceability matrix complete
|
|
139
|
+
|
|
140
|
+
**Evidence to Check**:
|
|
141
|
+
```bash
|
|
142
|
+
# Check requirement IDs in code
|
|
143
|
+
grep -r "REQ-" lib/{{feature-name}}/
|
|
144
|
+
|
|
145
|
+
# Check requirement IDs in tests
|
|
146
|
+
grep -r "REQ-" lib/{{feature-name}}/__tests__/
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Pass Criteria**: All requirements traceable to code and tests
|
|
150
|
+
|
|
151
|
+
### Traceability Matrix Verification
|
|
152
|
+
|
|
153
|
+
Create matrix:
|
|
154
|
+
|
|
155
|
+
| Requirement | Design | Implementation | Tests | Status |
|
|
156
|
+
|-------------|--------|----------------|-------|--------|
|
|
157
|
+
| REQ-AUTH-001 | Section 7 | AuthService.register() | auth-service.test.ts:L25 | ✅ |
|
|
158
|
+
| REQ-AUTH-002 | Section 7 | PasswordValidator.validate() | password-validator.test.ts:L15 | ✅ |
|
|
159
|
+
| REQ-AUTH-003 | Section 7 | AuthService.login() | auth-service.test.ts:L45 | ✅ |
|
|
160
|
+
|
|
161
|
+
## Article VI: Project Memory
|
|
162
|
+
|
|
163
|
+
**Rule**: All agents consult steering before decisions
|
|
164
|
+
|
|
165
|
+
**Validation**:
|
|
166
|
+
- [ ] Implementation follows steering/structure.md patterns
|
|
167
|
+
- [ ] Uses tech stack from steering/tech.md
|
|
168
|
+
- [ ] Aligns with steering/product.md goals
|
|
169
|
+
- [ ] Steering consulted during development
|
|
170
|
+
|
|
171
|
+
**Evidence to Check**:
|
|
172
|
+
- Directory structure matches steering/structure.md
|
|
173
|
+
- Dependencies match steering/tech.md
|
|
174
|
+
- Feature aligns with steering/product.md
|
|
175
|
+
|
|
176
|
+
**Pass Criteria**: Implementation consistent with steering
|
|
177
|
+
|
|
178
|
+
## Article VII: Simplicity Gate
|
|
179
|
+
|
|
180
|
+
**Rule**: Start with max 3 libraries initially
|
|
181
|
+
|
|
182
|
+
**Validation**:
|
|
183
|
+
- [ ] Feature count reasonable
|
|
184
|
+
- [ ] No premature complexity
|
|
185
|
+
- [ ] Dependencies justified
|
|
186
|
+
|
|
187
|
+
**Evidence to Check**:
|
|
188
|
+
```bash
|
|
189
|
+
# Count libraries
|
|
190
|
+
ls -d lib/*/ | wc -l
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Pass Criteria**: Complexity justified
|
|
194
|
+
|
|
195
|
+
## Article VIII: Anti-Abstraction Gate
|
|
196
|
+
|
|
197
|
+
**Rule**: Use framework features directly, no unnecessary wrappers
|
|
198
|
+
|
|
199
|
+
**Validation**:
|
|
200
|
+
- [ ] No custom ORM wrapper (use Prisma directly)
|
|
201
|
+
- [ ] No custom React wrapper
|
|
202
|
+
- [ ] No custom Next.js wrapper
|
|
203
|
+
- [ ] Abstractions have documented justification
|
|
204
|
+
|
|
205
|
+
**Evidence to Check**:
|
|
206
|
+
```bash
|
|
207
|
+
# Check for custom wrappers
|
|
208
|
+
grep -r "class.*Wrapper" lib/{{feature-name}}/
|
|
209
|
+
grep -r "class.*Adapter" lib/{{feature-name}}/
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Pass Criteria**: No unnecessary abstractions
|
|
213
|
+
|
|
214
|
+
## Article IX: Integration-First Testing
|
|
215
|
+
|
|
216
|
+
**Rule**: Use real services, minimize mocks
|
|
217
|
+
|
|
218
|
+
**Validation**:
|
|
219
|
+
- [ ] Tests use real database (test DB)
|
|
220
|
+
- [ ] Minimal mocking
|
|
221
|
+
- [ ] Integration tests present
|
|
222
|
+
- [ ] E2E tests for critical flows
|
|
223
|
+
|
|
224
|
+
**Evidence to Check**:
|
|
225
|
+
```bash
|
|
226
|
+
# Check for mocks
|
|
227
|
+
grep -r "jest.mock" lib/{{feature-name}}/__tests__/
|
|
228
|
+
grep -r "vi.mock" lib/{{feature-name}}/__tests__/
|
|
229
|
+
|
|
230
|
+
# Count integration tests
|
|
231
|
+
find tests/integration -name "*{{feature-name}}*.test.ts"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Pass Criteria**: Real services used, mocks justified
|
|
235
|
+
|
|
236
|
+
# Step 3: Security Validation (OWASP Top 10)
|
|
237
|
+
|
|
238
|
+
## A01: Broken Access Control
|
|
239
|
+
- [ ] Authorization checks present
|
|
240
|
+
- [ ] User permissions verified
|
|
241
|
+
- [ ] No direct object references
|
|
242
|
+
|
|
243
|
+
## A02: Cryptographic Failures
|
|
244
|
+
- [ ] Passwords hashed (bcrypt/argon2)
|
|
245
|
+
- [ ] Sensitive data encrypted
|
|
246
|
+
- [ ] TLS/HTTPS enforced
|
|
247
|
+
|
|
248
|
+
## A03: Injection
|
|
249
|
+
- [ ] Parameterized queries (Prisma ORM)
|
|
250
|
+
- [ ] Input validation
|
|
251
|
+
- [ ] No string concatenation in SQL
|
|
252
|
+
|
|
253
|
+
## A05: Security Misconfiguration
|
|
254
|
+
- [ ] Secrets in environment variables
|
|
255
|
+
- [ ] No hardcoded credentials
|
|
256
|
+
- [ ] Secure headers configured
|
|
257
|
+
|
|
258
|
+
## A07: Authentication Failures
|
|
259
|
+
- [ ] Rate limiting implemented
|
|
260
|
+
- [ ] Account lockout after failed attempts
|
|
261
|
+
- [ ] Session management secure
|
|
262
|
+
|
|
263
|
+
**Evidence to Check**:
|
|
264
|
+
```typescript
|
|
265
|
+
// Check password hashing
|
|
266
|
+
grep -r "bcrypt\\|argon2" lib/{{feature-name}}/
|
|
267
|
+
|
|
268
|
+
// Check for hardcoded secrets
|
|
269
|
+
grep -rE "(password|secret|api_key)\\s*=\\s*['\"]" lib/{{feature-name}}/
|
|
270
|
+
|
|
271
|
+
// Check for SQL injection
|
|
272
|
+
grep -r "query.*+.*params" lib/{{feature-name}}/
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
# Step 4: Code Quality Validation
|
|
276
|
+
|
|
277
|
+
## SOLID Principles
|
|
278
|
+
|
|
279
|
+
**S - Single Responsibility**: Each class has one reason to change
|
|
280
|
+
**O - Open/Closed**: Open for extension, closed for modification
|
|
281
|
+
**L - Liskov Substitution**: Subtypes substitutable for base types
|
|
282
|
+
**I - Interface Segregation**: Many specific interfaces > one general
|
|
283
|
+
**D - Dependency Inversion**: Depend on abstractions, not concretions
|
|
284
|
+
|
|
285
|
+
**Evidence to Check**: Code review
|
|
286
|
+
|
|
287
|
+
## Clean Code
|
|
288
|
+
|
|
289
|
+
- [ ] Meaningful variable names
|
|
290
|
+
- [ ] Functions < 50 lines
|
|
291
|
+
- [ ] Classes < 300 lines
|
|
292
|
+
- [ ] No code duplication
|
|
293
|
+
- [ ] Proper error handling
|
|
294
|
+
|
|
295
|
+
**Evidence to Check**:
|
|
296
|
+
```bash
|
|
297
|
+
# Check function length
|
|
298
|
+
grep -A 50 "function\\|=>" lib/{{feature-name}}/*.ts
|
|
299
|
+
|
|
300
|
+
# Check for duplication
|
|
301
|
+
npx jscpd lib/{{feature-name}}/
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Type Safety
|
|
305
|
+
|
|
306
|
+
- [ ] TypeScript strict mode enabled
|
|
307
|
+
- [ ] No `any` types
|
|
308
|
+
- [ ] Explicit return types
|
|
309
|
+
- [ ] Proper generics
|
|
310
|
+
|
|
311
|
+
**Evidence to Check**:
|
|
312
|
+
```bash
|
|
313
|
+
# Check for any types
|
|
314
|
+
grep -r ": any" lib/{{feature-name}}/
|
|
315
|
+
|
|
316
|
+
# Check tsconfig
|
|
317
|
+
cat tsconfig.json | grep strict
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
# Step 5: Performance Validation
|
|
321
|
+
|
|
322
|
+
## Response Time
|
|
323
|
+
- [ ] API endpoints < 500ms
|
|
324
|
+
- [ ] Database queries optimized
|
|
325
|
+
- [ ] Indexes on foreign keys
|
|
326
|
+
|
|
327
|
+
## Scalability
|
|
328
|
+
- [ ] Stateless design
|
|
329
|
+
- [ ] Horizontal scaling possible
|
|
330
|
+
- [ ] No memory leaks
|
|
331
|
+
|
|
332
|
+
**Evidence to Check**:
|
|
333
|
+
- Load testing results
|
|
334
|
+
- Profiling data
|
|
335
|
+
|
|
336
|
+
# Step 6: Documentation Validation
|
|
337
|
+
|
|
338
|
+
## Code Documentation
|
|
339
|
+
- [ ] JSDoc on all public functions
|
|
340
|
+
- [ ] Requirement IDs in comments
|
|
341
|
+
- [ ] README.md in lib/{{feature-name}}/
|
|
342
|
+
|
|
343
|
+
## API Documentation
|
|
344
|
+
- [ ] OpenAPI/Swagger spec
|
|
345
|
+
- [ ] Request/response examples
|
|
346
|
+
- [ ] Error codes documented
|
|
347
|
+
|
|
348
|
+
## User Documentation
|
|
349
|
+
- [ ] Usage guide
|
|
350
|
+
- [ ] Configuration guide
|
|
351
|
+
- [ ] Troubleshooting guide
|
|
352
|
+
|
|
353
|
+
**Evidence to Check**:
|
|
354
|
+
```bash
|
|
355
|
+
# Check for JSDoc
|
|
356
|
+
grep -r "/**" lib/{{feature-name}}/
|
|
357
|
+
|
|
358
|
+
# Check for README
|
|
359
|
+
ls lib/{{feature-name}}/README.md
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
# Step 7: Validation Report
|
|
363
|
+
|
|
364
|
+
Generate comprehensive report:
|
|
365
|
+
|
|
366
|
+
```markdown
|
|
367
|
+
# Constitutional Validation Report: {{feature-name}}
|
|
368
|
+
|
|
369
|
+
**Date**: {{date}}
|
|
370
|
+
**Version**: 1.0
|
|
371
|
+
|
|
372
|
+
## Executive Summary
|
|
373
|
+
|
|
374
|
+
- **Overall Status**: ✅ PASS / ❌ FAIL / ⚠️ PARTIAL
|
|
375
|
+
- **Constitutional Compliance**: X/9 articles
|
|
376
|
+
- **Requirements Coverage**: X% (Y/Z requirements)
|
|
377
|
+
- **Test Coverage**: X%
|
|
378
|
+
- **Security Score**: X/5 (OWASP Top 10)
|
|
379
|
+
|
|
380
|
+
## Article-by-Article Validation
|
|
381
|
+
|
|
382
|
+
### Article I: Library-First Principle
|
|
383
|
+
**Status**: ✅ PASS
|
|
384
|
+
|
|
385
|
+
- ✅ Core implementation in lib/auth/
|
|
386
|
+
- ✅ Framework-agnostic design
|
|
387
|
+
- ✅ Clean public API
|
|
388
|
+
|
|
389
|
+
**Evidence**: [link to code]
|
|
390
|
+
|
|
391
|
+
### Article II: CLI Interface Mandate
|
|
392
|
+
**Status**: ✅ PASS
|
|
393
|
+
|
|
394
|
+
- ✅ CLI interface at lib/auth/cli.ts
|
|
395
|
+
- ✅ Exposes register, login, list-users commands
|
|
396
|
+
- ✅ Help text complete
|
|
397
|
+
|
|
398
|
+
**Evidence**: [link to CLI file]
|
|
399
|
+
|
|
400
|
+
### Article III: Test-First Imperative
|
|
401
|
+
**Status**: ✅ PASS
|
|
402
|
+
|
|
403
|
+
- ✅ Test coverage: 85%
|
|
404
|
+
- ✅ Tests written before code (git history verified)
|
|
405
|
+
- ✅ RED-GREEN-BLUE pattern followed
|
|
406
|
+
|
|
407
|
+
**Evidence**: [coverage report]
|
|
408
|
+
|
|
409
|
+
### Article IV: EARS Requirements Format
|
|
410
|
+
**Status**: ✅ PASS
|
|
411
|
+
|
|
412
|
+
- ✅ All 3 requirements use EARS
|
|
413
|
+
- ✅ Keywords present (WHEN, SHALL, IF)
|
|
414
|
+
- ✅ Requirements unambiguous
|
|
415
|
+
|
|
416
|
+
**Evidence**: [requirements.md]
|
|
417
|
+
|
|
418
|
+
### Article V: Traceability Mandate
|
|
419
|
+
**Status**: ✅ PASS
|
|
420
|
+
|
|
421
|
+
- ✅ 100% requirements traceable (3/3)
|
|
422
|
+
- ✅ Requirement IDs in code comments
|
|
423
|
+
- ✅ Traceability matrix complete
|
|
424
|
+
|
|
425
|
+
**Evidence**: [traceability matrix]
|
|
426
|
+
|
|
427
|
+
### Article VI: Project Memory
|
|
428
|
+
**Status**: ✅ PASS
|
|
429
|
+
|
|
430
|
+
- ✅ Follows structure.md patterns
|
|
431
|
+
- ✅ Uses tech.md stack (TypeScript, Prisma, bcrypt)
|
|
432
|
+
- ✅ Aligns with product.md goals
|
|
433
|
+
|
|
434
|
+
**Evidence**: [steering files]
|
|
435
|
+
|
|
436
|
+
### Article VII: Simplicity Gate
|
|
437
|
+
**Status**: ✅ PASS
|
|
438
|
+
|
|
439
|
+
- ✅ Single focused library (auth)
|
|
440
|
+
- ✅ No premature complexity
|
|
441
|
+
- ✅ Dependencies justified
|
|
442
|
+
|
|
443
|
+
### Article VIII: Anti-Abstraction Gate
|
|
444
|
+
**Status**: ✅ PASS
|
|
445
|
+
|
|
446
|
+
- ✅ Uses Prisma directly (no ORM wrapper)
|
|
447
|
+
- ✅ Uses bcrypt directly (no crypto wrapper)
|
|
448
|
+
- ✅ No unnecessary abstractions
|
|
449
|
+
|
|
450
|
+
**Evidence**: [code review]
|
|
451
|
+
|
|
452
|
+
### Article IX: Integration-First Testing
|
|
453
|
+
**Status**: ✅ PASS
|
|
454
|
+
|
|
455
|
+
- ✅ Tests use real PostgreSQL (test DB)
|
|
456
|
+
- ✅ Minimal mocking (0 mocks found)
|
|
457
|
+
- ✅ Integration tests present
|
|
458
|
+
|
|
459
|
+
**Evidence**: [test files]
|
|
460
|
+
|
|
461
|
+
## Requirements Coverage
|
|
462
|
+
|
|
463
|
+
| ID | Requirement | Design | Code | Tests | Status |
|
|
464
|
+
|----|-------------|--------|------|-------|--------|
|
|
465
|
+
| REQ-AUTH-001 | User Registration | ✅ | ✅ | ✅ | PASS |
|
|
466
|
+
| REQ-AUTH-002 | Password Validation | ✅ | ✅ | ✅ | PASS |
|
|
467
|
+
| REQ-AUTH-003 | User Login | ✅ | ✅ | ✅ | PASS |
|
|
468
|
+
|
|
469
|
+
**Coverage**: 100% (3/3 requirements)
|
|
470
|
+
|
|
471
|
+
## Security Validation (OWASP Top 10)
|
|
472
|
+
|
|
473
|
+
- ✅ A01: Authorization checks present
|
|
474
|
+
- ✅ A02: Passwords hashed with bcrypt
|
|
475
|
+
- ✅ A03: Parameterized queries (Prisma)
|
|
476
|
+
- ✅ A05: Secrets in env variables
|
|
477
|
+
- ✅ A07: Rate limiting implemented
|
|
478
|
+
|
|
479
|
+
**Security Score**: 5/5
|
|
480
|
+
|
|
481
|
+
## Code Quality
|
|
482
|
+
|
|
483
|
+
- ✅ SOLID principles followed
|
|
484
|
+
- ✅ TypeScript strict mode
|
|
485
|
+
- ✅ No `any` types
|
|
486
|
+
- ✅ Clean code standards met
|
|
487
|
+
- ✅ 0 linting errors
|
|
488
|
+
|
|
489
|
+
## Performance
|
|
490
|
+
|
|
491
|
+
- ✅ Login endpoint: 245ms avg
|
|
492
|
+
- ✅ Register endpoint: 310ms avg
|
|
493
|
+
- ✅ Database queries optimized
|
|
494
|
+
- ✅ Indexes present
|
|
495
|
+
|
|
496
|
+
## Documentation
|
|
497
|
+
|
|
498
|
+
- ✅ JSDoc on all public functions
|
|
499
|
+
- ✅ README.md complete
|
|
500
|
+
- ✅ API documentation (OpenAPI)
|
|
501
|
+
- ✅ Usage examples provided
|
|
502
|
+
|
|
503
|
+
## Issues Found
|
|
504
|
+
|
|
505
|
+
None
|
|
506
|
+
|
|
507
|
+
## Recommendations
|
|
508
|
+
|
|
509
|
+
1. Consider adding 2FA support (future enhancement)
|
|
510
|
+
2. Add monitoring for failed login attempts
|
|
511
|
+
3. Implement password rotation policy
|
|
512
|
+
|
|
513
|
+
## Conclusion
|
|
514
|
+
|
|
515
|
+
**Status**: ✅ PASS
|
|
516
|
+
|
|
517
|
+
The {{feature-name}} feature fully complies with all 9 Constitutional Articles and meets all requirements with 100% traceability and 85% test coverage.
|
|
518
|
+
|
|
519
|
+
**Approved for**: Production Deployment
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
**Validator**: AI Agent
|
|
523
|
+
**Date**: {{date}}
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
# Step 8: Remediation (if issues found)
|
|
527
|
+
|
|
528
|
+
If validation fails:
|
|
529
|
+
|
|
530
|
+
1. **Document Issues**:
|
|
531
|
+
- List all violations
|
|
532
|
+
- Severity: Critical / High / Medium / Low
|
|
533
|
+
- Remediation steps
|
|
534
|
+
|
|
535
|
+
2. **Create Action Plan**:
|
|
536
|
+
- Prioritize issues
|
|
537
|
+
- Assign tasks
|
|
538
|
+
- Set deadlines
|
|
539
|
+
|
|
540
|
+
3. **Re-validate**:
|
|
541
|
+
- After fixes, run validation again
|
|
542
|
+
- Verify all issues resolved
|
|
543
|
+
|
|
544
|
+
# Next Steps
|
|
545
|
+
|
|
546
|
+
After validation:
|
|
547
|
+
1. If PASS: Approve for deployment
|
|
548
|
+
2. If FAIL: Create remediation plan
|
|
549
|
+
3. Update stakeholders
|
|
550
|
+
4. Proceed to deployment or fix issues
|
|
551
|
+
|
|
552
|
+
**Execute validation now.**
|
|
553
|
+
"""
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# MUSUBI for GitHub Copilot
|
|
2
|
+
|
|
3
|
+
**Ultimate Specification Driven Development**
|
|
4
|
+
|
|
5
|
+
This project uses **MUSUBI** (Ultimate Specification Driven Development) configured for GitHub Copilot.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 📋 **Constitutional Governance** - 9 immutable articles + Phase -1 Gates
|
|
10
|
+
- 📝 **EARS Requirements Format** - Unambiguous requirements with complete traceability
|
|
11
|
+
- 🧭 **Auto-Updating Project Memory** - Steering system maintains architecture, tech stack, and product context
|
|
12
|
+
- 🌐 **Bilingual Documentation** - All documents created in both English and Japanese
|
|
13
|
+
|
|
14
|
+
## Custom Prompts
|
|
15
|
+
|
|
16
|
+
GitHub Copilot uses custom prompts in `.github/prompts/`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Generate project memory
|
|
20
|
+
#sdd-steering
|
|
21
|
+
|
|
22
|
+
# Create requirements
|
|
23
|
+
#sdd-requirements <feature>
|
|
24
|
+
|
|
25
|
+
# Design architecture
|
|
26
|
+
#sdd-design <feature>
|
|
27
|
+
|
|
28
|
+
# Break down into tasks
|
|
29
|
+
#sdd-tasks <feature>
|
|
30
|
+
|
|
31
|
+
# Implement feature
|
|
32
|
+
#sdd-implement <feature>
|
|
33
|
+
|
|
34
|
+
# Validate constitutional compliance
|
|
35
|
+
#sdd-validate <feature>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Project Memory (Steering System)
|
|
39
|
+
|
|
40
|
+
**IMPORTANT**: Before starting any task, check if steering files exist in `steering/` directory:
|
|
41
|
+
|
|
42
|
+
- `steering/structure.md` - Architecture patterns, directory organization, naming conventions
|
|
43
|
+
- `steering/tech.md` - Technology stack, frameworks, development tools
|
|
44
|
+
- `steering/product.md` - Business context, product purpose, users
|
|
45
|
+
|
|
46
|
+
If these files exist, ALWAYS read them first to understand project context.
|
|
47
|
+
|
|
48
|
+
## SDD Workflow (8 Stages)
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
Research → Requirements → Design → Tasks → Implementation → Testing → Deployment → Monitoring
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Each stage has:
|
|
55
|
+
- Quality gates
|
|
56
|
+
- Traceability requirements
|
|
57
|
+
- Constitutional validation
|
|
58
|
+
|
|
59
|
+
## EARS Requirements Format
|
|
60
|
+
|
|
61
|
+
All requirements must use EARS patterns:
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
### Requirement: User Login
|
|
65
|
+
|
|
66
|
+
WHEN user provides valid credentials,
|
|
67
|
+
THEN the system SHALL authenticate the user
|
|
68
|
+
AND the system SHALL create a session.
|
|
69
|
+
|
|
70
|
+
#### Scenario: Successful login
|
|
71
|
+
- WHEN user enters correct email and password
|
|
72
|
+
- THEN system SHALL verify credentials
|
|
73
|
+
- AND system SHALL redirect to dashboard
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Constitutional Governance
|
|
77
|
+
|
|
78
|
+
MUSUBI enforces 9 immutable constitutional articles:
|
|
79
|
+
|
|
80
|
+
1. **Library-First Principle** - Features start as libraries
|
|
81
|
+
2. **CLI Interface Mandate** - All libraries expose CLI
|
|
82
|
+
3. **Test-First Imperative** - Tests before code (Red-Green-Blue)
|
|
83
|
+
4. **EARS Requirements Format** - Unambiguous requirements
|
|
84
|
+
5. **Traceability Mandate** - 100% coverage required
|
|
85
|
+
6. **Project Memory** - All prompts check steering first
|
|
86
|
+
7. **Simplicity Gate** - Maximum 3 projects initially
|
|
87
|
+
8. **Anti-Abstraction Gate** - Use framework features directly
|
|
88
|
+
9. **Integration-First Testing** - Real services over mocks
|
|
89
|
+
|
|
90
|
+
## Bilingual Documentation
|
|
91
|
+
|
|
92
|
+
**All agent-generated documents are created in both English and Japanese.**
|
|
93
|
+
|
|
94
|
+
### Language Policy
|
|
95
|
+
|
|
96
|
+
- **English**: Reference/source documents (`.md`)
|
|
97
|
+
- **Japanese**: Translations (`.ja.md`)
|
|
98
|
+
- **Prompts**: Always read English versions for work
|
|
99
|
+
- **Code References**: Requirement IDs, technical terms stay in English
|
|
100
|
+
|
|
101
|
+
## Quick Start
|
|
102
|
+
|
|
103
|
+
### First Time Setup
|
|
104
|
+
|
|
105
|
+
1. Generate project memory:
|
|
106
|
+
```
|
|
107
|
+
#sdd-steering
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
2. Review steering context in `steering/` directory
|
|
111
|
+
|
|
112
|
+
3. Start development
|
|
113
|
+
|
|
114
|
+
### Example Usage
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Greenfield Project (0→1)
|
|
118
|
+
#sdd-steering
|
|
119
|
+
#sdd-requirements user-authentication
|
|
120
|
+
#sdd-design user-authentication
|
|
121
|
+
#sdd-tasks user-authentication
|
|
122
|
+
#sdd-implement user-authentication
|
|
123
|
+
|
|
124
|
+
# Brownfield Project (1→n)
|
|
125
|
+
#sdd-steering
|
|
126
|
+
#sdd-change-init add-2fa
|
|
127
|
+
#sdd-change-apply add-2fa
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Learn More
|
|
131
|
+
|
|
132
|
+
- [MUSUBI Documentation](https://github.com/your-org/musubi)
|
|
133
|
+
- [Constitutional Governance](steering/rules/constitution.md)
|
|
134
|
+
- [8-Stage SDD Workflow](steering/rules/workflow.md)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
**MUSUBI for GitHub Copilot** - むすび - Bringing specifications, design, and code together.
|