musubi-sdd 3.5.1 → 3.6.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.
Files changed (29) hide show
  1. package/README.md +25 -3
  2. package/bin/musubi-orchestrate.js +309 -0
  3. package/package.json +1 -1
  4. package/src/llm-providers/anthropic-provider.js +175 -0
  5. package/src/llm-providers/base-provider.js +221 -0
  6. package/src/llm-providers/copilot-provider.js +262 -0
  7. package/src/llm-providers/index.js +214 -0
  8. package/src/llm-providers/openai-provider.js +205 -0
  9. package/src/orchestration/index.js +25 -0
  10. package/src/orchestration/patterns/swarm.js +111 -4
  11. package/src/orchestration/replanning/adaptive-goal-modifier.js +1150 -0
  12. package/src/orchestration/replanning/alternative-generator.js +508 -0
  13. package/src/orchestration/replanning/config.js +378 -0
  14. package/src/orchestration/replanning/goal-progress-tracker.js +727 -0
  15. package/src/orchestration/replanning/index.js +82 -0
  16. package/src/orchestration/replanning/plan-evaluator.js +455 -0
  17. package/src/orchestration/replanning/plan-monitor.js +379 -0
  18. package/src/orchestration/replanning/proactive-path-optimizer.js +972 -0
  19. package/src/orchestration/replanning/replan-history.js +402 -0
  20. package/src/orchestration/replanning/replanning-engine.js +706 -0
  21. package/src/templates/agents/claude-code/CLAUDE.md +45 -0
  22. package/src/templates/agents/claude-code/skills/orchestrator/SKILL.md +20 -0
  23. package/src/templates/agents/claude-code/skills/orchestrator/patterns.md +89 -0
  24. package/src/templates/agents/codex/AGENTS.md +13 -0
  25. package/src/templates/agents/cursor/AGENTS.md +13 -0
  26. package/src/templates/agents/gemini-cli/GEMINI.md +13 -0
  27. package/src/templates/agents/github-copilot/AGENTS.md +13 -0
  28. package/src/templates/agents/qwen-code/QWEN.md +13 -0
  29. package/src/templates/agents/windsurf/AGENTS.md +13 -0
@@ -233,6 +233,51 @@ MUSUBI enforces 9 immutable constitutional articles:
233
233
  /sdd-change-archive add-2fa
234
234
  ```
235
235
 
236
+ ## CLI Commands (v3.5.0)
237
+
238
+ MUSUBI provides powerful CLI tools that can be used from any terminal. Install with:
239
+
240
+ ```bash
241
+ npm install -g musubi-sdd
242
+ # or use directly
243
+ npx musubi-sdd <command>
244
+ ```
245
+
246
+ ### Core Commands
247
+
248
+ | Command | Purpose | Example |
249
+ |---------|---------|---------|
250
+ | `musubi-workflow` | Workflow state & metrics | `npx musubi-workflow status` |
251
+ | `musubi-requirements` | EARS requirements | `npx musubi-requirements init <feature>` |
252
+ | `musubi-design` | C4 + ADR design | `npx musubi-design init <feature>` |
253
+ | `musubi-tasks` | Task breakdown | `npx musubi-tasks init <feature>` |
254
+ | `musubi-trace` | Traceability | `npx musubi-trace matrix` |
255
+ | `musubi-validate` | Constitutional validation | `npx musubi-validate all` |
256
+
257
+ ### Advanced Commands (v3.5.0 NEW)
258
+
259
+ | Command | Purpose | Example |
260
+ |---------|---------|---------|
261
+ | `musubi-orchestrate` | Multi-skill orchestration | `npx musubi-orchestrate auto <task>` |
262
+ | `musubi-browser` | Browser automation & E2E | `npx musubi-browser run "click login"` |
263
+ | `musubi-gui` | Web GUI dashboard | `npx musubi-gui start` |
264
+ | `musubi-remember` | Agent memory management | `npx musubi-remember extract` |
265
+ | `musubi-resolve` | GitHub Issue resolution | `npx musubi-resolve <issue-number>` |
266
+ | `musubi-convert` | Format conversion | `npx musubi-convert to-speckit` |
267
+
268
+ ### Replanning Commands (v3.6.0 NEW)
269
+
270
+ | Command | Purpose | Example |
271
+ |---------|---------|---------|
272
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `npx musubi-orchestrate replan <context-id>` |
273
+ | `musubi-orchestrate goal register` | Register a new goal | `npx musubi-orchestrate goal register --name "Deploy API"` |
274
+ | `musubi-orchestrate goal update` | Update goal progress | `npx musubi-orchestrate goal update <goal-id> --progress 50` |
275
+ | `musubi-orchestrate goal status` | View goal status | `npx musubi-orchestrate goal status [goal-id]` |
276
+ | `musubi-orchestrate optimize run` | Run path optimization | `npx musubi-orchestrate optimize run <path-id>` |
277
+ | `musubi-orchestrate optimize suggest` | Get optimization suggestions | `npx musubi-orchestrate optimize suggest <path-id>` |
278
+ | `musubi-orchestrate path analyze` | Analyze execution path | `npx musubi-orchestrate path analyze <path-id>` |
279
+ | `musubi-orchestrate path optimize` | Optimize execution path | `npx musubi-orchestrate path optimize <path-id>` |
280
+
236
281
  ## Learn More
237
282
 
238
283
  - [MUSUBI Documentation](https://github.com/your-org/musubi)
@@ -105,6 +105,15 @@ The Orchestrator can leverage all MUSUBI CLI commands to execute tasks efficient
105
105
  | `musubi-resolve` | GitHub Issue auto-resolution | `musubi-resolve <issue-number>` |
106
106
  | `musubi-convert` | Format conversion (Spec Kit) | `musubi-convert to-speckit` |
107
107
 
108
+ ### Replanning Commands (v3.6.0 NEW)
109
+
110
+ | Command | Purpose | Example |
111
+ | ------------------------------ | ---------------------------- | ------------------------------------------------- |
112
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `musubi-orchestrate replan <context-id>` |
113
+ | `musubi-orchestrate goal` | Goal management | `musubi-orchestrate goal register --name "Deploy"`|
114
+ | `musubi-orchestrate optimize` | Path optimization | `musubi-orchestrate optimize run <path-id>` |
115
+ | `musubi-orchestrate path` | Path analysis | `musubi-orchestrate path analyze <path-id>` |
116
+
108
117
  ### Detailed Command Options
109
118
 
110
119
  **musubi-workflow** (v2.1.0 NEW):
@@ -228,6 +237,17 @@ The Orchestrator can leverage all MUSUBI CLI commands to execute tasks efficient
228
237
  - `analyze` - Analyze format compatibility
229
238
  - `--output <dir>` - Specify output directory
230
239
 
240
+ **musubi-orchestrate replanning** (v3.6.0 NEW):
241
+
242
+ - `replan <context-id>` - Execute dynamic replanning for a context
243
+ - `goal register --name <name>` - Register a new goal
244
+ - `goal update <goal-id> --progress <percentage>` - Update goal progress
245
+ - `goal status [goal-id]` - View goal status (all goals or specific)
246
+ - `optimize run <path-id>` - Run path optimization
247
+ - `optimize suggest <path-id>` - Get optimization suggestions
248
+ - `path analyze <path-id>` - Analyze execution path
249
+ - `path optimize <path-id>` - Optimize execution path
250
+
231
251
  ---
232
252
 
233
253
  ## OpenHands-Inspired Modules (v3.0.0)
@@ -226,6 +226,8 @@ Before Production Release:
226
226
  | Design review | Group Chat | Multi-perspective feedback |
227
227
  | Production release | Human-in-Loop | Critical validation |
228
228
  | Unclear request | Auto | Let orchestrator decide |
229
+ | Long-running workflows | Replanning | Handle failures gracefully |
230
+ | Resilient execution | Replanning | Automatic recovery |
229
231
 
230
232
  ---
231
233
 
@@ -264,3 +266,90 @@ Sequential Phase (continue):
264
266
  Human Gate:
265
267
  → Release approval
266
268
  ```
269
+
270
+ ---
271
+
272
+ ## Pattern 7: Replanning Pattern (v3.6.0 NEW)
273
+
274
+ **Description**: Dynamic replanning when tasks fail, timeout, or encounter obstacles. The ReplanningEngine monitors execution and adjusts plans in real-time.
275
+
276
+ ```
277
+ Execute Task
278
+
279
+ Monitor (failure/timeout/quality issue?)
280
+ ↓ Yes
281
+ Trigger Replan
282
+
283
+ Analyze Context
284
+
285
+ Generate Alternative Plan
286
+
287
+ Execute Alternative
288
+ ```
289
+
290
+ **Use When**:
291
+ - Tasks may fail or timeout
292
+ - Alternative approaches exist
293
+ - Resilience is critical
294
+ - Long-running workflows
295
+
296
+ **Components**:
297
+
298
+ | Component | Purpose | CLI Command |
299
+ |-----------|---------|-------------|
300
+ | ReplanningEngine | Core replanning logic | `musubi-orchestrate replan <context-id>` |
301
+ | GoalProgressTracker | Track goal completion | `musubi-orchestrate goal status` |
302
+ | ProactivePathOptimizer | Optimize execution paths | `musubi-orchestrate optimize run <path-id>` |
303
+ | AdaptiveGoalModifier | Adjust goals dynamically | `musubi-orchestrate goal update <goal-id>` |
304
+
305
+ **Example**:
306
+ ```
307
+ User: "Deploy API to production"
308
+
309
+ Initial Plan:
310
+ 1. Build → 2. Test → 3. Deploy
311
+
312
+ Execution:
313
+ 1. Build ✓
314
+ 2. Test → FAILURE (timeout)
315
+
316
+ Replan Triggered:
317
+ - Reason: timeout
318
+ - Decision: retry with smaller test subset
319
+ - Alternative: 2a. Run critical tests only
320
+
321
+ Continue:
322
+ 2a. Critical Tests ✓
323
+ 3. Deploy ✓
324
+ ```
325
+
326
+ **Trigger Types**:
327
+ - `failure` - Task execution failed
328
+ - `timeout` - Task exceeded time limit
329
+ - `quality` - Output quality below threshold
330
+ - `manual` - Human-triggered replan
331
+ - `dependency` - Dependency unavailable
332
+
333
+ **Decision Types**:
334
+ - `continue` - Proceed with next task
335
+ - `retry` - Retry the failed task
336
+ - `alternative` - Use alternative approach
337
+ - `abort` - Stop execution
338
+ - `human` - Escalate to human decision
339
+
340
+ **CLI Usage**:
341
+ ```bash
342
+ # Execute replanning for a context
343
+ musubi-orchestrate replan ctx-12345
344
+
345
+ # Register and track goals
346
+ musubi-orchestrate goal register --name "Deploy API" --target 100
347
+ musubi-orchestrate goal update goal-1 --progress 50
348
+ musubi-orchestrate goal status
349
+
350
+ # Optimize execution paths
351
+ musubi-orchestrate path analyze path-1
352
+ musubi-orchestrate optimize suggest path-1
353
+ musubi-orchestrate optimize run path-1
354
+ ```
355
+
@@ -177,6 +177,19 @@ npx musubi-sdd <command>
177
177
  | `musubi-resolve` | GitHub Issue resolution | `npx musubi-resolve <issue-number>` |
178
178
  | `musubi-convert` | Format conversion | `npx musubi-convert to-speckit` |
179
179
 
180
+ ### Replanning Commands (v3.6.0 NEW)
181
+
182
+ | Command | Purpose | Example |
183
+ |---------|---------|--------|
184
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `npx musubi-orchestrate replan <context-id>` |
185
+ | `musubi-orchestrate goal register` | Register a new goal | `npx musubi-orchestrate goal register --name "Deploy API"` |
186
+ | `musubi-orchestrate goal update` | Update goal progress | `npx musubi-orchestrate goal update <goal-id> --progress 50` |
187
+ | `musubi-orchestrate goal status` | View goal status | `npx musubi-orchestrate goal status [goal-id]` |
188
+ | `musubi-orchestrate optimize run` | Run path optimization | `npx musubi-orchestrate optimize run <path-id>` |
189
+ | `musubi-orchestrate optimize suggest` | Get optimization suggestions | `npx musubi-orchestrate optimize suggest <path-id>` |
190
+ | `musubi-orchestrate path analyze` | Analyze execution path | `npx musubi-orchestrate path analyze <path-id>` |
191
+ | `musubi-orchestrate path optimize` | Optimize execution path | `npx musubi-orchestrate path optimize <path-id>` |
192
+
180
193
  ## Learn More
181
194
 
182
195
  - [MUSUBI Documentation](https://github.com/nahisaho/musubi)
@@ -177,6 +177,19 @@ npx musubi-sdd <command>
177
177
  | `musubi-resolve` | GitHub Issue resolution | `npx musubi-resolve <issue-number>` |
178
178
  | `musubi-convert` | Format conversion | `npx musubi-convert to-speckit` |
179
179
 
180
+ ### Replanning Commands (v3.6.0 NEW)
181
+
182
+ | Command | Purpose | Example |
183
+ |---------|---------|--------|
184
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `npx musubi-orchestrate replan <context-id>` |
185
+ | `musubi-orchestrate goal register` | Register a new goal | `npx musubi-orchestrate goal register --name "Deploy API"` |
186
+ | `musubi-orchestrate goal update` | Update goal progress | `npx musubi-orchestrate goal update <goal-id> --progress 50` |
187
+ | `musubi-orchestrate goal status` | View goal status | `npx musubi-orchestrate goal status [goal-id]` |
188
+ | `musubi-orchestrate optimize run` | Run path optimization | `npx musubi-orchestrate optimize run <path-id>` |
189
+ | `musubi-orchestrate optimize suggest` | Get optimization suggestions | `npx musubi-orchestrate optimize suggest <path-id>` |
190
+ | `musubi-orchestrate path analyze` | Analyze execution path | `npx musubi-orchestrate path analyze <path-id>` |
191
+ | `musubi-orchestrate path optimize` | Optimize execution path | `npx musubi-orchestrate path optimize <path-id>` |
192
+
180
193
  ## Learn More
181
194
 
182
195
  - [MUSUBI Documentation](https://github.com/nahisaho/musubi)
@@ -166,6 +166,19 @@ npx musubi-sdd <command>
166
166
  | `musubi-resolve` | GitHub Issue resolution | `npx musubi-resolve <issue-number>` |
167
167
  | `musubi-convert` | Format conversion | `npx musubi-convert to-speckit` |
168
168
 
169
+ ### Replanning Commands (v3.6.0 NEW)
170
+
171
+ | Command | Purpose | Example |
172
+ |---------|---------|--------|
173
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `npx musubi-orchestrate replan <context-id>` |
174
+ | `musubi-orchestrate goal register` | Register a new goal | `npx musubi-orchestrate goal register --name "Deploy API"` |
175
+ | `musubi-orchestrate goal update` | Update goal progress | `npx musubi-orchestrate goal update <goal-id> --progress 50` |
176
+ | `musubi-orchestrate goal status` | View goal status | `npx musubi-orchestrate goal status [goal-id]` |
177
+ | `musubi-orchestrate optimize run` | Run path optimization | `npx musubi-orchestrate optimize run <path-id>` |
178
+ | `musubi-orchestrate optimize suggest` | Get optimization suggestions | `npx musubi-orchestrate optimize suggest <path-id>` |
179
+ | `musubi-orchestrate path analyze` | Analyze execution path | `npx musubi-orchestrate path analyze <path-id>` |
180
+ | `musubi-orchestrate path optimize` | Optimize execution path | `npx musubi-orchestrate path optimize <path-id>` |
181
+
169
182
  ## Learn More
170
183
 
171
184
  - [MUSUBI Documentation](https://github.com/nahisaho/musubi)
@@ -204,6 +204,19 @@ npx musubi-sdd <command>
204
204
  | `musubi-resolve` | GitHub Issue auto-resolution | `npx musubi-resolve <issue-number>` |
205
205
  | `musubi-convert` | Format conversion (Spec Kit) | `npx musubi-convert to-speckit` |
206
206
 
207
+ ### Replanning Commands (v3.6.0 NEW)
208
+
209
+ | Command | Purpose | Example |
210
+ |---------|---------|---------|
211
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `npx musubi-orchestrate replan <context-id>` |
212
+ | `musubi-orchestrate goal register` | Register a new goal | `npx musubi-orchestrate goal register --name "Deploy API"` |
213
+ | `musubi-orchestrate goal update` | Update goal progress | `npx musubi-orchestrate goal update <goal-id> --progress 50` |
214
+ | `musubi-orchestrate goal status` | View goal status | `npx musubi-orchestrate goal status [goal-id]` |
215
+ | `musubi-orchestrate optimize run` | Run path optimization | `npx musubi-orchestrate optimize run <path-id>` |
216
+ | `musubi-orchestrate optimize suggest` | Get optimization suggestions | `npx musubi-orchestrate optimize suggest <path-id>` |
217
+ | `musubi-orchestrate path analyze` | Analyze execution path | `npx musubi-orchestrate path analyze <path-id>` |
218
+ | `musubi-orchestrate path optimize` | Optimize execution path | `npx musubi-orchestrate path optimize <path-id>` |
219
+
207
220
  ### CLI + Prompt Integration
208
221
 
209
222
  Combine CLI commands with GitHub Copilot prompts for maximum efficiency:
@@ -166,6 +166,19 @@ npx musubi-sdd <command>
166
166
  | `musubi-resolve` | GitHub Issue resolution | `npx musubi-resolve <issue-number>` |
167
167
  | `musubi-convert` | Format conversion | `npx musubi-convert to-speckit` |
168
168
 
169
+ ### Replanning Commands (v3.6.0 NEW)
170
+
171
+ | Command | Purpose | Example |
172
+ |---------|---------|--------|
173
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `npx musubi-orchestrate replan <context-id>` |
174
+ | `musubi-orchestrate goal register` | Register a new goal | `npx musubi-orchestrate goal register --name "Deploy API"` |
175
+ | `musubi-orchestrate goal update` | Update goal progress | `npx musubi-orchestrate goal update <goal-id> --progress 50` |
176
+ | `musubi-orchestrate goal status` | View goal status | `npx musubi-orchestrate goal status [goal-id]` |
177
+ | `musubi-orchestrate optimize run` | Run path optimization | `npx musubi-orchestrate optimize run <path-id>` |
178
+ | `musubi-orchestrate optimize suggest` | Get optimization suggestions | `npx musubi-orchestrate optimize suggest <path-id>` |
179
+ | `musubi-orchestrate path analyze` | Analyze execution path | `npx musubi-orchestrate path analyze <path-id>` |
180
+ | `musubi-orchestrate path optimize` | Optimize execution path | `npx musubi-orchestrate path optimize <path-id>` |
181
+
169
182
  ## Learn More
170
183
 
171
184
  - [MUSUBI Documentation](https://github.com/nahisaho/musubi)
@@ -177,6 +177,19 @@ npx musubi-sdd <command>
177
177
  | `musubi-resolve` | GitHub Issue resolution | `npx musubi-resolve <issue-number>` |
178
178
  | `musubi-convert` | Format conversion | `npx musubi-convert to-speckit` |
179
179
 
180
+ ### Replanning Commands (v3.6.0 NEW)
181
+
182
+ | Command | Purpose | Example |
183
+ |---------|---------|--------|
184
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `npx musubi-orchestrate replan <context-id>` |
185
+ | `musubi-orchestrate goal register` | Register a new goal | `npx musubi-orchestrate goal register --name "Deploy API"` |
186
+ | `musubi-orchestrate goal update` | Update goal progress | `npx musubi-orchestrate goal update <goal-id> --progress 50` |
187
+ | `musubi-orchestrate goal status` | View goal status | `npx musubi-orchestrate goal status [goal-id]` |
188
+ | `musubi-orchestrate optimize run` | Run path optimization | `npx musubi-orchestrate optimize run <path-id>` |
189
+ | `musubi-orchestrate optimize suggest` | Get optimization suggestions | `npx musubi-orchestrate optimize suggest <path-id>` |
190
+ | `musubi-orchestrate path analyze` | Analyze execution path | `npx musubi-orchestrate path analyze <path-id>` |
191
+ | `musubi-orchestrate path optimize` | Optimize execution path | `npx musubi-orchestrate path optimize <path-id>` |
192
+
180
193
  ## Learn More
181
194
 
182
195
  - [MUSUBI Documentation](https://github.com/nahisaho/musubi)