musubix 3.6.1 → 3.7.3

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 (36) hide show
  1. package/.github/skills/build-fix/SKILL.md +124 -0
  2. package/.github/skills/checkpoint/SKILL.md +131 -0
  3. package/.github/skills/codemap/SKILL.md +120 -0
  4. package/.github/skills/codemap/templates/codemap-index.md +142 -0
  5. package/.github/skills/codemap/templates/package-codemap.md +160 -0
  6. package/.github/skills/context-optimizer/SKILL.md +109 -0
  7. package/.github/skills/context-optimizer/contexts/dev.md +40 -0
  8. package/.github/skills/context-optimizer/contexts/research.md +55 -0
  9. package/.github/skills/context-optimizer/contexts/review.md +49 -0
  10. package/.github/skills/e2e-runner/SKILL.md +145 -0
  11. package/.github/skills/eval-harness/SKILL.md +111 -0
  12. package/.github/skills/eval-harness/examples/capability-eval.md +158 -0
  13. package/.github/skills/eval-harness/examples/human-grader-template.md +326 -0
  14. package/.github/skills/eval-harness/examples/regression-eval.md +228 -0
  15. package/.github/skills/learning-hooks/SKILL.md +101 -0
  16. package/.github/skills/learning-hooks/templates/learned-skill-template.md +79 -0
  17. package/.github/skills/musubix-adr-generation/SKILL.md +33 -168
  18. package/.github/skills/musubix-best-practices/SKILL.md +46 -276
  19. package/.github/skills/musubix-c4-design/SKILL.md +48 -124
  20. package/.github/skills/musubix-code-generation/SKILL.md +46 -193
  21. package/.github/skills/musubix-domain-inference/SKILL.md +54 -168
  22. package/.github/skills/musubix-ears-validation/SKILL.md +49 -136
  23. package/.github/skills/musubix-sdd-workflow/SKILL.md +56 -178
  24. package/.github/skills/musubix-technical-writing/SKILL.md +45 -381
  25. package/.github/skills/musubix-test-generation/SKILL.md +52 -176
  26. package/.github/skills/musubix-traceability/SKILL.md +52 -99
  27. package/.github/skills/refactor-cleaner/SKILL.md +105 -0
  28. package/.github/skills/session-manager/SKILL.md +119 -0
  29. package/.github/skills/session-manager/scripts/session-end.sh +175 -0
  30. package/.github/skills/session-manager/scripts/session-start.sh +87 -0
  31. package/.github/skills/verification-loop/SKILL.md +111 -0
  32. package/.github/skills/verification-loop/scripts/verify.sh +305 -0
  33. package/AGENTS.md +231 -1034
  34. package/docs/CODEMAPS/CODEMAP.md +1 -0
  35. package/docs/adr/ADR-v3.7.0-001-everything-claude-code-integration.md +102 -0
  36. package/package.json +2 -2
@@ -1,162 +1,86 @@
1
1
  ---
2
2
  name: musubix-c4-design
3
- description: Guide for creating C4 model design documents. Use this when asked to create architecture designs, system context diagrams, container diagrams, or component diagrams following the C4 model methodology.
3
+ description: C4モデル設計ドキュメント作成ガイド。アーキテクチャ図・コンポーネント設計に使用。
4
4
  license: MIT
5
5
  ---
6
6
 
7
- # MUSUBIX C4 Design Skill
7
+ # C4 Design Skill
8
8
 
9
- This skill guides you through creating C4 model architecture designs for MUSUBIX projects.
9
+ C4モデル4レベルでアーキテクチャを構造化。
10
10
 
11
- ## Overview
11
+ ## C4 Levels
12
12
 
13
- The C4 model provides four levels of abstraction for describing software architecture:
13
+ | Level | 名称 | 内容 |
14
+ |-------|------|------|
15
+ | **1** | Context | システム境界・外部アクター |
16
+ | **2** | Container | 技術選択・デプロイ単位 |
17
+ | **3** | Component | コンテナ内部構造 |
18
+ | **4** | Code | 実装詳細(任意) |
14
19
 
15
- 1. **Context** - System boundaries and external actors
16
- 2. **Container** - Technology choices and deployable units
17
- 3. **Component** - Internal structure of containers
18
- 4. **Code** - Implementation details (optional)
20
+ ## WHEN DO
19
21
 
20
- ## Prerequisites
22
+ | WHEN | DO |
23
+ |------|-----|
24
+ | 設計開始前 | `storage/specs/`のREQ-*を確認 |
25
+ | 新規システム設計 | Context→Container→Componentの順で作成 |
26
+ | コンポーネント追加 | Component Levelを更新 |
21
27
 
22
- Before creating designs:
23
-
24
- 1. Read requirements from `storage/specs/` (REQ-* files)
25
- 2. Check `steering/structure.ja.md` for architecture guidelines
26
- 3. Review `steering/tech.ja.md` for technology constraints
27
-
28
- ## Design Document Template
28
+ ## Design Template
29
29
 
30
30
  ```markdown
31
- # DES-[CATEGORY]-[NUMBER]: [Design Title]
31
+ # DES-[CATEGORY]-[NUMBER]: [Title]
32
32
 
33
33
  ## メタデータ
34
- - **作成日**: YYYY-MM-DD
35
- - **トレーサビリティ**: REQ-XXX-NNN
34
+ - 作成日: YYYY-MM-DD
35
+ - トレーサビリティ: REQ-XXX-NNN
36
36
 
37
37
  ## 1. Context Level
38
-
39
- ### システムコンテキスト図
40
- [External actors and systems that interact with our system]
41
-
42
- ### 外部アクター
43
38
  | アクター | 説明 | インタラクション |
44
39
  |---------|------|-----------------|
45
- | User | システム利用者 | Web UI経由でアクセス |
40
+ | User | システム利用者 | Web UI経由 |
46
41
 
47
42
  ## 2. Container Level
48
-
49
- ### コンテナ構成
50
43
  | コンテナ | 技術 | 責務 |
51
44
  |---------|------|------|
52
- | Web App | React/Next.js | UI提供 |
53
- | API Server | Node.js/Express | ビジネスロジック |
54
- | Database | PostgreSQL | データ永続化 |
55
-
56
- ### コンテナ間通信
57
- [Describe how containers communicate]
45
+ | Web App | React | UI提供 |
46
+ | API | Node.js | ビジネスロジック |
47
+ | DB | PostgreSQL | データ永続化 |
58
48
 
59
49
  ## 3. Component Level
60
-
61
- ### [Container Name] コンポーネント
62
-
63
50
  | コンポーネント | 種別 | 責務 | 依存先 |
64
51
  |---------------|------|------|--------|
65
52
  | XxxService | Service | ビジネスロジック | XxxRepository |
66
53
  | XxxRepository | Repository | データアクセス | Database |
67
- | XxxController | Controller | リクエスト処理 | XxxService |
68
-
69
- ## 4. 設計パターン
70
-
71
- ### 適用パターン
72
- | パターン | 適用箇所 | 理由 |
73
- |---------|---------|------|
74
- | Repository | データアクセス層 | 永続化の抽象化 |
75
- | Service | ビジネス層 | ロジックの集約 |
76
- | Factory | オブジェクト生成 | 生成ロジックの分離 |
77
-
78
- ## 5. 非機能要件への対応
79
-
80
- ### セキュリティ
81
- - 認証: [方式]
82
- - 認可: [方式]
83
- - データ保護: [方式]
84
-
85
- ### スケーラビリティ
86
- - [スケーリング戦略]
87
-
88
- ### 可用性
89
- - [可用性設計]
90
- ```
91
-
92
- ## C4 Diagram Syntax (Mermaid)
93
-
94
- ### Context Diagram
95
- ```mermaid
96
- flowchart TB
97
- subgraph External["外部システム"]
98
- User[ユーザー]
99
- ExtAPI[外部API]
100
- end
101
-
102
- subgraph System["対象システム"]
103
- App[アプリケーション]
104
- end
105
-
106
- User --> App
107
- App --> ExtAPI
108
- ```
109
-
110
- ### Container Diagram
111
- ```mermaid
112
- flowchart TB
113
- subgraph Containers["コンテナ構成"]
114
- Web[Web App<br/>React]
115
- API[API Server<br/>Node.js]
116
- DB[(Database<br/>PostgreSQL)]
117
- end
118
-
119
- Web --> API
120
- API --> DB
121
- ```
122
-
123
- ### Component Diagram
124
- ```mermaid
125
- flowchart TB
126
- subgraph APIServer["API Server"]
127
- Controller[Controller]
128
- Service[Service]
129
- Repository[Repository]
130
- end
131
-
132
- Controller --> Service
133
- Service --> Repository
134
54
  ```
135
55
 
136
- ## Design Patterns Reference
56
+ ## Design Patterns
137
57
 
138
58
  | パターン | 用途 | 適用場面 |
139
59
  |---------|------|---------|
140
- | **Repository** | データアクセス抽象化 | DB操作 |
141
- | **Service** | ビジネスロジック集約 | ユースケース実装 |
142
- | **Factory** | オブジェクト生成 | 複雑な生成ロジック |
143
- | **Strategy** | アルゴリズム切替 | 認証方式、計算方式 |
144
- | **Observer** | イベント通知 | 状態変更の伝播 |
145
- | **Decorator** | 機能追加 | ログ、キャッシュ |
146
-
147
- ## Domain-Specific Components
148
-
149
- Use `npx musubix design generate` to get domain-specific component recommendations for 62 domains.
60
+ | Repository | データアクセス抽象化 | DB操作 |
61
+ | Service | ビジネスロジック集約 | ユースケース |
62
+ | Factory | オブジェクト生成 | 複雑な生成 |
63
+ | Strategy | アルゴリズム切替 | 認証・計算方式 |
64
+
65
+ ## CLI
66
+
67
+ ```bash
68
+ npx musubix design generate <file> # 設計生成
69
+ npx musubix design patterns <context> # パターン検出
70
+ npx musubix design c4 <file> # C4ダイアグラム
71
+ npx musubix design traceability # REQ↔DES検証
72
+ ```
150
73
 
151
- ## Output Location
74
+ ## 出力例
152
75
 
153
- Save design documents to:
154
76
  ```
155
- storage/design/DES-[CATEGORY]-[NUMBER].md
77
+ ┌─────────────────────────────────────────┐
78
+ │ C4 Design Generated │
79
+ ├─────────────────────────────────────────┤
80
+ │ Design ID: DES-SHOP-001 │
81
+ │ Containers: 3 (Web, API, DB) │
82
+ │ Components: 8 (Services, Repos) │
83
+ │ Patterns: Repository, Service │
84
+ │ Traceability: REQ-SHOP-001 │
85
+ └─────────────────────────────────────────┘
156
86
  ```
157
-
158
- ## Related Skills
159
-
160
- - `musubix-ears-validation` - Requirements validation
161
- - `musubix-code-generation` - Generate code from design
162
- - `musubix-adr-generation` - Document architecture decisions
@@ -1,237 +1,90 @@
1
1
  ---
2
2
  name: musubix-code-generation
3
- description: Guide for generating code from design specifications using MUSUBIX. Use this when asked to generate code, implement features, or create components following design documents.
3
+ description: 設計仕様からコード生成ガイド。実装・機能作成に使用。
4
4
  license: MIT
5
5
  ---
6
6
 
7
- # MUSUBIX Code Generation Skill
7
+ # Code Generation Skill
8
8
 
9
- This skill guides you through generating code from design specifications following MUSUBIX methodology.
10
-
11
- ## Prerequisites
12
-
13
- Before generating code:
14
-
15
- 1. Verify design document exists (`DES-*`)
16
- 2. Verify requirements are traceable (`REQ-*`)
17
- 3. Check `steering/tech.ja.md` for technology stack
9
+ 設計ドキュメントからコードを生成し、トレーサビリティを維持。
18
10
 
19
11
  ## Supported Languages
20
12
 
21
- | Language | Extension | Features |
22
- |----------|-----------|----------|
23
- | TypeScript | `.ts` | Full support with types |
13
+ | 言語 | 拡張子 | サポート機能 |
14
+ |------|--------|-------------|
15
+ | TypeScript | `.ts` | フル型サポート |
24
16
  | JavaScript | `.js` | ES6+ modules |
25
- | Python | `.py` | Type hints support |
26
- | Java | `.java` | Interface/Class generation |
27
- | Go | `.go` | Struct/Interface generation |
28
- | Rust | `.rs` | Trait/Struct generation |
29
- | C# | `.cs` | Interface/Class generation |
30
-
31
- ## Code Generation Workflow
17
+ | Python | `.py` | 型ヒント |
18
+ | Java/Go/Rust/C# | 各種 | Interface/Struct生成 |
32
19
 
33
- ### Step 1: Read Design Document
34
-
35
- ```bash
36
- # Generate code from design
37
- npx musubix codegen generate <design-file>
38
- ```
20
+ ## WHEN DO
39
21
 
40
- ### Step 2: Generate with Traceability
22
+ | WHEN | DO |
23
+ |------|-----|
24
+ | コード生成前 | DES-*とREQ-*の存在確認 |
25
+ | 実装開始 | テスト先行(Article III) |
26
+ | コード作成 | @see タグでトレーサビリティ追加 |
41
27
 
42
- Always include requirement references:
28
+ ## Traceability Comment
43
29
 
44
30
  ```typescript
45
31
  /**
46
32
  * UserService - Handles user operations
47
- *
48
33
  * @see REQ-INT-001 - Neuro-Symbolic Integration
49
34
  * @see DES-INT-001 - Integration Layer Design
50
35
  */
51
- export class UserService {
52
- // Implementation
53
- }
54
- ```
55
-
56
- ### Step 3: Follow Test-First (Article III)
57
-
58
- 1. **Write test first**:
59
- ```typescript
60
- describe('UserService', () => {
61
- it('should create user', async () => {
62
- const service = new UserService();
63
- const user = await service.create({ name: 'Test' });
64
- expect(user.id).toBeDefined();
65
- });
66
- });
67
- ```
68
-
69
- 2. **Implement minimal code**:
70
- ```typescript
71
- export class UserService {
72
- async create(data: CreateUserDto): Promise<User> {
73
- return { id: generateId(), ...data };
74
- }
75
- }
36
+ export class UserService { ... }
76
37
  ```
77
38
 
78
- 3. **Refactor**
79
-
80
39
  ## Design Pattern Templates
81
40
 
82
- ### Singleton Pattern
83
- ```typescript
84
- /**
85
- * @see REQ-DES-001 - Pattern Detection
86
- * @pattern Singleton
87
- */
88
- export class ConfigManager {
89
- private static instance: ConfigManager;
90
-
91
- private constructor() {}
92
-
93
- static getInstance(): ConfigManager {
94
- if (!ConfigManager.instance) {
95
- ConfigManager.instance = new ConfigManager();
96
- }
97
- return ConfigManager.instance;
98
- }
99
- }
100
- ```
101
-
102
- ### Factory Pattern
103
- ```typescript
104
- /**
105
- * @see REQ-DES-001 - Pattern Detection
106
- * @pattern Factory
107
- */
108
- export interface ServiceFactory {
109
- create(type: string): Service;
110
- }
111
-
112
- export class DefaultServiceFactory implements ServiceFactory {
113
- create(type: string): Service {
114
- switch (type) {
115
- case 'auth': return new AuthService();
116
- case 'user': return new UserService();
117
- default: throw new Error(`Unknown service: ${type}`);
118
- }
119
- }
120
- }
121
- ```
41
+ | パターン | 用途 |
42
+ |---------|------|
43
+ | **Singleton** | グローバルインスタンス管理 |
44
+ | **Factory** | 型に応じたオブジェクト生成 |
45
+ | **Repository** | データアクセス抽象化 |
122
46
 
123
47
  ### Repository Pattern
48
+
124
49
  ```typescript
125
- /**
126
- * @see REQ-COD-001 - Code Generation
127
- * @pattern Repository
128
- */
50
+ /** @pattern Repository */
129
51
  export interface Repository<T> {
130
52
  findById(id: string): Promise<T | null>;
131
- findAll(): Promise<T[]>;
132
53
  save(entity: T): Promise<T>;
133
54
  delete(id: string): Promise<void>;
134
55
  }
135
-
136
- export class UserRepository implements Repository<User> {
137
- async findById(id: string): Promise<User | null> {
138
- // Implementation
139
- }
140
- // ... other methods
141
- }
142
56
  ```
143
57
 
144
- ## CLI Commands
58
+ ## CLI
145
59
 
146
60
  ```bash
147
- # Generate code from design
148
- npx musubix codegen generate <design-file>
149
-
150
- # Generate status transition code (v3.1.0)
151
- npx musubix codegen status <spec>
152
- npx musubix codegen status <spec> --enum # Use enum type
153
-
154
- # Analyze existing code
155
- npx musubix codegen analyze <file>
156
-
157
- # Security scan
158
- npx musubix codegen security <path>
159
-
160
- # Scaffold with Value Objects and Status machines (v3.1.0)
161
- npx musubix scaffold domain-model <name> -v "Price,Email"
162
- npx musubix scaffold domain-model <name> -s "Order,Task"
61
+ npx musubix codegen generate <design-file> # コード生成
62
+ npx musubix codegen generate <file> --full-skeleton # 4ファイル生成
63
+ npx musubix codegen generate <file> --with-tests # テスト付き
64
+ npx musubix codegen status <spec> # ステータス遷移コード
65
+ npx musubix codegen status <spec> --enum # enum型
66
+ npx musubix codegen analyze <file> # 静的解析
67
+ npx musubix codegen security <path> # セキュリティスキャン
163
68
  ```
164
69
 
165
70
  ## Quality Checks (Article IX)
166
71
 
167
- Before committing code:
168
-
169
- - [ ] **Type Safety**: No `any` types (TypeScript)
170
- - [ ] **Traceability**: All classes/functions have `@see` references
171
- - [ ] **Tests**: Test coverage ≥ 80%
172
- - [ ] **Linting**: `npm run lint` passes
173
- - [ ] **Build**: `npm run build` succeeds
174
-
175
- ## Neuro-Symbolic Integration (REQ-INT-002)
176
-
177
- When generating code that involves decision-making:
72
+ - [ ] No `any` types
73
+ - [ ] @see references on all classes/functions
74
+ - [ ] Test coverage 80%
75
+ - [ ] `npm run lint` passes
76
+ - [ ] `npm run build` succeeds
178
77
 
179
- ```typescript
180
- /**
181
- * @see REQ-INT-002 - Confidence Evaluation
182
- */
183
- async function integrateResults(
184
- neuralResult: NeuralResult,
185
- symbolicResult: SymbolicResult
186
- ): Promise<FinalResult> {
187
- // Decision rules from REQ-INT-002
188
- if (symbolicResult.status === 'invalid') {
189
- return rejectNeural(neuralResult);
190
- }
191
-
192
- if (neuralResult.confidence >= 0.8) {
193
- return adoptNeural(neuralResult);
194
- }
195
-
196
- return prioritizeSymbolic(symbolicResult);
197
- }
198
- ```
199
-
200
- ## File Structure Convention
78
+ ## 出力例
201
79
 
202
80
  ```
203
- packages/
204
- ├── core/
205
- │ └── src/
206
- ├── [feature]/
207
- │ ├── index.ts # Public exports
208
- ├── [feature].ts # Main implementation
209
- ├── types.ts # Type definitions
210
- │ └── __tests__/ # Tests
211
- │ └── index.ts # Package exports
212
- ```
213
-
214
- ## Error Handling Pattern
215
-
216
- ```typescript
217
- /**
218
- * @see REQ-ERR-001 - Graceful Degradation
219
- */
220
- export class MuSubixError extends Error {
221
- constructor(
222
- message: string,
223
- public code: string,
224
- public recoverable: boolean = true
225
- ) {
226
- super(message);
227
- this.name = 'MuSubixError';
228
- }
229
- }
230
-
231
- // Usage
232
- throw new MuSubixError(
233
- 'Failed to connect to YATA',
234
- 'YATA_CONNECTION_ERROR',
235
- true // Can retry
236
- );
81
+ ┌─────────────────────────────────────────┐
82
+ Code Generated │
83
+ ├─────────────────────────────────────────┤
84
+ Source: DES-AUTH-001 │
85
+ Files: 4 generated │
86
+ Patterns: Repository, Service │
87
+ Coverage: @see tags added │
88
+ Tests: test stubs generated │
89
+ └─────────────────────────────────────────┘
237
90
  ```