orbit-auto 3.0.0__tar.gz
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.
- orbit_auto-3.0.0/.gitignore +18 -0
- orbit_auto-3.0.0/CLAUDE.md +579 -0
- orbit_auto-3.0.0/PKG-INFO +176 -0
- orbit_auto-3.0.0/README.md +151 -0
- orbit_auto-3.0.0/orbit_auto/__init__.py +32 -0
- orbit_auto-3.0.0/orbit_auto/__main__.py +13 -0
- orbit_auto-3.0.0/orbit_auto/claude_runner.py +439 -0
- orbit_auto-3.0.0/orbit_auto/cli.py +325 -0
- orbit_auto-3.0.0/orbit_auto/code_reviewer.py +187 -0
- orbit_auto-3.0.0/orbit_auto/dag.py +336 -0
- orbit_auto-3.0.0/orbit_auto/db_logger.py +293 -0
- orbit_auto-3.0.0/orbit_auto/display.py +382 -0
- orbit_auto-3.0.0/orbit_auto/init_task.py +79 -0
- orbit_auto-3.0.0/orbit_auto/models.py +195 -0
- orbit_auto-3.0.0/orbit_auto/parallel.py +464 -0
- orbit_auto-3.0.0/orbit_auto/plan_validator.py +128 -0
- orbit_auto-3.0.0/orbit_auto/runnable.py +273 -0
- orbit_auto-3.0.0/orbit_auto/sequential.py +597 -0
- orbit_auto-3.0.0/orbit_auto/state.py +286 -0
- orbit_auto-3.0.0/orbit_auto/task_parser.py +300 -0
- orbit_auto-3.0.0/orbit_auto/templates/__init__.py +126 -0
- orbit_auto-3.0.0/orbit_auto/worker.py +483 -0
- orbit_auto-3.0.0/orbit_auto/worktree.py +224 -0
- orbit_auto-3.0.0/pyproject.toml +73 -0
- orbit_auto-3.0.0/tests/conftest.py +69 -0
- orbit_auto-3.0.0/tests/test_claude_runner.py +133 -0
- orbit_auto-3.0.0/tests/test_dag.py +133 -0
- orbit_auto-3.0.0/tests/test_models.py +91 -0
- orbit_auto-3.0.0/tests/test_plan_validator.py +118 -0
- orbit_auto-3.0.0/tests/test_runnable.py +120 -0
- orbit_auto-3.0.0/tests/test_state.py +187 -0
- orbit_auto-3.0.0/tests/test_task_parser.py +163 -0
- orbit_auto-3.0.0/uv.lock +433 -0
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Orbit Auto is an autonomous AI development tool that enables Claude to work continuously on programming tasks until completion. It uses iterative loops where AI reads its previous work via the file system.
|
|
8
|
+
|
|
9
|
+
**This repository contains a custom implementation integrated with our orbit task management system.** The scripts here work with the `~/.claude/orbit/active/<task-name>/` directory structure and support features like `/orbit:go`, task DB time tracking, dashboard visualization, and the hybrid 3-file approach (`*-tasks.md`, `*-context.md`, `*-auto-log.md`).
|
|
10
|
+
|
|
11
|
+
**CLI Command:** `orbit-auto`
|
|
12
|
+
**Core Philosophy:** "Iteration beats perfection on the first attempt"
|
|
13
|
+
|
|
14
|
+
## Architecture
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
+-------------------------------------------------------------+
|
|
18
|
+
| ORBIT AUTO |
|
|
19
|
+
+-------------------------------------------------------------+
|
|
20
|
+
| PROMPT -> WORK -> CHECK -> EXIT? (YES=done, NO=repeat) |
|
|
21
|
+
+-------------------------------------------------------------+
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Key principles:
|
|
25
|
+
- **Self-referential feedback** - Same prompt repeated, AI sees file changes
|
|
26
|
+
- **File persistence** - All work persists via filesystem between iterations
|
|
27
|
+
- **Git visibility** - Each iteration sees git history for progress tracking
|
|
28
|
+
- **Deterministic exit** - `<promise>COMPLETE</promise>` signals completion
|
|
29
|
+
|
|
30
|
+
## Repository Structure
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
orbit-auto/
|
|
34
|
+
+-- orbit_auto/ # Python package
|
|
35
|
+
| +-- __init__.py
|
|
36
|
+
| +-- __main__.py # Entry point: python -m orbit_auto
|
|
37
|
+
| +-- cli.py # Argument parsing, commands
|
|
38
|
+
| +-- models.py # Data models (Task, State, Config)
|
|
39
|
+
| +-- dag.py # Dependency graph builder
|
|
40
|
+
| +-- state.py # State management with file locking
|
|
41
|
+
| +-- task_parser.py # Parse tasks.md and prompts
|
|
42
|
+
| +-- claude_runner.py # Claude CLI integration
|
|
43
|
+
| +-- display.py # Terminal output and colors
|
|
44
|
+
| +-- db_logger.py # Database logging for dashboard
|
|
45
|
+
| +-- sequential.py # Sequential execution
|
|
46
|
+
| +-- parallel.py # Parallel orchestration
|
|
47
|
+
| +-- worker.py # Worker process
|
|
48
|
+
| +-- init_task.py # Task initialization
|
|
49
|
+
| +-- templates/ # Embedded templates
|
|
50
|
+
+-- pyproject.toml # Package configuration (name: orbit-auto)
|
|
51
|
+
+-- README.md # Quick reference
|
|
52
|
+
+-- SKILL.md # PRD Builder skill documentation
|
|
53
|
+
+-- CLAUDE.md # This file
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Orbit Files Integration
|
|
57
|
+
|
|
58
|
+
### Task Directory Structure
|
|
59
|
+
When running orbit-auto, tasks are organized in the centralized orbit directory:
|
|
60
|
+
```
|
|
61
|
+
~/.claude/orbit/
|
|
62
|
+
+-- active/
|
|
63
|
+
| +-- <task-name>/
|
|
64
|
+
| +-- <task-name>-tasks.md # Checkbox items
|
|
65
|
+
| +-- <task-name>-context.md # KEY learnings only
|
|
66
|
+
| +-- <task-name>-plan.md # Implementation plan (optional)
|
|
67
|
+
| +-- <task-name>-auto-log.md # Detailed iteration history (auto-created)
|
|
68
|
+
| +-- prompts/ # Optimized prompts (optional)
|
|
69
|
+
| +-- README.md # Index with status tracking
|
|
70
|
+
| +-- task-01-prompt.md # Optimized prompt for task 1
|
|
71
|
+
| +-- task-02-prompt.md # etc.
|
|
72
|
+
| +-- ...
|
|
73
|
+
+-- completed/
|
|
74
|
+
+-- <task-name>/ # Moved here on completion
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Hybrid 3-File Approach
|
|
78
|
+
|
|
79
|
+
| File | What Goes Here | Written By |
|
|
80
|
+
|------|----------------|------------|
|
|
81
|
+
| `*-tasks.md` | Checkbox items, acceptance criteria | Human initially, orbit-auto marks `[x]` |
|
|
82
|
+
| `*-context.md` | KEY learnings, blockers, decisions | Human + orbit-auto (important stuff only) |
|
|
83
|
+
| `*-auto-log.md` | Detailed iteration history | Orbit-auto only (delete after completion) |
|
|
84
|
+
|
|
85
|
+
**Why this works:**
|
|
86
|
+
- Context file stays clean and useful for `/orbit:go`
|
|
87
|
+
- Auto log has full debugging history if needed
|
|
88
|
+
- Log can be deleted after task completion
|
|
89
|
+
|
|
90
|
+
### Task DB Integration
|
|
91
|
+
Scripts integrate with `~/.claude/scripts/orbit_db.py` when available:
|
|
92
|
+
- Time tracking via heartbeat processing
|
|
93
|
+
- Progress updates with `[PROGRESS] X/Y (Z%)` format
|
|
94
|
+
- Task completion marking
|
|
95
|
+
|
|
96
|
+
### Dashboard Integration
|
|
97
|
+
|
|
98
|
+
Orbit Auto logs execution runs to the task database for visualization in the Orbit Dashboard (`http://localhost:8787`).
|
|
99
|
+
|
|
100
|
+
**What's logged:**
|
|
101
|
+
- Execution start/end with status (completed, failed, cancelled)
|
|
102
|
+
- Per-worker task claims, completions, and failures
|
|
103
|
+
- Progress updates (completed/failed subtask counts)
|
|
104
|
+
- Log entries with levels (debug, info, warn, error, success)
|
|
105
|
+
|
|
106
|
+
**Retention Policy:**
|
|
107
|
+
- Keep last 10 executions per task
|
|
108
|
+
- Delete executions older than 30 days
|
|
109
|
+
- Cleanup runs automatically when starting new executions
|
|
110
|
+
|
|
111
|
+
**Dashboard Features:**
|
|
112
|
+
- **Auto tab**: View active projects with D3.js dependency graphs
|
|
113
|
+
- **Output viewer**: Browse execution logs with filtering by level, worker, and subtask
|
|
114
|
+
- **SSE streaming**: Live log updates during running executions
|
|
115
|
+
|
|
116
|
+
### Optimized Prompts (Orbit Feature)
|
|
117
|
+
|
|
118
|
+
The orbit plugin can generate optimized prompts for each subtask with agent/skill references. Prompts can be executed manually or via orbit-auto. This enables:
|
|
119
|
+
|
|
120
|
+
- **Parallel agent execution** - Each prompt specifies which agents to use
|
|
121
|
+
- **Better task context** - Prompts include specific instructions, constraints, and validation steps
|
|
122
|
+
- **Status tracking** - Prompts have statuses: Pending -> Approved -> In Progress -> Completed
|
|
123
|
+
|
|
124
|
+
#### How It Works
|
|
125
|
+
|
|
126
|
+
1. **Discovery** - `/orbit:prompts` analyzes subtasks, lists relevant agents/skills, identifies gaps
|
|
127
|
+
2. **Gap Resolution** - If gaps found, suggests creating new agents/skills (user must approve)
|
|
128
|
+
3. **Generation** - Uses `/optimize-prompt` to create structured prompts with XML tags
|
|
129
|
+
4. **Batch Approval** - All prompts shown together for batch approval (approve once for all)
|
|
130
|
+
5. **Execution** - Orbit-auto uses prompts in order, following checkboxes in tasks.md
|
|
131
|
+
6. **Tracking** - Progress tracked via checkboxes in tasks.md (single source of truth)
|
|
132
|
+
|
|
133
|
+
#### Prompt File Structure
|
|
134
|
+
|
|
135
|
+
**Note:** Prompts do NOT have status fields. Progress is tracked by checkboxes in the tasks file.
|
|
136
|
+
|
|
137
|
+
```markdown
|
|
138
|
+
---
|
|
139
|
+
task_id: "01"
|
|
140
|
+
task_title: "Add priority field to Task model"
|
|
141
|
+
agents:
|
|
142
|
+
- python-pro
|
|
143
|
+
skills:
|
|
144
|
+
- pytest-patterns
|
|
145
|
+
dependencies: []
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
# Task 01: Add priority field to Task model
|
|
149
|
+
|
|
150
|
+
<context>...</context>
|
|
151
|
+
<instructions>...</instructions>
|
|
152
|
+
<constraints>...</constraints>
|
|
153
|
+
<agents>
|
|
154
|
+
## Available Agents
|
|
155
|
+
Use the **Task tool** with the specified `subagent_type`:
|
|
156
|
+
| Agent | Invoke With | Use For |
|
|
157
|
+
|-------|-------------|---------|
|
|
158
|
+
| python-pro | `subagent_type="python-pro"` | Python best practices |
|
|
159
|
+
</agents>
|
|
160
|
+
<skills>
|
|
161
|
+
## Available Skills
|
|
162
|
+
Invoke skills directly using `/skill-name`:
|
|
163
|
+
| Skill | Invoke | Auto-triggers on |
|
|
164
|
+
|-------|--------|------------------|
|
|
165
|
+
| pytest-patterns | `/pytest-patterns` | pytest, fixture |
|
|
166
|
+
</skills>
|
|
167
|
+
<validation>...</validation>
|
|
168
|
+
<acceptance_criteria>...</acceptance_criteria>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
#### Creating Prompts
|
|
172
|
+
|
|
173
|
+
Use the orbit plugin commands:
|
|
174
|
+
|
|
175
|
+
1. **Create the task** (if not already done):
|
|
176
|
+
```bash
|
|
177
|
+
/orbit:new my-feature
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
2. **Generate optimized prompts** with agent/skill discovery:
|
|
181
|
+
```bash
|
|
182
|
+
/orbit:prompts my-feature
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
This workflow:
|
|
186
|
+
- Analyzes subtasks and identifies relevant agents/skills
|
|
187
|
+
- Shows gaps and suggests new agents/skills if needed (user approval required)
|
|
188
|
+
- Uses `/optimize-prompt` internally for each subtask
|
|
189
|
+
- **Shows all prompts together for batch approval**
|
|
190
|
+
- Creates `prompts/` directory with indexed prompt files
|
|
191
|
+
|
|
192
|
+
#### Using Prompts
|
|
193
|
+
|
|
194
|
+
**Manual execution** - work through prompts one at a time:
|
|
195
|
+
```bash
|
|
196
|
+
cat prompts/task-01-prompt.md # Read the prompt
|
|
197
|
+
# Then paste into a new Claude session or continue in current session
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Orbit-auto execution** - autonomous batch processing:
|
|
201
|
+
```bash
|
|
202
|
+
orbit-auto my-feature
|
|
203
|
+
# Output:
|
|
204
|
+
# Found 5 prompt file(s) in prompts/
|
|
205
|
+
# Prompts: Using optimized prompts (tracking via tasks.md)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Orbit-auto determines which prompt to use by checking which tasks are still uncompleted (marked `[ ]`) in the tasks.md file. When a task is marked `[x]`, it moves to the next prompt.
|
|
209
|
+
|
|
210
|
+
## Usage
|
|
211
|
+
|
|
212
|
+
### Installation
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# From the orbit-auto directory
|
|
216
|
+
pip install -e .
|
|
217
|
+
|
|
218
|
+
# Or run directly with Python
|
|
219
|
+
python -m orbit_auto <task-name>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Commands
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Initialize a new task
|
|
226
|
+
orbit-auto init <task-name> "description"
|
|
227
|
+
|
|
228
|
+
# Run in parallel mode (default, 8 workers)
|
|
229
|
+
orbit-auto <task-name>
|
|
230
|
+
|
|
231
|
+
# Run with more workers
|
|
232
|
+
orbit-auto <task-name> -w 12
|
|
233
|
+
|
|
234
|
+
# Run in sequential mode
|
|
235
|
+
orbit-auto <task-name> --sequential
|
|
236
|
+
|
|
237
|
+
# Show execution plan without running
|
|
238
|
+
orbit-auto <task-name> --dry-run
|
|
239
|
+
|
|
240
|
+
# Check task status
|
|
241
|
+
orbit-auto status <task-name>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Options
|
|
245
|
+
|
|
246
|
+
| Option | Default | Description |
|
|
247
|
+
|--------|---------|-------------|
|
|
248
|
+
| `-w, --workers N` | 8 | Number of parallel workers (max: 12) |
|
|
249
|
+
| `-r, --retries N` | 3 | Max retries per task |
|
|
250
|
+
| `--pause N` | 3 | Pause between iterations (sequential mode) |
|
|
251
|
+
| `--sequential, -s` | | Run in sequential mode |
|
|
252
|
+
| `--parallel, -p` | + | Run in parallel mode (default) |
|
|
253
|
+
| `--fail-fast` | | Stop all workers on first failure |
|
|
254
|
+
| `--dry-run` | | Show execution plan without running |
|
|
255
|
+
| `-v, --visibility` | verbose | Output level: verbose, minimal, none |
|
|
256
|
+
| `--no-color` | | Disable colored output |
|
|
257
|
+
|
|
258
|
+
### Environment Variables
|
|
259
|
+
|
|
260
|
+
| Variable | Default | Description |
|
|
261
|
+
|----------|---------|-------------|
|
|
262
|
+
| `ORBIT_AUTO_VISIBILITY` | `verbose` | Controls tool call output during iterations |
|
|
263
|
+
|
|
264
|
+
**Visibility Modes:**
|
|
265
|
+
- `verbose` - Timestamps + full paths + command args (default)
|
|
266
|
+
- `minimal` - Timestamps + filenames only
|
|
267
|
+
- `none` - Original behavior (no tool visibility)
|
|
268
|
+
|
|
269
|
+
Example output with `verbose`:
|
|
270
|
+
```
|
|
271
|
+
-------------------------------------------------------------------
|
|
272
|
+
* ITERATION 1/20 | Task 2/9 | #........... 11%
|
|
273
|
+
> Add priority field to Task model
|
|
274
|
+
-------------------------------------------------------------------
|
|
275
|
+
|
|
276
|
+
* Working...
|
|
277
|
+
14:32:05 Read ~/.claude/orbit/active/my-task/my-task-tasks.md
|
|
278
|
+
14:32:06 Read ~/.claude/orbit/active/my-task/my-task-context.md
|
|
279
|
+
14:32:08 Edit src/components/Button.tsx
|
|
280
|
+
14:32:15 Bash npm run typecheck
|
|
281
|
+
14:32:28 Done (23s, 5 tools)
|
|
282
|
+
|
|
283
|
+
+ SUCCESS | 23s | 5 tools
|
|
284
|
+
|_ Added priority field with enum type and default value
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Usage examples:
|
|
288
|
+
```bash
|
|
289
|
+
# Default (verbose)
|
|
290
|
+
orbit-auto my-task
|
|
291
|
+
|
|
292
|
+
# Minimal output
|
|
293
|
+
ORBIT_AUTO_VISIBILITY=minimal orbit-auto my-task
|
|
294
|
+
|
|
295
|
+
# Disable tool visibility
|
|
296
|
+
ORBIT_AUTO_VISIBILITY=none orbit-auto my-task
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Parallel Mode
|
|
300
|
+
|
|
301
|
+
Parallel mode runs multiple tasks concurrently while respecting dependencies.
|
|
302
|
+
|
|
303
|
+
**Requirements:**
|
|
304
|
+
- Task must have `prompts/` directory with `task-XX-prompt.md` files
|
|
305
|
+
- Each prompt needs YAML frontmatter with `task_id` and `dependencies` fields
|
|
306
|
+
|
|
307
|
+
**How it works:**
|
|
308
|
+
1. Parses dependencies from prompt YAML frontmatter
|
|
309
|
+
2. Builds DAG and computes parallel execution "waves"
|
|
310
|
+
3. Shows execution plan for user approval
|
|
311
|
+
4. Spawns worker processes (up to 12)
|
|
312
|
+
5. Workers claim tasks atomically, respecting dependencies
|
|
313
|
+
6. State synced to tasks.md periodically
|
|
314
|
+
|
|
315
|
+
**Dependency format in prompts:**
|
|
316
|
+
```yaml
|
|
317
|
+
dependencies: ["01", "03"] # Waits for tasks 01 and 03
|
|
318
|
+
dependencies: [] # No dependencies (Wave 1)
|
|
319
|
+
# (missing field) # Implicit dependency on previous task
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Sequential Mode
|
|
323
|
+
|
|
324
|
+
Sequential mode runs tasks one at a time, in order. Use this for:
|
|
325
|
+
- Simple linear workflows
|
|
326
|
+
- Tasks that need careful human oversight
|
|
327
|
+
- Debugging specific task failures
|
|
328
|
+
|
|
329
|
+
## Task Writing Rules
|
|
330
|
+
|
|
331
|
+
### Story Size (Critical)
|
|
332
|
+
Every task must fit in one context window (~10 min):
|
|
333
|
+
- Add a database field and migration
|
|
334
|
+
- Create one UI component
|
|
335
|
+
- Modify a single backend action
|
|
336
|
+
|
|
337
|
+
**Rule:** If you can't describe it in 2-3 sentences, split it.
|
|
338
|
+
|
|
339
|
+
| Too Broad | Break Down Into |
|
|
340
|
+
|-----------|-----------------|
|
|
341
|
+
| Build the dashboard | Schema -> Queries -> UI |
|
|
342
|
+
| Add authentication | Schema -> Middleware -> UI -> Sessions |
|
|
343
|
+
|
|
344
|
+
### Dependency-First Ordering
|
|
345
|
+
1. Database/schema updates
|
|
346
|
+
2. Backend logic
|
|
347
|
+
3. UI elements consuming backend
|
|
348
|
+
4. Aggregated or summary views
|
|
349
|
+
|
|
350
|
+
### Acceptance Criteria
|
|
351
|
+
Must be objectively verifiable:
|
|
352
|
+
- + "Add `status` column with default `pending`"
|
|
353
|
+
- + "Dropdown includes All / Active / Completed"
|
|
354
|
+
- x "Works as expected" / "Good UX"
|
|
355
|
+
|
|
356
|
+
**Mandatory criteria:**
|
|
357
|
+
- "Typecheck passes" (all code changes)
|
|
358
|
+
- "Verify changes work in browser" (UI changes)
|
|
359
|
+
|
|
360
|
+
## File Update Rules
|
|
361
|
+
|
|
362
|
+
### Tasks File (`*-tasks.md`)
|
|
363
|
+
```markdown
|
|
364
|
+
**Status:** In Progress
|
|
365
|
+
**Last Updated:** YYYY-MM-DD HH:MM
|
|
366
|
+
**Remaining:** Configure webhook endpoint, add integration tests
|
|
367
|
+
|
|
368
|
+
## Tasks
|
|
369
|
+
- [x] Completed task
|
|
370
|
+
- [ ] Next task with clear acceptance criteria
|
|
371
|
+
- [ ] Typecheck passes
|
|
372
|
+
```
|
|
373
|
+
Update `**Remaining:**` field with natural language summary (max 15 words).
|
|
374
|
+
|
|
375
|
+
### Context File (`*-context.md`)
|
|
376
|
+
**Only add KEY learnings:**
|
|
377
|
+
- Architectural decisions made
|
|
378
|
+
- Important gotchas discovered
|
|
379
|
+
- Patterns to follow/avoid
|
|
380
|
+
|
|
381
|
+
**DO NOT add:** routine completion notes, iteration-by-iteration updates.
|
|
382
|
+
|
|
383
|
+
### Auto Log (`*-auto-log.md`)
|
|
384
|
+
Detailed iteration history (auto-generated):
|
|
385
|
+
```markdown
|
|
386
|
+
## Iteration N - [Task Title]
|
|
387
|
+
**Status:** SUCCESS/FAILED/PROGRESS
|
|
388
|
+
**Time:** [timestamp]
|
|
389
|
+
**Duration:** Xs | **Tools:** N
|
|
390
|
+
|
|
391
|
+
### Files Modified
|
|
392
|
+
- `path/to/file.ts`
|
|
393
|
+
|
|
394
|
+
### Summary
|
|
395
|
+
Added priority field to Task model using SQLAlchemy Enum. Created migration with default 'medium'.
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
On completion, adds:
|
|
399
|
+
```markdown
|
|
400
|
+
# COMPLETED
|
|
401
|
+
**Finished:** YYYY-MM-DD HH:MM
|
|
402
|
+
**Total iterations:** N
|
|
403
|
+
**Duration:** Xs
|
|
404
|
+
|
|
405
|
+
## Run Summary
|
|
406
|
+
Implemented complete task priority system across 5 subtasks. Main challenge was circular imports, resolved with lazy loading.
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
## Learning Tags
|
|
410
|
+
|
|
411
|
+
Orbit-auto extracts learning-centric information from Claude's responses using XML tags. These tags help future iterations learn from past attempts.
|
|
412
|
+
|
|
413
|
+
> **CRITICAL: Without `<what_worked>` tag, orbit-auto cannot detect task success and will retry indefinitely!**
|
|
414
|
+
>
|
|
415
|
+
> Every successful task completion MUST include:
|
|
416
|
+
> ```xml
|
|
417
|
+
> <what_worked>Brief description of approach that succeeded</what_worked>
|
|
418
|
+
> ```
|
|
419
|
+
>
|
|
420
|
+
> This is the ONLY way orbit-auto knows a task succeeded. The prompt template (`templates/prompt-template.md`) includes instructions for this tag.
|
|
421
|
+
|
|
422
|
+
### Required Tags (every response)
|
|
423
|
+
|
|
424
|
+
**Always include:**
|
|
425
|
+
```xml
|
|
426
|
+
<learnings>Key insights discovered during this attempt</learnings>
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Success Tags (REQUIRED for task completion)
|
|
430
|
+
|
|
431
|
+
**CRITICAL:** Orbit-auto only marks a task complete if it sees one of:
|
|
432
|
+
1. `<promise>COMPLETE</promise>` - signals ALL tasks done
|
|
433
|
+
2. `<what_worked>` tag - signals THIS task succeeded
|
|
434
|
+
|
|
435
|
+
Without these tags, the task is considered **failed** and will be retried.
|
|
436
|
+
|
|
437
|
+
**On SUCCESS, you MUST include:**
|
|
438
|
+
```xml
|
|
439
|
+
<what_worked>The specific approach that succeeded</what_worked>
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Failure Tags
|
|
443
|
+
|
|
444
|
+
**On FAILURE, include ALL of these:**
|
|
445
|
+
```xml
|
|
446
|
+
<what_failed>Exact error/symptom observed</what_failed>
|
|
447
|
+
<dont_retry>Approaches that didn't work - prevents repeating mistakes</dont_retry>
|
|
448
|
+
<try_next>Prioritized list of what to try next</try_next>
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Pattern Discovery (optional)
|
|
452
|
+
|
|
453
|
+
**When discovering a reusable pattern:**
|
|
454
|
+
```xml
|
|
455
|
+
<pattern_discovered>Pattern name: Description</pattern_discovered>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Good pattern examples:**
|
|
459
|
+
- "Temp file cleanup: Always use trap to clean temp files on EXIT"
|
|
460
|
+
- "Safe grep count: Use || true after grep -c to handle zero matches"
|
|
461
|
+
|
|
462
|
+
Patterns are automatically bubbled up to the Codebase Knowledge section at the top of the auto log.
|
|
463
|
+
|
|
464
|
+
### Gotcha Discovery (optional)
|
|
465
|
+
|
|
466
|
+
**When discovering a surprising behavior to avoid:**
|
|
467
|
+
```xml
|
|
468
|
+
<gotcha>Issue: What went wrong and how to avoid it</gotcha>
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
**Good gotcha examples:**
|
|
472
|
+
- "grep -c exit code: Returns exit 1 when count is 0 - breaks set -e"
|
|
473
|
+
- "sed -i on macOS: Requires '' as first argument unlike Linux"
|
|
474
|
+
- "JSON parsing: Use jq instead of grep for text fields - handles escaped quotes"
|
|
475
|
+
|
|
476
|
+
Gotchas are automatically bubbled up to the Codebase Knowledge section at the top of the auto log.
|
|
477
|
+
|
|
478
|
+
### Run Completion
|
|
479
|
+
|
|
480
|
+
**When ALL tasks are complete:**
|
|
481
|
+
```xml
|
|
482
|
+
<run_summary>Overall summary of work done</run_summary>
|
|
483
|
+
<promise>COMPLETE</promise>
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### How Tags Are Used
|
|
487
|
+
|
|
488
|
+
| Tag | Written To | Purpose |
|
|
489
|
+
|-----|-----------|---------|
|
|
490
|
+
| `<learnings>` | Auto log, Console | Shows what was learned |
|
|
491
|
+
| `<what_worked>` | Auto log, Console | Documents successful approach |
|
|
492
|
+
| `<what_failed>` | Auto log | Records failure details |
|
|
493
|
+
| `<dont_retry>` | Auto log | Prevents repeating mistakes |
|
|
494
|
+
| `<try_next>` | Auto log | Guides next attempt |
|
|
495
|
+
| `<pattern_discovered>` | Codebase Knowledge section | Reusable patterns |
|
|
496
|
+
| `<gotcha>` | Codebase Knowledge section | Surprising behaviors to avoid |
|
|
497
|
+
| `<run_summary>` | Auto log, Console | Final summary |
|
|
498
|
+
|
|
499
|
+
### Log Compaction
|
|
500
|
+
|
|
501
|
+
When a task completes successfully, all its attempts are compacted to a single line:
|
|
502
|
+
```markdown
|
|
503
|
+
## Task 2: Create config.sh - SUCCESS (2 attempts)
|
|
504
|
+
**Learning:** Config vars must be exported for child scripts
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
This keeps the log focused on actionable information for future iterations.
|
|
508
|
+
|
|
509
|
+
## Completion Signal
|
|
510
|
+
|
|
511
|
+
Output `<promise>COMPLETE</promise>` when ALL tasks are marked `[x]`. Include `<run_summary>` before it for best results.
|
|
512
|
+
|
|
513
|
+
## Blocker Syntax
|
|
514
|
+
|
|
515
|
+
Mark tasks that require human review before proceeding:
|
|
516
|
+
```markdown
|
|
517
|
+
- [ ] [WAIT] Task that needs human approval before proceeding
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
When orbit-auto encounters `[WAIT]`:
|
|
521
|
+
1. Outputs `<blocker>WAITING_FOR_HUMAN</blocker>`
|
|
522
|
+
2. Loop exits with code 2 (blocked, not failed)
|
|
523
|
+
3. Human reviews and either completes task or removes marker
|
|
524
|
+
4. Rerun orbit-auto to continue
|
|
525
|
+
|
|
526
|
+
## Workflow
|
|
527
|
+
|
|
528
|
+
### Quick Start
|
|
529
|
+
1. `orbit-auto init my-feature "Description"`
|
|
530
|
+
2. Edit `~/.claude/orbit/active/my-feature/my-feature-tasks.md` with tasks
|
|
531
|
+
3. Add context to `~/.claude/orbit/active/my-feature/my-feature-context.md`
|
|
532
|
+
4. `orbit-auto my-feature` # or `orbit-auto my-feature --sequential`
|
|
533
|
+
|
|
534
|
+
### Integration with /orbit:go
|
|
535
|
+
The context file is designed to survive compaction and work with `/orbit:go`:
|
|
536
|
+
- Keep it clean with only significant learnings
|
|
537
|
+
- Next Steps section helps resume work
|
|
538
|
+
- Blockers section surfaces issues
|
|
539
|
+
|
|
540
|
+
## PRD Builder Skill
|
|
541
|
+
|
|
542
|
+
The `SKILL.md` file contains a PRD Builder skill for creating Product Requirements Documents optimized for orbit-auto loops.
|
|
543
|
+
|
|
544
|
+
Key PRD rules:
|
|
545
|
+
1. Each user story must fit in one context window (~10 min)
|
|
546
|
+
2. Stories ordered by dependency (schema -> backend -> UI)
|
|
547
|
+
3. All acceptance criteria must be objectively verifiable
|
|
548
|
+
4. Always include "Typecheck passes" criterion
|
|
549
|
+
5. UI stories must include "Verify changes work in browser"
|
|
550
|
+
|
|
551
|
+
## When to Use Orbit Auto
|
|
552
|
+
|
|
553
|
+
**Good use cases:**
|
|
554
|
+
- Large refactors with test coverage
|
|
555
|
+
- Batch operations across codebase
|
|
556
|
+
- Test coverage expansion
|
|
557
|
+
- Tasks with automatic verification (tests, typecheck)
|
|
558
|
+
|
|
559
|
+
**Bad use cases:**
|
|
560
|
+
- Tasks requiring human judgment/design decisions
|
|
561
|
+
- One-shot operations
|
|
562
|
+
- Unclear success criteria
|
|
563
|
+
- Production debugging
|
|
564
|
+
|
|
565
|
+
## Safety Best Practices
|
|
566
|
+
|
|
567
|
+
1. **Always set max-iterations** as a safety net (default: 20)
|
|
568
|
+
2. **Monitor token usage** - loops can be expensive
|
|
569
|
+
3. **Clear completion criteria** - vague goals = infinite loops
|
|
570
|
+
4. **Use git** - you can always revert bad iterations
|
|
571
|
+
5. **Start small** - test with 5-10 iterations first
|
|
572
|
+
|
|
573
|
+
## Exit Codes
|
|
574
|
+
|
|
575
|
+
| Code | Meaning |
|
|
576
|
+
|------|---------|
|
|
577
|
+
| 0 | All tasks completed successfully |
|
|
578
|
+
| 1 | Max iterations reached (timeout) |
|
|
579
|
+
| 2 | Blocked on `[WAIT]` task (human input needed) |
|