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,230 +0,0 @@
1
- # MUSUBIX Test Generation Command
2
-
3
- Generate comprehensive tests following Test-First (Red-Green-Blue) methodology.
4
-
5
- ---
6
-
7
- ## Instructions for AI Agent
8
-
9
- You are executing the `musubix test [feature-name]` command to generate tests.
10
-
11
- ### Command Format
12
-
13
- ```bash
14
- npx musubix test generate <file>
15
- npx musubix test coverage <dir>
16
- ```
17
-
18
- ### Your Task
19
-
20
- Generate comprehensive tests following:
21
-
22
- 1. Test-First (Red-Green-Blue) methodology
23
- 2. EARS requirements coverage
24
- 3. Result Type testing patterns
25
- 4. Status transition testing
26
-
27
- ---
28
-
29
- ## Process
30
-
31
- ### 1. Read Requirements and Design
32
-
33
- ```bash
34
- # Requirements (for test cases)
35
- storage/specs/REQ-{{FEATURE}}-001.md
36
-
37
- # Design (for component structure)
38
- storage/specs/DES-{{FEATURE}}-001.md
39
-
40
- # Existing implementation
41
- packages/core/src/{{feature}}/**/*.ts
42
- ```
43
-
44
- ### 2. Test Categories
45
-
46
- Generate tests for each category:
47
-
48
- | Category | Coverage Target | Priority |
49
- |----------|-----------------|----------|
50
- | Unit Tests | Functions, Value Objects | P0 |
51
- | Integration Tests | Services, Repositories | P0 |
52
- | E2E Tests | Full workflows | P1 |
53
- | Edge Cases | Boundary conditions | P0 |
54
- | Error Cases | Error handling | P0 |
55
-
56
- ### 3. Test Structure
57
-
58
- ```typescript
59
- import { describe, it, expect, beforeEach } from 'vitest';
60
-
61
- describe('FeatureName', () => {
62
- beforeEach(() => {
63
- // Reset counters for deterministic IDs
64
- resetFeatureCounter();
65
- });
66
-
67
- describe('creation', () => {
68
- it('should create valid entity', () => {
69
- // Arrange
70
- const input = { ... };
71
-
72
- // Act
73
- const result = createEntity(input);
74
-
75
- // Assert
76
- expect(result.isOk()).toBe(true);
77
- if (result.isOk()) {
78
- expect(result.value.id).toMatch(/^ENT-\d{8}-001$/);
79
- }
80
- });
81
-
82
- it('should reject invalid input', () => {
83
- // Arrange
84
- const input = { invalid: true };
85
-
86
- // Act
87
- const result = createEntity(input);
88
-
89
- // Assert
90
- expect(result.isErr()).toBe(true);
91
- if (result.isErr()) {
92
- expect(result.error.message).toContain('validation');
93
- }
94
- });
95
- });
96
- });
97
- ```
98
-
99
- ### 4. EARS Requirements Mapping
100
-
101
- Each requirement must have corresponding tests:
102
-
103
- ```typescript
104
- /**
105
- * REQ-AUTH-001: WHEN user provides valid credentials,
106
- * THEN the system SHALL authenticate the user.
107
- */
108
- describe('REQ-AUTH-001: User Authentication', () => {
109
- it('should authenticate user with valid credentials', async () => {
110
- // Test implementation
111
- });
112
- });
113
- ```
114
-
115
- ### 5. Result Type Test Patterns
116
-
117
- ```typescript
118
- // ✅ Test both success and failure cases
119
- describe('createPrice', () => {
120
- it('should create valid price', () => {
121
- const result = createPrice(1000);
122
- expect(result.isOk()).toBe(true);
123
- if (result.isOk()) {
124
- expect(result.value.amount).toBe(1000);
125
- }
126
- });
127
-
128
- it('should reject price below minimum', () => {
129
- const result = createPrice(50);
130
- expect(result.isErr()).toBe(true);
131
- if (result.isErr()) {
132
- expect(result.error.message).toContain('100');
133
- }
134
- });
135
- });
136
- ```
137
-
138
- ### 6. Status Transition Testing
139
-
140
- ```typescript
141
- describe('Status Transitions', () => {
142
- const validTransitions: [Status, Status][] = [
143
- ['draft', 'active'],
144
- ['active', 'completed'],
145
- ['active', 'cancelled'],
146
- ];
147
-
148
- const invalidTransitions: [Status, Status][] = [
149
- ['completed', 'active'],
150
- ['cancelled', 'draft'],
151
- ];
152
-
153
- validTransitions.forEach(([from, to]) => {
154
- it(`should allow transition from ${from} to ${to}`, () => {
155
- const entity = createEntityWithStatus(from);
156
- const result = entity.transitionTo(to);
157
- expect(result.isOk()).toBe(true);
158
- });
159
- });
160
-
161
- invalidTransitions.forEach(([from, to]) => {
162
- it(`should reject transition from ${from} to ${to}`, () => {
163
- const entity = createEntityWithStatus(from);
164
- const result = entity.transitionTo(to);
165
- expect(result.isErr()).toBe(true);
166
- });
167
- });
168
- });
169
- ```
170
-
171
- ---
172
-
173
- ## Output Format
174
-
175
- ```markdown
176
- # Test Generation Report: {{FEATURE}}
177
-
178
- ## Summary
179
- - **Test Files Created**: X
180
- - **Test Cases**: X total (X unit, X integration, X e2e)
181
- - **Requirements Covered**: X/Y (Z%)
182
-
183
- ## Generated Test Files
184
-
185
- ### packages/core/__tests__/{{feature}}/entity.test.ts
186
- - X test cases
187
- - Covers: REQ-XXX-001, REQ-XXX-002
188
-
189
- ### packages/core/__tests__/{{feature}}/service.test.ts
190
- - X test cases
191
- - Covers: REQ-XXX-003, REQ-XXX-004
192
-
193
- ## Requirements Coverage Matrix
194
-
195
- | Requirement | Test File | Test Cases | Status |
196
- |-------------|-----------|------------|--------|
197
- | REQ-XXX-001 | entity.test.ts | 3 | ✅ |
198
- | REQ-XXX-002 | entity.test.ts | 2 | ✅ |
199
- | REQ-XXX-003 | service.test.ts | 4 | ✅ |
200
-
201
- ## Run Tests
202
-
203
- \`\`\`bash
204
- npm run test -- packages/core/__tests__/{{feature}}/
205
- npm run test:coverage
206
- \`\`\`
207
- ```
208
-
209
- ---
210
-
211
- ## Traceability
212
-
213
- This skill implements:
214
- - **Article III**: Test-First Imperative (テスト先行開発)
215
- - **Article V**: Traceability Mandate (要件↔テストの追跡)
216
-
217
- ---
218
-
219
- ## Related Commands
220
-
221
- ```bash
222
- # Generate tests
223
- npx musubix test generate <file>
224
-
225
- # Run tests with coverage
226
- npm run test:coverage
227
-
228
- # Validate traceability
229
- npx musubix trace validate
230
- ```
@@ -1,304 +0,0 @@
1
- # MUSUBIX Validate Command
2
-
3
- Validate constitutional compliance and requirements coverage.
4
-
5
- ---
6
-
7
- ## Instructions for AI Agent
8
-
9
- You are executing the `musubix validate [feature-name]` command to validate constitutional compliance.
10
-
11
- ### Command Format
12
-
13
- ```bash
14
- npx musubix validate authentication
15
- npx musubix trace validate
16
- npx musubix trace matrix
17
- ```
18
-
19
- ### Your Task
20
-
21
- Perform comprehensive validation of the feature implementation against:
22
-
23
- 1. 9 Constitutional Articles
24
- 2. Requirements coverage (100% traceability)
25
- 3. Code quality standards
26
- 4. Test coverage
27
-
28
- ---
29
-
30
- ## Process
31
-
32
- ### 1. Read All Documentation
33
-
34
- ```bash
35
- # Requirements and Design
36
- storage/specs/REQ-{{FEATURE}}-001.md
37
- storage/specs/DES-{{FEATURE}}-001.md
38
- storage/specs/TSK-{{FEATURE}}-001.md
39
-
40
- # Steering Context
41
- steering/structure.ja.md
42
- steering/tech.ja.md
43
- steering/rules/constitution.md
44
-
45
- # Source Code
46
- packages/core/src/{{feature}}/**/*.ts
47
- packages/core/__tests__/**/*.test.ts
48
- packages/mcp-server/src/tools/**/*.ts
49
- ```
50
-
51
- ---
52
-
53
- ### 2. Constitutional Validation
54
-
55
- Validate each of the 9 Constitutional Articles:
56
-
57
- #### Article I: Library-First Principle
58
-
59
- **Requirement**: Features as independent packages
60
-
61
- **Validation**:
62
- - [ ] Feature in `packages/` directory
63
- - [ ] Has `package.json` (monorepo workspace)
64
- - [ ] Exports public API via `index.ts`
65
- - [ ] No circular dependencies
66
-
67
- ```markdown
68
- ### Article I: Library-First Principle
69
-
70
- **Status**: ✅ PASS / ❌ FAIL
71
-
72
- **Evidence**:
73
- - Location: `packages/core/src/{{feature}}/`
74
- - Public API: `packages/core/src/{{feature}}/index.ts`
75
- - Exports: {{Feature}}Service, {{Feature}}Options
76
- ```
77
-
78
- ---
79
-
80
- #### Article II: CLI Interface Mandate
81
-
82
- **Requirement**: CLI interface for all libraries
83
-
84
- **Validation**:
85
- - [ ] CLI command exists in `packages/core/src/cli/commands/`
86
- - [ ] `--help` flag works
87
- - [ ] Documented in CLI help
88
-
89
- ```markdown
90
- ### Article II: CLI Interface Mandate
91
-
92
- **Status**: ✅ PASS / ❌ FAIL
93
-
94
- **Evidence**:
95
- - CLI: `npx musubix {{feature}}`
96
- - Help: `npx musubix {{feature}} --help`
97
- - Registered: packages/core/src/cli/index.ts
98
- ```
99
-
100
- ---
101
-
102
- #### Article III: Test-First Imperative
103
-
104
- **Requirement**: Tests before implementation (Red-Green-Blue)
105
-
106
- **Validation**:
107
- - [ ] Tests in `packages/core/__tests__/unit/`
108
- - [ ] Tests cover all requirements
109
- - [ ] Coverage ≥ 80%
110
-
111
- ```bash
112
- npm run test:coverage
113
- ```
114
-
115
- ```markdown
116
- ### Article III: Test-First Imperative
117
-
118
- **Status**: ✅ PASS / ❌ FAIL
119
-
120
- **Coverage**: XX%
121
- **Test Files**:
122
- - packages/core/__tests__/unit/{{feature}}.test.ts
123
- - packages/core/__tests__/integration/{{feature}}.integration.test.ts
124
- ```
125
-
126
- ---
127
-
128
- #### Article IV: EARS Requirements Format
129
-
130
- **Requirement**: All requirements in EARS format
131
-
132
- **Validation**:
133
- - [ ] All requirements use EARS patterns
134
- - [ ] Each has unique ID (REQ-XXX-NNN)
135
- - [ ] Each has acceptance criteria
136
-
137
- ```markdown
138
- ### Article IV: EARS Requirements Format
139
-
140
- **Status**: ✅ PASS / ❌ FAIL
141
-
142
- **Requirements Checked**: X
143
- **EARS Patterns Used**:
144
- - Ubiquitous: X
145
- - Event-driven: X
146
- - State-driven: X
147
- - Unwanted: X
148
- - Optional: X
149
- ```
150
-
151
- ---
152
-
153
- #### Article V: Traceability Mandate
154
-
155
- **Requirement**: 100% traceability REQ↔DES↔TSK↔CODE↔TEST
156
-
157
- **Validation**:
158
-
159
- ```markdown
160
- ### Article V: Traceability Mandate
161
-
162
- **Status**: ✅ PASS / ❌ FAIL
163
-
164
- **Traceability Matrix**:
165
-
166
- | Requirement | Design | Task | Code | Test |
167
- |-------------|--------|------|------|------|
168
- | REQ-XXX-001 | DES-XXX-001 | TSK-XXX-001 | {{feature}}/service.ts | {{feature}}.test.ts |
169
-
170
- **Coverage**: 100%
171
- **Unmapped Requirements**: None
172
- ```
173
-
174
- ---
175
-
176
- #### Article VI: Project Memory (Steering)
177
-
178
- **Requirement**: Consult steering before decisions
179
-
180
- **Validation**:
181
- - [ ] Design references steering files
182
- - [ ] Tech stack matches `steering/tech.ja.md`
183
- - [ ] Architecture matches `steering/structure.ja.md`
184
-
185
- ---
186
-
187
- #### Article VII: Design Patterns
188
-
189
- **Requirement**: Document pattern applications
190
-
191
- **Validation**:
192
- - [ ] Patterns documented in design
193
- - [ ] ADRs created for decisions
194
-
195
- ---
196
-
197
- #### Article VIII: Decision Records
198
-
199
- **Requirement**: All decisions as ADRs
200
-
201
- **Validation**:
202
- - [ ] ADRs in design document
203
- - [ ] Each ADR has: Status, Context, Decision, Consequences
204
-
205
- ---
206
-
207
- #### Article IX: Quality Gates
208
-
209
- **Requirement**: Validate before phase transitions
210
-
211
- **Validation**:
212
- - [ ] Requirements validated before design
213
- - [ ] Design validated before implementation
214
- - [ ] Tests pass before deployment
215
-
216
- ---
217
-
218
- ### 3. Generate Validation Report
219
-
220
- ```markdown
221
- # Validation Report: {{FEATURE_NAME}}
222
-
223
- **Date**: {{DATE}}
224
- **Validator**: AI Agent
225
-
226
- ## Summary
227
-
228
- | Article | Status | Score |
229
- |---------|--------|-------|
230
- | I. Library-First | ✅ | 100% |
231
- | II. CLI Interface | ✅ | 100% |
232
- | III. Test-First | ✅ | 85% |
233
- | IV. EARS Format | ✅ | 100% |
234
- | V. Traceability | ✅ | 100% |
235
- | VI. Project Memory | ✅ | 100% |
236
- | VII. Design Patterns | ✅ | 100% |
237
- | VIII. Decision Records | ✅ | 100% |
238
- | IX. Quality Gates | ✅ | 100% |
239
-
240
- **Overall Compliance**: ✅ PASS (97%)
241
-
242
- ## Test Coverage
243
-
244
- - Unit Tests: XX%
245
- - Integration Tests: XX%
246
- - Total: XX%
247
-
248
- ## Traceability Coverage
249
-
250
- - Requirements → Design: 100%
251
- - Design → Tasks: 100%
252
- - Tasks → Code: 100%
253
- - Code → Tests: 100%
254
-
255
- ## Issues Found
256
-
257
- ### Critical (P0)
258
- None
259
-
260
- ### High (P1)
261
- None
262
-
263
- ### Medium (P2)
264
- - [Issue description]
265
-
266
- ## Recommendations
267
-
268
- 1. [Recommendation 1]
269
- 2. [Recommendation 2]
270
- ```
271
-
272
- ---
273
-
274
- ### 4. MCP Tool Integration
275
-
276
- Use MUSUBIX MCP tools:
277
-
278
- ```
279
- sdd_validate_constitution - Validate constitutional compliance
280
- sdd_validate_traceability - Validate traceability matrix
281
- ```
282
-
283
- ---
284
-
285
- ### 5. Validation Commands
286
-
287
- ```bash
288
- # Run all validations
289
- npm test
290
- npm run typecheck
291
- npm run lint
292
-
293
- # Check coverage
294
- npm run test:coverage
295
-
296
- # Traceability
297
- npx musubix trace matrix
298
- npx musubix trace validate
299
- ```
300
-
301
- ---
302
-
303
- **MUSUBIX**: https://github.com/nahisaho/MUSUBIX
304
- **Version**: 1.0.0