claude-symphony 0.0.5 → 0.0.6

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 (32) hide show
  1. package/bin/create.js +120 -3
  2. package/package.json +3 -2
  3. package/template/.claude/settings.json +0 -2
  4. package/template/.claude/skills/context-compression/README.md +39 -0
  5. package/template/CLAUDE.md +64 -1
  6. package/template/config/ai_fallbacks.yaml +130 -0
  7. package/template/config/implementation.yaml.template +72 -72
  8. package/template/config/pipeline.yaml +50 -0
  9. package/template/config/ui-ux.yaml +31 -0
  10. package/template/scripts/config-manager.sh +350 -0
  11. package/template/scripts/context-manager.sh +55 -4
  12. package/template/scripts/goto-stage.sh +264 -0
  13. package/template/scripts/next-stage.sh +132 -0
  14. package/template/stages/01-brainstorm/HANDOFF.md.template +42 -42
  15. package/template/stages/02-research/HANDOFF.md.template +42 -42
  16. package/template/stages/03-planning/HANDOFF.md.template +39 -39
  17. package/template/stages/04-ui-ux/CLAUDE.md +40 -0
  18. package/template/stages/04-ui-ux/HANDOFF.md.template +38 -38
  19. package/template/stages/04-ui-ux/inputs/moodboard/brand-assets/.gitkeep +3 -0
  20. package/template/stages/04-ui-ux/inputs/moodboard/sketches/.gitkeep +3 -0
  21. package/template/stages/04-ui-ux/inputs/moodboard/ui-references/.gitkeep +3 -0
  22. package/template/stages/05-task-management/HANDOFF.md.template +38 -38
  23. package/template/stages/06-implementation/CLAUDE.md +39 -0
  24. package/template/stages/06-implementation/HANDOFF.md.template +76 -76
  25. package/template/stages/06-implementation/config.yaml +16 -0
  26. package/template/stages/07-refactoring/HANDOFF.md.template +42 -42
  27. package/template/stages/08-qa/HANDOFF.md.template +45 -45
  28. package/template/stages/09-testing/HANDOFF.md.template +46 -46
  29. package/template/stages/10-deployment/HANDOFF.md.template +60 -60
  30. package/template/state/progress.json.template +26 -0
  31. package/template/state/templates/handoff_base.md.template +57 -57
  32. package/template/state/templates/phase_state.md.template +35 -35
package/bin/create.js CHANGED
@@ -3,7 +3,8 @@
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
5
  import { fileURLToPath } from 'url';
6
- import { input } from '@inquirer/prompts';
6
+ import { input, confirm } from '@inquirer/prompts';
7
+ import yaml from 'js-yaml';
7
8
 
8
9
  const __filename = fileURLToPath(import.meta.url);
9
10
  const __dirname = path.dirname(__filename);
@@ -79,9 +80,106 @@ async function collectBriefInfo() {
79
80
  featureNum++;
80
81
  }
81
82
 
83
+ // === Development mode configuration ===
84
+ console.log('');
85
+ log('⚙️ Development mode configuration', 'yellow');
86
+
87
+ info.sprintMode = await confirm({
88
+ message: '🔄 Enable sprint-based iterative development?',
89
+ default: true
90
+ });
91
+
92
+ if (info.sprintMode) {
93
+ info.defaultSprints = await input({
94
+ message: '📊 Default number of sprints:',
95
+ default: '3',
96
+ validate: (v) => {
97
+ const num = parseInt(v);
98
+ if (isNaN(num) || num < 1) return 'Enter a number >= 1';
99
+ if (num > 100) return '⚠️ Maximum 100 sprints allowed';
100
+ return true;
101
+ }
102
+ });
103
+ }
104
+
105
+ info.notionEnabled = await confirm({
106
+ message: '📋 Enable Notion task integration?',
107
+ default: true
108
+ });
109
+
82
110
  return info;
83
111
  }
84
112
 
113
+ function applyConfigSettings(targetDir, info) {
114
+ const pipelinePath = path.join(targetDir, 'config', 'pipeline.yaml');
115
+ const taskConfigPath = path.join(targetDir, 'stages', '05-task-management', 'config.yaml');
116
+ const progressPath = path.join(targetDir, 'state', 'progress.json');
117
+
118
+ // Sprint mode settings
119
+ if (fs.existsSync(pipelinePath)) {
120
+ try {
121
+ let content = fs.readFileSync(pipelinePath, 'utf8');
122
+ const config = yaml.load(content);
123
+
124
+ if (config.sprint_mode) {
125
+ config.sprint_mode.enabled = info.sprintMode ?? true;
126
+ config.sprint_mode.sprint_config.default_sprints = parseInt(info.defaultSprints) || 3;
127
+ }
128
+
129
+ fs.writeFileSync(pipelinePath, yaml.dump(config, { lineWidth: -1 }));
130
+ } catch (e) {
131
+ // Silently continue if YAML parsing fails
132
+ }
133
+ }
134
+
135
+ // Notion settings (if config exists)
136
+ if (fs.existsSync(taskConfigPath)) {
137
+ try {
138
+ let content = fs.readFileSync(taskConfigPath, 'utf8');
139
+ const config = yaml.load(content);
140
+
141
+ if (config && !config.notion_integration) {
142
+ config.notion_integration = { enabled: info.notionEnabled ?? true };
143
+ } else if (config && config.notion_integration) {
144
+ config.notion_integration.enabled = info.notionEnabled ?? true;
145
+ }
146
+
147
+ fs.writeFileSync(taskConfigPath, yaml.dump(config, { lineWidth: -1 }));
148
+ } catch (e) {
149
+ // Silently continue if YAML parsing fails
150
+ }
151
+ }
152
+
153
+ // Update progress.json with sprint count
154
+ if (fs.existsSync(progressPath)) {
155
+ try {
156
+ const progress = JSON.parse(fs.readFileSync(progressPath, 'utf8'));
157
+ const sprintCount = parseInt(info.defaultSprints) || 3;
158
+
159
+ if (progress.current_iteration) {
160
+ progress.current_iteration.total_sprints = sprintCount;
161
+ }
162
+
163
+ // Regenerate sprints object based on count
164
+ if (progress.sprints) {
165
+ progress.sprints = {};
166
+ for (let i = 1; i <= sprintCount; i++) {
167
+ progress.sprints[`Sprint ${i}`] = {
168
+ status: "pending",
169
+ tasks_total: 0,
170
+ tasks_completed: 0,
171
+ checkpoint_id: null
172
+ };
173
+ }
174
+ }
175
+
176
+ fs.writeFileSync(progressPath, JSON.stringify(progress, null, 2));
177
+ } catch (e) {
178
+ // Silently continue if JSON parsing fails
179
+ }
180
+ }
181
+ }
182
+
85
183
  function generateBriefContent(projectName, info) {
86
184
  // Core features formatting
87
185
  let featuresContent;
@@ -220,7 +318,13 @@ ${colors.yellow}After creation:${colors.reset}
220
318
  log('✓ progress.json initialized', 'green');
221
319
  }
222
320
 
223
- // 5. Create project_brief.md
321
+ // 5. Apply configuration settings (sprint mode, notion)
322
+ if (!skipPrompts) {
323
+ applyConfigSettings(targetDir, briefInfo);
324
+ log('✓ Configuration settings applied', 'green');
325
+ }
326
+
327
+ // 6. Create project_brief.md
224
328
  const briefPath = path.join(targetDir, 'stages', '01-brainstorm', 'inputs', 'project_brief.md');
225
329
  const briefDir = path.dirname(briefPath);
226
330
 
@@ -232,7 +336,7 @@ ${colors.yellow}After creation:${colors.reset}
232
336
  fs.writeFileSync(briefPath, briefContent);
233
337
  log('✓ project_brief.md created', 'green');
234
338
 
235
- // 6. Completion message
339
+ // 7. Completion message
236
340
  console.log('');
237
341
  log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', 'green');
238
342
  log(`✓ Project '${actualProjectName}' created successfully!`, 'green');
@@ -253,6 +357,19 @@ ${colors.yellow}After creation:${colors.reset}
253
357
  console.log(' → 05-task-management → 06-implementation → 07-refactoring');
254
358
  console.log(' → 08-qa → 09-testing → 10-deployment');
255
359
  console.log('');
360
+ // Plugin installation message (more prominent)
361
+ console.log('');
362
+ log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', 'yellow');
363
+ log('🎯 Recommended: Install claude-hud plugin', 'yellow');
364
+ log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', 'yellow');
365
+ console.log('');
366
+ console.log(' claude-hud visualizes context usage, tool activity, and progress.');
367
+ console.log('');
368
+ console.log(' Run these commands in Claude Code:');
369
+ console.log('');
370
+ log(' /plugin marketplace add jarrodwatts/claude-hud', 'cyan');
371
+ log(' /plugin install claude-hud', 'cyan');
372
+ console.log('');
256
373
  }
257
374
 
258
375
  main().catch(err => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-symphony",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Multi-AI Orchestration Framework - Create new projects with 10-stage development workflow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "homepage": "https://github.com/znehraks/claude-symphony#readme",
41
41
  "dependencies": {
42
- "@inquirer/prompts": "^7.10.1"
42
+ "@inquirer/prompts": "^7.10.1",
43
+ "js-yaml": "^4.1.0"
43
44
  }
44
45
  }
@@ -24,7 +24,6 @@
24
24
  "stop": ".claude/hooks/stop.sh - auto /compact",
25
25
  "session_start": ".claude/hooks/session-start.sh - auto recovery"
26
26
  },
27
-
28
27
  "commands": {
29
28
  "init-project": {
30
29
  "description": "Initialize new project",
@@ -127,7 +126,6 @@
127
126
  "file": "commands/validate.md"
128
127
  }
129
128
  },
130
-
131
129
  "skills": {
132
130
  "smart-handoff": {
133
131
  "description": "Smart context extraction and HANDOFF generation",
@@ -119,3 +119,42 @@ Adjust thresholds in settings.json:
119
119
  }
120
120
  }
121
121
  ```
122
+
123
+ ## Claude Code Built-in vs Custom Tools
124
+
125
+ ### Built-in Summarization (`/compact`)
126
+ Claude Code has built-in context summarization that:
127
+ - Automatically condenses conversation history
128
+ - Preserves key decisions and context
129
+ - Runs without external tools
130
+
131
+ **When to use:** Quick compression when context is getting large
132
+
133
+ ### Custom Pipeline (`context-manager.sh`)
134
+ This project provides additional tooling:
135
+ - Token estimation based on file content
136
+ - Auto-snapshot generation
137
+ - Stage-aware context tracking
138
+ - Recovery file generation
139
+
140
+ **When to use:** Full state management with recovery capability
141
+
142
+ ### claude-hud Plugin Integration
143
+
144
+ For real-time context monitoring, install the claude-hud plugin:
145
+
146
+ ```bash
147
+ /plugin marketplace add jarrodwatts/claude-hud
148
+ /plugin install claude-hud
149
+ ```
150
+
151
+ **Benefits with claude-hud:**
152
+ - Visual context usage in statusline
153
+ - Proactive warnings before thresholds
154
+ - No manual `/context` checks needed
155
+
156
+ **Combined workflow:**
157
+ 1. claude-hud monitors context visually
158
+ 2. When warning appears, run `./scripts/context-manager.sh --auto-compact warning`
159
+ 3. Script saves snapshot then triggers `/compact`
160
+ 4. Recovery possible from saved snapshots
@@ -71,6 +71,46 @@
71
71
  2. **externalize_code**: Replace code blocks with file references
72
72
  3. **handoff_generation**: Externalize current state to HANDOFF.md
73
73
 
74
+ ### Context Check Protocol
75
+
76
+ > Run `/context` every 5 completed tasks to check token usage.
77
+
78
+ | Remaining Context | Status | Recommended Action |
79
+ |-------------------|--------|-------------------|
80
+ | **60%+** | Normal | Continue working |
81
+ | **50-60%** | Warning | Consider `/compact` |
82
+ | **40-50%** | Action | Run `/compact`, save state |
83
+ | **<40%** | Critical | `/clear` or handoff required |
84
+
85
+ **Protocol Steps:**
86
+ 1. After every 5 tasks, run `/context` to check usage
87
+ 2. If warning level reached, run `./scripts/context-manager.sh --auto-compact warning`
88
+ 3. If critical level reached, generate HANDOFF.md before `/clear`
89
+
90
+ ## Recommended Plugins
91
+
92
+ ### 🎯 claude-hud (Context Monitoring) - Highly Recommended!
93
+
94
+ Visualizes context usage, tool activity, and todo progress in the statusline.
95
+
96
+ **Installation (run in Claude Code):**
97
+ ```bash
98
+ /plugin marketplace add jarrodwatts/claude-hud
99
+ /plugin install claude-hud
100
+
101
+ # Step 3: Setup (optional)
102
+ /claude-hud:setup
103
+ ```
104
+
105
+ **Features:**
106
+ - Context window usage visualization
107
+ - Tool activity tracking
108
+ - Agent state monitoring
109
+ - Todo progress display
110
+ - Git branch info
111
+
112
+ **GitHub:** https://github.com/jarrodwatts/claude-hud
113
+
74
114
  ## Stage Transition Protocol
75
115
 
76
116
  ### Required Sequence
@@ -117,9 +157,32 @@
117
157
  ### Navigation Commands
118
158
  | Command | Description |
119
159
  |---------|-------------|
120
- | `/next` | Transition to next stage |
160
+ | `/next` | Transition to next stage (or next Sprint in Stage 06) |
161
+ | `/next --stage` | Force stage transition (skip Sprint check) |
121
162
  | `/restore` | Restore from checkpoint |
122
163
 
164
+ ### Sprint Commands
165
+ | Command | Description |
166
+ |---------|-------------|
167
+ | `/sprint` | Show current sprint status |
168
+ | `/sprint tasks` | List tasks for current sprint |
169
+ | `/sprint complete` | Mark current sprint as complete |
170
+
171
+ ### Loop-back Commands
172
+ | Command | Description |
173
+ |---------|-------------|
174
+ | `/goto <stage>` | Jump to previous stage (intentional loop-back) |
175
+ | `/goto --list` | Show available stages for loop-back |
176
+ | `/goto --history` | Show loop-back history |
177
+
178
+ ### Configuration Commands
179
+ | Command | Description |
180
+ |---------|-------------|
181
+ | `/config sprint enable` | Enable sprint mode |
182
+ | `/config sprint disable` | Disable sprint mode (single-pass) |
183
+ | `/config sprint status` | Show current iteration settings |
184
+ | `/config sprint count <n>` | Set default sprint count |
185
+
123
186
  ### Stage Shortcut Commands
124
187
  | Command | Stage |
125
188
  |---------|-------|
@@ -0,0 +1,130 @@
1
+ # AI Model Fallback Strategy
2
+ # Principle: Claude=MCP tools, Codex=Pure code analysis, Gemini=Creative tasks
3
+
4
+ fallback_strategy:
5
+ default_fallback: claude
6
+ auto_switch: true
7
+ retry_count: 2
8
+ retry_delay_ms: 3000
9
+
10
+ # Stage-specific primary model (based on MCP usage)
11
+ # MCP tools: exa, web_search, context7, playwright, notion, figma, etc.
12
+ stage_overrides:
13
+ 01-brainstorm:
14
+ primary: gemini # Creative idea generation
15
+ fallback: claude
16
+ mcp_required: false
17
+ rationale: "Brainstorming benefits from Gemini's creative divergent thinking"
18
+
19
+ 02-research:
20
+ primary: claude # Uses exa, web_search MCP tools
21
+ fallback: gemini
22
+ mcp_required: true
23
+ mcp_tools: [exa, web_search]
24
+ rationale: "Research requires MCP tools for web search and data gathering"
25
+
26
+ 03-planning:
27
+ primary: gemini # Architecture design (creative)
28
+ fallback: claude
29
+ mcp_required: false
30
+ rationale: "System architecture benefits from creative exploration"
31
+
32
+ 04-ui-ux:
33
+ primary: gemini # Design creativity
34
+ fallback: claude
35
+ mcp_required: false # figma MCP is optional
36
+ mcp_tools: [figma]
37
+ rationale: "UI/UX design requires creative visual thinking"
38
+
39
+ 05-task-management:
40
+ primary: claude # Uses notion MCP
41
+ fallback: gemini
42
+ mcp_required: true
43
+ mcp_tools: [notion]
44
+ rationale: "Task management integrates with Notion via MCP"
45
+
46
+ 06-implementation:
47
+ primary: claude # Uses context7 MCP for docs
48
+ fallback: codex
49
+ mcp_required: true
50
+ mcp_tools: [context7, serena]
51
+ rationale: "Implementation needs context7 for up-to-date documentation"
52
+
53
+ 07-refactoring:
54
+ primary: codex # Pure code analysis/refactoring
55
+ fallback: claude
56
+ mcp_required: false
57
+ rationale: "Refactoring is pure code analysis - Codex specialty"
58
+
59
+ 08-qa:
60
+ primary: claude # May use playwright MCP
61
+ fallback: codex
62
+ mcp_required: false # playwright optional for manual QA
63
+ mcp_tools: [playwright]
64
+ rationale: "QA can benefit from browser automation via playwright"
65
+
66
+ 09-testing:
67
+ primary: claude # Uses playwright MCP for E2E tests
68
+ fallback: codex # Unit tests don't need MCP
69
+ mcp_required: true
70
+ mcp_tools: [playwright]
71
+ rationale: "E2E testing requires playwright MCP for browser automation"
72
+
73
+ 10-deployment:
74
+ primary: claude # General task handling
75
+ fallback: codex
76
+ mcp_required: false
77
+ rationale: "Deployment scripts and CI/CD configuration"
78
+
79
+ # Fallback trigger conditions
80
+ triggers:
81
+ - api_failure # API call failed
82
+ - rate_limit # Rate limit exceeded
83
+ - quality_threshold_fail # Output quality below threshold
84
+ - timeout # Response timeout
85
+ - context_overflow # Context window exceeded
86
+
87
+ # Quality thresholds for auto-fallback
88
+ quality_thresholds:
89
+ code_quality: 0.7 # Lint/typecheck pass rate
90
+ test_coverage: 0.6 # Minimum coverage for fallback
91
+ response_coherence: 0.8 # Response quality score
92
+
93
+ # Logging configuration
94
+ logging:
95
+ enabled: true
96
+ destination: HANDOFF.md
97
+ log_format: |
98
+ ## AI Model Switch Log
99
+ | Time | From | To | Reason | Stage |
100
+ |------|------|----|---------| ------|
101
+
102
+ # Model capabilities reference
103
+ model_capabilities:
104
+ claude:
105
+ strengths:
106
+ - MCP tool integration
107
+ - Code generation accuracy
108
+ - Context understanding
109
+ weaknesses:
110
+ - Creative brainstorming
111
+ best_for: [implementation, testing, task_management]
112
+
113
+ gemini:
114
+ strengths:
115
+ - Creative exploration
116
+ - Rapid ideation
117
+ - Visual thinking
118
+ weaknesses:
119
+ - No MCP integration
120
+ best_for: [brainstorming, planning, ui_ux]
121
+
122
+ codex:
123
+ strengths:
124
+ - Deep code analysis
125
+ - Refactoring patterns
126
+ - Code comprehension
127
+ weaknesses:
128
+ - No MCP integration
129
+ - Limited creativity
130
+ best_for: [refactoring, code_review, unit_testing]