@cjvana/claude-auto 0.1.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.
- package/.claude-plugin/plugin.json +10 -0
- package/LICENSE +21 -0
- package/README.md +435 -0
- package/dist/check-repo-6C4QI2M2.js +33 -0
- package/dist/check-repo-6C4QI2M2.js.map +1 -0
- package/dist/check-repo-SXWFIVO5.js +8 -0
- package/dist/check-repo-SXWFIVO5.js.map +1 -0
- package/dist/chunk-24PS2XSV.js +203 -0
- package/dist/chunk-24PS2XSV.js.map +1 -0
- package/dist/chunk-2D5E23XA.js +129 -0
- package/dist/chunk-2D5E23XA.js.map +1 -0
- package/dist/chunk-3NEANSUS.js +26 -0
- package/dist/chunk-3NEANSUS.js.map +1 -0
- package/dist/chunk-4I5UIASZ.js +71 -0
- package/dist/chunk-4I5UIASZ.js.map +1 -0
- package/dist/chunk-5LGOK52J.js +38 -0
- package/dist/chunk-5LGOK52J.js.map +1 -0
- package/dist/chunk-6RYMWH5M.js +35 -0
- package/dist/chunk-6RYMWH5M.js.map +1 -0
- package/dist/chunk-A6XWZPLY.js +56 -0
- package/dist/chunk-A6XWZPLY.js.map +1 -0
- package/dist/chunk-AWLSYOVF.js +61 -0
- package/dist/chunk-AWLSYOVF.js.map +1 -0
- package/dist/chunk-BY5YEOVG.js +75 -0
- package/dist/chunk-BY5YEOVG.js.map +1 -0
- package/dist/chunk-D4MBOIYQ.js +46 -0
- package/dist/chunk-D4MBOIYQ.js.map +1 -0
- package/dist/chunk-DVZC42TL.js +33 -0
- package/dist/chunk-DVZC42TL.js.map +1 -0
- package/dist/chunk-E3XVLTT4.js +13 -0
- package/dist/chunk-E3XVLTT4.js.map +1 -0
- package/dist/chunk-GLW7T4QE.js +116 -0
- package/dist/chunk-GLW7T4QE.js.map +1 -0
- package/dist/chunk-H2MUDYMW.js +23 -0
- package/dist/chunk-H2MUDYMW.js.map +1 -0
- package/dist/chunk-HF7PGQI3.js +69 -0
- package/dist/chunk-HF7PGQI3.js.map +1 -0
- package/dist/chunk-LBH6SLHH.js +543 -0
- package/dist/chunk-LBH6SLHH.js.map +1 -0
- package/dist/chunk-M53MPY3U.js +115 -0
- package/dist/chunk-M53MPY3U.js.map +1 -0
- package/dist/chunk-MI7OZ5XD.js +146 -0
- package/dist/chunk-MI7OZ5XD.js.map +1 -0
- package/dist/chunk-NB46PEG2.js +177 -0
- package/dist/chunk-NB46PEG2.js.map +1 -0
- package/dist/chunk-ORBF5IW3.js +60 -0
- package/dist/chunk-ORBF5IW3.js.map +1 -0
- package/dist/chunk-PFU5YLRH.js +131 -0
- package/dist/chunk-PFU5YLRH.js.map +1 -0
- package/dist/chunk-QLRCFKLU.js +34 -0
- package/dist/chunk-QLRCFKLU.js.map +1 -0
- package/dist/chunk-QQTIJN3S.js +167 -0
- package/dist/chunk-QQTIJN3S.js.map +1 -0
- package/dist/chunk-QRYCNVLT.js +72 -0
- package/dist/chunk-QRYCNVLT.js.map +1 -0
- package/dist/chunk-S6E67XMR.js +52 -0
- package/dist/chunk-S6E67XMR.js.map +1 -0
- package/dist/chunk-S6W4SURF.js +33 -0
- package/dist/chunk-S6W4SURF.js.map +1 -0
- package/dist/chunk-SMZYA6CY.js +121 -0
- package/dist/chunk-SMZYA6CY.js.map +1 -0
- package/dist/chunk-SNOA575X.js +12 -0
- package/dist/chunk-SNOA575X.js.map +1 -0
- package/dist/chunk-SZRIZBWI.js +44 -0
- package/dist/chunk-SZRIZBWI.js.map +1 -0
- package/dist/chunk-TAGHPCFT.js +47 -0
- package/dist/chunk-TAGHPCFT.js.map +1 -0
- package/dist/chunk-TGKCHHXT.js +34 -0
- package/dist/chunk-TGKCHHXT.js.map +1 -0
- package/dist/chunk-TORYFKPK.js +39 -0
- package/dist/chunk-TORYFKPK.js.map +1 -0
- package/dist/chunk-U35GRLBD.js +143 -0
- package/dist/chunk-U35GRLBD.js.map +1 -0
- package/dist/chunk-W2HBRERV.js +57 -0
- package/dist/chunk-W2HBRERV.js.map +1 -0
- package/dist/chunk-WYU476R2.js +119 -0
- package/dist/chunk-WYU476R2.js.map +1 -0
- package/dist/chunk-YMO45Z6G.js +69 -0
- package/dist/chunk-YMO45Z6G.js.map +1 -0
- package/dist/claude-auto-run.js +1717 -0
- package/dist/claude-auto-run.js.map +1 -0
- package/dist/claude-auto.js +186 -0
- package/dist/claude-auto.js.map +1 -0
- package/dist/cost-QGM3D4QW.js +72 -0
- package/dist/cost-QGM3D4QW.js.map +1 -0
- package/dist/cost-QKN3U7AG.js +11 -0
- package/dist/cost-QKN3U7AG.js.map +1 -0
- package/dist/create-T3BDDS6G.js +14 -0
- package/dist/create-T3BDDS6G.js.map +1 -0
- package/dist/create-U5WYKTD4.js +118 -0
- package/dist/create-U5WYKTD4.js.map +1 -0
- package/dist/crontab-CDMC2FDT.js +118 -0
- package/dist/crontab-CDMC2FDT.js.map +1 -0
- package/dist/crontab-MAJ52FOK.js +118 -0
- package/dist/crontab-MAJ52FOK.js.map +1 -0
- package/dist/crontab-PNEWANLW.js +12 -0
- package/dist/crontab-PNEWANLW.js.map +1 -0
- package/dist/edit-77E3ZQHM.js +134 -0
- package/dist/edit-77E3ZQHM.js.map +1 -0
- package/dist/edit-RVPRAAQ2.js +13 -0
- package/dist/edit-RVPRAAQ2.js.map +1 -0
- package/dist/index.d.ts +1137 -0
- package/dist/index.js +2049 -0
- package/dist/index.js.map +1 -0
- package/dist/launchd-7F27BIZB.js +166 -0
- package/dist/launchd-7F27BIZB.js.map +1 -0
- package/dist/launchd-HNZIWLNC.js +166 -0
- package/dist/launchd-HNZIWLNC.js.map +1 -0
- package/dist/launchd-LZGDP7BM.js +12 -0
- package/dist/launchd-LZGDP7BM.js.map +1 -0
- package/dist/list-OIGERGYJ.js +15 -0
- package/dist/list-OIGERGYJ.js.map +1 -0
- package/dist/list-T35RSQVU.js +73 -0
- package/dist/list-T35RSQVU.js.map +1 -0
- package/dist/logs-D5FNSCXE.js +12 -0
- package/dist/logs-D5FNSCXE.js.map +1 -0
- package/dist/logs-YVSFXBSB.js +40 -0
- package/dist/logs-YVSFXBSB.js.map +1 -0
- package/dist/pause-2YOLFMAR.js +12 -0
- package/dist/pause-2YOLFMAR.js.map +1 -0
- package/dist/pause-JB42JGTB.js +45 -0
- package/dist/pause-JB42JGTB.js.map +1 -0
- package/dist/pause-OJNUYBCJ.js +47 -0
- package/dist/pause-OJNUYBCJ.js.map +1 -0
- package/dist/remove-RXYKFYBI.js +12 -0
- package/dist/remove-RXYKFYBI.js.map +1 -0
- package/dist/remove-UASXZCOR.js +59 -0
- package/dist/remove-UASXZCOR.js.map +1 -0
- package/dist/report-CHAJH2SA.js +150 -0
- package/dist/report-CHAJH2SA.js.map +1 -0
- package/dist/report-IYGK5HTC.js +14 -0
- package/dist/report-IYGK5HTC.js.map +1 -0
- package/dist/resume-3ATNZP6D.js +13 -0
- package/dist/resume-3ATNZP6D.js.map +1 -0
- package/dist/resume-6WVGU6XW.js +48 -0
- package/dist/resume-6WVGU6XW.js.map +1 -0
- package/dist/resume-JVTR7OEX.js +50 -0
- package/dist/resume-JVTR7OEX.js.map +1 -0
- package/dist/schtasks-2EQAD3ES.js +11 -0
- package/dist/schtasks-2EQAD3ES.js.map +1 -0
- package/dist/schtasks-4V2IFD3A.js +142 -0
- package/dist/schtasks-4V2IFD3A.js.map +1 -0
- package/dist/schtasks-JGEPEKQS.js +142 -0
- package/dist/schtasks-JGEPEKQS.js.map +1 -0
- package/dist/tui-2DUPCX3Q.js +15 -0
- package/dist/tui-2DUPCX3Q.js.map +1 -0
- package/dist/tui-6LOGPILA.js +547 -0
- package/dist/tui-6LOGPILA.js.map +1 -0
- package/package.json +81 -0
- package/scripts/postinstall.mjs +65 -0
- package/scripts/preuninstall.mjs +33 -0
- package/skills/edit/SKILL.md +25 -0
- package/skills/list/SKILL.md +26 -0
- package/skills/logs/SKILL.md +33 -0
- package/skills/pause/SKILL.md +21 -0
- package/skills/remove/SKILL.md +22 -0
- package/skills/resume/SKILL.md +21 -0
- package/skills/setup/SKILL.md +195 -0
- package/skills/status/SKILL.md +27 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-auto",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Autonomous Claude Code cron jobs for continuous codebase improvement. Set up scheduled jobs where Claude autonomously works on your repos — you wake up to PRs.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "claude-auto contributors"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"keywords": ["autonomous", "cron", "scheduling", "coding-agent"]
|
|
10
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cjvana
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
# claude-auto
|
|
2
|
+
|
|
3
|
+
Autonomous Claude Code cron jobs for continuous codebase improvement. Set up a schedule, point it at a repo, and wake up to PRs.
|
|
4
|
+
|
|
5
|
+
Claude researches your codebase, picks the highest-value work (open issues, bugs it discovers, or features it wants to add), creates a branch, does the work, updates docs, opens a PR, and notifies you. It learns from previous runs, iterates on reviewer feedback, and can run a multi-stage plan/implement/review pipeline for higher-quality output.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @cjvana/claude-auto
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This registers `claude-auto` as a Claude Code plugin. The `/claude-auto:setup` slash command becomes available in Claude Code sessions.
|
|
14
|
+
|
|
15
|
+
### Requirements
|
|
16
|
+
|
|
17
|
+
- Node.js >= 22
|
|
18
|
+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed
|
|
19
|
+
- [GitHub CLI](https://cli.github.com/) (`gh`) authenticated
|
|
20
|
+
- macOS, Linux, or Windows
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### Option A: Conversational Setup (Recommended)
|
|
25
|
+
|
|
26
|
+
In a Claude Code session:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
/claude-auto:setup
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Claude walks you through everything — repo, branch, schedule, focus areas, system prompt, notifications, guardrails — and creates the job.
|
|
33
|
+
|
|
34
|
+
### Option B: CLI
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
claude-auto create \
|
|
38
|
+
--name my-api \
|
|
39
|
+
--repo /path/to/my-api \
|
|
40
|
+
--branch main \
|
|
41
|
+
--schedule "0 */6 * * *" \
|
|
42
|
+
--system-prompt-file prompt.txt
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## How It Works
|
|
46
|
+
|
|
47
|
+
Each cron tick:
|
|
48
|
+
|
|
49
|
+
1. **Budget check** — skip if daily/weekly/monthly cap exceeded
|
|
50
|
+
2. **Load context** — prior runs from SQLite (avoids duplicate work)
|
|
51
|
+
3. **Check PR feedback** — if reviewers left comments on a previous PR, address those first
|
|
52
|
+
4. **Acquire lock** — prevents overlapping runs
|
|
53
|
+
5. **Pull latest** from configured branch
|
|
54
|
+
6. **Pick work** following priority chain:
|
|
55
|
+
- Open PRs with review comments (highest priority)
|
|
56
|
+
- Open GitHub issues / feature requests (triaged by complexity)
|
|
57
|
+
- Bugs Claude discovers in the code
|
|
58
|
+
- Features Claude thinks would be useful
|
|
59
|
+
7. **Execute** — single Claude spawn or multi-stage pipeline (plan → implement → review)
|
|
60
|
+
8. **Rebase check** — auto-resolve if target branch diverged
|
|
61
|
+
9. **Open PR** with detailed description
|
|
62
|
+
10. **Update documentation** affected by changes
|
|
63
|
+
11. **Notify** via Discord, Slack, Telegram, or GitHub comments
|
|
64
|
+
12. **Record** cost and context to SQLite for future runs
|
|
65
|
+
|
|
66
|
+
## Model Selection
|
|
67
|
+
|
|
68
|
+
Configure which Claude model to use per job:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
model: opus # or: sonnet, haiku, default
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or with the pipeline, configure per stage:
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
pipeline:
|
|
78
|
+
enabled: true
|
|
79
|
+
planModel: haiku # Fast, cheap planning
|
|
80
|
+
implementModel: opus # Best quality for code
|
|
81
|
+
reviewModel: sonnet # Balanced review
|
|
82
|
+
maxReviewRounds: 2
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Supported values: `sonnet`, `opus`, `haiku`, `default`, or full model IDs like `claude-opus-4-6`.
|
|
86
|
+
|
|
87
|
+
## Agent Pipeline
|
|
88
|
+
|
|
89
|
+
Enable multi-stage plan → implement → review for higher-quality PRs:
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
pipeline:
|
|
93
|
+
enabled: true
|
|
94
|
+
planModel: haiku
|
|
95
|
+
implementModel: opus
|
|
96
|
+
reviewModel: sonnet
|
|
97
|
+
fixModel: opus
|
|
98
|
+
maxReviewRounds: 2
|
|
99
|
+
budgetSplit:
|
|
100
|
+
plan: 0.15
|
|
101
|
+
implement: 0.55
|
|
102
|
+
review: 0.15
|
|
103
|
+
fix: 0.15
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Each stage spawns a separate Claude instance with a stage-specific system prompt:
|
|
107
|
+
- **Plan** — reads codebase, understands the issue, creates implementation plan
|
|
108
|
+
- **Implement** — executes the plan, writes code and tests
|
|
109
|
+
- **Review** — checks implementation against the plan, can request changes
|
|
110
|
+
- **Fix** — addresses review feedback (loops until review passes or max rounds)
|
|
111
|
+
|
|
112
|
+
When the review stage finds issues, it rejects the PR and the fix stage runs. This loop continues until the review passes or `maxReviewRounds` is exceeded.
|
|
113
|
+
|
|
114
|
+
Pipeline is disabled by default. Existing single-spawn configs work identically.
|
|
115
|
+
|
|
116
|
+
## PR Feedback Loop
|
|
117
|
+
|
|
118
|
+
Claude iterates on its own PRs based on reviewer feedback:
|
|
119
|
+
|
|
120
|
+
1. Before picking new work, Claude checks for open PRs with unaddressed review comments
|
|
121
|
+
2. When feedback exists, Claude checks out the existing PR branch and addresses it
|
|
122
|
+
3. After fixing, pushes to the same branch and comments on the PR with what changed
|
|
123
|
+
4. After `maxFeedbackRounds` (default 3), posts a "needs human review" comment and moves on
|
|
124
|
+
|
|
125
|
+
Review comments are sanitized (XML framing, 2000-char truncation, bot comments filtered) to prevent prompt injection.
|
|
126
|
+
|
|
127
|
+
## Issue Triage
|
|
128
|
+
|
|
129
|
+
Claude evaluates issues before picking work:
|
|
130
|
+
|
|
131
|
+
- **Complexity scoring** — body length, reproduction steps, labels, assignees
|
|
132
|
+
- **Label priority** — "good first issue" (+30), "bug" (+20), "enhancement" (+10)
|
|
133
|
+
- **Skip logic** — filters out spam (too short), vague issues, already-assigned, already-attempted
|
|
134
|
+
- Top candidates are presented to Claude ranked by score
|
|
135
|
+
|
|
136
|
+
## Cost Tracking
|
|
137
|
+
|
|
138
|
+
Track spending and enforce budgets:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# View costs per job
|
|
142
|
+
claude-auto cost
|
|
143
|
+
claude-auto cost my-api --json
|
|
144
|
+
|
|
145
|
+
# Set budget caps in config
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
budget:
|
|
150
|
+
dailyUsd: 10.00
|
|
151
|
+
weeklyUsd: 50.00
|
|
152
|
+
monthlyUsd: 150.00
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
When a budget cap is reached, scheduled runs skip with a `budget-exceeded` status and send a notification. Per-run limits still apply via `guardrails.maxBudgetUsd`.
|
|
156
|
+
|
|
157
|
+
## Job Management
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# List all jobs
|
|
161
|
+
claude-auto list
|
|
162
|
+
claude-auto list --json
|
|
163
|
+
|
|
164
|
+
# View run history
|
|
165
|
+
claude-auto logs my-api
|
|
166
|
+
claude-auto logs my-api --limit 5
|
|
167
|
+
|
|
168
|
+
# Aggregate report
|
|
169
|
+
claude-auto report
|
|
170
|
+
claude-auto report my-api
|
|
171
|
+
|
|
172
|
+
# Cost tracking
|
|
173
|
+
claude-auto cost
|
|
174
|
+
claude-auto cost my-api
|
|
175
|
+
|
|
176
|
+
# Pause / resume
|
|
177
|
+
claude-auto pause my-api
|
|
178
|
+
claude-auto resume my-api
|
|
179
|
+
|
|
180
|
+
# Edit configuration
|
|
181
|
+
claude-auto edit my-api --schedule "0 9 * * 1-5"
|
|
182
|
+
claude-auto edit my-api --max-turns 100
|
|
183
|
+
claude-auto edit my-api --model opus
|
|
184
|
+
|
|
185
|
+
# Remove a job
|
|
186
|
+
claude-auto remove my-api
|
|
187
|
+
claude-auto remove my-api --keep-logs
|
|
188
|
+
|
|
189
|
+
# Interactive dashboard
|
|
190
|
+
claude-auto dashboard
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Or use Claude Code skills:
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
/claude-auto:list
|
|
197
|
+
/claude-auto:pause my-api
|
|
198
|
+
/claude-auto:edit my-api
|
|
199
|
+
/claude-auto:status my-api
|
|
200
|
+
/claude-auto:logs my-api
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## TUI Dashboard
|
|
204
|
+
|
|
205
|
+
Launch an interactive terminal dashboard:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
claude-auto dashboard
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Features:
|
|
212
|
+
- Live job status with auto-refresh (3-second polling)
|
|
213
|
+
- Per-job cost summaries
|
|
214
|
+
- Last run / next run times
|
|
215
|
+
- Keyboard navigation: arrow keys, Enter for detail, Escape to go back
|
|
216
|
+
- Quick actions: `p` pause/resume, `l` view logs, `q` quit
|
|
217
|
+
|
|
218
|
+
Built with [ink](https://github.com/vadimdemedes/ink) + React. Dependencies are lazily loaded — no startup cost for non-dashboard commands.
|
|
219
|
+
|
|
220
|
+
## Configuration
|
|
221
|
+
|
|
222
|
+
Jobs are stored as human-readable YAML at `~/.claude-auto/jobs/<job-id>/config.yaml`. Edit them directly or use the CLI.
|
|
223
|
+
|
|
224
|
+
```yaml
|
|
225
|
+
# Job: my-api
|
|
226
|
+
name: my-api
|
|
227
|
+
repo: /Users/dev/my-api
|
|
228
|
+
branch: main
|
|
229
|
+
schedule: "0 */6 * * *"
|
|
230
|
+
timezone: America/Chicago
|
|
231
|
+
enabled: true
|
|
232
|
+
|
|
233
|
+
# Model selection
|
|
234
|
+
model: opus
|
|
235
|
+
|
|
236
|
+
# What Claude focuses on
|
|
237
|
+
focus:
|
|
238
|
+
- Fix open issues
|
|
239
|
+
- Improve test coverage
|
|
240
|
+
- Update outdated dependencies
|
|
241
|
+
|
|
242
|
+
# Custom personality
|
|
243
|
+
systemPrompt: |
|
|
244
|
+
You are a careful, senior engineer. Prefer small, focused changes.
|
|
245
|
+
Always add or update tests. Write detailed PR descriptions.
|
|
246
|
+
Never introduce new dependencies without strong justification.
|
|
247
|
+
|
|
248
|
+
# Safety limits
|
|
249
|
+
guardrails:
|
|
250
|
+
maxTurns: 50
|
|
251
|
+
maxBudgetUsd: 5.00
|
|
252
|
+
noNewDeps: false
|
|
253
|
+
noArchChanges: false
|
|
254
|
+
bugFixOnly: false
|
|
255
|
+
restrictToPaths: []
|
|
256
|
+
|
|
257
|
+
# Budget caps (cumulative)
|
|
258
|
+
budget:
|
|
259
|
+
dailyUsd: 10.00
|
|
260
|
+
weeklyUsd: 50.00
|
|
261
|
+
monthlyUsd: 150.00
|
|
262
|
+
|
|
263
|
+
# PR feedback
|
|
264
|
+
maxFeedbackRounds: 3
|
|
265
|
+
|
|
266
|
+
# Multi-stage pipeline (optional)
|
|
267
|
+
pipeline:
|
|
268
|
+
enabled: false
|
|
269
|
+
planModel: haiku
|
|
270
|
+
implementModel: opus
|
|
271
|
+
reviewModel: sonnet
|
|
272
|
+
fixModel: opus
|
|
273
|
+
maxReviewRounds: 2
|
|
274
|
+
|
|
275
|
+
# Notifications
|
|
276
|
+
discord:
|
|
277
|
+
webhookUrl: https://discord.com/api/webhooks/...
|
|
278
|
+
onSuccess: true
|
|
279
|
+
onFailure: true
|
|
280
|
+
onNoChanges: false
|
|
281
|
+
onLocked: false
|
|
282
|
+
|
|
283
|
+
slack:
|
|
284
|
+
webhookUrl: https://hooks.slack.com/services/...
|
|
285
|
+
onSuccess: true
|
|
286
|
+
onFailure: true
|
|
287
|
+
|
|
288
|
+
telegram:
|
|
289
|
+
botToken: "123456:ABC..."
|
|
290
|
+
chatId: "-100..."
|
|
291
|
+
onSuccess: true
|
|
292
|
+
onFailure: true
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Schedule Format
|
|
296
|
+
|
|
297
|
+
Natural language (Claude converts during setup):
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
every 6 hours
|
|
301
|
+
twice a day
|
|
302
|
+
weekdays at 9am
|
|
303
|
+
every monday at 2pm
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Or standard cron:
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
0 */6 * * * # every 6 hours
|
|
310
|
+
0 9,17 * * * # 9am and 5pm
|
|
311
|
+
0 9 * * 1-5 # weekdays at 9am
|
|
312
|
+
0 14 * * 1 # mondays at 2pm
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Guardrails
|
|
316
|
+
|
|
317
|
+
Full trust by default. Optionally restrict what Claude can do:
|
|
318
|
+
|
|
319
|
+
| Flag | Config key | Effect |
|
|
320
|
+
|------|-----------|--------|
|
|
321
|
+
| `--max-turns N` | `guardrails.maxTurns` | Terminate after N Claude turns |
|
|
322
|
+
| `--max-budget N` | `guardrails.maxBudgetUsd` | Cap spend per run at $N |
|
|
323
|
+
| `--no-new-deps` | `guardrails.noNewDeps` | Prevent adding new dependencies |
|
|
324
|
+
| `--no-arch-changes` | `guardrails.noArchChanges` | Prevent architectural changes |
|
|
325
|
+
| `--bug-fix-only` | `guardrails.bugFixOnly` | Only fix bugs, no new features |
|
|
326
|
+
| `--restrict-paths` | `guardrails.restrictToPaths` | Only touch files in these directories |
|
|
327
|
+
|
|
328
|
+
## Notifications
|
|
329
|
+
|
|
330
|
+
Configure per job. Each provider supports event triggers:
|
|
331
|
+
|
|
332
|
+
| Event | Default | When |
|
|
333
|
+
|-------|---------|------|
|
|
334
|
+
| `onSuccess` | true | PR created successfully |
|
|
335
|
+
| `onFailure` | true | Run errored, merge conflict, or budget exceeded |
|
|
336
|
+
| `onNoChanges` | false | Claude found nothing to do |
|
|
337
|
+
| `onLocked` | false | Another run was already active |
|
|
338
|
+
|
|
339
|
+
GitHub issue comments are automatic — when Claude works on an issue, it comments with status and PR link.
|
|
340
|
+
|
|
341
|
+
## Git Safety
|
|
342
|
+
|
|
343
|
+
These invariants are structurally enforced (not just policy):
|
|
344
|
+
|
|
345
|
+
- **Never commits to main** or the configured branch
|
|
346
|
+
- **Never force pushes** — no `--force` flag exists in the codebase
|
|
347
|
+
- **Always creates a new branch** per run (`claude-auto/<job-id>/<timestamp>`)
|
|
348
|
+
- **Always opens a PR** — human review before merge
|
|
349
|
+
- **File-based locking** prevents concurrent runs on the same job
|
|
350
|
+
- **Auto-rebase** before push when target branch has diverged
|
|
351
|
+
- **Clean abort** on merge conflicts — never produces broken code
|
|
352
|
+
|
|
353
|
+
## Cross-Run Context
|
|
354
|
+
|
|
355
|
+
Claude remembers what it did in previous runs:
|
|
356
|
+
|
|
357
|
+
- Stores structured facts (PR URLs, issue numbers, files modified, summaries) in SQLite
|
|
358
|
+
- Loads a rolling window of recent runs into the system prompt
|
|
359
|
+
- Avoids re-opening issues it already submitted PRs for
|
|
360
|
+
- Tracks PR feedback rounds to know when to stop iterating
|
|
361
|
+
|
|
362
|
+
Data is stored at `~/.claude-auto/claude-auto.db` (SQLite with WAL mode).
|
|
363
|
+
|
|
364
|
+
## Platform Support
|
|
365
|
+
|
|
366
|
+
| Platform | Scheduler | Status |
|
|
367
|
+
|----------|-----------|--------|
|
|
368
|
+
| macOS | launchd (plist) | Full support |
|
|
369
|
+
| Linux | crontab | Full support |
|
|
370
|
+
| Windows | Task Scheduler (schtasks.exe) | Full support |
|
|
371
|
+
|
|
372
|
+
Common cron expressions are automatically translated to each platform's native format. Unsupported complex patterns throw a clear error with a suggestion to simplify.
|
|
373
|
+
|
|
374
|
+
## Architecture
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
claude-auto (npm package)
|
|
378
|
+
├── bin/
|
|
379
|
+
│ ├── claude-auto.ts # CLI entry point
|
|
380
|
+
│ └── claude-auto-run.ts # Cron entry point
|
|
381
|
+
├── src/
|
|
382
|
+
│ ├── core/ # Config, job manager, schedule, types, database
|
|
383
|
+
│ ├── platform/ # Crontab, launchd, schtasks adapters
|
|
384
|
+
│ ├── runner/ # Orchestrator, pipeline, spawner, git ops,
|
|
385
|
+
│ │ # PR feedback, issue triage, cost tracker,
|
|
386
|
+
│ │ # context store, prompt builder, logger
|
|
387
|
+
│ ├── notifications/ # Discord/Slack/Telegram formatters + dispatcher
|
|
388
|
+
│ ├── cli/ # Command router + 11 subcommands
|
|
389
|
+
│ └── tui/ # ink/React dashboard (lazily loaded)
|
|
390
|
+
├── skills/ # 8 Claude Code SKILL.md files
|
|
391
|
+
├── .claude-plugin/ # Plugin manifest
|
|
392
|
+
└── scripts/ # postinstall/preuninstall
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
## Multiple Jobs
|
|
396
|
+
|
|
397
|
+
Run different jobs for different concerns:
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
# Security-focused, weekly, using Opus
|
|
401
|
+
claude-auto create --name security-audit --repo ~/my-app \
|
|
402
|
+
--schedule "0 3 * * 0" --model opus \
|
|
403
|
+
--system-prompt-file security-prompt.txt
|
|
404
|
+
|
|
405
|
+
# Bug fixes, daily, budget-capped
|
|
406
|
+
claude-auto create --name bug-fixer --repo ~/my-app \
|
|
407
|
+
--schedule "0 2 * * *" --bug-fix-only \
|
|
408
|
+
--max-budget 3.00
|
|
409
|
+
|
|
410
|
+
# Pipeline mode for complex work
|
|
411
|
+
claude-auto create --name feature-builder --repo ~/my-app \
|
|
412
|
+
--schedule "0 10 * * 1-5" --model opus
|
|
413
|
+
# Then enable pipeline in config:
|
|
414
|
+
# claude-auto edit feature-builder (set pipeline.enabled: true)
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
## Development
|
|
418
|
+
|
|
419
|
+
```bash
|
|
420
|
+
git clone https://github.com/cj-vana/claude-auto.git
|
|
421
|
+
cd claude-auto
|
|
422
|
+
npm install
|
|
423
|
+
npm run build
|
|
424
|
+
npm test
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
npm run typecheck # TypeScript type checking
|
|
429
|
+
npm run lint # Biome linting
|
|
430
|
+
npm run test:watch # Watch mode
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## License
|
|
434
|
+
|
|
435
|
+
MIT
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
execCommand
|
|
3
|
+
} from "./chunk-3NEANSUS.js";
|
|
4
|
+
|
|
5
|
+
// src/cli/commands/check-repo.ts
|
|
6
|
+
import { stat } from "fs/promises";
|
|
7
|
+
async function checkRepoCommand(args) {
|
|
8
|
+
const repoPath = args.path;
|
|
9
|
+
if (!repoPath) {
|
|
10
|
+
console.error("Usage: claude-auto check-repo --path <path>");
|
|
11
|
+
throw new Error("Missing --path argument");
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
const s = await stat(repoPath);
|
|
15
|
+
if (!s.isDirectory()) {
|
|
16
|
+
console.log(JSON.stringify({ exists: false, error: "Not a directory" }));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
await execCommand("git", ["-C", repoPath, "rev-parse", "--git-dir"]);
|
|
20
|
+
const { stdout } = await execCommand("git", ["-C", repoPath, "remote", "get-url", "origin"]);
|
|
21
|
+
console.log(JSON.stringify({ exists: true, isGitRepo: true, remote: stdout.trim() }));
|
|
22
|
+
} catch (err) {
|
|
23
|
+
if (err instanceof Error && "code" in err && err.code === "ENOENT") {
|
|
24
|
+
console.log(JSON.stringify({ exists: false }));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
console.log(JSON.stringify({ exists: false }));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
checkRepoCommand
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=check-repo-6C4QI2M2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/check-repo.ts"],"sourcesContent":["import { stat } from \"node:fs/promises\";\nimport { execCommand } from \"../../util/exec.js\";\nimport type { ParsedCommand } from \"../types.js\";\n\n/**\n * Check if a path is a valid git repository.\n * Outputs JSON for the setup wizard to consume.\n */\nexport async function checkRepoCommand(args: ParsedCommand[\"args\"]): Promise<void> {\n\tconst repoPath = args.path as string | undefined;\n\tif (!repoPath) {\n\t\tconsole.error(\"Usage: claude-auto check-repo --path <path>\");\n\t\tthrow new Error(\"Missing --path argument\");\n\t}\n\n\ttry {\n\t\tconst s = await stat(repoPath);\n\t\tif (!s.isDirectory()) {\n\t\t\tconsole.log(JSON.stringify({ exists: false, error: \"Not a directory\" }));\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if it's a git repo\n\t\tawait execCommand(\"git\", [\"-C\", repoPath, \"rev-parse\", \"--git-dir\"]);\n\n\t\t// Get remote URL\n\t\tconst { stdout } = await execCommand(\"git\", [\"-C\", repoPath, \"remote\", \"get-url\", \"origin\"]);\n\t\tconsole.log(JSON.stringify({ exists: true, isGitRepo: true, remote: stdout.trim() }));\n\t} catch (err: unknown) {\n\t\tif (err instanceof Error && \"code\" in err && (err as NodeJS.ErrnoException).code === \"ENOENT\") {\n\t\t\tconsole.log(JSON.stringify({ exists: false }));\n\t\t\treturn;\n\t\t}\n\t\t// If stat succeeded but git commands failed, still report as not a git repo\n\t\tconsole.log(JSON.stringify({ exists: false }));\n\t}\n}\n"],"mappings":";;;;;AAAA,SAAS,YAAY;AAQrB,eAAsB,iBAAiB,MAA4C;AAClF,QAAM,WAAW,KAAK;AACtB,MAAI,CAAC,UAAU;AACd,YAAQ,MAAM,6CAA6C;AAC3D,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AAEA,MAAI;AACH,UAAM,IAAI,MAAM,KAAK,QAAQ;AAC7B,QAAI,CAAC,EAAE,YAAY,GAAG;AACrB,cAAQ,IAAI,KAAK,UAAU,EAAE,QAAQ,OAAO,OAAO,kBAAkB,CAAC,CAAC;AACvE;AAAA,IACD;AAGA,UAAM,YAAY,OAAO,CAAC,MAAM,UAAU,aAAa,WAAW,CAAC;AAGnE,UAAM,EAAE,OAAO,IAAI,MAAM,YAAY,OAAO,CAAC,MAAM,UAAU,UAAU,WAAW,QAAQ,CAAC;AAC3F,YAAQ,IAAI,KAAK,UAAU,EAAE,QAAQ,MAAM,WAAW,MAAM,QAAQ,OAAO,KAAK,EAAE,CAAC,CAAC;AAAA,EACrF,SAAS,KAAc;AACtB,QAAI,eAAe,SAAS,UAAU,OAAQ,IAA8B,SAAS,UAAU;AAC9F,cAAQ,IAAI,KAAK,UAAU,EAAE,QAAQ,MAAM,CAAC,CAAC;AAC7C;AAAA,IACD;AAEA,YAAQ,IAAI,KAAK,UAAU,EAAE,QAAQ,MAAM,CAAC,CAAC;AAAA,EAC9C;AACD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|