claude-task-master 0.2.0
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.
- checksums.yaml +7 -0
- data/CLAUDE.md +192 -0
- data/README.md +231 -0
- data/bin/claude-task-master +6 -0
- data/lib/claude_task_master/claude.rb +305 -0
- data/lib/claude_task_master/cli.rb +537 -0
- data/lib/claude_task_master/github.rb +345 -0
- data/lib/claude_task_master/loop.rb +250 -0
- data/lib/claude_task_master/pr_comment.rb +170 -0
- data/lib/claude_task_master/state.rb +183 -0
- data/lib/claude_task_master/version.rb +5 -0
- data/lib/claude_task_master.rb +17 -0
- metadata +141 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 7dbcfc3c4a723e88aec42f1982dfec744e7a2e341279b3e3d34c4500500a8579
|
|
4
|
+
data.tar.gz: d40ffdfcd238845e784184b08bd4068ec1e757e3e8b461b13ecbed9bac70e732
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: fd790d64324ad5ce56e7e3ffcc00fe73f049881f788e67dd566e972a6a38041d6090349eb75d86d568e3e90f078e4b9b2048efa1698cb11301f3389acca5bc02
|
|
7
|
+
data.tar.gz: 481b06664e4c243f87aef1130b708835f25d50f6ae2a6719d922201f8d2cf2e2e807c76e25f7e70d3ff063b7d9f9223de2a70424250804b12e1e9a13cdfac293
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Instructions for Claude Code when working on this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
**claude-task-master** — Autonomous task loop for Claude Code.
|
|
8
|
+
|
|
9
|
+
A lightweight Ruby harness that keeps Claude working until success criteria are met. It's not trying to make Claude smarter—Claude is already smart. It just keeps the loop going:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
plan → work → check → work → check → ... → done
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Core Philosophy
|
|
16
|
+
|
|
17
|
+
1. **Claude does the work AND the checking** - The harness just keeps calling Claude
|
|
18
|
+
2. **State via files** - Everything persists in `.claude-task-master/`
|
|
19
|
+
3. **Generic review system** - Works with CodeRabbit, Copilot, or any review tool
|
|
20
|
+
4. **Shift handoff pattern** - Each Claude invocation is like a new engineer taking over
|
|
21
|
+
|
|
22
|
+
## Architecture
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
bin/claude-task-master # CLI entry point
|
|
26
|
+
lib/
|
|
27
|
+
claude_task_master.rb # Main require file
|
|
28
|
+
claude_task_master/
|
|
29
|
+
cli.rb # Thor CLI commands
|
|
30
|
+
loop.rb # Main work loop
|
|
31
|
+
state.rb # State management (.claude-task-master/)
|
|
32
|
+
claude.rb # Claude CLI wrapper
|
|
33
|
+
github.rb # GitHub operations (gh CLI)
|
|
34
|
+
reviewers/
|
|
35
|
+
base.rb # Base reviewer interface
|
|
36
|
+
coderabbit.rb # CodeRabbit implementation
|
|
37
|
+
copilot.rb # GitHub Copilot implementation
|
|
38
|
+
generic.rb # Generic PR comment reviewer
|
|
39
|
+
providers/
|
|
40
|
+
ci.rb # Generic CI status checker
|
|
41
|
+
sentry.rb # Sentry error monitoring
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Start fresh with a goal
|
|
48
|
+
claude-task-master "build a REST API with user auth"
|
|
49
|
+
|
|
50
|
+
# Resume previous work
|
|
51
|
+
claude-task-master # No args = resume
|
|
52
|
+
claude-task-master --resume
|
|
53
|
+
|
|
54
|
+
# Check status
|
|
55
|
+
claude-task-master status
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## State Directory
|
|
59
|
+
|
|
60
|
+
All state lives in `.claude-task-master/` within the project:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
.claude-task-master/
|
|
64
|
+
├── goal.txt # What we're building
|
|
65
|
+
├── criteria.txt # Success criteria
|
|
66
|
+
├── plan.md # Generated plan with [ ]/[x] checkboxes
|
|
67
|
+
├── state.json # Machine state (current task, PR #, etc.)
|
|
68
|
+
├── progress.md # Human-readable progress notes
|
|
69
|
+
├── context.md # Accumulated learnings (fed to Claude)
|
|
70
|
+
└── logs/
|
|
71
|
+
├── session-001.md # Full log per Claude invocation
|
|
72
|
+
└── session-002.md
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## The Loop
|
|
76
|
+
|
|
77
|
+
```ruby
|
|
78
|
+
# Pseudocode - this is the entire thing
|
|
79
|
+
def run
|
|
80
|
+
setup_or_resume
|
|
81
|
+
|
|
82
|
+
loop do
|
|
83
|
+
# Build context from state files
|
|
84
|
+
context = build_context
|
|
85
|
+
|
|
86
|
+
# Call Claude with full autonomy
|
|
87
|
+
invoke_claude(context)
|
|
88
|
+
|
|
89
|
+
# Check if done
|
|
90
|
+
break if success_criteria_met?
|
|
91
|
+
|
|
92
|
+
# Brief pause between invocations
|
|
93
|
+
sleep 2
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
puts "Done!"
|
|
97
|
+
end
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Claude Invocation
|
|
101
|
+
|
|
102
|
+
Each Claude call gets:
|
|
103
|
+
1. The goal and success criteria
|
|
104
|
+
2. Current state (what task we're on, PR status, etc.)
|
|
105
|
+
3. Context from previous sessions
|
|
106
|
+
4. Instructions to update state files when done
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
claude -p \
|
|
110
|
+
--dangerously-skip-permissions \
|
|
111
|
+
--allowedTools "Bash,Edit,Read,Write,Glob,Grep" \
|
|
112
|
+
"#{context_and_instructions}"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Review System
|
|
116
|
+
|
|
117
|
+
The harness is agnostic to review tools. It checks:
|
|
118
|
+
|
|
119
|
+
1. **CI status**: `gh pr checks --watch` (waits for completion)
|
|
120
|
+
2. **Review comments**: Fetches PR comments, filters by reviewer
|
|
121
|
+
3. **Unresolved threads**: Uses GitHub GraphQL for resolution status
|
|
122
|
+
|
|
123
|
+
Claude reads comments and decides what to fix. The harness just reports.
|
|
124
|
+
|
|
125
|
+
## Key Files
|
|
126
|
+
|
|
127
|
+
### cli.rb
|
|
128
|
+
Thor CLI with commands: `start`, `resume`, `status`
|
|
129
|
+
|
|
130
|
+
### loop.rb
|
|
131
|
+
Main loop logic. Calls Claude repeatedly until done.
|
|
132
|
+
|
|
133
|
+
### state.rb
|
|
134
|
+
Reads/writes `.claude-task-master/` files. Handles resume.
|
|
135
|
+
|
|
136
|
+
### claude.rb
|
|
137
|
+
Wrapper around `claude` CLI. Builds prompts, captures output.
|
|
138
|
+
|
|
139
|
+
### github.rb
|
|
140
|
+
GitHub operations via `gh` CLI:
|
|
141
|
+
- Create PR: `gh pr create`
|
|
142
|
+
- Check CI: `gh pr checks`
|
|
143
|
+
- Get comments: `gh api repos/:owner/:repo/pulls/:pr/comments`
|
|
144
|
+
- Merge: `gh pr merge`
|
|
145
|
+
|
|
146
|
+
### reviewers/base.rb
|
|
147
|
+
Interface for review systems:
|
|
148
|
+
```ruby
|
|
149
|
+
class Base
|
|
150
|
+
def fetch_comments(pr_number) = raise NotImplementedError
|
|
151
|
+
def unresolved_comments(pr_number) = raise NotImplementedError
|
|
152
|
+
def resolve_comment(comment_id) = raise NotImplementedError
|
|
153
|
+
end
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Code Style
|
|
157
|
+
|
|
158
|
+
- Ruby 3.1+
|
|
159
|
+
- Single Responsibility Principle (SRP) - each file does one thing
|
|
160
|
+
- No metaprogramming magic
|
|
161
|
+
- Explicit over implicit
|
|
162
|
+
- Files under 200 lines
|
|
163
|
+
|
|
164
|
+
## Testing
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
bundle exec rspec
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Tests use fixtures and mocked Claude calls. No real API calls in tests.
|
|
171
|
+
|
|
172
|
+
## Development
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Install dependencies
|
|
176
|
+
bundle install
|
|
177
|
+
|
|
178
|
+
# Run locally
|
|
179
|
+
bundle exec bin/claude-task-master "test goal"
|
|
180
|
+
|
|
181
|
+
# Run tests
|
|
182
|
+
bundle exec rspec
|
|
183
|
+
|
|
184
|
+
# Lint
|
|
185
|
+
bundle exec rubocop
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Security
|
|
189
|
+
|
|
190
|
+
- Uses `--dangerously-skip-permissions` - only run in trusted environments
|
|
191
|
+
- No credentials stored in state files
|
|
192
|
+
- Uses `gh` CLI for auth (inherits user's GitHub auth)
|
data/README.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# claude-task-master
|
|
2
|
+
|
|
3
|
+
Autonomous task loop for Claude Code. Keep Claude working until the job is done.
|
|
4
|
+
|
|
5
|
+
## The Loop
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
plan → work → check → work → check → ... → done
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Claude does the work AND the checking. The task master just keeps the loop going.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Install
|
|
17
|
+
gem install claude-task-master
|
|
18
|
+
|
|
19
|
+
# Start a new task
|
|
20
|
+
claude-task-master start "build a REST API with user authentication"
|
|
21
|
+
|
|
22
|
+
# Enter success criteria when prompted:
|
|
23
|
+
> tests pass, PR merged, no sentry errors for 10 minutes
|
|
24
|
+
|
|
25
|
+
# Let it run. Come back later.
|
|
26
|
+
# Press Ctrl+C to pause anytime.
|
|
27
|
+
|
|
28
|
+
# Resume
|
|
29
|
+
claude-task-master resume
|
|
30
|
+
# Or just:
|
|
31
|
+
claude-task-master
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## How It Works
|
|
35
|
+
|
|
36
|
+
1. **Planning Phase**: Claude analyzes your codebase, creates a plan with tasks
|
|
37
|
+
2. **Work Loop**: Claude implements tasks one by one
|
|
38
|
+
3. **PR Cycle**: Create PR → wait for CI → fix review comments → repeat → merge
|
|
39
|
+
4. **Success Check**: Verifies success criteria are met
|
|
40
|
+
5. **Next Task**: Moves to next task until all done
|
|
41
|
+
|
|
42
|
+
All state persists in `.claude-task-master/` so you can:
|
|
43
|
+
- Pause and resume anytime
|
|
44
|
+
- Inspect progress in human-readable files
|
|
45
|
+
- Kill and restart without losing work
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Start fresh
|
|
51
|
+
claude-task-master start "your goal here"
|
|
52
|
+
|
|
53
|
+
# Resume previous work
|
|
54
|
+
claude-task-master resume
|
|
55
|
+
claude-task-master # shorthand
|
|
56
|
+
|
|
57
|
+
# Check status
|
|
58
|
+
claude-task-master status
|
|
59
|
+
|
|
60
|
+
# View the plan
|
|
61
|
+
claude-task-master plan
|
|
62
|
+
|
|
63
|
+
# View session logs
|
|
64
|
+
claude-task-master logs
|
|
65
|
+
claude-task-master logs --last 3
|
|
66
|
+
claude-task-master logs --session 5
|
|
67
|
+
|
|
68
|
+
# View context/progress
|
|
69
|
+
claude-task-master context
|
|
70
|
+
claude-task-master progress
|
|
71
|
+
|
|
72
|
+
# PR comments (uses current PR if not specified)
|
|
73
|
+
claude-task-master comments # all comments
|
|
74
|
+
claude-task-master comments 123 # specific PR
|
|
75
|
+
claude-task-master comments -a # actionable only
|
|
76
|
+
claude-task-master comments -u # unresolved threads
|
|
77
|
+
|
|
78
|
+
# PR management
|
|
79
|
+
claude-task-master pr status # PR info
|
|
80
|
+
claude-task-master pr checks # CI status
|
|
81
|
+
claude-task-master pr merge # merge current PR
|
|
82
|
+
|
|
83
|
+
# Clean up and start fresh
|
|
84
|
+
claude-task-master clean
|
|
85
|
+
claude-task-master clean -f # skip confirmation
|
|
86
|
+
|
|
87
|
+
# Check prerequisites
|
|
88
|
+
claude-task-master doctor
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Options
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Use different model
|
|
95
|
+
claude-task-master start "goal" --model opus
|
|
96
|
+
|
|
97
|
+
# Provide criteria inline
|
|
98
|
+
claude-task-master start "goal" --criteria "tests pass, deploys to staging"
|
|
99
|
+
|
|
100
|
+
# Don't auto-merge PRs (require manual review and merge)
|
|
101
|
+
claude-task-master start "goal" --no-merge
|
|
102
|
+
|
|
103
|
+
# Limit number of work sessions
|
|
104
|
+
claude-task-master start "goal" --max-sessions 10
|
|
105
|
+
claude-task-master resume -m 5 # shorthand
|
|
106
|
+
|
|
107
|
+
# Pause after creating each PR for review
|
|
108
|
+
claude-task-master start "goal" --pause-on-pr
|
|
109
|
+
|
|
110
|
+
# Verbose output
|
|
111
|
+
claude-task-master start "goal" --verbose
|
|
112
|
+
|
|
113
|
+
# Combine options
|
|
114
|
+
claude-task-master start "goal" --no-merge --max-sessions 20 --model opus
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## State Directory
|
|
118
|
+
|
|
119
|
+
Everything lives in `.claude-task-master/`:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
.claude-task-master/
|
|
123
|
+
├── goal.txt # What you asked for
|
|
124
|
+
├── criteria.txt # Success criteria
|
|
125
|
+
├── plan.md # Tasks with checkboxes
|
|
126
|
+
├── state.json # Machine state
|
|
127
|
+
├── progress.md # Human-readable progress
|
|
128
|
+
├── context.md # Learnings across sessions
|
|
129
|
+
└── logs/
|
|
130
|
+
└── session-*.md # Full log per Claude invocation
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Works With Any Review System
|
|
134
|
+
|
|
135
|
+
The task master is agnostic to code review tools:
|
|
136
|
+
|
|
137
|
+
- **CodeRabbit** - Detects comments from `coderabbitai[bot]`
|
|
138
|
+
- **GitHub Copilot** - Detects suggestions and reviews
|
|
139
|
+
- **Human reviewers** - Claude reads and addresses any PR comments
|
|
140
|
+
- **Generic** - Any comment on the PR gets attention
|
|
141
|
+
|
|
142
|
+
Claude reads the comments and decides what to fix. The harness just reports.
|
|
143
|
+
|
|
144
|
+
## Requirements
|
|
145
|
+
|
|
146
|
+
- Ruby 3.1+
|
|
147
|
+
- [Claude Code CLI](https://claude.ai/code) (`npm install -g @anthropic-ai/claude-code`)
|
|
148
|
+
- [GitHub CLI](https://cli.github.com/) (`gh`) - for PR features
|
|
149
|
+
- `--dangerously-skip-permissions` - only use in trusted environments
|
|
150
|
+
|
|
151
|
+
## How It Calls Claude
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
claude -p \
|
|
155
|
+
--dangerously-skip-permissions \
|
|
156
|
+
--model sonnet \
|
|
157
|
+
"Your context and instructions here"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Each invocation is independent. State persists via files.
|
|
161
|
+
|
|
162
|
+
## Example Session
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
$ claude-task-master start "add user authentication to the API"
|
|
166
|
+
Starting claude-task-master...
|
|
167
|
+
Goal: add user authentication to the API
|
|
168
|
+
|
|
169
|
+
What are your success criteria?
|
|
170
|
+
(e.g., 'tests pass, deploys to staging, no sentry errors for 10min')
|
|
171
|
+
> tests pass, PR merged
|
|
172
|
+
|
|
173
|
+
Phase 1: Planning...
|
|
174
|
+
....................
|
|
175
|
+
Plan created. Check .claude-task-master/plan.md
|
|
176
|
+
|
|
177
|
+
Phase 2: Working...
|
|
178
|
+
Press Ctrl+C to pause (can resume later)
|
|
179
|
+
|
|
180
|
+
[Session 1] Working on: Set up authentication dependencies
|
|
181
|
+
Completed in 45.2s
|
|
182
|
+
|
|
183
|
+
[Session 2] Working on: Create user model and migrations
|
|
184
|
+
Completed in 89.1s
|
|
185
|
+
PR created: #42
|
|
186
|
+
|
|
187
|
+
[Session 3] Working on: Fix CodeRabbit comments
|
|
188
|
+
Completed in 32.5s
|
|
189
|
+
|
|
190
|
+
[Session 4] Working on: Address remaining review feedback
|
|
191
|
+
Completed in 28.3s
|
|
192
|
+
|
|
193
|
+
[Session 5] Working on: Merge and verify
|
|
194
|
+
Completed in 15.0s
|
|
195
|
+
|
|
196
|
+
SUCCESS!
|
|
197
|
+
All tasks completed. Check .claude-task-master/progress.md
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Development
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
git clone https://github.com/developerz-ai/claude-task-master
|
|
204
|
+
cd claude-task-master
|
|
205
|
+
bundle install
|
|
206
|
+
|
|
207
|
+
# Run locally
|
|
208
|
+
bundle exec bin/claude-task-master start "test goal"
|
|
209
|
+
|
|
210
|
+
# Run tests
|
|
211
|
+
bundle exec rspec
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Philosophy
|
|
215
|
+
|
|
216
|
+
Claude is smart. It can:
|
|
217
|
+
- Read code and understand patterns
|
|
218
|
+
- Make decisions about implementation
|
|
219
|
+
- Create PRs and fix review comments
|
|
220
|
+
- Know when it's done
|
|
221
|
+
|
|
222
|
+
The task master just:
|
|
223
|
+
- Keeps calling Claude
|
|
224
|
+
- Persists state between calls
|
|
225
|
+
- Detects success/blocked
|
|
226
|
+
|
|
227
|
+
That's it. ~300 lines of Ruby. Claude does the thinking.
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
|
|
231
|
+
MIT
|