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.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +531 -0
  3. package/README.md +531 -0
  4. package/bin/musubi-init.js +321 -0
  5. package/bin/musubi.js +359 -0
  6. package/package.json +55 -0
  7. package/src/agents/registry.js +242 -0
  8. package/src/templates/agents/claude-code/CLAUDE.md +232 -0
  9. package/src/templates/agents/claude-code/commands/sdd-design.md +673 -0
  10. package/src/templates/agents/claude-code/commands/sdd-implement.md +777 -0
  11. package/src/templates/agents/claude-code/commands/sdd-requirements.md +438 -0
  12. package/src/templates/agents/claude-code/commands/sdd-steering.md +334 -0
  13. package/src/templates/agents/claude-code/commands/sdd-tasks.md +582 -0
  14. package/src/templates/agents/claude-code/commands/sdd-validate.md +710 -0
  15. package/src/templates/agents/claude-code/skills/ai-ml-engineer/SKILL.md +3055 -0
  16. package/src/templates/agents/claude-code/skills/api-designer/SKILL.md +1364 -0
  17. package/src/templates/agents/claude-code/skills/bug-hunter/SKILL.md +482 -0
  18. package/src/templates/agents/claude-code/skills/change-impact-analyzer/SKILL.md +397 -0
  19. package/src/templates/agents/claude-code/skills/cloud-architect/SKILL.md +1468 -0
  20. package/src/templates/agents/claude-code/skills/code-reviewer/SKILL.md +906 -0
  21. package/src/templates/agents/claude-code/skills/constitution-enforcer/SKILL.md +466 -0
  22. package/src/templates/agents/claude-code/skills/database-administrator/SKILL.md +3522 -0
  23. package/src/templates/agents/claude-code/skills/database-schema-designer/SKILL.md +1158 -0
  24. package/src/templates/agents/claude-code/skills/devops-engineer/SKILL.md +647 -0
  25. package/src/templates/agents/claude-code/skills/orchestrator/SKILL.md +574 -0
  26. package/src/templates/agents/claude-code/skills/performance-optimizer/SKILL.md +464 -0
  27. package/src/templates/agents/claude-code/skills/project-manager/SKILL.md +769 -0
  28. package/src/templates/agents/claude-code/skills/quality-assurance/SKILL.md +1059 -0
  29. package/src/templates/agents/claude-code/skills/release-coordinator/SKILL.md +653 -0
  30. package/src/templates/agents/claude-code/skills/requirements-analyst/SKILL.md +1287 -0
  31. package/src/templates/agents/claude-code/skills/security-auditor/SKILL.md +1107 -0
  32. package/src/templates/agents/claude-code/skills/site-reliability-engineer/SKILL.md +404 -0
  33. package/src/templates/agents/claude-code/skills/software-developer/SKILL.md +1254 -0
  34. package/src/templates/agents/claude-code/skills/steering/SKILL.md +383 -0
  35. package/src/templates/agents/claude-code/skills/system-architect/SKILL.md +1288 -0
  36. package/src/templates/agents/claude-code/skills/technical-writer/SKILL.md +712 -0
  37. package/src/templates/agents/claude-code/skills/test-engineer/SKILL.md +1262 -0
  38. package/src/templates/agents/claude-code/skills/traceability-auditor/SKILL.md +298 -0
  39. package/src/templates/agents/claude-code/skills/ui-ux-designer/SKILL.md +1009 -0
  40. package/src/templates/agents/codex/AGENTS.md +138 -0
  41. package/src/templates/agents/codex/commands/sdd-design.md +673 -0
  42. package/src/templates/agents/codex/commands/sdd-implement.md +777 -0
  43. package/src/templates/agents/codex/commands/sdd-requirements.md +438 -0
  44. package/src/templates/agents/codex/commands/sdd-steering.md +334 -0
  45. package/src/templates/agents/codex/commands/sdd-tasks.md +582 -0
  46. package/src/templates/agents/codex/commands/sdd-validate.md +710 -0
  47. package/src/templates/agents/cursor/AGENTS.md +138 -0
  48. package/src/templates/agents/cursor/commands/sdd-design.md +673 -0
  49. package/src/templates/agents/cursor/commands/sdd-implement.md +777 -0
  50. package/src/templates/agents/cursor/commands/sdd-requirements.md +438 -0
  51. package/src/templates/agents/cursor/commands/sdd-steering.md +334 -0
  52. package/src/templates/agents/cursor/commands/sdd-tasks.md +582 -0
  53. package/src/templates/agents/cursor/commands/sdd-validate.md +710 -0
  54. package/src/templates/agents/gemini-cli/GEMINI.md +128 -0
  55. package/src/templates/agents/gemini-cli/commands/sdd-design.toml +359 -0
  56. package/src/templates/agents/gemini-cli/commands/sdd-implement.toml +484 -0
  57. package/src/templates/agents/gemini-cli/commands/sdd-requirements.toml +291 -0
  58. package/src/templates/agents/gemini-cli/commands/sdd-steering.toml +209 -0
  59. package/src/templates/agents/gemini-cli/commands/sdd-tasks.toml +441 -0
  60. package/src/templates/agents/gemini-cli/commands/sdd-validate.toml +553 -0
  61. package/src/templates/agents/github-copilot/AGENTS.md +138 -0
  62. package/src/templates/agents/github-copilot/commands/sdd-design.md +673 -0
  63. package/src/templates/agents/github-copilot/commands/sdd-implement.md +777 -0
  64. package/src/templates/agents/github-copilot/commands/sdd-requirements.md +438 -0
  65. package/src/templates/agents/github-copilot/commands/sdd-steering.md +334 -0
  66. package/src/templates/agents/github-copilot/commands/sdd-tasks.md +582 -0
  67. package/src/templates/agents/github-copilot/commands/sdd-validate.md +710 -0
  68. package/src/templates/agents/qwen-code/QWEN.md +128 -0
  69. package/src/templates/agents/qwen-code/commands/sdd-design.md +673 -0
  70. package/src/templates/agents/qwen-code/commands/sdd-implement.md +777 -0
  71. package/src/templates/agents/qwen-code/commands/sdd-requirements.md +438 -0
  72. package/src/templates/agents/qwen-code/commands/sdd-steering.md +334 -0
  73. package/src/templates/agents/qwen-code/commands/sdd-tasks.md +582 -0
  74. package/src/templates/agents/qwen-code/commands/sdd-validate.md +710 -0
  75. package/src/templates/agents/windsurf/AGENTS.md +138 -0
  76. package/src/templates/agents/windsurf/commands/sdd-design.md +673 -0
  77. package/src/templates/agents/windsurf/commands/sdd-implement.md +777 -0
  78. package/src/templates/agents/windsurf/commands/sdd-requirements.md +438 -0
  79. package/src/templates/agents/windsurf/commands/sdd-steering.md +334 -0
  80. package/src/templates/agents/windsurf/commands/sdd-tasks.md +582 -0
  81. package/src/templates/agents/windsurf/commands/sdd-validate.md +710 -0
  82. package/src/templates/shared/constitution/constitution.md +408 -0
  83. package/src/templates/shared/constitution/ears-format.md +613 -0
  84. package/src/templates/shared/constitution/workflow.md +653 -0
  85. package/src/templates/shared/documents/design.md +737 -0
  86. package/src/templates/shared/documents/requirements.md +329 -0
  87. package/src/templates/shared/documents/research.md +494 -0
  88. package/src/templates/shared/documents/tasks.md +781 -0
  89. package/src/templates/shared/steering/product.md +544 -0
  90. package/src/templates/shared/steering/structure.md +405 -0
  91. package/src/templates/shared/steering/tech.md +537 -0
@@ -0,0 +1,405 @@
1
+ # Project Structure
2
+
3
+ **Project**: {{PROJECT_NAME}}
4
+ **Last Updated**: {{DATE}}
5
+ **Version**: 1.0
6
+
7
+ ---
8
+
9
+ ## Architecture Pattern
10
+
11
+ **Primary Pattern**: {{ARCHITECTURE_PATTERN}}
12
+
13
+ > [Description of the architecture pattern used in this project]
14
+ > Examples: Monorepo with Library-First, Microservices, Modular Monolith, Serverless
15
+
16
+ ---
17
+
18
+ ## Directory Organization
19
+
20
+ ### Root Structure
21
+
22
+ ```
23
+ {{PROJECT_NAME}}/
24
+ ├── lib/ # Reusable libraries (Article I: Library-First)
25
+ ├── app/ # Application code (Next.js, etc.)
26
+ ├── api/ # API routes/controllers
27
+ ├── components/ # UI components
28
+ ├── services/ # Business logic services
29
+ ├── tests/ # Test suites
30
+ ├── docs/ # Documentation
31
+ ├── storage/ # SDD artifacts
32
+ │ ├── specs/ # Requirements, design, tasks
33
+ │ ├── changes/ # Delta specifications (brownfield)
34
+ │ └── validation/ # Validation reports
35
+ ├── steering/ # Project memory (this directory)
36
+ │ ├── structure.md # This file
37
+ │ ├── tech.md # Technology stack
38
+ │ ├── product.md # Product context
39
+ │ └── rules/ # Constitutional governance
40
+ ├── templates/ # Document templates
41
+ └── [Other directories]
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Library-First Pattern (Article I)
47
+
48
+ All features begin as independent libraries in `lib/`.
49
+
50
+ ### Library Structure
51
+
52
+ Each library follows this structure:
53
+
54
+ ```
55
+ lib/{{feature}}/
56
+ ├── src/
57
+ │ ├── index.ts # Public API exports
58
+ │ ├── service.ts # Business logic
59
+ │ ├── repository.ts # Data access
60
+ │ ├── types.ts # TypeScript types
61
+ │ ├── errors.ts # Custom errors
62
+ │ └── validators.ts # Input validation
63
+ ├── tests/
64
+ │ ├── service.test.ts # Unit tests
65
+ │ ├── repository.test.ts # Integration tests (real DB)
66
+ │ └── integration.test.ts # E2E tests
67
+ ├── cli.ts # CLI interface (Article II)
68
+ ├── package.json # Library metadata
69
+ ├── tsconfig.json # TypeScript config
70
+ └── README.md # Library documentation
71
+ ```
72
+
73
+ ### Library Guidelines
74
+
75
+ - **Independence**: Libraries MUST NOT depend on application code
76
+ - **Public API**: All exports via `src/index.ts`
77
+ - **Testing**: Independent test suite
78
+ - **CLI**: All libraries expose CLI interface (Article II)
79
+
80
+ ---
81
+
82
+ ## Application Structure
83
+
84
+ ### Application Organization
85
+
86
+ ```
87
+ app/
88
+ ├── (auth)/ # Route groups (Next.js App Router)
89
+ │ ├── login/
90
+ │ │ └── page.tsx
91
+ │ └── register/
92
+ │ └── page.tsx
93
+ ├── dashboard/
94
+ │ └── page.tsx
95
+ ├── api/ # API routes
96
+ │ ├── auth/
97
+ │ │ └── route.ts
98
+ │ └── users/
99
+ │ └── route.ts
100
+ ├── layout.tsx # Root layout
101
+ └── page.tsx # Home page
102
+ ```
103
+
104
+ ### Application Guidelines
105
+
106
+ - **Library Usage**: Applications import from `lib/` modules
107
+ - **Thin Controllers**: API routes delegate to library services
108
+ - **No Business Logic**: Business logic belongs in libraries
109
+
110
+ ---
111
+
112
+ ## Component Organization
113
+
114
+ ### UI Components
115
+
116
+ ```
117
+ components/
118
+ ├── ui/ # Base UI components (shadcn/ui)
119
+ │ ├── button.tsx
120
+ │ ├── input.tsx
121
+ │ └── card.tsx
122
+ ├── auth/ # Feature-specific components
123
+ │ ├── LoginForm.tsx
124
+ │ └── RegisterForm.tsx
125
+ ├── dashboard/
126
+ │ └── StatsCard.tsx
127
+ └── shared/ # Shared components
128
+ ├── Header.tsx
129
+ └── Footer.tsx
130
+ ```
131
+
132
+ ### Component Guidelines
133
+
134
+ - **Composition**: Prefer composition over props drilling
135
+ - **Types**: All props typed with TypeScript
136
+ - **Tests**: Component tests with React Testing Library
137
+
138
+ ---
139
+
140
+ ## Database Organization
141
+
142
+ ### Schema Organization
143
+
144
+ ```
145
+ prisma/
146
+ ├── schema.prisma # Prisma schema
147
+ ├── migrations/ # Database migrations
148
+ │ ├── 001_create_users_table/
149
+ │ │ └── migration.sql
150
+ │ └── 002_create_sessions_table/
151
+ │ └── migration.sql
152
+ └── seed.ts # Database seed data
153
+ ```
154
+
155
+ ### Database Guidelines
156
+
157
+ - **Migrations**: All schema changes via migrations
158
+ - **Naming**: snake_case for tables and columns
159
+ - **Indexes**: Index foreign keys and frequently queried columns
160
+
161
+ ---
162
+
163
+ ## Test Organization
164
+
165
+ ### Test Structure
166
+
167
+ ```
168
+ tests/
169
+ ├── unit/ # Unit tests (per library)
170
+ │ └── auth/
171
+ │ └── service.test.ts
172
+ ├── integration/ # Integration tests (real services)
173
+ │ └── auth/
174
+ │ └── login.test.ts
175
+ ├── e2e/ # End-to-end tests
176
+ │ └── auth/
177
+ │ └── user-flow.test.ts
178
+ └── fixtures/ # Test data and fixtures
179
+ └── users.ts
180
+ ```
181
+
182
+ ### Test Guidelines
183
+
184
+ - **Test-First**: Tests written BEFORE implementation (Article III)
185
+ - **Real Services**: Integration tests use real DB/cache (Article IX)
186
+ - **Coverage**: Minimum 80% coverage
187
+ - **Naming**: `*.test.ts` for unit, `*.integration.test.ts` for integration
188
+
189
+ ---
190
+
191
+ ## Documentation Organization
192
+
193
+ ### Documentation Structure
194
+
195
+ ```
196
+ docs/
197
+ ├── architecture/ # Architecture documentation
198
+ │ ├── c4-diagrams/
199
+ │ └── adr/ # Architecture Decision Records
200
+ ├── api/ # API documentation
201
+ │ ├── openapi.yaml
202
+ │ └── graphql.schema
203
+ ├── guides/ # Developer guides
204
+ │ ├── getting-started.md
205
+ │ └── contributing.md
206
+ └── runbooks/ # Operational runbooks
207
+ ├── deployment.md
208
+ └── troubleshooting.md
209
+ ```
210
+
211
+ ---
212
+
213
+ ## SDD Artifacts Organization
214
+
215
+ ### Storage Directory
216
+
217
+ ```
218
+ storage/
219
+ ├── specs/ # Specifications
220
+ │ ├── auth-requirements.md
221
+ │ ├── auth-design.md
222
+ │ ├── auth-tasks.md
223
+ │ └── payment-requirements.md
224
+ ├── changes/ # Delta specifications (brownfield)
225
+ │ ├── add-2fa.md
226
+ │ └── upgrade-jwt.md
227
+ ├── features/ # Feature tracking
228
+ │ ├── auth.json
229
+ │ └── payment.json
230
+ └── validation/ # Validation reports
231
+ ├── auth-validation-report.md
232
+ └── payment-validation-report.md
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Naming Conventions
238
+
239
+ ### File Naming
240
+
241
+ - **TypeScript**: `PascalCase.tsx` for components, `camelCase.ts` for utilities
242
+ - **React Components**: `PascalCase.tsx` (e.g., `LoginForm.tsx`)
243
+ - **Utilities**: `camelCase.ts` (e.g., `formatDate.ts`)
244
+ - **Tests**: `*.test.ts` or `*.spec.ts`
245
+ - **Constants**: `SCREAMING_SNAKE_CASE.ts` (e.g., `API_ENDPOINTS.ts`)
246
+
247
+ ### Directory Naming
248
+
249
+ - **Features**: `kebab-case` (e.g., `user-management/`)
250
+ - **Components**: `kebab-case` or `PascalCase` (consistent within project)
251
+
252
+ ### Variable Naming
253
+
254
+ - **Variables**: `camelCase`
255
+ - **Constants**: `SCREAMING_SNAKE_CASE`
256
+ - **Types/Interfaces**: `PascalCase`
257
+ - **Enums**: `PascalCase`
258
+
259
+ ---
260
+
261
+ ## Integration Patterns
262
+
263
+ ### Library → Application Integration
264
+
265
+ ```typescript
266
+ // ✅ CORRECT: Application imports from library
267
+ import { AuthService } from '@/lib/auth';
268
+
269
+ const authService = new AuthService(repository);
270
+ const result = await authService.login(credentials);
271
+ ```
272
+
273
+ ```typescript
274
+ // ❌ WRONG: Library imports from application
275
+ // Libraries must NOT depend on application code
276
+ import { AuthContext } from '@/app/contexts/auth'; // Violation!
277
+ ```
278
+
279
+ ### Service → Repository Pattern
280
+
281
+ ```typescript
282
+ // Service layer (business logic)
283
+ export class AuthService {
284
+ constructor(private repository: UserRepository) {}
285
+
286
+ async login(credentials: LoginRequest): Promise<LoginResponse> {
287
+ // Business logic here
288
+ const user = await this.repository.findByEmail(credentials.email);
289
+ // ...
290
+ }
291
+ }
292
+
293
+ // Repository layer (data access)
294
+ export class UserRepository {
295
+ constructor(private prisma: PrismaClient) {}
296
+
297
+ async findByEmail(email: string): Promise<User | null> {
298
+ return this.prisma.user.findUnique({ where: { email } });
299
+ }
300
+ }
301
+ ```
302
+
303
+ ---
304
+
305
+ ## Deployment Structure
306
+
307
+ ### Deployment Units
308
+
309
+ **Projects** (independently deployable):
310
+ 1. {{PROJECT_NAME}} - Main application
311
+
312
+ > ⚠️ **Simplicity Gate (Article VII)**: Maximum 3 projects initially.
313
+ > If adding more projects, document justification in Phase -1 Gate approval.
314
+
315
+ ### Environment Structure
316
+
317
+ ```
318
+ environments/
319
+ ├── development/
320
+ │ └── .env.development
321
+ ├── staging/
322
+ │ └── .env.staging
323
+ └── production/
324
+ └── .env.production
325
+ ```
326
+
327
+ ---
328
+
329
+ ## Multi-Language Support
330
+
331
+ ### Language Policy
332
+
333
+ - **Primary Language**: English
334
+ - **Documentation**: English first (`.md`), then Japanese (`.ja.md`)
335
+ - **Code Comments**: English
336
+ - **UI Strings**: i18n framework
337
+
338
+ ### i18n Organization
339
+
340
+ ```
341
+ locales/
342
+ ├── en/
343
+ │ ├── common.json
344
+ │ └── auth.json
345
+ └── ja/
346
+ ├── common.json
347
+ └── auth.json
348
+ ```
349
+
350
+ ---
351
+
352
+ ## Version Control
353
+
354
+ ### Branch Organization
355
+
356
+ - `main` - Production branch
357
+ - `develop` - Development branch
358
+ - `feature/*` - Feature branches
359
+ - `hotfix/*` - Hotfix branches
360
+ - `release/*` - Release branches
361
+
362
+ ### Commit Message Convention
363
+
364
+ ```
365
+ <type>(<scope>): <subject>
366
+
367
+ <body>
368
+
369
+ <footer>
370
+ ```
371
+
372
+ **Types**: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
373
+
374
+ **Example**:
375
+ ```
376
+ feat(auth): implement user login (REQ-AUTH-001)
377
+
378
+ Add login functionality with email and password authentication.
379
+ Session created with 24-hour expiry.
380
+
381
+ Closes REQ-AUTH-001
382
+ ```
383
+
384
+ ---
385
+
386
+ ## Constitutional Compliance
387
+
388
+ This structure enforces:
389
+
390
+ - **Article I**: Library-first pattern in `lib/`
391
+ - **Article II**: CLI interfaces per library
392
+ - **Article III**: Test structure supports Test-First
393
+ - **Article VI**: Steering files maintain project memory
394
+
395
+ ---
396
+
397
+ ## Changelog
398
+
399
+ ### Version 1.1 (Planned)
400
+ - [Future changes]
401
+
402
+ ---
403
+
404
+ **Last Updated**: {{DATE}}
405
+ **Maintained By**: {{MAINTAINER}}