sisyphi 0.1.2 → 0.1.4
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.
- package/README.md +103 -33
- package/dist/{chunk-FWHTKXN5.js → chunk-N2BPQOO2.js} +23 -3
- package/dist/chunk-N2BPQOO2.js.map +1 -0
- package/dist/cli.js +85 -162
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +603 -186
- package/dist/daemon.js.map +1 -1
- package/dist/templates/CLAUDE.md +50 -0
- package/dist/templates/agent-plugin/.claude/agents/debug.md +39 -0
- package/dist/templates/agent-plugin/.claude/agents/plan.md +101 -0
- package/dist/templates/agent-plugin/.claude/agents/review-plan.md +81 -0
- package/dist/templates/agent-plugin/.claude/agents/review.md +56 -0
- package/dist/templates/agent-plugin/.claude/agents/spec-draft.md +73 -0
- package/dist/templates/agent-plugin/.claude/agents/test-spec.md +56 -0
- package/dist/templates/agent-plugin/.claude-plugin/plugin.json +5 -0
- package/dist/templates/agent-plugin/agents/CLAUDE.md +52 -0
- package/dist/templates/agent-plugin/agents/debug.md +39 -0
- package/dist/templates/agent-plugin/agents/operator.md +56 -0
- package/dist/templates/agent-plugin/agents/plan.md +101 -0
- package/dist/templates/agent-plugin/agents/review-plan.md +81 -0
- package/dist/templates/agent-plugin/agents/review.md +56 -0
- package/dist/templates/agent-plugin/agents/spec-draft.md +73 -0
- package/dist/templates/agent-plugin/agents/test-spec.md +56 -0
- package/dist/templates/agent-suffix.md +3 -1
- package/dist/templates/banner.txt +24 -6
- package/dist/templates/orchestrator-plugin/.claude/commands/begin.md +62 -0
- package/dist/templates/orchestrator-plugin/.claude/skills/orchestration/SKILL.md +40 -0
- package/dist/templates/orchestrator-plugin/.claude/skills/orchestration/task-patterns.md +222 -0
- package/dist/templates/orchestrator-plugin/.claude/skills/orchestration/workflow-examples.md +208 -0
- package/dist/templates/orchestrator-plugin/.claude-plugin/plugin.json +5 -0
- package/dist/templates/orchestrator-plugin/hooks/hooks.json +25 -0
- package/dist/templates/orchestrator-plugin/scripts/block-task.sh +4 -0
- package/dist/templates/orchestrator-plugin/scripts/stop-suggest.sh +4 -0
- package/dist/templates/orchestrator-plugin/skills/git-management/SKILL.md +111 -0
- package/dist/templates/orchestrator-plugin/skills/orchestration/SKILL.md +40 -0
- package/dist/templates/orchestrator-plugin/skills/orchestration/task-patterns.md +248 -0
- package/dist/templates/orchestrator-plugin/skills/orchestration/workflow-examples.md +237 -0
- package/dist/templates/orchestrator-settings.json +2 -0
- package/dist/templates/orchestrator.md +56 -49
- package/dist/templates/resources/.claude/agents/debug.md +39 -0
- package/dist/templates/resources/.claude/agents/plan.md +101 -0
- package/dist/templates/resources/.claude/agents/review-plan.md +81 -0
- package/dist/templates/resources/.claude/agents/review.md +56 -0
- package/dist/templates/resources/.claude/agents/spec-draft.md +73 -0
- package/dist/templates/resources/.claude/agents/test-spec.md +56 -0
- package/dist/templates/resources/.claude/commands/begin.md +62 -0
- package/dist/templates/resources/.claude/skills/orchestration/SKILL.md +40 -0
- package/dist/templates/resources/.claude/skills/orchestration/task-patterns.md +222 -0
- package/dist/templates/resources/.claude/skills/orchestration/workflow-examples.md +208 -0
- package/dist/templates/resources/.claude-plugin/plugin.json +8 -0
- package/package.json +2 -2
- package/templates/CLAUDE.md +50 -0
- package/templates/agent-plugin/.claude-plugin/plugin.json +5 -0
- package/templates/agent-plugin/agents/CLAUDE.md +52 -0
- package/templates/agent-plugin/agents/debug.md +39 -0
- package/templates/agent-plugin/agents/operator.md +56 -0
- package/templates/agent-plugin/agents/plan.md +101 -0
- package/templates/agent-plugin/agents/review-plan.md +81 -0
- package/templates/agent-plugin/agents/review.md +56 -0
- package/templates/agent-plugin/agents/spec-draft.md +73 -0
- package/templates/agent-plugin/agents/test-spec.md +56 -0
- package/templates/agent-suffix.md +3 -1
- package/templates/banner.txt +24 -6
- package/templates/orchestrator-plugin/.claude-plugin/plugin.json +5 -0
- package/templates/orchestrator-plugin/hooks/hooks.json +25 -0
- package/templates/orchestrator-plugin/scripts/block-task.sh +4 -0
- package/templates/orchestrator-plugin/scripts/stop-suggest.sh +4 -0
- package/templates/orchestrator-plugin/skills/git-management/SKILL.md +111 -0
- package/templates/orchestrator-plugin/skills/orchestration/SKILL.md +40 -0
- package/templates/orchestrator-plugin/skills/orchestration/task-patterns.md +248 -0
- package/templates/orchestrator-plugin/skills/orchestration/workflow-examples.md +237 -0
- package/templates/orchestrator-settings.json +2 -0
- package/templates/orchestrator.md +56 -49
- package/dist/chunk-FWHTKXN5.js.map +0 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Workflow Examples
|
|
2
|
+
|
|
3
|
+
End-to-end examples showing how the orchestrator structures cycles for real scenarios.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Example 1: Fix a Race Condition in WebSocket Reconnection
|
|
8
|
+
|
|
9
|
+
**Starting task**: "WebSocket connections sometimes drop messages during reconnection"
|
|
10
|
+
|
|
11
|
+
### Cycle 1 — Diagnosis
|
|
12
|
+
```
|
|
13
|
+
plan.md:
|
|
14
|
+
## Bug Fix: WebSocket message loss during reconnection
|
|
15
|
+
|
|
16
|
+
- [ ] Diagnose message loss during WebSocket reconnection
|
|
17
|
+
- [ ] Fix root cause
|
|
18
|
+
- [ ] Validate fix under concurrent load
|
|
19
|
+
- [ ] Review fix
|
|
20
|
+
|
|
21
|
+
Agents spawned:
|
|
22
|
+
debug agent → "Diagnose why WebSocket messages are lost during reconnection.
|
|
23
|
+
Focus on src/ws/client.ts and src/ws/reconnect.ts.
|
|
24
|
+
Check for race conditions between disconnect handler and message queue.
|
|
25
|
+
Look at git blame for recent changes to reconnection logic."
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Cycle 2 — Read diagnosis, plan fix
|
|
29
|
+
```
|
|
30
|
+
Agent report: "Root cause: reconnect() clears the message queue before the new socket
|
|
31
|
+
is ready. Messages sent between disconnect and reconnect are dropped.
|
|
32
|
+
Line 47 of src/ws/reconnect.ts — queue.clear() is called in onDisconnect
|
|
33
|
+
but should be deferred until onReconnect confirms the new socket is live.
|
|
34
|
+
Confidence: High."
|
|
35
|
+
|
|
36
|
+
plan.md updated:
|
|
37
|
+
- [x] ~~Diagnose message loss during WebSocket reconnection~~
|
|
38
|
+
- [ ] Fix root cause — queue.clear() at L47 of reconnect.ts runs too early
|
|
39
|
+
- [ ] Validate fix under concurrent load
|
|
40
|
+
- [ ] Review fix
|
|
41
|
+
|
|
42
|
+
Agents spawned:
|
|
43
|
+
implement agent → "Fix race condition in src/ws/reconnect.ts.
|
|
44
|
+
Root cause: queue.clear() at line 47 runs on disconnect, dropping pending messages.
|
|
45
|
+
Fix: defer queue drain until reconnect confirms new socket. Buffer messages during
|
|
46
|
+
reconnection window. See existing buffer pattern in src/ws/buffer.ts."
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Cycle 3 — Validate
|
|
50
|
+
```
|
|
51
|
+
Agent report: "Fixed. Moved queue.clear() to onReconnect callback after socket.readyState
|
|
52
|
+
confirms OPEN. Added message buffer during reconnection window. 2 files changed."
|
|
53
|
+
|
|
54
|
+
plan.md updated:
|
|
55
|
+
- [x] ~~Diagnose message loss~~
|
|
56
|
+
- [x] ~~Fix root cause~~
|
|
57
|
+
- [ ] Validate fix under concurrent load
|
|
58
|
+
- [ ] Review fix
|
|
59
|
+
|
|
60
|
+
Agents spawned:
|
|
61
|
+
validate agent → "Verify WebSocket reconnection fix. Run existing tests in
|
|
62
|
+
src/__tests__/ws/. Manually verify: disconnect simulation should not lose queued
|
|
63
|
+
messages. Check that buffer drains correctly on reconnect."
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Cycle 4 — Review and complete
|
|
67
|
+
```
|
|
68
|
+
Validation: PASS. Existing tests pass, reconnection preserves messages.
|
|
69
|
+
|
|
70
|
+
plan.md updated:
|
|
71
|
+
- [x] ~~Diagnose~~, [x] ~~Fix~~, [x] ~~Validate~~
|
|
72
|
+
- [ ] Review fix
|
|
73
|
+
|
|
74
|
+
Agents spawned:
|
|
75
|
+
review agent → "Review changes in src/ws/reconnect.ts and src/ws/buffer.ts.
|
|
76
|
+
Focus on: thread safety of the new buffer, memory leak potential if reconnect
|
|
77
|
+
never succeeds, edge case of rapid disconnect/reconnect cycles."
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Cycle 5 — Complete
|
|
81
|
+
```
|
|
82
|
+
Review: Clean. One medium finding — buffer should have a max size to prevent
|
|
83
|
+
memory issues if reconnect fails indefinitely. Not blocking.
|
|
84
|
+
|
|
85
|
+
All plan.md items complete.
|
|
86
|
+
|
|
87
|
+
Action: complete — "Fixed WebSocket message loss during reconnection. Messages now
|
|
88
|
+
buffered during reconnection window and drained on successful reconnect."
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Example 2: Add API Rate Limiting
|
|
94
|
+
|
|
95
|
+
**Starting task**: "Add rate limiting to the REST API — per-user, configurable limits"
|
|
96
|
+
|
|
97
|
+
### Cycle 1 — Spec
|
|
98
|
+
```
|
|
99
|
+
plan.md:
|
|
100
|
+
## Feature: API Rate Limiting
|
|
101
|
+
|
|
102
|
+
### Spec & Planning
|
|
103
|
+
- [ ] Draft spec for API rate limiting
|
|
104
|
+
- [ ] Plan implementation
|
|
105
|
+
- [ ] Review plan
|
|
106
|
+
|
|
107
|
+
### Implementation
|
|
108
|
+
- [ ] Implement rate limiting middleware
|
|
109
|
+
- [ ] Implement rate limit configuration
|
|
110
|
+
- [ ] Implement rate limit headers and error responses
|
|
111
|
+
|
|
112
|
+
### Validation
|
|
113
|
+
- [ ] Validate implementation
|
|
114
|
+
- [ ] Review implementation
|
|
115
|
+
|
|
116
|
+
Agents spawned:
|
|
117
|
+
spec-draft agent → "Investigate codebase and draft spec for per-user API rate
|
|
118
|
+
limiting. Check existing middleware patterns in src/api/middleware/.
|
|
119
|
+
Questions to resolve: storage backend (Redis vs in-memory), limit granularity
|
|
120
|
+
(per-endpoint vs global), response format for rate-limited requests."
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Cycle 2 — Plan (after human reviews spec)
|
|
124
|
+
```
|
|
125
|
+
Agent report: "Spec saved to context/spec-rate-limiting.md.
|
|
126
|
+
Approach: Redis-backed sliding window. Per-user with endpoint-specific overrides.
|
|
127
|
+
Standard 429 response with Retry-After header. Config via environment variables.
|
|
128
|
+
Open questions resolved with user: Redis is already in stack, use it."
|
|
129
|
+
|
|
130
|
+
plan.md updated (spec item marked done):
|
|
131
|
+
- [x] ~~Draft spec for API rate limiting~~
|
|
132
|
+
- [ ] Plan implementation
|
|
133
|
+
...
|
|
134
|
+
|
|
135
|
+
Agents spawned:
|
|
136
|
+
plan agent → "Create implementation plan from spec at context/spec-rate-limiting.md"
|
|
137
|
+
test-spec agent → "Define behavioral properties for rate limiting from spec"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Cycle 3 — Review plan
|
|
141
|
+
```
|
|
142
|
+
Both agents complete. Plan at context/plan-rate-limiting.md.
|
|
143
|
+
Plan has 3 phases: middleware, config, response format.
|
|
144
|
+
|
|
145
|
+
Agents spawned:
|
|
146
|
+
review-plan agent → "Validate plan at context/plan-rate-limiting.md
|
|
147
|
+
against spec at context/spec-rate-limiting.md"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Cycle 4 — Implement (phases 1+2 parallel)
|
|
151
|
+
```
|
|
152
|
+
Plan review: PASS.
|
|
153
|
+
|
|
154
|
+
plan.md updated (plan review done, starting implementation):
|
|
155
|
+
- [x] ~~Draft spec~~, [x] ~~Plan~~, [x] ~~Review plan~~
|
|
156
|
+
- [ ] Implement rate limiting middleware
|
|
157
|
+
- [ ] Implement rate limit configuration
|
|
158
|
+
...
|
|
159
|
+
|
|
160
|
+
Agents spawned:
|
|
161
|
+
implement agent → "Implement Phase 1 from context/plan-rate-limiting.md —
|
|
162
|
+
rate limiting middleware in src/api/middleware/rate-limit.ts"
|
|
163
|
+
implement agent → "Implement Phase 2 from context/plan-rate-limiting.md —
|
|
164
|
+
rate limit configuration in src/config/rate-limits.ts"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Cycle 5-7 — Continue phases, validate, review, complete
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Example 3: Refactor Authentication Module
|
|
172
|
+
|
|
173
|
+
**Starting task**: "Refactor auth — extract token logic from route handlers into dedicated service"
|
|
174
|
+
|
|
175
|
+
### Cycle 1 — Plan + baseline
|
|
176
|
+
```
|
|
177
|
+
plan.md:
|
|
178
|
+
## Refactor: Extract Token Service
|
|
179
|
+
|
|
180
|
+
- [ ] Plan auth refactor — extract token service
|
|
181
|
+
- [ ] Capture behavioral baseline (run all auth tests)
|
|
182
|
+
- [ ] Create TokenService class with extracted logic
|
|
183
|
+
- [ ] Update route handlers to use TokenService
|
|
184
|
+
- [ ] Update tests to use new service interface
|
|
185
|
+
- [ ] Validate all auth tests still pass
|
|
186
|
+
- [ ] Review for dead code and missed references
|
|
187
|
+
|
|
188
|
+
Agents spawned (parallel):
|
|
189
|
+
plan agent → "Plan refactor: extract token creation, validation, and refresh
|
|
190
|
+
logic from src/api/routes/auth.ts into a new src/services/token-service.ts.
|
|
191
|
+
Map all token-related functions, their callers, and the extraction plan."
|
|
192
|
+
validate agent → "Run all tests in src/__tests__/auth/ and record results.
|
|
193
|
+
This is the behavioral baseline — these must all pass after refactor."
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Cycle 2 — Extract (serial — must happen before consumer updates)
|
|
197
|
+
```
|
|
198
|
+
Plan complete, baseline captured (47 tests passing).
|
|
199
|
+
|
|
200
|
+
plan.md updated:
|
|
201
|
+
- [x] ~~Plan auth refactor~~
|
|
202
|
+
- [x] ~~Capture behavioral baseline~~ (47 tests passing)
|
|
203
|
+
- [ ] Create TokenService class with extracted logic
|
|
204
|
+
...
|
|
205
|
+
|
|
206
|
+
Agents spawned:
|
|
207
|
+
implement agent → "Execute Phase 1 of refactor plan: create TokenService class
|
|
208
|
+
at src/services/token-service.ts. Extract validateToken, createToken, refreshToken
|
|
209
|
+
from src/api/routes/auth.ts. Export the class. Do NOT modify route handlers yet."
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Cycle 3 — Update consumers (parallel where possible)
|
|
213
|
+
```
|
|
214
|
+
TokenService created.
|
|
215
|
+
|
|
216
|
+
Agents spawned:
|
|
217
|
+
implement agent → "Update route handlers in src/api/routes/auth.ts to import
|
|
218
|
+
and use TokenService instead of inline token logic. Remove extracted functions."
|
|
219
|
+
implement agent → "Update tests in src/__tests__/auth/ to use TokenService
|
|
220
|
+
where they directly tested extracted functions."
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Cycle 4 — Validate + review
|
|
224
|
+
```
|
|
225
|
+
Agents spawned (parallel):
|
|
226
|
+
validate agent → "Run all auth tests. Compare against baseline of 47 passing.
|
|
227
|
+
Every test must still pass."
|
|
228
|
+
review agent → "Review src/api/routes/auth.ts and src/services/token-service.ts.
|
|
229
|
+
Check for: dead code left behind, missed references to old functions, broken imports."
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Cycle 5 — Complete
|
|
233
|
+
```
|
|
234
|
+
All 47 tests passing. Review clean.
|
|
235
|
+
All plan.md items complete.
|
|
236
|
+
Complete — "Extracted token logic into TokenService. All existing tests pass."
|
|
237
|
+
```
|
|
@@ -8,71 +8,79 @@ You are respawned fresh each cycle with the latest state. You have no memory bey
|
|
|
8
8
|
|
|
9
9
|
## Each Cycle
|
|
10
10
|
|
|
11
|
-
1. Read `<state>` carefully —
|
|
11
|
+
1. Read `<state>` carefully — plan, agent reports, cycle history
|
|
12
12
|
2. Assess where things stand. What succeeded? What failed? What's unclear?
|
|
13
13
|
3. Understand what you're delegating before you delegate it. You'll write better agent instructions if you know the code.
|
|
14
14
|
4. Decide what to do next: break down work, spawn agents, re-plan, validate, or complete.
|
|
15
|
-
5. Update
|
|
15
|
+
5. Update plan.md, spawn agents, then `sisyphus yield --prompt "what to focus on next cycle"`
|
|
16
16
|
|
|
17
17
|
## This Is Not Autonomous
|
|
18
18
|
|
|
19
19
|
You are a coordinator working with a human. **Pause and ask for direction when**:
|
|
20
20
|
|
|
21
|
-
- The
|
|
21
|
+
- The goal is ambiguous and you're about to make assumptions
|
|
22
22
|
- You've discovered something unexpected that changes the scope
|
|
23
23
|
- There are multiple valid approaches and the choice matters
|
|
24
24
|
- An agent failed and you're not sure why — don't just retry blindly
|
|
25
25
|
- You're about to do something irreversible or high-risk
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## plan.md and logs.md
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Two files are auto-created in the session directory (`.sisyphus/sessions/$SISYPHUS_SESSION_ID/`) and referenced in `<state>` every cycle. **You own these files** — read and edit them directly.
|
|
30
30
|
|
|
31
|
-
###
|
|
31
|
+
### plan.md — What still needs to happen
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
**This is your sole source of truth for what work remains.** Write what you still need to do: phases, next steps, open questions, file references, dependencies. **Remove items as they're completed** so this file only reflects outstanding work. This keeps your context lean across cycles — a 50-item plan shouldn't list 45 completed items.
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
Finish auth middleware
|
|
35
|
+
Each item in the plan should be completable by a single agent in a single cycle without conflicting with other agents' work. Right-sized means ~30 tool calls — describable in 2-3 sentences with a clear done condition.
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
```
|
|
37
|
+
Too broad: `"implement auth"` — this is a project phase, not a work item.
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
Right-sized:
|
|
40
|
+
- `"Add session middleware to src/server.ts (MemoryStore, env-based secret)"`
|
|
41
|
+
- `"Create POST /api/login route in src/routes/auth.ts — validate against users table, set session"`
|
|
42
|
+
- `"Add requireAuth middleware to src/middleware/auth.ts, apply to /api/protected/* in src/routes/index.ts"`
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
Good plan.md content:
|
|
45
|
+
- Remaining phases with concrete next steps
|
|
46
|
+
- Separate phases for testing and validation and code-review
|
|
47
|
+
- Ambiguous future phases dedicated to simply "re-evaluating as a developer"
|
|
48
|
+
- File paths that need to be created or modified
|
|
49
|
+
- Open design questions or unknowns to investigate
|
|
44
50
|
|
|
45
|
-
|
|
46
|
-
- **pending** — Confirmed work, ready for an agent.
|
|
47
|
-
- **in_progress** — Actively being worked on. Can last multiple cycles.
|
|
48
|
-
- **done** — Completed and verified.
|
|
51
|
+
### logs.md — Session memory
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
Your persistent memory across cycles. Unlike plan.md, entries here **accumulate** — they're a log, not a scratchpad. Write things you'd want your future self (respawned fresh next cycle) to know.
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
Good logs.md content:
|
|
56
|
+
- Decisions made and their rationale
|
|
57
|
+
- Things you tried that failed (and why)
|
|
58
|
+
- Gotchas discovered during exploration or implementation
|
|
59
|
+
- Key findings from agent reports worth preserving
|
|
60
|
+
- Corrections to earlier assumptions
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
### Workflow
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
- `"Add requireAuth middleware to src/middleware/auth.ts, apply to /api/protected/* in src/routes/index.ts"`
|
|
64
|
+
- **Cycle 0**: Spawn explore agents to investigate relevant areas of the codebase. They save context files to `.sisyphus/sessions/$SISYPHUS_SESSION_ID/context/` (e.g., `explore-auth.md`, `explore-api-routes.md`). Then write your initial plan.md based on their findings. This pays for itself: you get back up to speed each cycle by reading context files, and agents you spawn later get pre-digested codebase knowledge via references to those files in their instructions.
|
|
65
|
+
- **Each cycle**: Read plan.md and logs.md from `<state>`. Update plan.md (prune done items, refine next steps). Append to logs.md with anything important from this cycle. Then spawn agents and yield.
|
|
66
|
+
- **Keep both current**: If you discover something that changes the plan, update plan.md immediately. If you learn something worth remembering, log it immediately.
|
|
60
67
|
|
|
61
68
|
## Context Directory
|
|
62
69
|
|
|
63
|
-
The context directory (`.sisyphus/sessions/$SISYPHUS_SESSION_ID/context/`) is for persistent artifacts too large for
|
|
70
|
+
The context directory (`.sisyphus/sessions/$SISYPHUS_SESSION_ID/context/`) is for persistent artifacts too large for agent instructions or logs: specs, detailed plans, exploration findings, test strategies.
|
|
64
71
|
|
|
65
72
|
The `<state>` block lists context dir contents each cycle. Read files when you need full detail.
|
|
66
73
|
|
|
67
|
-
-
|
|
74
|
+
- Plan items should **reference** context files rather than duplicating detail: `"See spec-auth-flow.md in context dir."`
|
|
68
75
|
- Agents writing plans or specs should save output to the context dir with descriptive filenames: `spec-auth-flow.md`, `plan-webhook-retry.md`, `explore-config-system.md`
|
|
69
76
|
- The context dir persists across all cycles.
|
|
70
77
|
|
|
71
78
|
## Thinking About Work
|
|
72
79
|
|
|
73
|
-
You wouldn't jump straight to coding without understanding the problem, and you wouldn't ship without testing. These are the phases of work — each can be its own cycle
|
|
80
|
+
You wouldn't jump straight to coding without understanding the problem, and you wouldn't ship without testing. These are the phases of work — each can be its own cycle and agent. Think like a developer:
|
|
74
81
|
|
|
75
|
-
- **
|
|
82
|
+
- **Explore** — spawn agents to investigate the relevant codebase and save findings to context files
|
|
83
|
+
- **Spec** — define what needs to change based on exploration findings
|
|
76
84
|
- **Plan** — draft an approach, review it next cycle before committing
|
|
77
85
|
- **Implement** — the actual code changes, with clear file ownership per agent
|
|
78
86
|
- **Review** — audit work for correctness and quality
|
|
@@ -84,11 +92,11 @@ You wouldn't jump straight to coding without understanding the problem, and you
|
|
|
84
92
|
|
|
85
93
|
A one-file fix can go straight to implement → validate. But for multi-file changes or design decisions:
|
|
86
94
|
|
|
87
|
-
- **You MUST spawn
|
|
95
|
+
- **You MUST spawn explore agents before planning.** Explore agents investigate the codebase and save context files. Without exploration, plans are based on assumptions. When spawning future agents, pass them references to relevant context files so they start informed.
|
|
88
96
|
|
|
89
|
-
- **You MUST
|
|
97
|
+
- **You MUST spawn a plan agent before implementation.** Plan agents use explore context to map changes file by file and save a plan to the context dir. For larger features, spawn a spec agent first to define *what*, then a plan agent for *how*.
|
|
90
98
|
|
|
91
|
-
|
|
99
|
+
- **You MUST have plans reviewed before acting on them.** Spawn a review agent to audit for missed edge cases, file conflicts, and incorrect assumptions before implementation begins.
|
|
92
100
|
|
|
93
101
|
### Interleave phases across cycles
|
|
94
102
|
|
|
@@ -110,6 +118,16 @@ Prefer validation that exercises actual behavior over surface checks:
|
|
|
110
118
|
|
|
111
119
|
If the project lacks validation tooling, **create it**. A smoke-test script pays for itself immediately.
|
|
112
120
|
|
|
121
|
+
### Don't Trust Agent Reports
|
|
122
|
+
|
|
123
|
+
Agents are optimistic — they'll report success even when the work is sloppy. Passing tests and type checks are table stakes. **Spawn review agents to audit the actual code** and look for these patterns:
|
|
124
|
+
|
|
125
|
+
- Mock/placeholder data left in production code
|
|
126
|
+
- Dead code and unused imports
|
|
127
|
+
- Duplicate logic instead of reusing what exists
|
|
128
|
+
- Overengineered abstractions
|
|
129
|
+
- Hacky unidiomatic solutions (hand-rolling what a library already does)
|
|
130
|
+
|
|
113
131
|
### Slash Commands
|
|
114
132
|
|
|
115
133
|
Agents can invoke slash commands via `/skill:name` syntax to load specialized methodologies:
|
|
@@ -120,33 +138,22 @@ sisyphus spawn --name "debug-auth" --instruction '/devcore:debugging Investigate
|
|
|
120
138
|
|
|
121
139
|
## File Conflicts
|
|
122
140
|
|
|
123
|
-
If multiple agents run concurrently, ensure they don't edit the same files. If overlap is unavoidable, serialize across cycles.
|
|
141
|
+
If multiple agents run concurrently, ensure they don't edit the same files. If overlap is unavoidable, serialize across cycles. Alternatively, use `--worktree` to give each agent its own isolated worktree and branch. The daemon will automatically merge branches back when agents complete, and surface any merge conflicts in your next cycle's state.
|
|
124
142
|
|
|
125
143
|
## CLI Reference
|
|
126
144
|
|
|
127
145
|
```bash
|
|
128
|
-
# Task management — use stdin for multi-line descriptions
|
|
129
|
-
cat <<'EOF' | sisyphus tasks add
|
|
130
|
-
Multi-line description with context and acceptance criteria.
|
|
131
|
-
EOF
|
|
132
|
-
cat <<'EOF' | sisyphus tasks add --status draft
|
|
133
|
-
Draft task to investigate later.
|
|
134
|
-
EOF
|
|
135
|
-
sisyphus tasks update <taskId> --status draft|pending|in_progress|done
|
|
136
|
-
sisyphus tasks update <taskId> --description "$(cat <<'EOF'
|
|
137
|
-
Updated description with new findings.
|
|
138
|
-
EOF
|
|
139
|
-
)"
|
|
140
|
-
sisyphus tasks list
|
|
141
|
-
|
|
142
146
|
# Spawn an agent
|
|
143
147
|
sisyphus spawn --agent-type <type> --name <name> --instruction "what to do"
|
|
144
148
|
|
|
149
|
+
# Spawn an agent in an isolated worktree (separate branch + working directory)
|
|
150
|
+
sisyphus spawn --worktree --name <name> --instruction "what to do"
|
|
151
|
+
|
|
145
152
|
# Yield control
|
|
146
153
|
sisyphus yield # default prompt next cycle
|
|
147
|
-
sisyphus yield --prompt "focus on
|
|
154
|
+
sisyphus yield --prompt "focus on auth middleware next" # self-prompt for next cycle
|
|
148
155
|
cat <<'EOF' | sisyphus yield # pipe longer self-prompt
|
|
149
|
-
Next cycle: review agent-003's report
|
|
156
|
+
Next cycle: review agent-003's report, then spawn
|
|
150
157
|
a validation agent to test the middleware integration.
|
|
151
158
|
EOF
|
|
152
159
|
|
|
@@ -159,4 +166,4 @@ sisyphus status
|
|
|
159
166
|
|
|
160
167
|
## Completion
|
|
161
168
|
|
|
162
|
-
Call `sisyphus complete` only when the overall goal is genuinely achieved **and validated by an agent other than the one that did the work**. If unsure, spawn a validation agent first.
|
|
169
|
+
Call `sisyphus complete` only when the overall goal is genuinely achieved **and validated by an agent other than the one that did the work**. If unsure, spawn a validation agent first. Remember, use sisyphus spawn, not Task() tool.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/paths.ts"],"sourcesContent":["import { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nexport function globalDir(): string {\n return join(homedir(), '.sisyphus');\n}\n\nexport function socketPath(): string {\n return join(globalDir(), 'daemon.sock');\n}\n\nexport function globalConfigPath(): string {\n return join(globalDir(), 'config.json');\n}\n\nexport function daemonLogPath(): string {\n return join(globalDir(), 'daemon.log');\n}\n\nexport function daemonPidPath(): string {\n return join(globalDir(), 'daemon.pid');\n}\n\nexport function projectDir(cwd: string): string {\n return join(cwd, '.sisyphus');\n}\n\nexport function projectConfigPath(cwd: string): string {\n return join(projectDir(cwd), 'config.json');\n}\n\nexport function projectOrchestratorPromptPath(cwd: string): string {\n return join(projectDir(cwd), 'orchestrator.md');\n}\n\nexport function sessionsDir(cwd: string): string {\n return join(projectDir(cwd), 'sessions');\n}\n\nexport function sessionDir(cwd: string, sessionId: string): string {\n return join(sessionsDir(cwd), sessionId);\n}\n\nexport function statePath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'state.json');\n}\n\nexport function reportsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'reports');\n}\n\nexport function reportFilePath(cwd: string, sessionId: string, agentId: string, suffix: string): string {\n return join(reportsDir(cwd, sessionId), `${agentId}-${suffix}.md`);\n}\n\nexport function contextDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'context');\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,SAAS,YAAY;AAEd,SAAS,YAAoB;AAClC,SAAO,KAAK,QAAQ,GAAG,WAAW;AACpC;AAEO,SAAS,aAAqB;AACnC,SAAO,KAAK,UAAU,GAAG,aAAa;AACxC;AAEO,SAAS,mBAA2B;AACzC,SAAO,KAAK,UAAU,GAAG,aAAa;AACxC;AAEO,SAAS,gBAAwB;AACtC,SAAO,KAAK,UAAU,GAAG,YAAY;AACvC;AAEO,SAAS,gBAAwB;AACtC,SAAO,KAAK,UAAU,GAAG,YAAY;AACvC;AAEO,SAAS,WAAW,KAAqB;AAC9C,SAAO,KAAK,KAAK,WAAW;AAC9B;AAEO,SAAS,kBAAkB,KAAqB;AACrD,SAAO,KAAK,WAAW,GAAG,GAAG,aAAa;AAC5C;AAEO,SAAS,8BAA8B,KAAqB;AACjE,SAAO,KAAK,WAAW,GAAG,GAAG,iBAAiB;AAChD;AAEO,SAAS,YAAY,KAAqB;AAC/C,SAAO,KAAK,WAAW,GAAG,GAAG,UAAU;AACzC;AAEO,SAAS,WAAW,KAAa,WAA2B;AACjE,SAAO,KAAK,YAAY,GAAG,GAAG,SAAS;AACzC;AAEO,SAAS,UAAU,KAAa,WAA2B;AAChE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,YAAY;AACtD;AAEO,SAAS,WAAW,KAAa,WAA2B;AACjE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,SAAS;AACnD;AAEO,SAAS,eAAe,KAAa,WAAmB,SAAiB,QAAwB;AACtG,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,GAAG,OAAO,IAAI,MAAM,KAAK;AACnE;AAEO,SAAS,WAAW,KAAa,WAA2B;AACjE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,SAAS;AACnD;","names":[]}
|