musubix 3.4.7 → 3.5.1
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.
- package/README.md +50 -315
- package/bin/musubix.js +1 -9
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -58
- package/.github/AGENTS.md +0 -949
- package/.github/prompts/sdd-change-apply.prompt.md +0 -283
- package/.github/prompts/sdd-change-archive.prompt.md +0 -241
- package/.github/prompts/sdd-change-init.prompt.md +0 -269
- package/.github/prompts/sdd-design.prompt.md +0 -250
- package/.github/prompts/sdd-implement.prompt.md +0 -387
- package/.github/prompts/sdd-requirements.prompt.md +0 -193
- package/.github/prompts/sdd-review.prompt.md +0 -155
- package/.github/prompts/sdd-security.prompt.md +0 -228
- package/.github/prompts/sdd-steering.prompt.md +0 -269
- package/.github/prompts/sdd-tasks.prompt.md +0 -255
- package/.github/prompts/sdd-test.prompt.md +0 -230
- package/.github/prompts/sdd-validate.prompt.md +0 -304
- package/.github/skills/musubix-adr-generation/SKILL.md +0 -209
- package/.github/skills/musubix-best-practices/SKILL.md +0 -315
- package/.github/skills/musubix-c4-design/SKILL.md +0 -162
- package/.github/skills/musubix-code-generation/SKILL.md +0 -237
- package/.github/skills/musubix-domain-inference/SKILL.md +0 -196
- package/.github/skills/musubix-ears-validation/SKILL.md +0 -161
- package/.github/skills/musubix-sdd-workflow/SKILL.md +0 -217
- package/.github/skills/musubix-technical-writing/SKILL.md +0 -444
- package/.github/skills/musubix-test-generation/SKILL.md +0 -212
- package/.github/skills/musubix-traceability/SKILL.md +0 -141
- package/AGENTS.md +0 -1134
- package/LICENSE +0 -21
- package/README.ja.md +0 -313
- package/bin/musubix-mcp.js +0 -15
- package/docs/API-REFERENCE.md +0 -1425
- package/docs/GITHUB-ACTIONS-NPM-SETUP.md +0 -132
- package/docs/INSTALL-GUIDE.ja.md +0 -459
- package/docs/INSTALL-GUIDE.md +0 -459
- package/docs/MIGRATION-v3.0.md +0 -324
- package/docs/MUSUBI-enhancement_roadmap_20260105.md +0 -651
- package/docs/MUSUBIX-v3.0-User-Guide.md +0 -1357
- package/docs/MUSUBIXv2.2.0-Manual-outline.md +0 -136
- package/docs/MUSUBIXv2.2.0-Manual.md +0 -3123
- package/docs/MUSUBIXv2.3.5-Refactering.md +0 -1310
- package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +0 -291
- package/docs/MUSUBIv2.2.0-USERGUIDE.md +0 -2079
- package/docs/ROADMAP-v1.5.md +0 -116
- package/docs/SwarmCoding.md +0 -1284
- package/docs/Test-prompt.md +0 -105
- package/docs/USER-GUIDE-v1.8.0.md +0 -2371
- package/docs/USER-GUIDE.ja.md +0 -2147
- package/docs/USER-GUIDE.md +0 -3022
- package/docs/YATA-GLOBAL-GUIDE.ja.md +0 -750
- package/docs/YATA-GLOBAL-GUIDE.md +0 -595
- package/docs/YATA-LOCAL-GUIDE.ja.md +0 -989
- package/docs/YATA-LOCAL-GUIDE.md +0 -730
- package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +0 -75
- package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +0 -79
- package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +0 -90
- package/docs/adr/ADR-v3.4.0-001-deep-research-architecture.md +0 -217
- package/docs/adr/ADR-v3.4.0-002-search-provider-selection.md +0 -308
- package/docs/adr/ADR-v3.4.0-003-lm-api-integration.md +0 -475
- package/docs/enterprise-knowledge-management.md +0 -1737
- package/docs/evolution-from-musubi-to-musubix.md +0 -2170
- package/docs/getting-started-with-sdd.md +0 -1602
- package/docs/moodle-refactering-codegraph-musubix.md +0 -391
- package/docs/moodle-refactering-codegraph.md +0 -278
- package/docs/overview/MUSUBIX-CodeGraph.md +0 -322
- package/docs/overview/MUSUBIX-Core.md +0 -671
- package/docs/overview/MUSUBIX-Decisions.md +0 -494
- package/docs/overview/MUSUBIX-FormalVerify.md +0 -566
- package/docs/overview/MUSUBIX-Knowledge.md +0 -1231
- package/docs/overview/MUSUBIX-Learning.md +0 -837
- package/docs/overview/MUSUBIX-MCP-Server.md +0 -535
- package/docs/overview/MUSUBIX-Overview.md +0 -264
- package/docs/overview/MUSUBIX-Phase1-Complete.md +0 -271
- package/docs/overview/MUSUBIX-Phase2-Complete.md +0 -310
- package/docs/overview/MUSUBIX-Policy.md +0 -477
- package/docs/overview/MUSUBIX-Roadmap-v2.md +0 -399
- package/docs/overview/MUSUBIX-Security-Plan.md +0 -939
- package/docs/overview/MUSUBIX-Security-v2.1.md +0 -668
- package/docs/overview/MUSUBIX-Security.md +0 -891
- package/docs/overview/MUSUBIX-YATA.md +0 -666
- package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +0 -513
- package/docs/overview/Neuro-SymbolicAI.md +0 -159
- package/docs/packages/knowledge.md +0 -594
- package/docs/qiita-linux-kernel-knowledge-graph.md +0 -596
- package/scripts/generate-quality-gate-report.ts +0 -106
- package/scripts/postinstall.js +0 -94
- package/steering/.musubi-version +0 -1
- package/steering/product.ja.md +0 -572
- package/steering/project.yml +0 -66
- package/steering/rules/constitution.md +0 -491
- package/steering/structure.ja.md +0 -503
- package/steering/tech.ja.md +0 -208
|
@@ -1,444 +0,0 @@
|
|
|
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
|
-
[](https://badge.fury.io/js/package-name)
|
|
28
|
-
[](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
|
|
@@ -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
|