musubix 3.3.4 → 3.3.5

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 (92) hide show
  1. package/.github/AGENTS.md +949 -0
  2. package/.github/prompts/sdd-change-apply.prompt.md +283 -0
  3. package/.github/prompts/sdd-change-archive.prompt.md +241 -0
  4. package/.github/prompts/sdd-change-init.prompt.md +269 -0
  5. package/.github/prompts/sdd-design.prompt.md +250 -0
  6. package/.github/prompts/sdd-implement.prompt.md +387 -0
  7. package/.github/prompts/sdd-requirements.prompt.md +193 -0
  8. package/.github/prompts/sdd-review.prompt.md +155 -0
  9. package/.github/prompts/sdd-security.prompt.md +228 -0
  10. package/.github/prompts/sdd-steering.prompt.md +269 -0
  11. package/.github/prompts/sdd-tasks.prompt.md +255 -0
  12. package/.github/prompts/sdd-test.prompt.md +230 -0
  13. package/.github/prompts/sdd-validate.prompt.md +304 -0
  14. package/.github/skills/musubix-adr-generation/SKILL.md +209 -0
  15. package/.github/skills/musubix-best-practices/SKILL.md +315 -0
  16. package/.github/skills/musubix-c4-design/SKILL.md +162 -0
  17. package/.github/skills/musubix-code-generation/SKILL.md +237 -0
  18. package/.github/skills/musubix-domain-inference/SKILL.md +196 -0
  19. package/.github/skills/musubix-ears-validation/SKILL.md +161 -0
  20. package/.github/skills/musubix-sdd-workflow/SKILL.md +217 -0
  21. package/.github/skills/musubix-technical-writing/SKILL.md +444 -0
  22. package/.github/skills/musubix-test-generation/SKILL.md +212 -0
  23. package/.github/skills/musubix-traceability/SKILL.md +141 -0
  24. package/AGENTS.md +1065 -0
  25. package/LICENSE +21 -0
  26. package/README.ja.md +296 -0
  27. package/README.md +305 -50
  28. package/bin/musubix-mcp.js +15 -0
  29. package/bin/musubix.js +9 -1
  30. package/docs/API-REFERENCE.md +1425 -0
  31. package/docs/GITHUB-ACTIONS-NPM-SETUP.md +132 -0
  32. package/docs/INSTALL-GUIDE.ja.md +459 -0
  33. package/docs/INSTALL-GUIDE.md +459 -0
  34. package/docs/MIGRATION-v3.0.md +324 -0
  35. package/docs/MUSUBI-enhancement_roadmap_20260105.md +651 -0
  36. package/docs/MUSUBIX-v3.0-User-Guide.md +1357 -0
  37. package/docs/MUSUBIXv2.2.0-Manual-outline.md +136 -0
  38. package/docs/MUSUBIXv2.2.0-Manual.md +3123 -0
  39. package/docs/MUSUBIXv2.3.5-Refactering.md +1310 -0
  40. package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +291 -0
  41. package/docs/MUSUBIv2.2.0-USERGUIDE.md +2079 -0
  42. package/docs/ROADMAP-v1.5.md +116 -0
  43. package/docs/SwarmCoding.md +1284 -0
  44. package/docs/Test-prompt.md +105 -0
  45. package/docs/USER-GUIDE-v1.8.0.md +2371 -0
  46. package/docs/USER-GUIDE.ja.md +2147 -0
  47. package/docs/USER-GUIDE.md +3022 -0
  48. package/docs/YATA-GLOBAL-GUIDE.ja.md +750 -0
  49. package/docs/YATA-GLOBAL-GUIDE.md +595 -0
  50. package/docs/YATA-LOCAL-GUIDE.ja.md +989 -0
  51. package/docs/YATA-LOCAL-GUIDE.md +730 -0
  52. package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +75 -0
  53. package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +79 -0
  54. package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +90 -0
  55. package/docs/enterprise-knowledge-management.md +1737 -0
  56. package/docs/evolution-from-musubi-to-musubix.md +2170 -0
  57. package/docs/getting-started-with-sdd.md +1602 -0
  58. package/docs/moodle-refactering-codegraph-musubix.md +391 -0
  59. package/docs/moodle-refactering-codegraph.md +278 -0
  60. package/docs/overview/MUSUBIX-CodeGraph.md +322 -0
  61. package/docs/overview/MUSUBIX-Core.md +671 -0
  62. package/docs/overview/MUSUBIX-Decisions.md +494 -0
  63. package/docs/overview/MUSUBIX-FormalVerify.md +566 -0
  64. package/docs/overview/MUSUBIX-Knowledge.md +1231 -0
  65. package/docs/overview/MUSUBIX-Learning.md +837 -0
  66. package/docs/overview/MUSUBIX-MCP-Server.md +535 -0
  67. package/docs/overview/MUSUBIX-Overview.md +264 -0
  68. package/docs/overview/MUSUBIX-Phase1-Complete.md +271 -0
  69. package/docs/overview/MUSUBIX-Phase2-Complete.md +310 -0
  70. package/docs/overview/MUSUBIX-Policy.md +477 -0
  71. package/docs/overview/MUSUBIX-Roadmap-v2.md +399 -0
  72. package/docs/overview/MUSUBIX-Security-Plan.md +939 -0
  73. package/docs/overview/MUSUBIX-Security-v2.1.md +668 -0
  74. package/docs/overview/MUSUBIX-Security.md +891 -0
  75. package/docs/overview/MUSUBIX-YATA.md +666 -0
  76. package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +513 -0
  77. package/docs/overview/Neuro-SymbolicAI.md +159 -0
  78. package/docs/packages/knowledge.md +594 -0
  79. package/docs/qiita-linux-kernel-knowledge-graph.md +596 -0
  80. package/package.json +55 -51
  81. package/scripts/generate-quality-gate-report.ts +106 -0
  82. package/scripts/postinstall.js +94 -0
  83. package/steering/.musubi-version +1 -0
  84. package/steering/product.ja.md +572 -0
  85. package/steering/project.yml +66 -0
  86. package/steering/rules/constitution.md +491 -0
  87. package/steering/structure.ja.md +503 -0
  88. package/steering/tech.ja.md +208 -0
  89. package/dist/index.d.ts +0 -25
  90. package/dist/index.d.ts.map +0 -1
  91. package/dist/index.js +0 -74
  92. package/dist/index.js.map +0 -1
@@ -0,0 +1,387 @@
1
+ # MUSUBIX Implement Command
2
+
3
+ Execute implementation tasks for a feature following Test-First principles.
4
+
5
+ ---
6
+
7
+ ## Instructions for AI Agent
8
+
9
+ You are executing the `musubix implement [feature-name]` command to implement a feature following SDD workflow.
10
+
11
+ ### Command Format
12
+
13
+ ```bash
14
+ npx musubix implement authentication
15
+ npx musubix codegen generate design.md
16
+ ```
17
+
18
+ ### Your Task
19
+
20
+ Implement the feature by executing tasks from the task breakdown document, following Test-First principles (Article III) and constitutional governance.
21
+
22
+ ---
23
+
24
+ ## Process
25
+
26
+ ### 1. Read All Context
27
+
28
+ **CRITICAL**: Read these files first:
29
+
30
+ ```bash
31
+ # Task Breakdown
32
+ storage/specs/TSK-{{FEATURE}}-001.md
33
+
34
+ # Design
35
+ storage/specs/DES-{{FEATURE}}-001.md
36
+
37
+ # Requirements
38
+ storage/specs/REQ-{{FEATURE}}-001.md
39
+
40
+ # Steering Context
41
+ steering/structure.ja.md
42
+ steering/tech.ja.md
43
+ steering/product.ja.md
44
+ ```
45
+
46
+ ---
47
+
48
+ ### 2. Verify Prerequisites
49
+
50
+ **Check task breakdown exists**:
51
+
52
+ ```markdown
53
+ ❌ **Error**: Task breakdown not found
54
+
55
+ Expected: storage/specs/TSK-{{FEATURE}}-001.md
56
+
57
+ Please run `npx musubix tasks generate` first.
58
+ ```
59
+
60
+ ---
61
+
62
+ ### 3. Use Todo Tracking
63
+
64
+ Track implementation progress:
65
+
66
+ ```markdown
67
+ 1. TSK-001: Set Up Package Structure
68
+ 2. TSK-002: Write Tests (RED)
69
+ 3. TSK-003: Implement Code (GREEN)
70
+ 4. TSK-004: Refactor (BLUE)
71
+ 5. TSK-005: CLI Interface (Article II)
72
+ 6. TSK-006: MCP Tool (if needed)
73
+ ```
74
+
75
+ ---
76
+
77
+ ### 4. Execute Tasks in Order
78
+
79
+ #### TSK-001: Set Up Package Structure
80
+
81
+ **Create structure in appropriate package**:
82
+
83
+ ```
84
+ packages/core/src/{{feature}}/
85
+ ├── index.ts # Public API exports
86
+ ├── service.ts # Business logic
87
+ ├── types.ts # TypeScript types
88
+ └── errors.ts # Custom errors
89
+
90
+ packages/core/__tests__/
91
+ ├── unit/
92
+ │ └── {{feature}}.test.ts
93
+ └── integration/
94
+ └── {{feature}}.integration.test.ts
95
+ ```
96
+
97
+ **Create public API**:
98
+
99
+ ```typescript
100
+ // packages/core/src/{{feature}}/index.ts
101
+
102
+ /**
103
+ * {{Feature}} Module
104
+ *
105
+ * @see REQ-{{COMPONENT}}-001
106
+ * @see DES-{{FEATURE}}-001
107
+ */
108
+
109
+ export { {{Feature}}Service } from './service.js';
110
+ export type { {{Feature}}Options, {{Feature}}Result } from './types.js';
111
+ ```
112
+
113
+ **Create types**:
114
+
115
+ ```typescript
116
+ // packages/core/src/{{feature}}/types.ts
117
+
118
+ /**
119
+ * @see REQ-{{COMPONENT}}-001
120
+ */
121
+ export interface {{Feature}}Options {
122
+ input: string;
123
+ output?: string;
124
+ }
125
+
126
+ export interface {{Feature}}Result {
127
+ success: boolean;
128
+ data?: unknown;
129
+ error?: string;
130
+ }
131
+ ```
132
+
133
+ ---
134
+
135
+ #### TSK-002: Write Tests (RED Phase) 🔴
136
+
137
+ **CRITICAL (Article III)**: Tests BEFORE implementation.
138
+
139
+ ```typescript
140
+ // packages/core/__tests__/unit/{{feature}}.test.ts
141
+
142
+ import { describe, it, expect, beforeEach } from 'vitest';
143
+ import { {{Feature}}Service } from '../../src/{{feature}}/index.js';
144
+
145
+ describe('REQ-{{COMPONENT}}-001: {{Requirement Title}}', () => {
146
+ let service: {{Feature}}Service;
147
+
148
+ beforeEach(() => {
149
+ service = new {{Feature}}Service();
150
+ });
151
+
152
+ // Acceptance Criterion 1
153
+ it('should [acceptance criterion 1]', async () => {
154
+ // Arrange
155
+ const input = { /* ... */ };
156
+
157
+ // Act
158
+ const result = await service.process(input);
159
+
160
+ // Assert
161
+ expect(result.success).toBe(true);
162
+ });
163
+
164
+ // Acceptance Criterion 2
165
+ it('should handle errors gracefully', async () => {
166
+ // Arrange
167
+ const invalidInput = { /* ... */ };
168
+
169
+ // Act & Assert
170
+ await expect(service.process(invalidInput)).rejects.toThrow();
171
+ });
172
+ });
173
+ ```
174
+
175
+ **Run tests** (should FAIL):
176
+
177
+ ```bash
178
+ npm test packages/core/__tests__/unit/{{feature}}.test.ts
179
+ # Expected: Tests FAIL (service.ts doesn't exist yet)
180
+ ```
181
+
182
+ ---
183
+
184
+ #### TSK-003: Implement Code (GREEN Phase) 💚
185
+
186
+ **Create minimal implementation**:
187
+
188
+ ```typescript
189
+ // packages/core/src/{{feature}}/service.ts
190
+
191
+ import type { {{Feature}}Options, {{Feature}}Result } from './types.js';
192
+ import { ValidationError } from './errors.js';
193
+
194
+ /**
195
+ * {{Feature}} Service
196
+ *
197
+ * @see REQ-{{COMPONENT}}-001
198
+ * @see DES-{{FEATURE}}-001
199
+ */
200
+ export class {{Feature}}Service {
201
+ /**
202
+ * Process {{feature}} request
203
+ *
204
+ * Acceptance Criteria:
205
+ * - [Criterion 1]
206
+ * - [Criterion 2]
207
+ */
208
+ async process(options: {{Feature}}Options): Promise<{{Feature}}Result> {
209
+ // Validate input
210
+ this.validate(options);
211
+
212
+ // Process
213
+ const result = await this.execute(options);
214
+
215
+ return {
216
+ success: true,
217
+ data: result,
218
+ };
219
+ }
220
+
221
+ private validate(options: {{Feature}}Options): void {
222
+ if (!options.input) {
223
+ throw new ValidationError('input is required');
224
+ }
225
+ }
226
+
227
+ private async execute(options: {{Feature}}Options): Promise<unknown> {
228
+ // Minimal implementation
229
+ return { processed: true };
230
+ }
231
+ }
232
+ ```
233
+
234
+ **Run tests** (should PASS):
235
+
236
+ ```bash
237
+ npm test packages/core/__tests__/unit/{{feature}}.test.ts
238
+ # Expected: Tests PASS ✅
239
+ ```
240
+
241
+ ---
242
+
243
+ #### TSK-004: Refactor (BLUE Phase) 💙
244
+
245
+ **Improve code while keeping tests green**:
246
+
247
+ - Extract validators
248
+ - Add proper error handling
249
+ - Apply SOLID principles
250
+ - Improve naming
251
+
252
+ ```bash
253
+ npm test packages/core/__tests__/unit/{{feature}}.test.ts
254
+ # Expected: Tests still PASS ✅
255
+ ```
256
+
257
+ ---
258
+
259
+ #### TSK-005: CLI Command (Article II)
260
+
261
+ **Create CLI command**:
262
+
263
+ ```typescript
264
+ // packages/core/src/cli/commands/{{feature}}.ts
265
+
266
+ import type { Command } from 'commander';
267
+ import { {{Feature}}Service } from '../../{{feature}}/index.js';
268
+
269
+ /**
270
+ * Register {{feature}} command
271
+ *
272
+ * @see REQ-CLI-001
273
+ * @see Article II: CLI Interface Mandate
274
+ */
275
+ export function register{{Feature}}Command(program: Command): void {
276
+ program
277
+ .command('{{feature}}')
278
+ .description('{{Feature description}}')
279
+ .argument('<input>', 'Input file or value')
280
+ .option('-o, --output <path>', 'Output path')
281
+ .option('--json', 'Output as JSON')
282
+ .action(async (input, options) => {
283
+ const service = new {{Feature}}Service();
284
+ const result = await service.process({ input, ...options });
285
+
286
+ if (options.json) {
287
+ console.log(JSON.stringify(result, null, 2));
288
+ } else {
289
+ console.log(result);
290
+ }
291
+ });
292
+ }
293
+ ```
294
+
295
+ **Register in CLI**:
296
+
297
+ ```typescript
298
+ // packages/core/src/cli/index.ts
299
+
300
+ import { register{{Feature}}Command } from './commands/{{feature}}.js';
301
+
302
+ // In setupCommands function:
303
+ register{{Feature}}Command(program);
304
+ ```
305
+
306
+ ---
307
+
308
+ #### TSK-006: MCP Tool (if needed)
309
+
310
+ **Create MCP tool**:
311
+
312
+ ```typescript
313
+ // packages/mcp-server/src/tools/{{feature}}-tools.ts
314
+
315
+ import type { ToolDefinition, ToolResult } from '../types.js';
316
+
317
+ /**
318
+ * {{Feature}} Tool
319
+ *
320
+ * @see REQ-MCP-001
321
+ */
322
+ export const {{feature}}Tool: ToolDefinition = {
323
+ name: 'sdd_{{feature}}',
324
+ description: '{{Feature description}}',
325
+ inputSchema: {
326
+ type: 'object',
327
+ properties: {
328
+ input: {
329
+ type: 'string',
330
+ description: 'Input value',
331
+ },
332
+ },
333
+ required: ['input'],
334
+ },
335
+ handler: async (args): Promise<ToolResult> => {
336
+ const { input } = args as { input: string };
337
+
338
+ // Implementation
339
+ return {
340
+ content: [{ type: 'text', text: `Processed: ${input}` }],
341
+ };
342
+ },
343
+ };
344
+ ```
345
+
346
+ ---
347
+
348
+ ### 5. Validation Commands
349
+
350
+ ```bash
351
+ # Run all tests
352
+ npm test
353
+
354
+ # Type check
355
+ npm run typecheck
356
+
357
+ # Lint
358
+ npm run lint
359
+
360
+ # Build
361
+ npm run build
362
+ ```
363
+
364
+ ---
365
+
366
+ ### 6. Git Workflow
367
+
368
+ ```bash
369
+ # RED phase
370
+ git add packages/core/__tests__/
371
+ git commit -m "test: add failing tests for REQ-{{COMPONENT}}-001"
372
+
373
+ # GREEN phase
374
+ git add packages/core/src/{{feature}}/
375
+ git commit -m "feat: implement REQ-{{COMPONENT}}-001"
376
+
377
+ # BLUE phase
378
+ git commit -m "refactor: improve {{feature}} implementation"
379
+
380
+ # CLI
381
+ git commit -m "feat: add {{feature}} CLI command (Article II)"
382
+ ```
383
+
384
+ ---
385
+
386
+ **MUSUBIX**: https://github.com/nahisaho/MUSUBIX
387
+ **Version**: 1.0.0
@@ -0,0 +1,193 @@
1
+ # MUSUBIX Requirements Command
2
+
3
+ Create EARS-format requirements specification through interactive dialogue.
4
+
5
+ ---
6
+
7
+ ## Instructions for AI Agent
8
+
9
+ You are executing the `musubix requirements [feature-name]` command to create a requirements specification.
10
+
11
+ ### Command Format
12
+
13
+ ```bash
14
+ npx musubix requirements analyze authentication
15
+ npx musubix requirements validate spec.md
16
+ npx musubix requirements map spec.md
17
+ ```
18
+
19
+ ### Your Task
20
+
21
+ **CRITICAL**: Before generating requirements, engage in an interactive 1-on-1 dialogue with the user to uncover the TRUE PURPOSE behind their request.
22
+
23
+ ### Output Directory
24
+
25
+ **Requirements documents are saved to**: `storage/specs/`
26
+
27
+ - File: `storage/specs/REQ-{{FEATURE}}-001.md`
28
+
29
+ ---
30
+
31
+ ## Process
32
+
33
+ ### 1. Read Steering Context (Article VI)
34
+
35
+ **IMPORTANT**: Before starting, read steering files to understand project context:
36
+
37
+ ```bash
38
+ # Read these files first
39
+ steering/product.ja.md # Business context, users, goals
40
+ steering/structure.ja.md # Architecture patterns
41
+ steering/tech.ja.md # Technology stack
42
+ ```
43
+
44
+ **Extract**:
45
+
46
+ - Target users
47
+ - Product goals
48
+ - Existing architecture patterns
49
+ - Technology constraints (TypeScript, Node.js 20+)
50
+
51
+ ---
52
+
53
+ ### 2. Interactive True Purpose Discovery
54
+
55
+ **CRITICAL RULE**: Ask ONE question at a time, then STOP and WAIT.
56
+
57
+ #### Question Sequence
58
+
59
+ **Turn 1**: WHY question
60
+ ```
61
+ この機能で解決したい『本当の課題』は何ですか?
62
+ ```
63
+
64
+ **Turn 2**: WHO question
65
+ ```
66
+ この機能を最も必要としているのは誰ですか?
67
+ ```
68
+
69
+ **Turn 3**: WHAT-IF question
70
+ ```
71
+ もしこの機能が完璧に動作したら、何が変わりますか?
72
+ ```
73
+
74
+ **Turn 4**: CONSTRAINT question
75
+ ```
76
+ この機能で『絶対にやってはいけないこと』はありますか?
77
+ ```
78
+
79
+ **Turn 5**: SUCCESS CRITERIA question
80
+ ```
81
+ この機能が『成功した』と言えるのはどんな状態ですか?
82
+ ```
83
+
84
+ ---
85
+
86
+ ### 3. Apply EARS Format (Article IV)
87
+
88
+ **CRITICAL**: All requirements MUST use one of 5 EARS patterns.
89
+
90
+ | Pattern | Syntax | Usage |
91
+ |---------|--------|-------|
92
+ | **Ubiquitous** | `The [system] SHALL [action]` | Always-active features |
93
+ | **Event-driven** | `WHEN [event], the [system] SHALL [action]` | User action triggers |
94
+ | **State-driven** | `WHILE [state], the [system] SHALL [action]` | Continuous conditions |
95
+ | **Unwanted** | `IF [error], THEN the [system] SHALL [action]` | Error handling |
96
+ | **Optional** | `WHERE [feature], the [system] SHALL [action]` | Feature flags |
97
+
98
+ ---
99
+
100
+ ### 4. Generate Requirements Document
101
+
102
+ **Template**:
103
+
104
+ ```markdown
105
+ # Requirements Specification: {{FEATURE_NAME}}
106
+
107
+ **Document ID**: REQ-{{FEATURE}}-001
108
+ **Version**: 1.0.0
109
+ **Date**: {{DATE}}
110
+ **Status**: Draft
111
+
112
+ ## Overview
113
+
114
+ - **Purpose**: [True purpose discovered through dialogue]
115
+ - **Scope**: [In/Out scope]
116
+ - **Package**: packages/core/ or packages/mcp-server/ or packages/yata-client/
117
+
118
+ ## Stakeholders
119
+
120
+ | Role | Description | Needs |
121
+ |------|-------------|-------|
122
+ | Developer | Uses MUSUBIX CLI | Efficient workflow |
123
+
124
+ ## Functional Requirements
125
+
126
+ ### REQ-{{COMPONENT}}-001: [Title]
127
+
128
+ **EARS Pattern**: [Pattern name]
129
+
130
+ > [EARS statement]
131
+
132
+ **Priority**: P0/P1/P2/P3
133
+ **Acceptance Criteria**:
134
+ - [ ] [Criterion 1]
135
+ - [ ] [Criterion 2]
136
+
137
+ **Traceability**: → DES-{{FEATURE}}-001
138
+
139
+ ## Non-Functional Requirements
140
+
141
+ ### REQ-PERF-001: Performance
142
+ The system SHALL respond within 200ms for 95% of requests.
143
+
144
+ ### REQ-SEC-001: Security
145
+ The system SHALL prevent OWASP Top 10 vulnerabilities.
146
+
147
+ ## Traceability Matrix
148
+
149
+ | Requirement | Design | Task | Test |
150
+ |-------------|--------|------|------|
151
+ | REQ-{{COMPONENT}}-001 | DES-{{FEATURE}}-001 | TSK-{{FEATURE}}-001 | TBD |
152
+ ```
153
+
154
+ ---
155
+
156
+ ### 5. Requirements ID Format
157
+
158
+ **Format**: `REQ-[COMPONENT]-[NUMBER]`
159
+
160
+ **Examples**:
161
+ - `REQ-CLI-001` - CLI component
162
+ - `REQ-MCP-001` - MCP Server component
163
+ - `REQ-YATA-001` - YATA Client component
164
+ - `REQ-CORE-001` - Core library component
165
+
166
+ ---
167
+
168
+ ### 6. Quality Checklist
169
+
170
+ Each requirement MUST have:
171
+
172
+ - [ ] Unique ID (REQ-COMPONENT-NNN)
173
+ - [ ] EARS pattern (one of 5)
174
+ - [ ] Clear SHALL statement
175
+ - [ ] Testable acceptance criteria
176
+ - [ ] Priority (P0/P1/P2/P3)
177
+ - [ ] Status (Draft initially)
178
+
179
+ ---
180
+
181
+ ### 7. MCP Tool Integration
182
+
183
+ Use MUSUBIX MCP tools:
184
+
185
+ ```
186
+ sdd_create_requirements - Create requirements document
187
+ sdd_validate_requirements - Validate EARS patterns
188
+ ```
189
+
190
+ ---
191
+
192
+ **MUSUBIX**: https://github.com/nahisaho/MUSUBIX
193
+ **Version**: 1.0.0
@@ -0,0 +1,155 @@
1
+ # MUSUBIX Code Review Command
2
+
3
+ Perform comprehensive code review with SOLID principles and quality checks.
4
+
5
+ ---
6
+
7
+ ## Instructions for AI Agent
8
+
9
+ You are executing the `musubix review [feature-name]` command to perform code review.
10
+
11
+ ### Command Format
12
+
13
+ ```bash
14
+ npx musubix codegen analyze <file>
15
+ npx musubix trace validate
16
+ ```
17
+
18
+ ### Your Task
19
+
20
+ Perform comprehensive code review focusing on:
21
+
22
+ 1. SOLID Principles Compliance
23
+ 2. Code Quality Metrics
24
+ 3. Design Pattern Usage
25
+ 4. Traceability Verification
26
+ 5. Best Practices Adherence
27
+
28
+ ---
29
+
30
+ ## Process
31
+
32
+ ### 1. Read Source Code and Context
33
+
34
+ ```bash
35
+ # Source Code
36
+ packages/core/src/{{feature}}/**/*.ts
37
+ packages/mcp-server/src/tools/**/*.ts
38
+
39
+ # Design Documentation
40
+ storage/specs/DES-{{FEATURE}}-001.md
41
+
42
+ # Steering Context
43
+ steering/structure.ja.md
44
+ steering/tech.ja.md
45
+ steering/rules/constitution.md
46
+ ```
47
+
48
+ ### 2. SOLID Principles Check
49
+
50
+ Review each file for:
51
+
52
+ | Principle | Check |
53
+ |-----------|-------|
54
+ | **S**ingle Responsibility | 1つのクラス/関数は1つの責務のみ |
55
+ | **O**pen/Closed | 拡張に開き、修正に閉じている |
56
+ | **L**iskov Substitution | 派生クラスは基底クラスと置換可能 |
57
+ | **I**nterface Segregation | クライアント固有のインターフェース |
58
+ | **D**ependency Inversion | 抽象に依存、具象に依存しない |
59
+
60
+ ### 3. Code Quality Metrics
61
+
62
+ Analyze:
63
+
64
+ - **Cyclomatic Complexity**: 関数あたり10以下
65
+ - **Lines per Function**: 50行以下
66
+ - **Lines per File**: 300行以下
67
+ - **Nesting Depth**: 3レベル以下
68
+ - **Parameter Count**: 5個以下
69
+
70
+ ### 4. Design Pattern Review
71
+
72
+ Check for:
73
+
74
+ - [ ] Repository Pattern (データアクセス)
75
+ - [ ] Service Layer (ビジネスロジック)
76
+ - [ ] Factory Pattern (オブジェクト生成)
77
+ - [ ] Value Objects (ドメイン概念)
78
+ - [ ] Result Type (エラーハンドリング)
79
+
80
+ ### 5. Best Practices Check
81
+
82
+ | カテゴリ | チェック項目 |
83
+ |---------|-------------|
84
+ | 命名規則 | PascalCase (型), camelCase (変数/関数), UPPER_CASE (定数) |
85
+ | TypeScript | strict mode, 明示的な型定義, any禁止 |
86
+ | エラー処理 | Result<T, E>パターン, 適切なエラーメッセージ |
87
+ | コメント | JSDoc形式, 複雑なロジックの説明 |
88
+ | インポート | 絶対パス, 循環参照なし |
89
+
90
+ ---
91
+
92
+ ## Output Format
93
+
94
+ ```markdown
95
+ # Code Review Report: {{FEATURE}}
96
+
97
+ ## Summary
98
+ - **Overall Score**: A/B/C/D/F
99
+ - **Files Reviewed**: X files
100
+ - **Issues Found**: X critical, X warnings, X suggestions
101
+
102
+ ## SOLID Compliance
103
+ | Principle | Status | Notes |
104
+ |-----------|--------|-------|
105
+ | SRP | ✅/⚠️/❌ | ... |
106
+ | OCP | ✅/⚠️/❌ | ... |
107
+ | LSP | ✅/⚠️/❌ | ... |
108
+ | ISP | ✅/⚠️/❌ | ... |
109
+ | DIP | ✅/⚠️/❌ | ... |
110
+
111
+ ## Quality Metrics
112
+ | Metric | Value | Status |
113
+ |--------|-------|--------|
114
+ | Avg Cyclomatic Complexity | X | ✅/⚠️/❌ |
115
+ | Max Lines per Function | X | ✅/⚠️/❌ |
116
+ | Max Nesting Depth | X | ✅/⚠️/❌ |
117
+
118
+ ## Issues
119
+
120
+ ### Critical (Must Fix)
121
+ 1. [FILE:LINE] Description
122
+
123
+ ### Warnings (Should Fix)
124
+ 1. [FILE:LINE] Description
125
+
126
+ ### Suggestions (Nice to Have)
127
+ 1. [FILE:LINE] Description
128
+
129
+ ## Recommendations
130
+ 1. ...
131
+ 2. ...
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Traceability
137
+
138
+ This skill implements:
139
+ - **Article III**: Test-First Imperative (コードレビューによる品質確保)
140
+ - **Article VII**: Simplicity Gate (コードの複雑性チェック)
141
+
142
+ ---
143
+
144
+ ## Related Commands
145
+
146
+ ```bash
147
+ # Static analysis
148
+ npx musubix codegen analyze <file>
149
+
150
+ # Traceability validation
151
+ npx musubix trace validate
152
+
153
+ # Security scanning
154
+ npx musubix codegen security <path>
155
+ ```