musubix 3.4.3 → 3.4.7

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 (95) 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 +1134 -0
  25. package/LICENSE +21 -0
  26. package/README.ja.md +313 -0
  27. package/README.md +315 -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/adr/ADR-v3.4.0-001-deep-research-architecture.md +217 -0
  56. package/docs/adr/ADR-v3.4.0-002-search-provider-selection.md +308 -0
  57. package/docs/adr/ADR-v3.4.0-003-lm-api-integration.md +475 -0
  58. package/docs/enterprise-knowledge-management.md +1737 -0
  59. package/docs/evolution-from-musubi-to-musubix.md +2170 -0
  60. package/docs/getting-started-with-sdd.md +1602 -0
  61. package/docs/moodle-refactering-codegraph-musubix.md +391 -0
  62. package/docs/moodle-refactering-codegraph.md +278 -0
  63. package/docs/overview/MUSUBIX-CodeGraph.md +322 -0
  64. package/docs/overview/MUSUBIX-Core.md +671 -0
  65. package/docs/overview/MUSUBIX-Decisions.md +494 -0
  66. package/docs/overview/MUSUBIX-FormalVerify.md +566 -0
  67. package/docs/overview/MUSUBIX-Knowledge.md +1231 -0
  68. package/docs/overview/MUSUBIX-Learning.md +837 -0
  69. package/docs/overview/MUSUBIX-MCP-Server.md +535 -0
  70. package/docs/overview/MUSUBIX-Overview.md +264 -0
  71. package/docs/overview/MUSUBIX-Phase1-Complete.md +271 -0
  72. package/docs/overview/MUSUBIX-Phase2-Complete.md +310 -0
  73. package/docs/overview/MUSUBIX-Policy.md +477 -0
  74. package/docs/overview/MUSUBIX-Roadmap-v2.md +399 -0
  75. package/docs/overview/MUSUBIX-Security-Plan.md +939 -0
  76. package/docs/overview/MUSUBIX-Security-v2.1.md +668 -0
  77. package/docs/overview/MUSUBIX-Security.md +891 -0
  78. package/docs/overview/MUSUBIX-YATA.md +666 -0
  79. package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +513 -0
  80. package/docs/overview/Neuro-SymbolicAI.md +159 -0
  81. package/docs/packages/knowledge.md +594 -0
  82. package/docs/qiita-linux-kernel-knowledge-graph.md +596 -0
  83. package/package.json +58 -51
  84. package/scripts/generate-quality-gate-report.ts +106 -0
  85. package/scripts/postinstall.js +94 -0
  86. package/steering/.musubi-version +1 -0
  87. package/steering/product.ja.md +572 -0
  88. package/steering/project.yml +66 -0
  89. package/steering/rules/constitution.md +491 -0
  90. package/steering/structure.ja.md +503 -0
  91. package/steering/tech.ja.md +208 -0
  92. package/dist/index.d.ts +0 -25
  93. package/dist/index.d.ts.map +0 -1
  94. package/dist/index.js +0 -74
  95. package/dist/index.js.map +0 -1
@@ -0,0 +1,444 @@
1
+ ---
2
+ name: musubix-technical-writing
3
+ description: Guide for creating technical documentation including README, user guides, API references, and changelogs. Use this when asked to write documentation, create user manuals, or generate API docs.
4
+ license: MIT
5
+ ---
6
+
7
+ # MUSUBIX Technical Writing Skill
8
+
9
+ This skill guides you through creating high-quality technical documentation for software projects.
10
+
11
+ ## Overview
12
+
13
+ Technical documentation bridges the gap between code and users. MUSUBIX supports generating various document types with consistent structure and traceability.
14
+
15
+ ## Document Types
16
+
17
+ ### 1. README.md (Project Overview)
18
+
19
+ **Purpose**: First impression of your project.
20
+
21
+ **Template**:
22
+ ```markdown
23
+ # Project Name
24
+
25
+ > One-line description of what the project does.
26
+
27
+ [![npm version](https://badge.fury.io/js/package-name.svg)](https://badge.fury.io/js/package-name)
28
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
29
+
30
+ ## 🎯 Features
31
+
32
+ - Feature 1: Brief description
33
+ - Feature 2: Brief description
34
+ - Feature 3: Brief description
35
+
36
+ ## 📦 Installation
37
+
38
+ \`\`\`bash
39
+ npm install package-name
40
+ \`\`\`
41
+
42
+ ## 🚀 Quick Start
43
+
44
+ \`\`\`typescript
45
+ import { MainClass } from 'package-name';
46
+
47
+ const instance = new MainClass();
48
+ instance.doSomething();
49
+ \`\`\`
50
+
51
+ ## 📖 Documentation
52
+
53
+ - [Installation Guide](docs/INSTALL-GUIDE.md)
54
+ - [User Guide](docs/USER-GUIDE.md)
55
+ - [API Reference](docs/API-REFERENCE.md)
56
+
57
+ ## 🤝 Contributing
58
+
59
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
60
+
61
+ ## 📄 License
62
+
63
+ MIT License - see [LICENSE](LICENSE) for details.
64
+ ```
65
+
66
+ ### 2. INSTALL-GUIDE.md (Installation Guide)
67
+
68
+ **Purpose**: Step-by-step setup instructions.
69
+
70
+ **Structure**:
71
+ ```markdown
72
+ # Installation Guide
73
+
74
+ ## Prerequisites
75
+
76
+ | Requirement | Version | Check Command |
77
+ |-------------|---------|---------------|
78
+ | Node.js | >= 20.0.0 | `node --version` |
79
+ | npm | >= 10.0.0 | `npm --version` |
80
+
81
+ ## Installation Methods
82
+
83
+ ### Method 1: npm (Recommended)
84
+
85
+ \`\`\`bash
86
+ npm install package-name
87
+ \`\`\`
88
+
89
+ ### Method 2: From Source
90
+
91
+ \`\`\`bash
92
+ git clone https://github.com/user/repo.git
93
+ cd repo
94
+ npm install
95
+ npm run build
96
+ \`\`\`
97
+
98
+ ## Configuration
99
+
100
+ ### Environment Variables
101
+
102
+ | Variable | Description | Default |
103
+ |----------|-------------|---------|
104
+ | `API_KEY` | API authentication key | - |
105
+ | `LOG_LEVEL` | Logging verbosity | `info` |
106
+
107
+ ### Configuration File
108
+
109
+ Create `config.json`:
110
+ \`\`\`json
111
+ {
112
+ "setting1": "value1",
113
+ "setting2": true
114
+ }
115
+ \`\`\`
116
+
117
+ ## Verification
118
+
119
+ \`\`\`bash
120
+ npx package-name --version
121
+ \`\`\`
122
+
123
+ ## Troubleshooting
124
+
125
+ ### Common Issues
126
+
127
+ #### Issue: Module not found
128
+ **Solution**: Run `npm install` again.
129
+
130
+ #### Issue: Permission denied
131
+ **Solution**: Use `sudo` or fix npm permissions.
132
+ ```
133
+
134
+ ### 3. USER-GUIDE.md (User Guide)
135
+
136
+ **Purpose**: Comprehensive usage instructions.
137
+
138
+ **Structure**:
139
+ ```markdown
140
+ # User Guide
141
+
142
+ ## Table of Contents
143
+
144
+ 1. [Getting Started](#getting-started)
145
+ 2. [Basic Usage](#basic-usage)
146
+ 3. [Advanced Features](#advanced-features)
147
+ 4. [Best Practices](#best-practices)
148
+
149
+ ## Getting Started
150
+
151
+ ### Your First Project
152
+
153
+ 1. Create a new directory
154
+ 2. Initialize the project
155
+ 3. Run your first command
156
+
157
+ ## Basic Usage
158
+
159
+ ### Command: `command-name`
160
+
161
+ **Syntax**:
162
+ \`\`\`bash
163
+ npx tool command [options] <arguments>
164
+ \`\`\`
165
+
166
+ **Options**:
167
+ | Option | Short | Description |
168
+ |--------|-------|-------------|
169
+ | `--output` | `-o` | Output directory |
170
+ | `--verbose` | `-v` | Enable verbose logging |
171
+
172
+ **Examples**:
173
+ \`\`\`bash
174
+ # Basic usage
175
+ npx tool command input.txt
176
+
177
+ # With options
178
+ npx tool command -o output/ -v input.txt
179
+ \`\`\`
180
+
181
+ ## Advanced Features
182
+
183
+ ### Feature: Custom Configuration
184
+
185
+ [Detailed explanation with examples]
186
+
187
+ ## Best Practices
188
+
189
+ 1. **Do**: Recommended approach
190
+ 2. **Don't**: Anti-pattern to avoid
191
+ ```
192
+
193
+ ### 4. API-REFERENCE.md (API Reference)
194
+
195
+ **Purpose**: Complete API documentation.
196
+
197
+ **Structure**:
198
+ ```markdown
199
+ # API Reference
200
+
201
+ ## Classes
202
+
203
+ ### `ClassName`
204
+
205
+ Description of the class.
206
+
207
+ #### Constructor
208
+
209
+ \`\`\`typescript
210
+ new ClassName(options?: ClassOptions)
211
+ \`\`\`
212
+
213
+ | Parameter | Type | Description |
214
+ |-----------|------|-------------|
215
+ | `options` | `ClassOptions` | Configuration options |
216
+
217
+ #### Methods
218
+
219
+ ##### `methodName(param1, param2)`
220
+
221
+ Description of what the method does.
222
+
223
+ **Parameters**:
224
+ | Name | Type | Required | Description |
225
+ |------|------|----------|-------------|
226
+ | `param1` | `string` | Yes | First parameter |
227
+ | `param2` | `number` | No | Optional second parameter |
228
+
229
+ **Returns**: `Promise<Result>`
230
+
231
+ **Example**:
232
+ \`\`\`typescript
233
+ const result = await instance.methodName('value', 42);
234
+ \`\`\`
235
+
236
+ **Throws**:
237
+ - `ValidationError`: When param1 is empty
238
+
239
+ ## Interfaces
240
+
241
+ ### `InterfaceName`
242
+
243
+ \`\`\`typescript
244
+ interface InterfaceName {
245
+ property1: string;
246
+ property2?: number;
247
+ method(arg: string): void;
248
+ }
249
+ \`\`\`
250
+
251
+ ## Types
252
+
253
+ ### `TypeName`
254
+
255
+ \`\`\`typescript
256
+ type TypeName = 'option1' | 'option2' | 'option3';
257
+ \`\`\`
258
+ ```
259
+
260
+ ### 5. CHANGELOG.md (Change Log)
261
+
262
+ **Purpose**: Track version history.
263
+
264
+ **Format**: Follow [Keep a Changelog](https://keepachangelog.com/)
265
+
266
+ ```markdown
267
+ # Changelog
268
+
269
+ All notable changes to this project will be documented in this file.
270
+
271
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
272
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
273
+
274
+ ## [Unreleased]
275
+
276
+ ### Added
277
+ - New feature description
278
+
279
+ ### Changed
280
+ - Modified behavior description
281
+
282
+ ### Deprecated
283
+ - Feature to be removed in future
284
+
285
+ ### Removed
286
+ - Deleted feature description
287
+
288
+ ### Fixed
289
+ - Bug fix description
290
+
291
+ ### Security
292
+ - Security fix description
293
+
294
+ ## [1.0.0] - 2026-01-10
295
+
296
+ ### Added
297
+ - Initial release
298
+ - Core functionality
299
+ - CLI interface
300
+ ```
301
+
302
+ ### 6. CONTRIBUTING.md (Contributing Guide)
303
+
304
+ **Purpose**: Guide for contributors.
305
+
306
+ ```markdown
307
+ # Contributing Guide
308
+
309
+ Thank you for your interest in contributing!
310
+
311
+ ## Development Setup
312
+
313
+ 1. Fork the repository
314
+ 2. Clone your fork
315
+ 3. Install dependencies: `npm install`
316
+ 4. Create a branch: `git checkout -b feature/your-feature`
317
+
318
+ ## Code Standards
319
+
320
+ - Use TypeScript
321
+ - Follow ESLint rules
322
+ - Write tests for new features
323
+ - Maintain 80%+ code coverage
324
+
325
+ ## Pull Request Process
326
+
327
+ 1. Update documentation
328
+ 2. Add tests
329
+ 3. Run `npm test`
330
+ 4. Submit PR with clear description
331
+
332
+ ## Commit Message Format
333
+
334
+ \`\`\`
335
+ type(scope): description
336
+
337
+ [optional body]
338
+
339
+ [optional footer]
340
+ \`\`\`
341
+
342
+ Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
343
+
344
+ ## Code of Conduct
345
+
346
+ Be respectful and inclusive.
347
+ ```
348
+
349
+ ## Writing Guidelines
350
+
351
+ ### 1. Audience-Aware Writing
352
+
353
+ | Document | Audience | Tone | Technical Level |
354
+ |----------|----------|------|-----------------|
355
+ | README | Everyone | Welcoming | Low-Medium |
356
+ | INSTALL-GUIDE | Users | Instructive | Medium |
357
+ | USER-GUIDE | Users | Explanatory | Medium |
358
+ | API-REFERENCE | Developers | Technical | High |
359
+ | CONTRIBUTING | Contributors | Collaborative | High |
360
+
361
+ ### 2. Formatting Best Practices
362
+
363
+ ```markdown
364
+ # ✅ Good Practices
365
+
366
+ ## Use Clear Headings
367
+ Structure content hierarchically.
368
+
369
+ ## Include Code Examples
370
+ \`\`\`typescript
371
+ // Always show working examples
372
+ const example = 'value';
373
+ \`\`\`
374
+
375
+ ## Use Tables for Structured Data
376
+ | Column 1 | Column 2 |
377
+ |----------|----------|
378
+ | Data | Data |
379
+
380
+ ## Add Visual Cues
381
+ > 💡 **Tip**: Helpful advice
382
+ > ⚠️ **Warning**: Important caution
383
+ > ❌ **Error**: Common mistake
384
+ ```
385
+
386
+ ### 3. Multilingual Support
387
+
388
+ For projects requiring Japanese and English:
389
+
390
+ ```
391
+ docs/
392
+ ├── README.md # English (default)
393
+ ├── README.ja.md # Japanese
394
+ ├── USER-GUIDE.md # English
395
+ ├── USER-GUIDE.ja.md # Japanese
396
+ └── ...
397
+ ```
398
+
399
+ ## CLI Integration
400
+
401
+ ```bash
402
+ # Generate README from project analysis
403
+ npx musubix docs readme
404
+
405
+ # Generate API reference from TypeScript
406
+ npx musubix docs api --source src/
407
+
408
+ # Update CHANGELOG from git commits
409
+ npx musubix docs changelog --from v1.0.0
410
+
411
+ # Generate all documentation
412
+ npx musubix docs generate --all
413
+ ```
414
+
415
+ ## Traceability
416
+
417
+ Link documentation to requirements and design:
418
+
419
+ ```markdown
420
+ <!-- @requirement REQ-DOC-001 -->
421
+ <!-- @design DES-DOC-001 -->
422
+
423
+ # User Guide
424
+
425
+ This guide covers the usage of...
426
+ ```
427
+
428
+ ## Document Quality Checklist
429
+
430
+ - [ ] Clear purpose statement
431
+ - [ ] Logical structure with headings
432
+ - [ ] Working code examples
433
+ - [ ] Complete parameter documentation
434
+ - [ ] Error handling examples
435
+ - [ ] Up-to-date with current version
436
+ - [ ] Spell-checked and grammar-checked
437
+ - [ ] Links verified
438
+ - [ ] Screenshots/diagrams where helpful
439
+
440
+ ## Related Skills
441
+
442
+ - [musubix-sdd-workflow](../musubix-sdd-workflow/SKILL.md) - Overall development workflow
443
+ - [musubix-adr-generation](../musubix-adr-generation/SKILL.md) - Decision documentation
444
+ - [musubix-code-generation](../musubix-code-generation/SKILL.md) - Code with doc comments
@@ -0,0 +1,212 @@
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