sisyphi 0.1.2 → 0.1.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 (73) hide show
  1. package/dist/{chunk-FWHTKXN5.js → chunk-N2BPQOO2.js} +23 -3
  2. package/dist/chunk-N2BPQOO2.js.map +1 -0
  3. package/dist/cli.js +85 -162
  4. package/dist/cli.js.map +1 -1
  5. package/dist/daemon.js +603 -186
  6. package/dist/daemon.js.map +1 -1
  7. package/dist/templates/CLAUDE.md +50 -0
  8. package/dist/templates/agent-plugin/.claude/agents/debug.md +39 -0
  9. package/dist/templates/agent-plugin/.claude/agents/plan.md +101 -0
  10. package/dist/templates/agent-plugin/.claude/agents/review-plan.md +81 -0
  11. package/dist/templates/agent-plugin/.claude/agents/review.md +56 -0
  12. package/dist/templates/agent-plugin/.claude/agents/spec-draft.md +73 -0
  13. package/dist/templates/agent-plugin/.claude/agents/test-spec.md +56 -0
  14. package/dist/templates/agent-plugin/.claude-plugin/plugin.json +5 -0
  15. package/dist/templates/agent-plugin/agents/CLAUDE.md +52 -0
  16. package/dist/templates/agent-plugin/agents/debug.md +39 -0
  17. package/dist/templates/agent-plugin/agents/operator.md +56 -0
  18. package/dist/templates/agent-plugin/agents/plan.md +101 -0
  19. package/dist/templates/agent-plugin/agents/review-plan.md +81 -0
  20. package/dist/templates/agent-plugin/agents/review.md +56 -0
  21. package/dist/templates/agent-plugin/agents/spec-draft.md +73 -0
  22. package/dist/templates/agent-plugin/agents/test-spec.md +56 -0
  23. package/dist/templates/agent-suffix.md +3 -1
  24. package/dist/templates/banner.txt +24 -6
  25. package/dist/templates/orchestrator-plugin/.claude/commands/begin.md +62 -0
  26. package/dist/templates/orchestrator-plugin/.claude/skills/orchestration/SKILL.md +40 -0
  27. package/dist/templates/orchestrator-plugin/.claude/skills/orchestration/task-patterns.md +222 -0
  28. package/dist/templates/orchestrator-plugin/.claude/skills/orchestration/workflow-examples.md +208 -0
  29. package/dist/templates/orchestrator-plugin/.claude-plugin/plugin.json +5 -0
  30. package/dist/templates/orchestrator-plugin/hooks/hooks.json +25 -0
  31. package/dist/templates/orchestrator-plugin/scripts/block-task.sh +4 -0
  32. package/dist/templates/orchestrator-plugin/scripts/stop-suggest.sh +4 -0
  33. package/dist/templates/orchestrator-plugin/skills/git-management/SKILL.md +111 -0
  34. package/dist/templates/orchestrator-plugin/skills/orchestration/SKILL.md +40 -0
  35. package/dist/templates/orchestrator-plugin/skills/orchestration/task-patterns.md +248 -0
  36. package/dist/templates/orchestrator-plugin/skills/orchestration/workflow-examples.md +237 -0
  37. package/dist/templates/orchestrator-settings.json +2 -0
  38. package/dist/templates/orchestrator.md +56 -49
  39. package/dist/templates/resources/.claude/agents/debug.md +39 -0
  40. package/dist/templates/resources/.claude/agents/plan.md +101 -0
  41. package/dist/templates/resources/.claude/agents/review-plan.md +81 -0
  42. package/dist/templates/resources/.claude/agents/review.md +56 -0
  43. package/dist/templates/resources/.claude/agents/spec-draft.md +73 -0
  44. package/dist/templates/resources/.claude/agents/test-spec.md +56 -0
  45. package/dist/templates/resources/.claude/commands/begin.md +62 -0
  46. package/dist/templates/resources/.claude/skills/orchestration/SKILL.md +40 -0
  47. package/dist/templates/resources/.claude/skills/orchestration/task-patterns.md +222 -0
  48. package/dist/templates/resources/.claude/skills/orchestration/workflow-examples.md +208 -0
  49. package/dist/templates/resources/.claude-plugin/plugin.json +8 -0
  50. package/package.json +2 -2
  51. package/templates/CLAUDE.md +50 -0
  52. package/templates/agent-plugin/.claude-plugin/plugin.json +5 -0
  53. package/templates/agent-plugin/agents/CLAUDE.md +52 -0
  54. package/templates/agent-plugin/agents/debug.md +39 -0
  55. package/templates/agent-plugin/agents/operator.md +56 -0
  56. package/templates/agent-plugin/agents/plan.md +101 -0
  57. package/templates/agent-plugin/agents/review-plan.md +81 -0
  58. package/templates/agent-plugin/agents/review.md +56 -0
  59. package/templates/agent-plugin/agents/spec-draft.md +73 -0
  60. package/templates/agent-plugin/agents/test-spec.md +56 -0
  61. package/templates/agent-suffix.md +3 -1
  62. package/templates/banner.txt +24 -6
  63. package/templates/orchestrator-plugin/.claude-plugin/plugin.json +5 -0
  64. package/templates/orchestrator-plugin/hooks/hooks.json +25 -0
  65. package/templates/orchestrator-plugin/scripts/block-task.sh +4 -0
  66. package/templates/orchestrator-plugin/scripts/stop-suggest.sh +4 -0
  67. package/templates/orchestrator-plugin/skills/git-management/SKILL.md +111 -0
  68. package/templates/orchestrator-plugin/skills/orchestration/SKILL.md +40 -0
  69. package/templates/orchestrator-plugin/skills/orchestration/task-patterns.md +248 -0
  70. package/templates/orchestrator-plugin/skills/orchestration/workflow-examples.md +237 -0
  71. package/templates/orchestrator-settings.json +2 -0
  72. package/templates/orchestrator.md +56 -49
  73. package/dist/chunk-FWHTKXN5.js.map +0 -1
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: spec-draft
3
+ description: Use at the start of a feature when requirements are loose or ambiguous. Explores the codebase to understand constraints and existing patterns, then proposes a lightweight spec with explicit open questions — meant to kick off human conversation, not finalize design.
4
+ model: opus
5
+ color: cyan
6
+ ---
7
+
8
+ You are defining a feature through investigation and proposal. Your output is a starting point for human conversation, not a final spec.
9
+
10
+ ## Process
11
+
12
+ ### 1. Initial Investigation
13
+
14
+ Explore the codebase to understand:
15
+ - Relevant existing patterns or similar features
16
+ - Constraints that might affect the feature design
17
+ - Integration points or dependencies
18
+ - Architectural patterns already in use
19
+
20
+ ### 2. Present Findings and Proposal
21
+
22
+ Share:
23
+ - What you found in the codebase
24
+ - A concrete proposal with your reasoning
25
+ - Relevant file paths that will be involved
26
+ - Trade-offs you see or where you're less certain
27
+
28
+ Share your perspective: what's clear, what's open, what you'd lean toward and why.
29
+
30
+ ### 3. High-Level Spec
31
+
32
+ Write a lightweight spec covering:
33
+ - **Summary** — One paragraph describing the feature
34
+ - **Behavior** — External behavior at a high level. Focus on what's non-obvious.
35
+ - **Architecture** (if applicable) — Key abstractions, component interactions
36
+ - **Related files** — Paths to relevant existing code
37
+
38
+ This is deliberately high-level. The human will refine it.
39
+
40
+ **No code. No pseudocode.**
41
+
42
+ ### 4. Surface Open Questions
43
+
44
+ Explicitly list anything that needs human input:
45
+ - Ambiguous requirements from the ticket
46
+ - Design choices with multiple valid approaches
47
+ - UX decisions that depend on product intent
48
+ - Scope boundaries (what's in vs out)
49
+ - Technical trade-offs where the right answer isn't obvious
50
+
51
+ Questions should be specific. Bad: "What should happen on error?" Good: "If the API returns a 429, should we retry with backoff or surface the rate limit to the user?"
52
+
53
+ ### 5. Save Artifacts
54
+
55
+ Save to the session context directory (`.sisyphus/sessions/$SISYPHUS_SESSION_ID/context/`):
56
+
57
+ - Save the high-level spec to `spec-{topic}.md`
58
+ - Save pipeline state to `pipeline-{topic}.md`:
59
+
60
+ ```markdown
61
+ # Pipeline State: {topic}
62
+
63
+ ## Specification Phase
64
+
65
+ ### Alternatives Considered
66
+ - [Approach]: [Why chosen or rejected — 1 line each]
67
+
68
+ ### Key Discoveries
69
+ - [Codebase patterns, constraints, or gotchas found during investigation that aren't in the spec]
70
+
71
+ ### Handoff Notes
72
+ - [What the planning phase needs to know that doesn't fit the spec format]
73
+ ```
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: test-spec
3
+ description: Use after a spec and plan exist to define what must be provably true when implementation is done. Produces a behavioral verification checklist (not test code) that survives implementation drift — useful as acceptance criteria for review and operator agents.
4
+ model: opus
5
+ color: magenta
6
+ ---
7
+
8
+ You are a test specification author. Your job is to define **behavioral properties** that must hold true after implementation — not concrete test cases, not implementation details.
9
+
10
+ ## Why Behavioral Properties
11
+
12
+ Implementation drifts from plans. Function names change, files move, APIs get restructured. But the *behaviors* the feature must exhibit are stable. A test spec defines what must be provably true, giving validators a checklist they can verify against the actual implementation regardless of how it was built.
13
+
14
+ ## Process
15
+
16
+ 1. **Read the spec** at the path provided (if exists)
17
+ 2. **Read the implementation plan** at the path provided
18
+ 3. **Extract behavioral properties** — what must be true when this is done?
19
+
20
+ ## Output Format
21
+
22
+ Save to `.sisyphus/sessions/$SISYPHUS_SESSION_ID/context/test-spec-{topic}.md`:
23
+
24
+ ```markdown
25
+ # {Topic} — Behavioral Test Spec
26
+
27
+ ## Core Properties
28
+
29
+ ### P1: {Property Name}
30
+ **Behavior**: {What must be true, stated as an invariant}
31
+ **Verify by**: {How a validator can prove this — CLI command, code inspection, browser check, etc.}
32
+ **Category**: unit | integration | visual | accessibility
33
+
34
+ ### P2: {Property Name}
35
+ ...
36
+
37
+ ## Edge Cases
38
+
39
+ ### E1: {Edge Case}
40
+ **Behavior**: {What must happen under this condition}
41
+ **Verify by**: {Method}
42
+
43
+ ## Negative Properties
44
+
45
+ ### N1: {What must NOT happen}
46
+ **Behavior**: {Invariant}
47
+ **Verify by**: {Method}
48
+ ```
49
+
50
+ ## Standards
51
+
52
+ - **State behaviors, not implementations.** "Users can log in with email/password" not "loginHandler calls bcrypt.compare"
53
+ - **Each property must be independently verifiable.**
54
+ - **Include negative properties.** What must NOT happen is as important as what must happen.
55
+ - If the change is purely mechanical with nothing to verify behaviorally, call submit with `{ "testsNeeded": false }`
56
+ - Otherwise, after writing the test spec file, call submit with `{ "testsNeeded": true }`
@@ -1,10 +1,12 @@
1
1
  # Sisyphus Agent Context
2
2
 
3
- You are an agent in a sisyphus session. Do not spawn other agents or create tasks — only the orchestrator does that.
3
+ You are an agent in a sisyphus session.
4
4
 
5
5
  - **Session ID**: {{SESSION_ID}}
6
6
  - **Your Task**: {{INSTRUCTION}}
7
7
 
8
+ {{WORKTREE_CONTEXT}}
9
+
8
10
  ## Progress Reports
9
11
 
10
12
  Reports are non-terminal — you keep working after sending them. Use them for:
@@ -1,7 +1,25 @@
1
1
 
2
- _____ _____ _______ _______ _ _ _ _ _____
3
- / ___|_ _/ ___\ \ / / ___ \ | | | | | / ___|
4
- \ `--. | | \ `--. \ V /| |_/ / |_| | | | \ `--.
5
- `--. \ | | `--. \ \ / | __/| _ | | | |`--. \
6
- /\__/ /_| |_/\__/ / | | | | | | | | |_| /\__/ /
7
- \____/ \___/\____/ \_/ \_| \_| |_/\___/\____/
2
+ ╔═══════════════════════════════════════════════════════╗
3
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@%%%#*++**#%%@@@@@@@@@@@@@@
4
+ @@@@@@@@@@@@@@@@@@@@@@@@%*====-----::::-:=%@@@@@@@@@@
5
+ @@@@@@@@@@@@@@@@@@@@@%#=:.:-=------:... -%@@@@@@@@
6
+ @@@@@@@@@@@@@@@@@@%%#= .....:-:.......... *%@@@@@@
7
+ @@@@@@@@@@@@@@%+==-+%*: .:---::::....:.... #@@@@@@
8
+ ║ @@@@@@@@@@@@%#:. ..:. ..:-...:..... . :%@@@@@@ ║
9
+ ║ @@@@@@@@@@@@#:.:.. :*= ............ . :%@@@@@@ ║
10
+ ║ @@@@@@@@@@@@#--:.. -%+............... .. *%#=-:.: ║
11
+ ║ @@@@@@@@@@%#----.:#%+.::::... ..... .... .:# ║
12
+ ║ @@@@@@@@%+-:::.. :%@@@@@@@@%*=: ..*%@ ║
13
+ ║ @@@@@@%*-=:..::.:-..+@@@@@@%%#=:. .. . ... *@@@ ║
14
+ ║ @@@@#==::%@@@@@@%=:::=%*-:. .... . ... :%@@@@ ║
15
+ ║ @@#::=#@@@@%#-.:-... .::... :#%@@@@@ ║
16
+ ║ %=:%%%#####+:.: . ..... . . *%@@@@@@@ ║
17
+ ║ :::.:.:::..::. . .. :#@@@@@@@ ║
18
+ ║ %#*++===--============++===-::::::::---=====#%@@@@@@@ ║
19
+ ║ _____ _____ _______ _______ _ _ _ _ _____ ║
20
+ ║ / ___|_ _/ ___\ \ / / ___ \ | | | | | / ___| ║
21
+ ║ \ `--. | | \ `--. \ V /| |_/ / |_| | | | \ `--. ║
22
+ ║ `--. \ | | `--. \ \ / | __/| _ | | | |`--. \ ║
23
+ ║ /\__/ /_| |_/\__/ / | | | | | | | | |_| /\__/ / ║
24
+ ║ \____/ \___/\____/ \_/ \_| \_| |_/\___/\____/ ║
25
+ ╚═══════════════════════════════════════════════════════╝
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "sisyphus-orchestrator",
3
+ "version": "1.0.0",
4
+ "description": "Skills and commands for the sisyphus orchestrator"
5
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "Task",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/block-task.sh\""
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "Stop": [
15
+ {
16
+ "hooks": [
17
+ {
18
+ "type": "command",
19
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/stop-suggest.sh\""
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
25
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ cat <<'EOF'
3
+ {"decision":"block","reason":"Do not use the Task tool. Use `sisyphus spawn` to spawn agents in tmux panes instead."}
4
+ EOF
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ cat <<'EOF'
3
+ {"decision":"block","reason":"Before stopping, consider: use `sisyphus yield` to end this cycle and let the daemon respawn you with updated state, or use AskUserQuestion if you need clarification from the user."}
4
+ EOF
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: git-management
3
+ description: >
4
+ Set up and manage git worktree isolation for parallel agents. How to analyze a project for worktree config, create .sisyphus/worktree.json, handle merge conflicts surfaced by the daemon, and decide when to use --worktree vs not.
5
+ ---
6
+
7
+ # Git Worktree Management
8
+
9
+ ## Setting Up Worktree Config
10
+
11
+ Analyze the project to determine what gitignored files/directories agents need. Create `.sisyphus/worktree.json`:
12
+
13
+ ### Config Format
14
+
15
+ ```json
16
+ {
17
+ "copy": [],
18
+ "clone": [],
19
+ "symlink": [],
20
+ "init": ""
21
+ }
22
+ ```
23
+
24
+ **Fields:**
25
+ - `copy` — Files/dirs to copy from main worktree (e.g., `.env`, `.env.local`). Use for small files that may need per-worktree modifications.
26
+ - `clone` — Files/dirs to APFS copy-on-write clone (e.g., `node_modules`, `vendor`, `target`). Near-zero cost on macOS. Falls back to regular copy on other systems. Use for large directories.
27
+ - `symlink` — Files/dirs to symlink from main worktree. Use for things that should stay in sync across all worktrees.
28
+ - `init` — Shell command to run after worktree setup (e.g., `npm install`, `pip install -e .`, `cargo build`). Runs with cwd set to the worktree. Failures are logged but don't block agent startup.
29
+
30
+ **Note:** `.sisyphus` and `.claude` directories are ALWAYS symlinked automatically — you don't need to include them.
31
+
32
+ ### Analysis Checklist
33
+
34
+ Scan the project root for gitignored files that agents will need:
35
+
36
+ 1. **Environment files**: `.env`, `.env.local`, `.env.development` — usually `copy` (agents may need different ports)
37
+ 2. **Dependencies**: `node_modules`, `vendor`, `target`, `.venv`, `__pycache__` — use `clone` for large dirs
38
+ 3. **Build artifacts**: `dist`, `.next`, `build`, `.turbo` — usually `clone` for warm cache, or skip and let `init` rebuild
39
+ 4. **Tool config**: `.eslintcache`, `.pretterircache`, `.tsbuildinfo` — usually skip, tools regenerate
40
+ 5. **Other dotfiles**: Check what exists at root. Err on the side of including too much rather than too little.
41
+
42
+ ### Example Configs
43
+
44
+ **Node.js (npm/yarn):**
45
+ ```json
46
+ {
47
+ "copy": [".env", ".env.local"],
48
+ "clone": ["node_modules"],
49
+ "init": "npm install --prefer-offline"
50
+ }
51
+ ```
52
+
53
+ **Node.js (pnpm):**
54
+ ```json
55
+ {
56
+ "copy": [".env"],
57
+ "clone": [],
58
+ "init": "pnpm install --frozen-lockfile"
59
+ }
60
+ ```
61
+
62
+ **Python:**
63
+ ```json
64
+ {
65
+ "copy": [".env"],
66
+ "clone": [".venv"],
67
+ "init": "source .venv/bin/activate && pip install -e ."
68
+ }
69
+ ```
70
+
71
+ **Rust:**
72
+ ```json
73
+ {
74
+ "clone": ["target"],
75
+ "init": "cargo build"
76
+ }
77
+ ```
78
+
79
+ **No dependencies (simple project):**
80
+ ```json
81
+ {
82
+ "copy": [".env"]
83
+ }
84
+ ```
85
+
86
+ ## Handling Merge Conflicts
87
+
88
+ When the daemon merges agent branches back, conflicts appear in the `## Worktrees` section of your state block. For each conflicting agent you'll see:
89
+ - The branch name (still exists, unmerged)
90
+ - The worktree path (still exists on disk)
91
+ - The conflict details (git merge stderr output)
92
+
93
+ **Resolution approaches:**
94
+ 1. **Spawn a resolution agent** in the conflicting worktree to manually resolve and commit
95
+ 2. **Rebase the branch** onto current HEAD and resolve conflicts
96
+ 3. **Cherry-pick specific commits** instead of merging the whole branch
97
+ 4. **Discard the branch** if the work can be redone more cleanly
98
+
99
+ After resolution, the branch can be merged manually or left for the next cycle's automatic merge attempt.
100
+
101
+ ## When to Use Worktrees
102
+
103
+ **Use `--worktree`** when:
104
+ - Multiple agents will work on different features that touch overlapping files
105
+ - Agents need to make structural changes (renames, moves, deletes)
106
+ - The task involves feature branches that should be independently testable
107
+
108
+ **Skip `--worktree`** when:
109
+ - Agents work on completely separate files with no overlap
110
+ - Quick fixes or single-file changes
111
+ - Agents only read code (exploration, review)
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: orchestration
3
+ description: >
4
+ Task breakdown patterns for sisyphus orchestrator sessions. How to structure tasks, sequence agents, and manage cycles for debugging, feature builds, refactors, and other common workflows. Use when planning orchestration strategy or structuring a multi-agent session.
5
+ ---
6
+
7
+ # Orchestration Patterns
8
+
9
+ How to structure sisyphus sessions for common task types. This skill helps the orchestrator break work into tasks, choose agent types, sequence cycles, and handle failures.
10
+
11
+ ## Core Principles
12
+
13
+ 1. **plan.md is the orchestrator's memory.** plan.md and agent reports persist across cycles — they're all you have. Keep plan.md current and specific enough that a fresh orchestrator can pick up where you left off.
14
+
15
+ 2. **Agents are disposable.** Each agent gets one focused instruction. If it fails or the scope changes, spawn a new one — don't try to redirect a running agent.
16
+
17
+ 3. **Parallelize when independent.** If two tasks don't share files or depend on each other's output, spawn agents for both in the same cycle.
18
+
19
+ 4. **Validate at boundaries.** After each logical phase completes, spawn a validation agent before moving on. Catching problems early prevents cascading rework.
20
+
21
+ 5. **Reports are handoffs.** Agent reports should contain everything the next cycle's orchestrator needs — what was done, what was found, what's unresolved, where artifacts were saved.
22
+
23
+ ## Agent Types Quick Reference
24
+
25
+ | Agent | Model | Use For |
26
+ |-------|-------|---------|
27
+ | `sisyphus:general` | sonnet | Ad-hoc tasks, summarization, simple questions |
28
+ | `sisyphus:debug` | opus | Bug diagnosis and root cause analysis |
29
+ | `sisyphus:spec-draft` | opus | Feature investigation and spec drafting |
30
+ | `sisyphus:plan` | opus | Implementation planning from spec |
31
+ | `sisyphus:review-plan` | opus | Validate plan covers spec completely |
32
+ | `sisyphus:test-spec` | opus | Define behavioral properties to verify |
33
+ | `sisyphus:implement` | sonnet | Execute plan phases, write code |
34
+ | `sisyphus:validate` | opus | Verify implementation matches plan |
35
+ | `sisyphus:review` | opus | Code review with parallel concern subagents |
36
+ | `sisyphus:tactician` | opus | Track plan progress, dispatch next task |
37
+ | `sisyphus:triage` | sonnet | Classify tickets by type/size |
38
+
39
+ For task breakdown patterns per workflow type, see [task-patterns.md](task-patterns.md).
40
+ For end-to-end workflow examples, see [workflow-examples.md](workflow-examples.md).
@@ -0,0 +1,248 @@
1
+ # Work Breakdown Patterns
2
+
3
+ Patterns for how the orchestrator should structure plan.md for common workflow types. Each pattern shows the plan structure, agent assignments, cycle sequencing, and failure handling.
4
+
5
+ ---
6
+
7
+ ## Bug Fix
8
+
9
+ ### When to use
10
+ Something is broken. User reports a bug, test is failing, behavior is wrong.
11
+
12
+ ### Plan structure
13
+ ```
14
+ ## Bug Fix: [description]
15
+
16
+ - [ ] Diagnose root cause of [bug description]
17
+ - [ ] Implement fix for [root cause]
18
+ - [ ] Validate fix — regression tests pass, bug is resolved
19
+ - [ ] Review fix for unintended side effects
20
+ ```
21
+
22
+ ### Cycle plan
23
+ - **Cycle 1**: Spawn `sisyphus:debug` for diagnosis. Yield.
24
+ - **Cycle 2**: Read diagnosis report. If confident root cause found, spawn `sisyphus:implement` for fix with the diagnosis as context. Yield.
25
+ - **Cycle 3**: Spawn `sisyphus:validate` for validation. Yield.
26
+ - **Cycle 4**: If validation passes, spawn `sisyphus:review` for review. If fails, update plan with failure context and respawn implement. Yield.
27
+ - **Cycle 5**: Review results. Complete or address review findings.
28
+
29
+ ### Failure modes
30
+ - **Debug inconclusive**: Add more context to plan, respawn debug with narrower scope or different focus areas.
31
+ - **Fix breaks other things**: Validation catches this. Feed validation failures back into a new implement cycle.
32
+ - **Root cause was wrong**: Update plan with what was learned, respawn debug.
33
+
34
+ ### Parallelization
35
+ Usually serial — diagnosis must complete before fix, fix before validation. Exception: if the bug affects multiple independent areas, spawn multiple debug agents in parallel.
36
+
37
+ ---
38
+
39
+ ## Feature Build (Small — 1-3 files)
40
+
41
+ ### When to use
42
+ Clear requirements, small scope, no spec needed.
43
+
44
+ ### Plan structure
45
+ ```
46
+ ## Feature: [description]
47
+
48
+ - [ ] Plan implementation for [feature]
49
+ - [ ] Implement [feature]
50
+ - [ ] Validate implementation
51
+ ```
52
+
53
+ ### Cycle plan
54
+ - **Cycle 1**: Spawn `sisyphus:plan` for planning. Yield.
55
+ - **Cycle 2**: Spawn `sisyphus:implement` with plan path. Yield.
56
+ - **Cycle 3**: Spawn `sisyphus:validate` for validation. Yield.
57
+ - **Cycle 4**: Complete or fix issues.
58
+
59
+ ### Parallelization
60
+ Serial. Too small to benefit from parallel agents.
61
+
62
+ ---
63
+
64
+ ## Feature Build (Medium — 4-10 files)
65
+
66
+ ### When to use
67
+ Feature with moderate complexity. Requirements may need clarification. Multiple files across a few modules.
68
+
69
+ ### Plan structure
70
+ ```
71
+ ## Feature: [description]
72
+
73
+ ### Spec & Planning
74
+ - [ ] Draft spec — investigate codebase, propose approach
75
+ - [ ] Create implementation plan from spec
76
+ - [ ] Review plan against spec
77
+
78
+ ### Implementation
79
+ - [ ] Phase 1 — [foundation/types/interfaces]
80
+ - [ ] Phase 2 — [core logic]
81
+ - [ ] Phase 3 — [integration/wiring]
82
+
83
+ ### Validation
84
+ - [ ] Validate full implementation
85
+ - [ ] Review implementation
86
+ ```
87
+
88
+ ### Cycle plan
89
+ - **Cycle 1**: Spawn `sisyphus:spec-draft` for spec. Yield. (Human iterates on spec between cycles.)
90
+ - **Cycle 2**: Spawn `sisyphus:plan` for plan. Yield.
91
+ - **Cycle 3**: Spawn `sisyphus:review-plan` for review. If fail, respawn plan with issues. Yield.
92
+ - **Cycle 4**: Spawn `sisyphus:implement` for Phase 1. Yield.
93
+ - **Cycle 5**: Spawn `sisyphus:implement` for Phase 2 + `sisyphus:validate` for Phase 1 (parallel if independent). Yield.
94
+ - **Cycle 6-8**: Continue phases, validate, review.
95
+
96
+ ### Failure modes
97
+ - **Spec needs human input**: Mark session as needing human review. Orchestrator notes open questions.
98
+ - **Plan fails review**: Feed review issues back, respawn planner.
99
+ - **Phase fails validation**: Feed specifics back to implement agent for that phase only.
100
+
101
+ ### Parallelization
102
+ Phases without dependencies can run in parallel. Types/interfaces (Phase 1) must complete before implementation phases that consume them.
103
+
104
+ ---
105
+
106
+ ## Feature Build (Large — 10+ files)
107
+
108
+ ### When to use
109
+ Cross-cutting feature, multiple domains, needs team coordination.
110
+
111
+ ### Plan structure
112
+ ```
113
+ ## Feature: [description]
114
+
115
+ ### Spec & Planning
116
+ - [ ] Draft spec
117
+ - [ ] Create master implementation plan
118
+ - [ ] Review plan against spec
119
+ - [ ] Define behavioral test properties
120
+
121
+ ### Implementation
122
+ - [ ] Phase 1 — [domain A foundation]
123
+ - [ ] Phase 2 — [domain B foundation]
124
+ - [ ] Phase 3 — [domain A implementation]
125
+ - [ ] Phase 4 — [domain B implementation]
126
+ - [ ] Phase 5 — [integration layer]
127
+
128
+ ### Validation
129
+ - [ ] Validate full implementation
130
+ - [ ] Review implementation
131
+ - [ ] Adversarial validation against test spec
132
+ ```
133
+
134
+ ### Cycle plan
135
+ - **Cycle 1**: Spawn `sisyphus:spec-draft` for spec. Yield.
136
+ - **Cycle 2**: Spawn `sisyphus:plan` for plan + `sisyphus:test-spec` for test properties (parallel). Yield.
137
+ - **Cycle 3**: Spawn `sisyphus:review-plan` for review. Yield.
138
+ - **Cycle 4**: Spawn `sisyphus:implement` for Phase 1 + Phase 2 (parallel — independent domains). Yield.
139
+ - **Cycle 5**: Validate Phase 1 + Phase 2, then spawn Phase 3 + Phase 4 (parallel). Yield.
140
+ - **Cycle 6+**: Integration, validation, review.
141
+
142
+ ### Failure modes
143
+ - **Integration failures**: Often means contracts between domains don't match. Spawn debug agent targeting the integration seam.
144
+ - **Test spec violations**: Feed specific property failures back to implement.
145
+
146
+ ### Parallelization
147
+ Maximize. Independent domains run in parallel. Foundation phases complete before implementation phases in the same domain. Integration waits for all domain implementations.
148
+
149
+ ---
150
+
151
+ ## Refactor
152
+
153
+ ### When to use
154
+ Restructure code without changing behavior. Move files, rename abstractions, consolidate patterns.
155
+
156
+ ### Plan structure
157
+ ```
158
+ ## Refactor: [description]
159
+
160
+ - [ ] Analyze current structure and plan refactor
161
+ - [ ] Capture behavioral snapshot (existing tests + manual checks)
162
+ - [ ] Execute refactor phase 1 — [structural changes]
163
+ - [ ] Execute refactor phase 2 — [update consumers]
164
+ - [ ] Validate behavior preserved — all original tests pass
165
+ - [ ] Review for missed references, dead code, broken imports
166
+ ```
167
+
168
+ ### Cycle plan
169
+ - **Cycle 1**: Spawn `sisyphus:plan` for analysis + `sisyphus:validate` to capture baseline (parallel). Yield.
170
+ - **Cycle 2**: Spawn `sisyphus:implement` for phase 1. Yield.
171
+ - **Cycle 3**: Spawn `sisyphus:implement` for phase 2 + `sisyphus:validate` for phase 1 (parallel). Yield.
172
+ - **Cycle 4**: Spawn `sisyphus:validate` for full validation. Yield.
173
+ - **Cycle 5**: Spawn `sisyphus:review` for final review. Complete.
174
+
175
+ ### Key principle
176
+ **Behavior preservation is the only metric.** The refactor is correct if and only if all existing tests pass and externally observable behavior is unchanged.
177
+
178
+ ### Parallelization
179
+ Limited. Refactor phases are often sequential (move before update consumers). Validation can run in parallel with the next phase if they touch different files.
180
+
181
+ ---
182
+
183
+ ## Code Review
184
+
185
+ ### When to use
186
+ PR review, pre-merge check, or periodic quality audit.
187
+
188
+ ### Plan structure
189
+ ```
190
+ ## Review: [scope]
191
+
192
+ - [ ] Review [scope] for issues
193
+ - [ ] (conditional) Fix critical/high issues found
194
+ - [ ] (conditional) Re-review fixes
195
+ ```
196
+
197
+ ### Cycle plan
198
+ - **Cycle 1**: Spawn `sisyphus:review` for review. Yield.
199
+ - **Cycle 2**: If critical/high issues, spawn `sisyphus:implement` for fixes. If clean, complete.
200
+ - **Cycle 3**: Spawn `sisyphus:review` for re-review (targeted at fixes only). Complete.
201
+
202
+ ### Parallelization
203
+ Review itself parallelizes internally (subagents per concern). Fix cycle is usually serial.
204
+
205
+ ---
206
+
207
+ ## Investigation / Spike
208
+
209
+ ### When to use
210
+ Need to understand something before committing to an approach. Prototype, explore, or answer a technical question.
211
+
212
+ ### Plan structure
213
+ ```
214
+ ## Investigation: [question/area]
215
+
216
+ - [ ] Investigate [question/area]
217
+ - [ ] Summarize findings and recommendation
218
+ ```
219
+
220
+ ### Cycle plan
221
+ - **Cycle 1**: Spawn `sisyphus:debug` (for code investigation) or `sisyphus:general` (for broader research). Yield.
222
+ - **Cycle 2**: Spawn `sisyphus:general` to synthesize findings. Complete.
223
+
224
+ ### Parallelization
225
+ If investigating multiple independent areas, spawn parallel agents each exploring a different angle.
226
+
227
+ ---
228
+
229
+ ## Tactician-Driven Implementation
230
+
231
+ ### When to use
232
+ The plan exists and you want automated cycle-by-cycle execution without manual orchestrator decisions. The tactician reads the plan, dispatches one phase at a time, and tracks progress.
233
+
234
+ ### Plan structure
235
+ ```
236
+ ## Tactician Execution
237
+
238
+ - [ ] Execute implementation plan at [path] using tactician loop
239
+ ```
240
+
241
+ ### Cycle plan
242
+ This is a single-item pattern. The orchestrator spawns the tactician once:
243
+ - **Cycle 1**: Spawn `sisyphus:tactician` with plan path. The tactician internally dispatches implement/validate agents via submit tool actions. The orchestrator's role is minimal — just monitor the tactician's completion report.
244
+
245
+ ### When NOT to use
246
+ - When you need human checkpoints between phases
247
+ - When phases have external dependencies (waiting on API access, design review, etc.)
248
+ - When the task requires creative decisions the tactician shouldn't make alone