musubix 3.0.7 → 3.0.14

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 (92) hide show
  1. package/.github/AGENTS.md +858 -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 +229 -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 +210 -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 +873 -0
  25. package/LICENSE +21 -0
  26. package/README.ja.md +296 -0
  27. package/README.md +305 -44
  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 +2847 -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/enterprise-knowledge-management.md +1737 -0
  56. package/docs/evolution-from-musubi-to-musubix.md +2170 -0
  57. package/docs/getting-started-with-sdd.md +1602 -0
  58. package/docs/moodle-refactering-codegraph-musubix.md +391 -0
  59. package/docs/moodle-refactering-codegraph.md +278 -0
  60. package/docs/overview/MUSUBIX-CodeGraph.md +322 -0
  61. package/docs/overview/MUSUBIX-Core.md +671 -0
  62. package/docs/overview/MUSUBIX-Decisions.md +494 -0
  63. package/docs/overview/MUSUBIX-FormalVerify.md +566 -0
  64. package/docs/overview/MUSUBIX-Knowledge.md +1231 -0
  65. package/docs/overview/MUSUBIX-Learning.md +837 -0
  66. package/docs/overview/MUSUBIX-MCP-Server.md +535 -0
  67. package/docs/overview/MUSUBIX-Overview.md +264 -0
  68. package/docs/overview/MUSUBIX-Phase1-Complete.md +271 -0
  69. package/docs/overview/MUSUBIX-Phase2-Complete.md +310 -0
  70. package/docs/overview/MUSUBIX-Policy.md +477 -0
  71. package/docs/overview/MUSUBIX-Roadmap-v2.md +399 -0
  72. package/docs/overview/MUSUBIX-Security-Plan.md +939 -0
  73. package/docs/overview/MUSUBIX-Security-v2.1.md +668 -0
  74. package/docs/overview/MUSUBIX-Security.md +891 -0
  75. package/docs/overview/MUSUBIX-YATA.md +666 -0
  76. package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +513 -0
  77. package/docs/overview/Neuro-SymbolicAI.md +159 -0
  78. package/docs/packages/knowledge.md +594 -0
  79. package/docs/qiita-linux-kernel-knowledge-graph.md +596 -0
  80. package/package.json +56 -51
  81. package/scripts/generate-quality-gate-report.ts +106 -0
  82. package/scripts/postinstall.js +94 -0
  83. package/steering/.musubi-version +1 -0
  84. package/steering/product.ja.md +572 -0
  85. package/steering/project.yml +66 -0
  86. package/steering/rules/constitution.md +491 -0
  87. package/steering/structure.ja.md +503 -0
  88. package/steering/tech.ja.md +208 -0
  89. package/dist/index.d.ts +0 -25
  90. package/dist/index.d.ts.map +0 -1
  91. package/dist/index.js +0 -74
  92. package/dist/index.js.map +0 -1
@@ -0,0 +1,228 @@
1
+ # MUSUBIX Security Scan Command
2
+
3
+ Perform comprehensive security scanning and vulnerability detection.
4
+
5
+ ---
6
+
7
+ ## Instructions for AI Agent
8
+
9
+ You are executing the `musubix security [feature-name]` command to perform security analysis.
10
+
11
+ ### Command Format
12
+
13
+ ```bash
14
+ npx musubix codegen security <path>
15
+ ```
16
+
17
+ ### Your Task
18
+
19
+ Perform comprehensive security analysis covering:
20
+
21
+ 1. OWASP Top 10 vulnerabilities
22
+ 2. Dependency vulnerabilities
23
+ 3. Authentication/Authorization issues
24
+ 4. Data validation gaps
25
+ 5. Sensitive data exposure
26
+
27
+ ---
28
+
29
+ ## Process
30
+
31
+ ### 1. Read Source Code and Dependencies
32
+
33
+ ```bash
34
+ # Source Code
35
+ packages/core/src/{{feature}}/**/*.ts
36
+ packages/mcp-server/src/tools/**/*.ts
37
+
38
+ # Dependencies
39
+ package.json
40
+ package-lock.json
41
+
42
+ # Auth module
43
+ packages/core/src/auth/**/*.ts
44
+ ```
45
+
46
+ ### 2. OWASP Top 10 Checks
47
+
48
+ | # | Vulnerability | Check |
49
+ |---|--------------|-------|
50
+ | A01 | Broken Access Control | 認可チェックの実装確認 |
51
+ | A02 | Cryptographic Failures | 暗号化の適切な使用 |
52
+ | A03 | Injection | SQL/NoSQL/コマンドインジェクション |
53
+ | A04 | Insecure Design | セキュリティパターンの適用 |
54
+ | A05 | Security Misconfiguration | 設定の安全性 |
55
+ | A06 | Vulnerable Components | 依存関係の脆弱性 |
56
+ | A07 | Authentication Failures | 認証の実装不備 |
57
+ | A08 | Software/Data Integrity | データ整合性の検証 |
58
+ | A09 | Security Logging | ログと監視 |
59
+ | A10 | SSRF | サーバーサイドリクエストフォージェリ |
60
+
61
+ ### 3. Code Pattern Analysis
62
+
63
+ #### ❌ Dangerous Patterns
64
+
65
+ ```typescript
66
+ // SQL Injection - 危険
67
+ const query = `SELECT * FROM users WHERE id = ${userId}`;
68
+
69
+ // Command Injection - 危険
70
+ exec(`ls ${userInput}`);
71
+
72
+ // Path Traversal - 危険
73
+ const file = fs.readFileSync(`./uploads/${filename}`);
74
+
75
+ // Hardcoded Secrets - 危険
76
+ const apiKey = 'sk-1234567890abcdef';
77
+
78
+ // eval() - 危険
79
+ eval(userInput);
80
+ ```
81
+
82
+ #### ✅ Safe Patterns
83
+
84
+ ```typescript
85
+ // Parameterized Query - 安全
86
+ const query = db.query('SELECT * FROM users WHERE id = ?', [userId]);
87
+
88
+ // Input Validation - 安全
89
+ const sanitized = sanitize(userInput);
90
+
91
+ // Path Validation - 安全
92
+ const safePath = path.resolve('./uploads', path.basename(filename));
93
+
94
+ // Environment Variables - 安全
95
+ const apiKey = process.env.API_KEY;
96
+
97
+ // No eval - 安全
98
+ const result = JSON.parse(jsonString);
99
+ ```
100
+
101
+ ### 4. Authentication & Authorization
102
+
103
+ Check for:
104
+
105
+ - [ ] JWT/Session token validation
106
+ - [ ] Password hashing (bcrypt, argon2)
107
+ - [ ] Role-based access control (RBAC)
108
+ - [ ] Rate limiting
109
+ - [ ] CSRF protection
110
+ - [ ] Secure cookie flags
111
+
112
+ ### 5. Data Validation
113
+
114
+ ```typescript
115
+ // ✅ Recommended: Zod schema validation
116
+ import { z } from 'zod';
117
+
118
+ const UserInputSchema = z.object({
119
+ email: z.string().email(),
120
+ password: z.string().min(8).max(100),
121
+ age: z.number().int().positive().max(150),
122
+ });
123
+
124
+ // Validate all user inputs
125
+ const result = UserInputSchema.safeParse(userInput);
126
+ if (!result.success) {
127
+ return err(new ValidationError(result.error));
128
+ }
129
+ ```
130
+
131
+ ### 6. Dependency Audit
132
+
133
+ ```bash
134
+ # Check for known vulnerabilities
135
+ npm audit
136
+ npm audit --audit-level=moderate
137
+
138
+ # Update vulnerable packages
139
+ npm audit fix
140
+ ```
141
+
142
+ ---
143
+
144
+ ## Output Format
145
+
146
+ ```markdown
147
+ # Security Scan Report: {{FEATURE}}
148
+
149
+ ## Summary
150
+ - **Risk Level**: Critical/High/Medium/Low
151
+ - **Vulnerabilities Found**: X critical, X high, X medium, X low
152
+ - **Dependencies Audited**: X packages
153
+
154
+ ## OWASP Top 10 Assessment
155
+
156
+ | Category | Status | Findings |
157
+ |----------|--------|----------|
158
+ | A01: Access Control | ✅/⚠️/❌ | ... |
159
+ | A02: Cryptographic | ✅/⚠️/❌ | ... |
160
+ | A03: Injection | ✅/⚠️/❌ | ... |
161
+ | A04: Insecure Design | ✅/⚠️/❌ | ... |
162
+ | A05: Misconfiguration | ✅/⚠️/❌ | ... |
163
+ | A06: Vulnerable Deps | ✅/⚠️/❌ | ... |
164
+ | A07: Auth Failures | ✅/⚠️/❌ | ... |
165
+ | A08: Integrity | ✅/⚠️/❌ | ... |
166
+ | A09: Logging | ✅/⚠️/❌ | ... |
167
+ | A10: SSRF | ✅/⚠️/❌ | ... |
168
+
169
+ ## Critical Vulnerabilities
170
+
171
+ ### 1. [CRITICAL] SQL Injection in user-service.ts
172
+ - **Location**: packages/core/src/user/user-service.ts:45
173
+ - **Description**: User input directly concatenated in SQL query
174
+ - **Remediation**: Use parameterized queries
175
+ - **Reference**: CWE-89
176
+
177
+ ### 2. [HIGH] Hardcoded API Key
178
+ - **Location**: packages/core/src/auth/config.ts:12
179
+ - **Description**: API key stored in source code
180
+ - **Remediation**: Use environment variables
181
+ - **Reference**: CWE-798
182
+
183
+ ## Dependency Vulnerabilities
184
+
185
+ | Package | Severity | Version | Fixed In |
186
+ |---------|----------|---------|----------|
187
+ | lodash | High | 4.17.20 | 4.17.21 |
188
+
189
+ ## Recommendations
190
+
191
+ 1. **Immediate**: Fix all critical vulnerabilities
192
+ 2. **Short-term**: Update vulnerable dependencies
193
+ 3. **Long-term**: Implement security testing in CI/CD
194
+
195
+ ## Compliance Checklist
196
+
197
+ - [ ] Input validation on all user inputs
198
+ - [ ] Output encoding for XSS prevention
199
+ - [ ] Parameterized queries for database access
200
+ - [ ] Secrets in environment variables
201
+ - [ ] HTTPS enforced
202
+ - [ ] Security headers configured
203
+ - [ ] Rate limiting implemented
204
+ - [ ] Audit logging enabled
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Traceability
210
+
211
+ This skill implements:
212
+ - **Article IX**: Integration-First Testing (セキュリティテスト)
213
+ - Security requirements validation
214
+
215
+ ---
216
+
217
+ ## Related Commands
218
+
219
+ ```bash
220
+ # Security scan
221
+ npx musubix codegen security <path>
222
+
223
+ # Dependency audit
224
+ npm audit
225
+
226
+ # Static analysis
227
+ npx musubix codegen analyze <file>
228
+ ```
@@ -0,0 +1,269 @@
1
+ # MUSUBIX Steering Command
2
+
3
+ Generate or update project memory (steering context).
4
+
5
+ ---
6
+
7
+ ## Instructions for AI Agent
8
+
9
+ You are executing the `musubix steering` command to generate or update the project's steering context.
10
+
11
+ ### What is Steering?
12
+
13
+ Steering provides **project memory** for AI agents. It consists of core files that document:
14
+
15
+ 1. **structure.ja.md** - Architecture patterns, directory structure
16
+ 2. **tech.ja.md** - Technology stack, frameworks
17
+ 3. **product.ja.md** - Business context, product goals
18
+ 4. **rules/constitution.md** - 9 Constitutional Articles
19
+
20
+ ### Your Task
21
+
22
+ **Mode Detection**:
23
+
24
+ 1. **Bootstrap Mode** - No steering files exist → Generate initial files
25
+ 2. **Sync Mode** - Files exist, codebase changed → Update files
26
+ 3. **Review Mode** - User wants to review → Present and suggest improvements
27
+
28
+ ---
29
+
30
+ ## Mode 1: Bootstrap (First Time)
31
+
32
+ ### Detection
33
+
34
+ - `steering/` directory doesn't exist OR
35
+ - Core files missing
36
+
37
+ ### Steps
38
+
39
+ 1. **Analyze Codebase**:
40
+ - Directory structure
41
+ - Package.json files
42
+ - TypeScript configuration
43
+ - Test framework (Vitest)
44
+
45
+ 2. **Generate Steering Files**:
46
+
47
+ **Create `steering/structure.ja.md`**:
48
+
49
+ ```markdown
50
+ # Project Structure
51
+
52
+ **Project**: MUSUBIX
53
+ **Last Updated**: {{DATE}}
54
+
55
+ ## Architecture Pattern
56
+
57
+ **Primary Pattern**: Monorepo (npm workspaces)
58
+
59
+ ## Package Structure
60
+
61
+ \`\`\`
62
+ packages/
63
+ ├── core/ # @nahisaho/musubix-core
64
+ ├── mcp-server/ # @nahisaho/musubix-mcp-server
65
+ └── yata-client/ # @nahisaho/musubix-yata-client
66
+ \`\`\`
67
+
68
+ ## Core Package Modules
69
+
70
+ \`\`\`
71
+ packages/core/src/
72
+ ├── auth/ # Authentication
73
+ ├── cli/ # CLI Interface (Article II)
74
+ ├── codegen/ # Code Generation
75
+ ├── design/ # Design Patterns
76
+ ├── error/ # Error Handling
77
+ ├── explanation/ # Explanations
78
+ ├── requirements/ # Requirements Analysis
79
+ ├── traceability/ # Traceability
80
+ ├── types/ # Type Definitions
81
+ ├── utils/ # Utilities
82
+ └── validators/ # EARS Validation
83
+ \`\`\`
84
+
85
+ ## Naming Conventions
86
+
87
+ - Files: `kebab-case.ts`
88
+ - Classes: `PascalCase`
89
+ - Functions: `camelCase`
90
+ - Constants: `SCREAMING_SNAKE_CASE`
91
+ ```
92
+
93
+ **Create `steering/tech.ja.md`**:
94
+
95
+ ```markdown
96
+ # Technology Stack
97
+
98
+ **Project**: MUSUBIX
99
+ **Last Updated**: {{DATE}}
100
+
101
+ ## Core Technologies
102
+
103
+ | Category | Technology | Version |
104
+ |----------|------------|---------|
105
+ | Language | TypeScript | ^5.3 |
106
+ | Runtime | Node.js | >= 20.0.0 |
107
+ | Package Manager | npm | >= 10.0.0 |
108
+ | Build | npm workspaces | - |
109
+ | Test | Vitest | ^1.0.0 |
110
+ | Lint | ESLint | ^8.0.0 |
111
+
112
+ ## Package Dependencies
113
+
114
+ ### @nahisaho/musubix-core
115
+
116
+ - commander: CLI framework
117
+ - chalk: Terminal styling
118
+
119
+ ### @nahisaho/musubix-mcp-server
120
+
121
+ - MCP protocol support
122
+
123
+ ### @nahisaho/musubix-yata-client
124
+
125
+ - Knowledge graph client
126
+
127
+ ## Development Tools
128
+
129
+ - TypeScript strict mode
130
+ - ESM modules (`"type": "module"`)
131
+ - Vitest for testing
132
+ ```
133
+
134
+ **Create `steering/product.ja.md`**:
135
+
136
+ ```markdown
137
+ # Product Context
138
+
139
+ **Project**: MUSUBIX
140
+ **Last Updated**: {{DATE}}
141
+
142
+ ## Product Vision
143
+
144
+ Neuro-Symbolic AI Integration System that combines:
145
+ - **Neural (LLM)**: Creative code generation
146
+ - **Symbolic (YATA)**: Knowledge graph precision
147
+
148
+ ## Target Users
149
+
150
+ - Software Developers
151
+ - AI/ML Engineers
152
+ - Development Teams
153
+
154
+ ## Core Features
155
+
156
+ 1. EARS Requirements Analysis
157
+ 2. C4 Model Design Generation
158
+ 3. Test-First Development
159
+ 4. Complete Traceability
160
+ 5. MCP Server Integration
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Mode 2: Sync (Update Existing)
166
+
167
+ ### Detection
168
+
169
+ - Steering files exist
170
+ - Codebase has changes
171
+
172
+ ### Steps
173
+
174
+ 1. **Compare Current State**:
175
+ - Read existing steering files
176
+ - Analyze current codebase
177
+ - Identify discrepancies
178
+
179
+ 2. **Update Files**:
180
+ - Add new modules/packages
181
+ - Update technology versions
182
+ - Reflect architecture changes
183
+
184
+ 3. **Generate Diff Report**:
185
+
186
+ ```markdown
187
+ ## Steering Sync Report
188
+
189
+ ### Changes Detected
190
+
191
+ | File | Change | Action |
192
+ |------|--------|--------|
193
+ | structure.ja.md | New module: utils/ | Updated |
194
+ | tech.ja.md | Vitest 1.0 → 2.0 | Updated |
195
+
196
+ ### Files Updated
197
+
198
+ 1. `steering/structure.ja.md` - Added utils module
199
+ 2. `steering/tech.ja.md` - Updated Vitest version
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Mode 3: Review
205
+
206
+ ### Steps
207
+
208
+ 1. **Present Current Steering**:
209
+ - Show structure.ja.md content
210
+ - Show tech.ja.md content
211
+ - Show product.ja.md content
212
+
213
+ 2. **Analyze for Improvements**:
214
+ - Missing documentation
215
+ - Outdated information
216
+ - Inconsistencies
217
+
218
+ 3. **Suggest Improvements**:
219
+
220
+ ```markdown
221
+ ## Steering Review
222
+
223
+ ### Current State
224
+
225
+ ✅ structure.ja.md - Complete
226
+ ✅ tech.ja.md - Complete
227
+ ⚠️ product.ja.md - Missing user personas
228
+
229
+ ### Recommendations
230
+
231
+ 1. Add user personas to product.ja.md
232
+ 2. Update tech stack versions
233
+ 3. Add ADR index
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Constitutional Articles Reference
239
+
240
+ Always include reference to `steering/rules/constitution.md`:
241
+
242
+ | Article | Name | Summary |
243
+ |---------|------|---------|
244
+ | I | Library-First | Features in packages/ |
245
+ | II | CLI Interface | CLI for all libraries |
246
+ | III | Test-First | Red-Green-Blue |
247
+ | IV | EARS Format | Requirements syntax |
248
+ | V | Traceability | 100% tracking |
249
+ | VI | Project Memory | Read steering first |
250
+ | VII | Design Patterns | Document patterns |
251
+ | VIII | Decision Records | ADRs for decisions |
252
+ | IX | Quality Gates | Validate phases |
253
+
254
+ ---
255
+
256
+ ## Output
257
+
258
+ Save steering files to:
259
+
260
+ - `steering/structure.ja.md`
261
+ - `steering/tech.ja.md`
262
+ - `steering/product.ja.md`
263
+ - `steering/rules/constitution.md`
264
+ - `steering/project.yml`
265
+
266
+ ---
267
+
268
+ **MUSUBIX**: https://github.com/nahisaho/MUSUBIX
269
+ **Version**: 1.0.0