musubix 1.0.1 → 1.0.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.
@@ -0,0 +1,242 @@
1
+ # MUSUBIX - AI Coding Agents
2
+
3
+ This file defines AI agent configurations for MUSUBIX - Neuro-Symbolic AI Integration System.
4
+
5
+ **Platform Support**: GitHub Copilot, Claude, Cursor, Gemini CLI, Codex CLI, Windsurf
6
+
7
+ ---
8
+
9
+ ## MCP Server Integration
10
+
11
+ MUSUBIX provides an MCP Server (`@nahisaho/musubix-mcp-server`) with 9 tools and 3 prompts.
12
+
13
+ ### Starting MCP Server
14
+
15
+ ```bash
16
+ npx @nahisaho/musubix-mcp-server
17
+ npx musubix-mcp --transport stdio
18
+ ```
19
+
20
+ ### MCP Tools (9 Tools)
21
+
22
+ | Tool Name | Description | Usage |
23
+ |-----------|-------------|-------|
24
+ | `sdd_create_requirements` | Create EARS-format requirements document | Requirements phase |
25
+ | `sdd_validate_requirements` | Validate requirements against EARS patterns | Requirements validation |
26
+ | `sdd_create_design` | Create C4 model design document | Design phase |
27
+ | `sdd_validate_design` | Validate design traceability | Design validation |
28
+ | `sdd_create_tasks` | Generate implementation tasks | Task breakdown |
29
+ | `sdd_query_knowledge` | Query YATA knowledge graph | Knowledge retrieval |
30
+ | `sdd_update_knowledge` | Update knowledge graph | Knowledge management |
31
+ | `sdd_validate_constitution` | Validate against 9 Constitutional Articles | Compliance check |
32
+ | `sdd_validate_traceability` | Validate requirement-design-task traceability | Traceability audit |
33
+
34
+ ### MCP Prompts (3 Prompts)
35
+
36
+ | Prompt Name | Description |
37
+ |-------------|-------------|
38
+ | `sdd_requirements_analysis` | Analyze feature and generate EARS requirements |
39
+ | `sdd_requirements_review` | Review requirements for completeness |
40
+ | `sdd_design_generation` | Generate C4 model design from requirements |
41
+
42
+ **Setup**: See `steering/tech.ja.md` for configuration.
43
+
44
+ ---
45
+
46
+ ## Project Structure
47
+
48
+ MUSUBIX is a monorepo with 3 packages:
49
+
50
+ ```
51
+ packages/
52
+ ├── core/ # @nahisaho/musubix-core - CLI, validation, code generation
53
+ ├── mcp-server/ # @nahisaho/musubix-mcp-server - MCP Server
54
+ └── yata-client/ # @nahisaho/musubix-yata-client - Knowledge graph client
55
+ ```
56
+
57
+ ---
58
+
59
+ ## CLI Commands
60
+
61
+ ```bash
62
+ # Project initialization
63
+ npx musubix init [path] [--name <name>] [--force]
64
+
65
+ # Requirements analysis (EARS format)
66
+ npx musubix requirements analyze <file>
67
+ npx musubix requirements validate <file>
68
+ npx musubix requirements map <file>
69
+ npx musubix requirements search <query>
70
+
71
+ # Design generation
72
+ npx musubix design generate <file>
73
+ npx musubix design patterns <context>
74
+ npx musubix design validate <file>
75
+ npx musubix design c4 <file>
76
+ npx musubix design adr <decision>
77
+
78
+ # Code generation
79
+ npx musubix codegen generate <file>
80
+ npx musubix codegen analyze <file>
81
+ npx musubix codegen security <path>
82
+
83
+ # Test generation
84
+ npx musubix test generate <file>
85
+ npx musubix test coverage <dir>
86
+
87
+ # Traceability
88
+ npx musubix trace matrix
89
+ npx musubix trace impact <id>
90
+ npx musubix trace validate
91
+
92
+ # Explanation
93
+ npx musubix explain why <id>
94
+ npx musubix explain graph <id>
95
+ ```
96
+
97
+ ---
98
+
99
+ ## 9 Constitutional Articles
100
+
101
+ All development activities are governed by these immutable rules:
102
+
103
+ | Article | Name | Summary |
104
+ |---------|------|---------|
105
+ | **I** | Library-First | Features start as independent libraries in packages/ |
106
+ | **II** | CLI Interface | All libraries expose CLI |
107
+ | **III** | Test-First | Red-Green-Blue cycle |
108
+ | **IV** | EARS Format | Requirements in EARS syntax |
109
+ | **V** | Traceability | 100% Requirements↔Design↔Code↔Tests tracking |
110
+ | **VI** | Project Memory | Consult steering/ before decisions |
111
+ | **VII** | Design Patterns | Document pattern applications |
112
+ | **VIII** | Decision Records | All decisions as ADRs |
113
+ | **IX** | Quality Gates | Validate before phase transitions |
114
+
115
+ ---
116
+
117
+ ## Prompt Files
118
+
119
+ GitHub Copilot prompts are located in `.github/prompts/`:
120
+
121
+ | Prompt | Command | Description |
122
+ |--------|---------|-------------|
123
+ | `sdd-requirements.prompt.md` | `musubix requirements` | Create EARS requirements |
124
+ | `sdd-design.prompt.md` | `musubix design` | Generate C4 design |
125
+ | `sdd-tasks.prompt.md` | `musubix tasks` | Break down into tasks |
126
+ | `sdd-implement.prompt.md` | `musubix implement` | Execute implementation |
127
+ | `sdd-validate.prompt.md` | `musubix validate` | Validate compliance |
128
+ | `sdd-steering.prompt.md` | `musubix steering` | Manage project memory |
129
+ | `sdd-change-init.prompt.md` | `musubix change init` | Initialize change proposal |
130
+ | `sdd-change-apply.prompt.md` | `musubix change apply` | Apply change proposal |
131
+ | `sdd-change-archive.prompt.md` | `musubix change archive` | Archive completed change |
132
+
133
+ ---
134
+
135
+ ## Project Memory (Steering)
136
+
137
+ AI agents MUST consult these files before making decisions:
138
+
139
+ | File | Content |
140
+ |------|---------|
141
+ | `steering/structure.ja.md` | Architecture patterns, layer structure |
142
+ | `steering/tech.ja.md` | Technology stack (TypeScript, Node.js 20+) |
143
+ | `steering/product.ja.md` | Product context |
144
+ | `steering/rules/constitution.md` | 9 Constitutional Articles |
145
+ | `steering/project.yml` | Project configuration |
146
+
147
+ ---
148
+
149
+ ## Storage Structure
150
+
151
+ | Path | Content |
152
+ |------|---------|
153
+ | `storage/specs/` | Requirements (REQ-*), Design (DES-*), Tasks (TSK-*) |
154
+ | `storage/design/` | Design documents, C4 diagrams |
155
+ | `storage/traceability/` | Traceability matrices |
156
+ | `storage/reviews/` | Code reviews, validations |
157
+ | `storage/changes/` | Change proposals and implementations |
158
+ | `storage/archive/` | Archived documents |
159
+
160
+ ---
161
+
162
+ ## EARS Patterns
163
+
164
+ All requirements MUST use one of 5 EARS patterns:
165
+
166
+ | Pattern | Syntax | Example |
167
+ |---------|--------|---------|
168
+ | **Event-driven** | `WHEN [event], the [system] SHALL [response]` | WHEN user clicks Submit, the system SHALL validate input |
169
+ | **State-driven** | `WHILE [state], the [system] SHALL [response]` | WHILE loading, the UI SHALL show spinner |
170
+ | **Unwanted** | `IF [error], THEN the [system] SHALL [response]` | IF timeout occurs, THEN the system SHALL retry |
171
+ | **Optional** | `WHERE [feature enabled], the [system] SHALL [response]` | WHERE 2FA enabled, the system SHALL require OTP |
172
+ | **Ubiquitous** | `The [system] SHALL [requirement]` | The API SHALL authenticate all requests |
173
+
174
+ ---
175
+
176
+ ## C4 Model Levels
177
+
178
+ Design documents use 4 C4 levels:
179
+
180
+ | Level | Name | Content |
181
+ |-------|------|---------|
182
+ | **1** | Context | System boundary, external actors |
183
+ | **2** | Container | Deployable units, databases, APIs |
184
+ | **3** | Component | Internal structure, services, repositories |
185
+ | **4** | Code | Implementation details |
186
+
187
+ ---
188
+
189
+ ## Development Workflow
190
+
191
+ ```
192
+ 1. Read steering/ (Article VI)
193
+ 2. Define requirements in EARS format (Article IV)
194
+ 3. Design with C4 model
195
+ 4. Write tests first - RED (Article III)
196
+ 5. Implement minimum code - GREEN
197
+ 6. Refactor - BLUE
198
+ 7. Validate traceability (Article V)
199
+ 8. Pass quality gates (Article IX)
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Technology Stack
205
+
206
+ - **Language**: TypeScript
207
+ - **Runtime**: Node.js >= 20.0.0
208
+ - **Package Manager**: npm >= 10.0.0
209
+ - **Build**: npm workspaces (monorepo)
210
+ - **Test**: Vitest
211
+ - **Lint**: ESLint
212
+
213
+ ---
214
+
215
+ ## Quick Start
216
+
217
+ ```bash
218
+ # Initialize project
219
+ npx musubix init my-project
220
+
221
+ # Create requirements
222
+ npx musubix requirements analyze feature.md
223
+
224
+ # Generate design
225
+ npx musubix design generate requirements.md
226
+
227
+ # Break down tasks
228
+ npx musubix tasks generate design.md
229
+
230
+ # Implement with Test-First
231
+ npx musubix implement feature-name
232
+
233
+ # Validate
234
+ npx musubix validate feature-name
235
+ ```
236
+
237
+ ---
238
+
239
+ **Agent**: GitHub Copilot / Claude
240
+ **Last Updated**: 2026-01-02
241
+ **Version**: 1.0.0
242
+ **Repository**: https://github.com/nahisaho/MUSUBIX
@@ -0,0 +1,283 @@
1
+ # MUSUBIX Change Apply Command
2
+
3
+ Apply a change proposal to the codebase.
4
+
5
+ ---
6
+
7
+ ## Instructions for AI Agent
8
+
9
+ You are executing the `musubix change apply [change-name]` command to implement an approved change proposal.
10
+
11
+ ### Command Format
12
+
13
+ ```bash
14
+ npx musubix change apply add-2fa
15
+ npx musubix change apply migrate-to-graphql
16
+ ```
17
+
18
+ ### Your Task
19
+
20
+ Implement the changes defined in the change proposal, following constitutional governance.
21
+
22
+ ---
23
+
24
+ ## Process
25
+
26
+ ### 1. Read Change Proposal
27
+
28
+ **IMPORTANT**: Read the approved change proposal first:
29
+
30
+ ```bash
31
+ storage/changes/{{CHANGE_NAME}}-proposal.md
32
+ ```
33
+
34
+ **Extract**:
35
+
36
+ - ADDED requirements
37
+ - MODIFIED requirements
38
+ - REMOVED requirements
39
+ - Implementation plan
40
+
41
+ **Verify Approval**:
42
+
43
+ - Status must be "Approved" (not "Proposed")
44
+ - If not approved, abort and notify user
45
+
46
+ ---
47
+
48
+ ### 2. Read Steering Context (Article VI)
49
+
50
+ ```bash
51
+ steering/product.ja.md
52
+ steering/structure.ja.md
53
+ steering/tech.ja.md
54
+ ```
55
+
56
+ ---
57
+
58
+ ### 3. Execute Implementation Plan
59
+
60
+ Follow the phases defined in the change proposal:
61
+
62
+ #### Phase 1: Preparation
63
+
64
+ ```bash
65
+ # Create feature branch
66
+ git checkout -b feature/{{CHANGE_NAME}}
67
+
68
+ # Create implementation tracking document
69
+ touch storage/changes/{{CHANGE_NAME}}-implementation.md
70
+ ```
71
+
72
+ #### Phase 2: Update Requirements
73
+
74
+ For ADDED requirements:
75
+ - Create new requirement files in `storage/specs/`
76
+
77
+ For MODIFIED requirements:
78
+ - Update existing requirement files
79
+ - Mark version change
80
+
81
+ For REMOVED requirements:
82
+ - Archive to `storage/archive/`
83
+ - Update traceability
84
+
85
+ #### Phase 3: Update Design
86
+
87
+ - Update `storage/specs/DES-*.md` files
88
+ - Add new ADRs for significant changes
89
+
90
+ #### Phase 4: Implement Code
91
+
92
+ Follow Test-First (Article III):
93
+
94
+ 1. **Write Tests (RED)**
95
+ ```typescript
96
+ // packages/core/__tests__/unit/{{feature}}.test.ts
97
+ describe('REQ-{{COMPONENT}}-NEW-001: [New Feature]', () => {
98
+ it('should [new behavior]', () => {
99
+ // Test new functionality
100
+ });
101
+ });
102
+ ```
103
+
104
+ 2. **Implement (GREEN)**
105
+ ```typescript
106
+ // packages/core/src/{{feature}}/service.ts
107
+ // Minimal implementation to pass tests
108
+ ```
109
+
110
+ 3. **Refactor (BLUE)**
111
+ - Improve design
112
+ - Ensure tests still pass
113
+
114
+ ---
115
+
116
+ ### 4. Feature Flag (Optional)
117
+
118
+ For gradual rollout:
119
+
120
+ ```typescript
121
+ // packages/core/src/config/feature-flags.ts
122
+
123
+ export const FEATURE_FLAGS = {
124
+ enable_{{feature}}: {
125
+ enabled: false, // Start disabled
126
+ description: '{{CHANGE_DESCRIPTION}}',
127
+ },
128
+ } as const;
129
+ ```
130
+
131
+ ```typescript
132
+ // Usage in code
133
+ import { FEATURE_FLAGS } from '../config/feature-flags.js';
134
+
135
+ if (FEATURE_FLAGS.enable_{{feature}}.enabled) {
136
+ // New implementation
137
+ } else {
138
+ // Old implementation
139
+ }
140
+ ```
141
+
142
+ ---
143
+
144
+ ### 5. Update CLI (Article II)
145
+
146
+ If CLI changes:
147
+
148
+ ```typescript
149
+ // packages/core/src/cli/commands/{{feature}}.ts
150
+
151
+ export function register{{Feature}}Command(program: Command): void {
152
+ program
153
+ .command('{{feature}}')
154
+ .description('{{New/Updated description}}')
155
+ .option('--new-option', 'New option from change')
156
+ .action(async (options) => {
157
+ // Updated implementation
158
+ });
159
+ }
160
+ ```
161
+
162
+ ---
163
+
164
+ ### 6. Update MCP Tools
165
+
166
+ If MCP tools change:
167
+
168
+ ```typescript
169
+ // packages/mcp-server/src/tools/{{feature}}-tools.ts
170
+
171
+ export const {{feature}}Tool: ToolDefinition = {
172
+ name: 'sdd_{{feature}}',
173
+ description: '{{Updated description}}',
174
+ inputSchema: {
175
+ type: 'object',
176
+ properties: {
177
+ // Updated schema
178
+ newProperty: {
179
+ type: 'string',
180
+ description: 'New property from change',
181
+ },
182
+ },
183
+ },
184
+ handler: async (args) => {
185
+ // Updated implementation
186
+ },
187
+ };
188
+ ```
189
+
190
+ ---
191
+
192
+ ### 7. Generate Implementation Report
193
+
194
+ **Output**: `storage/changes/{{CHANGE_NAME}}-implementation.md`
195
+
196
+ ```markdown
197
+ # Implementation Report: {{CHANGE_NAME}}
198
+
199
+ **Date**: {{DATE}}
200
+ **Status**: In Progress / Completed
201
+
202
+ ## Summary
203
+
204
+ | Item | Status |
205
+ |------|--------|
206
+ | Requirements Updated | ✅ |
207
+ | Design Updated | ✅ |
208
+ | Tests Written | ✅ |
209
+ | Code Implemented | ✅ |
210
+ | Documentation Updated | ⏳ |
211
+
212
+ ## Changes Made
213
+
214
+ ### Files Created
215
+
216
+ - `packages/core/src/{{feature}}/new-module.ts`
217
+ - `packages/core/__tests__/unit/new-module.test.ts`
218
+
219
+ ### Files Modified
220
+
221
+ - `packages/core/src/{{feature}}/service.ts`
222
+ - `packages/mcp-server/src/tools/{{feature}}-tools.ts`
223
+
224
+ ### Files Deleted
225
+
226
+ - `packages/core/src/{{feature}}/deprecated.ts`
227
+
228
+ ## Test Results
229
+
230
+ \`\`\`
231
+ npm test
232
+
233
+ ✓ packages/core/__tests__/unit/{{feature}}.test.ts (10 tests)
234
+ ✓ packages/core/__tests__/integration/{{feature}}.integration.test.ts (5 tests)
235
+
236
+ Test Suites: 2 passed
237
+ Tests: 15 passed
238
+ Coverage: 87%
239
+ \`\`\`
240
+
241
+ ## Traceability Verification
242
+
243
+ | Requirement | Design | Code | Test |
244
+ |-------------|--------|------|------|
245
+ | REQ-XXX-NEW-001 | DES-XXX-001 | ✅ | ✅ |
246
+ | REQ-XXX-001 (mod) | DES-XXX-001 | ✅ | ✅ |
247
+
248
+ ## Deployment Notes
249
+
250
+ 1. Run migrations (if any)
251
+ 2. Enable feature flag
252
+ 3. Monitor metrics
253
+
254
+ ## Rollback Instructions
255
+
256
+ 1. Disable feature flag
257
+ 2. Revert to previous release
258
+ ```
259
+
260
+ ---
261
+
262
+ ### 8. Validation
263
+
264
+ Run all validations:
265
+
266
+ ```bash
267
+ # Tests
268
+ npm test
269
+
270
+ # Type check
271
+ npm run typecheck
272
+
273
+ # Lint
274
+ npm run lint
275
+
276
+ # Traceability
277
+ npx musubix trace validate
278
+ ```
279
+
280
+ ---
281
+
282
+ **MUSUBIX**: https://github.com/nahisaho/MUSUBIX
283
+ **Version**: 1.0.0