musubix 2.1.0 → 2.2.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 (70) hide show
  1. package/README.md +44 -310
  2. package/bin/musubix.js +4 -12
  3. package/dist/index.d.ts +25 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +73 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +49 -72
  8. package/.github/AGENTS.md +0 -242
  9. package/.github/prompts/sdd-change-apply.prompt.md +0 -283
  10. package/.github/prompts/sdd-change-archive.prompt.md +0 -241
  11. package/.github/prompts/sdd-change-init.prompt.md +0 -269
  12. package/.github/prompts/sdd-design.prompt.md +0 -250
  13. package/.github/prompts/sdd-implement.prompt.md +0 -387
  14. package/.github/prompts/sdd-requirements.prompt.md +0 -193
  15. package/.github/prompts/sdd-review.prompt.md +0 -155
  16. package/.github/prompts/sdd-security.prompt.md +0 -228
  17. package/.github/prompts/sdd-steering.prompt.md +0 -269
  18. package/.github/prompts/sdd-tasks.prompt.md +0 -255
  19. package/.github/prompts/sdd-test.prompt.md +0 -230
  20. package/.github/prompts/sdd-validate.prompt.md +0 -304
  21. package/.github/skills/musubix-adr-generation/SKILL.md +0 -209
  22. package/.github/skills/musubix-best-practices/SKILL.md +0 -315
  23. package/.github/skills/musubix-c4-design/SKILL.md +0 -162
  24. package/.github/skills/musubix-code-generation/SKILL.md +0 -229
  25. package/.github/skills/musubix-domain-inference/SKILL.md +0 -196
  26. package/.github/skills/musubix-ears-validation/SKILL.md +0 -161
  27. package/.github/skills/musubix-sdd-workflow/SKILL.md +0 -210
  28. package/.github/skills/musubix-test-generation/SKILL.md +0 -212
  29. package/.github/skills/musubix-traceability/SKILL.md +0 -141
  30. package/AGENTS.md +0 -622
  31. package/LICENSE +0 -21
  32. package/README.ja.md +0 -302
  33. package/bin/musubix-mcp.js +0 -19
  34. package/docs/API-REFERENCE.md +0 -1425
  35. package/docs/GITHUB-ACTIONS-NPM-SETUP.md +0 -132
  36. package/docs/INSTALL-GUIDE.ja.md +0 -459
  37. package/docs/INSTALL-GUIDE.md +0 -459
  38. package/docs/MUSUBI-enhancement_roadmap_20260105.md +0 -651
  39. package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +0 -291
  40. package/docs/ROADMAP-v1.5.md +0 -116
  41. package/docs/SwarmCoding.md +0 -1284
  42. package/docs/Test-prompt.md +0 -105
  43. package/docs/USER-GUIDE-v1.8.0.md +0 -2371
  44. package/docs/USER-GUIDE.ja.md +0 -2147
  45. package/docs/USER-GUIDE.md +0 -2652
  46. package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +0 -75
  47. package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +0 -79
  48. package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +0 -90
  49. package/docs/evolution-from-musubi-to-musubix.md +0 -2168
  50. package/docs/getting-started-with-sdd.md +0 -1602
  51. package/docs/overview/MUSUBIX-Core.md +0 -671
  52. package/docs/overview/MUSUBIX-FormalVerify.md +0 -566
  53. package/docs/overview/MUSUBIX-Learning.md +0 -837
  54. package/docs/overview/MUSUBIX-MCP-Server.md +0 -535
  55. package/docs/overview/MUSUBIX-Overview.md +0 -264
  56. package/docs/overview/MUSUBIX-Phase1-Complete.md +0 -271
  57. package/docs/overview/MUSUBIX-Phase2-Complete.md +0 -310
  58. package/docs/overview/MUSUBIX-Roadmap-v2.md +0 -399
  59. package/docs/overview/MUSUBIX-Security-Plan.md +0 -939
  60. package/docs/overview/MUSUBIX-Security.md +0 -891
  61. package/docs/overview/MUSUBIX-YATA.md +0 -666
  62. package/docs/overview/Neuro-SymbolicAI.md +0 -159
  63. package/scripts/generate-quality-gate-report.ts +0 -106
  64. package/scripts/postinstall.js +0 -94
  65. package/steering/.musubi-version +0 -1
  66. package/steering/product.ja.md +0 -572
  67. package/steering/project.yml +0 -66
  68. package/steering/rules/constitution.md +0 -412
  69. package/steering/structure.ja.md +0 -503
  70. package/steering/tech.ja.md +0 -208
@@ -1,210 +0,0 @@
1
- ---
2
- name: musubix-sdd-workflow
3
- description: Guide for MUSUBIX SDD (Specification-Driven Development) workflow. Use this when asked to develop features using MUSUBIX methodology, create requirements, designs, or implement code following the 9 constitutional articles.
4
- license: MIT
5
- ---
6
-
7
- # MUSUBIX SDD Workflow Skill
8
-
9
- This skill guides you through the complete SDD workflow for MUSUBIX projects.
10
-
11
- ## Prerequisites
12
-
13
- Before starting any development task:
14
-
15
- 1. Read `steering/` directory for project context
16
- 2. Check `steering/rules/constitution.md` for the 9 constitutional articles
17
- 3. Review existing specs in `storage/specs/`
18
-
19
- ## Complete Workflow
20
-
21
- ### Phase 1: Requirements Definition
22
-
23
- #### Step 1: Create Requirements Document (Article IV - EARS Format)
24
-
25
- Create requirements using EARS patterns:
26
-
27
- ```markdown
28
- # REQ-[CATEGORY]-[NUMBER]
29
-
30
- **種別**: [UBIQUITOUS|EVENT-DRIVEN|STATE-DRIVEN|UNWANTED|OPTIONAL]
31
- **優先度**: [P0|P1|P2]
32
-
33
- **要件**:
34
- [EARS形式の要件文]
35
-
36
- **トレーサビリティ**: DES-XXX, TEST-XXX
37
- ```
38
-
39
- EARS Patterns:
40
- - **Ubiquitous**: `THE [system] SHALL [requirement]`
41
- - **Event-driven**: `WHEN [event], THE [system] SHALL [response]`
42
- - **State-driven**: `WHILE [state], THE [system] SHALL [response]`
43
- - **Unwanted**: `THE [system] SHALL NOT [behavior]`
44
- - **Optional**: `IF [condition], THEN THE [system] SHALL [response]`
45
-
46
- #### Step 2-3: Requirements Review Loop
47
-
48
- Review requirements for:
49
- - EARS format compliance
50
- - Completeness and clarity
51
- - Testability
52
- - Traceability readiness
53
-
54
- **Repeat until no issues remain.**
55
-
56
- ### Phase 2: Design
57
-
58
- #### Step 4: Create Design Document (Article VII - Design Patterns)
59
-
60
- Create C4 model design documents:
61
-
62
- 1. **Context Level**: System boundaries and external actors
63
- 2. **Container Level**: Technology choices and container composition
64
- 3. **Component Level**: Internal structure of containers
65
- 4. **Code Level**: Implementation details
66
-
67
- Design document template:
68
- ```markdown
69
- # DES-[CATEGORY]-[NUMBER]
70
-
71
- ## トレーサビリティ
72
- - 要件: REQ-XXX
73
-
74
- ## C4モデル
75
- ### Level 2: Container
76
- [PlantUML diagram]
77
-
78
- ## コンポーネント設計
79
- [Component details]
80
- ```
81
-
82
- #### Step 5-6: Design Review Loop
83
-
84
- Review design for:
85
- - Requirement coverage
86
- - SOLID principles compliance
87
- - Design pattern appropriateness
88
- - Traceability to requirements
89
-
90
- **Repeat until no issues remain.**
91
-
92
- ### Phase 3: Task Decomposition
93
-
94
- #### Step 7: Generate Tasks
95
-
96
- Generate implementation tasks from design:
97
-
98
- ```markdown
99
- # TSK-[CATEGORY]-[NUMBER]
100
-
101
- ## 関連設計: DES-XXX
102
- ## 関連要件: REQ-XXX
103
-
104
- ## タスク内容
105
- [Implementation task description]
106
-
107
- ## 受入基準
108
- - [ ] Criterion 1
109
- - [ ] Criterion 2
110
-
111
- ## 見積もり
112
- [4時間以内を推奨]
113
- ```
114
-
115
- #### Step 8-9: Task Review Loop
116
-
117
- Review tasks for:
118
- - Appropriate granularity (≤4 hours)
119
- - Clear acceptance criteria
120
- - Complete traceability chain
121
-
122
- **Repeat until no issues remain.**
123
-
124
- ### Phase 4: Implementation
125
-
126
- #### Step 10: Coding & Unit Testing (Article III - Test-First)
127
-
128
- For each task, follow Red-Green-Blue cycle:
129
-
130
- 1. **Red**: Write failing test first
131
- 2. **Green**: Write minimal code to pass
132
- 3. **Blue**: Refactor while keeping tests green
133
-
134
- Add requirement IDs in code comments:
135
- ```typescript
136
- /**
137
- * @see REQ-INT-001 - Neuro-Symbolic Integration
138
- */
139
- ```
140
-
141
- #### Step 11: Integration Testing
142
-
143
- When required by the task:
144
- - Run integration tests
145
- - Verify component interactions
146
- - Ensure end-to-end flows work correctly
147
-
148
- ### Phase 5: Documentation & Completion
149
-
150
- #### Step 12: Update CHANGELOG.md
151
-
152
- Document all changes:
153
- - New features
154
- - Bug fixes
155
- - Breaking changes
156
- - Migration notes
157
-
158
- #### Step 13: Update Other Documentation
159
-
160
- If necessary, update:
161
- - README.md
162
- - USER-GUIDE.md
163
- - API-REFERENCE.md
164
- - AGENTS.md
165
-
166
- #### Step 14: Git Commit & Push
167
-
168
- ```bash
169
- git add .
170
- git commit -m "feat/fix/chore: description"
171
- git push
172
- ```
173
-
174
- ## Traceability Validation (Article V)
175
-
176
- Ensure 100% traceability throughout:
177
- ```
178
- REQ-* → DES-* → TSK-* → Code → Test
179
- ```
180
-
181
- ## CLI Commands
182
-
183
- ```bash
184
- # Requirements
185
- npx musubix requirements analyze <file>
186
- npx musubix requirements validate <file>
187
-
188
- # Design
189
- npx musubix design generate <file>
190
- npx musubix design patterns <context>
191
-
192
- # Code Generation
193
- npx musubix codegen generate <file>
194
-
195
- # Traceability
196
- npx musubix trace matrix
197
- npx musubix trace validate
198
- ```
199
-
200
- ## Constitutional Articles Checklist
201
-
202
- - [ ] **Article I**: Library-First - Is this a standalone library?
203
- - [ ] **Article II**: CLI Interface - Does it expose CLI?
204
- - [ ] **Article III**: Test-First - Are tests written first?
205
- - [ ] **Article IV**: EARS Format - Are requirements in EARS?
206
- - [ ] **Article V**: Traceability - Is everything traceable?
207
- - [ ] **Article VI**: Project Memory - Did you check steering/?
208
- - [ ] **Article VII**: Design Patterns - Are patterns documented?
209
- - [ ] **Article VIII**: Decision Records - Is ADR created?
210
- - [ ] **Article IX**: Quality Gates - Are quality checks passed?
@@ -1,212 +0,0 @@
1
- ---
2
- name: musubix-test-generation
3
- description: Guide for generating test code from designs and requirements. Use this when asked to create unit tests, integration tests, or test coverage analysis following TDD/BDD practices.
4
- license: MIT
5
- ---
6
-
7
- # MUSUBIX Test Generation Skill
8
-
9
- This skill guides you through generating comprehensive test suites that maintain traceability.
10
-
11
- ## Overview
12
-
13
- MUSUBIX follows **Article III - Test-First**: Red-Green-Blue TDD cycle.
14
-
15
- ```mermaid
16
- flowchart LR
17
- RED[🔴 Red<br/>Failing Test] --> GREEN[🟢 Green<br/>Minimal Code]
18
- GREEN --> BLUE[🔵 Blue<br/>Refactor]
19
- BLUE --> RED
20
- ```
21
-
22
- ## Test Structure
23
-
24
- ### Unit Test Template
25
-
26
- ```typescript
27
- /**
28
- * @requirement REQ-XXX-NNN
29
- * @design DES-XXX-NNN
30
- */
31
- import { describe, it, expect, beforeEach } from 'vitest';
32
- import { XxxService } from './xxx-service.js';
33
- import { resetXxxCounter } from './xxx-entity.js';
34
-
35
- describe('XxxService', () => {
36
- let service: XxxService;
37
- let repository: MockXxxRepository;
38
-
39
- beforeEach(() => {
40
- // BP-TEST-001: Reset counters before each test
41
- resetXxxCounter();
42
- repository = new MockXxxRepository();
43
- service = new XxxService(repository);
44
- });
45
-
46
- describe('create', () => {
47
- it('should create entity with valid input', async () => {
48
- // Arrange
49
- const input = { name: 'Test', value: 100 };
50
-
51
- // Act
52
- const result = await service.create(input);
53
-
54
- // Assert
55
- expect(result.isOk()).toBe(true);
56
- if (result.isOk()) {
57
- expect(result.value.name).toBe('Test');
58
- }
59
- });
60
-
61
- it('should return error for invalid input', async () => {
62
- // Arrange
63
- const input = { name: '', value: -1 };
64
-
65
- // Act
66
- const result = await service.create(input);
67
-
68
- // Assert
69
- expect(result.isErr()).toBe(true);
70
- });
71
- });
72
- });
73
- ```
74
-
75
- ### Integration Test Template
76
-
77
- ```typescript
78
- /**
79
- * @requirement REQ-XXX-NNN
80
- * @design DES-XXX-NNN
81
- */
82
- import { describe, it, expect, beforeAll, afterAll } from 'vitest';
83
-
84
- describe('XxxService Integration', () => {
85
- beforeAll(async () => {
86
- // Setup test environment
87
- });
88
-
89
- afterAll(async () => {
90
- // Cleanup
91
- });
92
-
93
- it('should complete full workflow', async () => {
94
- // Test full user journey
95
- });
96
- });
97
- ```
98
-
99
- ## Best Practices for Testing
100
-
101
- ### BP-TEST-001: Test Counter Reset
102
-
103
- ```typescript
104
- beforeEach(() => {
105
- resetPetCounter(); // Reset ID counters
106
- resetReservationCounter();
107
- });
108
- ```
109
-
110
- ### BP-TEST-002: Verify API Before Test
111
-
112
- ```typescript
113
- // ✅ Check actual API signature first
114
- const service = new PetService(repository);
115
- // Verify method exists and parameters match
116
- ```
117
-
118
- ### BP-TEST-004: Result Type Test Pattern
119
-
120
- ```typescript
121
- // ✅ Test both success and failure cases
122
- it('should handle success', async () => {
123
- const result = await service.create(validInput);
124
- expect(result.isOk()).toBe(true);
125
- if (result.isOk()) {
126
- expect(result.value.id).toBeDefined();
127
- }
128
- });
129
-
130
- it('should handle failure', async () => {
131
- const result = await service.create(invalidInput);
132
- expect(result.isErr()).toBe(true);
133
- if (result.isErr()) {
134
- expect(result.error.message).toContain('validation');
135
- }
136
- });
137
- ```
138
-
139
- ### BP-TEST-005: Status Transition Testing
140
-
141
- ```typescript
142
- describe('status transitions', () => {
143
- // Valid transitions
144
- it('should allow draft -> active', () => {
145
- const result = workflow.transition('draft', 'activate');
146
- expect(result).toBe('active');
147
- });
148
-
149
- // Invalid transitions
150
- it('should reject completed -> draft', () => {
151
- expect(() => workflow.transition('completed', 'revert'))
152
- .toThrow('Invalid transition');
153
- });
154
- });
155
- ```
156
-
157
- ## Test Categories
158
-
159
- | Category | Purpose | Location |
160
- |----------|---------|----------|
161
- | Unit | Single component | `__tests__/unit/` |
162
- | Integration | Multiple components | `__tests__/integration/` |
163
- | E2E | Full user flows | `__tests__/e2e/` |
164
-
165
- ## CLI Commands
166
-
167
- ```bash
168
- # Generate tests from design
169
- npx musubix test generate storage/design/DES-XXX.md
170
-
171
- # Run all tests
172
- npm test
173
-
174
- # Coverage report
175
- npx musubix test coverage src/
176
-
177
- # Run specific test file
178
- npm test -- xxx.test.ts
179
- ```
180
-
181
- ## Vitest Configuration
182
-
183
- ```typescript
184
- // vitest.config.ts
185
- import { defineConfig } from 'vitest/config';
186
-
187
- export default defineConfig({
188
- test: {
189
- globals: true,
190
- environment: 'node',
191
- include: ['**/*.test.ts'],
192
- coverage: {
193
- provider: 'v8',
194
- reporter: ['text', 'json', 'html'],
195
- },
196
- },
197
- });
198
- ```
199
-
200
- ## Coverage Targets
201
-
202
- | Metric | Target |
203
- |--------|--------|
204
- | Line Coverage | ≥80% |
205
- | Branch Coverage | ≥75% |
206
- | Function Coverage | ≥90% |
207
-
208
- ## Related Skills
209
-
210
- - `musubix-sdd-workflow` - Full SDD workflow with TDD
211
- - `musubix-code-generation` - Generate code to test
212
- - `musubix-traceability` - Link tests to requirements
@@ -1,141 +0,0 @@
1
- ---
2
- name: musubix-traceability
3
- description: Guide for managing traceability between requirements, designs, code, and tests. Use this when asked to verify traceability, create traceability matrices, or perform impact analysis.
4
- license: MIT
5
- ---
6
-
7
- # MUSUBIX Traceability Skill
8
-
9
- This skill guides you through maintaining full traceability across the development lifecycle.
10
-
11
- ## Overview
12
-
13
- MUSUBIX enforces **Article V - Traceability**: Complete bidirectional tracing between:
14
-
15
- ```
16
- Requirements (REQ-*) ↔ Design (DES-*) ↔ Tasks (TSK-*) ↔ Code ↔ Tests
17
- ```
18
-
19
- ## Traceability Matrix
20
-
21
- ### Creating a Traceability Matrix
22
-
23
- ```markdown
24
- # Traceability Matrix
25
-
26
- | 要件ID | 設計ID | タスクID | コード | テスト |
27
- |--------|--------|---------|--------|--------|
28
- | REQ-AUTH-001 | DES-AUTH-001 | TSK-001 | src/auth/auth-service.ts | auth.test.ts |
29
- | REQ-AUTH-002 | DES-AUTH-001 | TSK-002 | src/auth/token-manager.ts | token.test.ts |
30
- ```
31
-
32
- ### CLI Commands
33
-
34
- ```bash
35
- # Generate traceability matrix
36
- npx musubix trace matrix
37
-
38
- # Impact analysis for a specific requirement
39
- npx musubix trace impact REQ-AUTH-001
40
-
41
- # Validate all traceability links
42
- npx musubix trace validate
43
- ```
44
-
45
- ## Traceability in Code
46
-
47
- ### Adding Traceability Comments
48
-
49
- ```typescript
50
- /**
51
- * AuthService - 認証サービス
52
- * @requirement REQ-AUTH-001
53
- * @design DES-AUTH-001
54
- * @task TSK-001
55
- */
56
- export class AuthService {
57
- /**
58
- * ユーザー認証
59
- * @requirement REQ-AUTH-001
60
- */
61
- async authenticate(credentials: Credentials): Promise<Result<Token, AuthError>> {
62
- // Implementation
63
- }
64
- }
65
- ```
66
-
67
- ### Test Traceability
68
-
69
- ```typescript
70
- /**
71
- * @requirement REQ-AUTH-001
72
- * @design DES-AUTH-001
73
- */
74
- describe('AuthService', () => {
75
- describe('authenticate', () => {
76
- it('should return token for valid credentials', async () => {
77
- // Test implementation
78
- });
79
- });
80
- });
81
- ```
82
-
83
- ## Impact Analysis
84
-
85
- When a requirement changes, identify all affected artifacts:
86
-
87
- ```mermaid
88
- flowchart LR
89
- REQ[REQ-AUTH-001<br/>変更] --> DES[DES-AUTH-001<br/>設計]
90
- DES --> TSK1[TSK-001<br/>タスク]
91
- DES --> TSK2[TSK-002<br/>タスク]
92
- TSK1 --> CODE1[auth-service.ts]
93
- TSK2 --> CODE2[token-manager.ts]
94
- CODE1 --> TEST1[auth.test.ts]
95
- CODE2 --> TEST2[token.test.ts]
96
- ```
97
-
98
- ### Impact Analysis Steps
99
-
100
- 1. Identify changed requirement (REQ-*)
101
- 2. Find linked designs (DES-*)
102
- 3. Find linked tasks (TSK-*)
103
- 4. Locate affected code files
104
- 5. Identify tests to update
105
- 6. Update all artifacts
106
-
107
- ## Traceability Storage
108
-
109
- ```
110
- storage/traceability/
111
- ├── matrix.json # Full traceability matrix
112
- ├── requirements-map.json # REQ -> DES mappings
113
- ├── design-map.json # DES -> TSK mappings
114
- └── code-map.json # TSK -> Code mappings
115
- ```
116
-
117
- ## Verification Checklist
118
-
119
- Before completing any feature:
120
-
121
- - [ ] All requirements have linked designs
122
- - [ ] All designs have linked tasks
123
- - [ ] All tasks have linked code
124
- - [ ] All code has linked tests
125
- - [ ] Traceability comments in code
126
- - [ ] Matrix updated
127
-
128
- ## MCP Tool
129
-
130
- Use MCP tool for automated validation:
131
-
132
- ```
133
- Tool: sdd_validate_traceability
134
- Description: Validates bidirectional traceability across all artifacts
135
- ```
136
-
137
- ## Related Skills
138
-
139
- - `musubix-sdd-workflow` - Full SDD workflow
140
- - `musubix-ears-validation` - Requirements validation
141
- - `musubix-test-generation` - Generate tests with traceability