fleet-agents 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/LICENSE +21 -0
- package/README.md +144 -0
- package/bin/fleet.js +1018 -0
- package/commands/fleet.md +78 -0
- package/package.json +40 -0
- package/prompts/fix.md +46 -0
- package/prompts/research.md +38 -0
- package/prompts/review.md +51 -0
- package/review/README.md +60 -0
- package/review/cli.sh +63 -0
- package/review/coverage.sh +90 -0
- package/review/fix.sh +91 -0
- package/review/lib.sh +258 -0
- package/review/merge.sh +374 -0
- package/review/prompts/fix.md +190 -0
- package/review/prompts/review.md +170 -0
- package/review/review.sh +72 -0
- package/review/sync.sh +15 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sanil
|
|
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,144 @@
|
|
|
1
|
+
# fleet-agents
|
|
2
|
+
|
|
3
|
+
Run many [Claude Code](https://claude.com/claude-code) agents in parallel — each in its own
|
|
4
|
+
isolated **git worktree** with its own task — and orchestrate them from one place, including
|
|
5
|
+
from *inside* a Claude session via a `/fleet` slash command.
|
|
6
|
+
|
|
7
|
+
- **macOS / Linux / WSL** → agents run as panes in one **tmux** session you can attach/detach.
|
|
8
|
+
- **Windows** → each agent opens in its own terminal window (no tmux needed).
|
|
9
|
+
|
|
10
|
+
## Concepts (the mental model)
|
|
11
|
+
|
|
12
|
+
| Term | What it is |
|
|
13
|
+
|------|-----------|
|
|
14
|
+
| **session** | One tmux session — the container. Survives detach/reboot (state is saved). |
|
|
15
|
+
| **manager** | The orchestrator Claude in pane 0 of a session. You type `/fleet …` into it. |
|
|
16
|
+
| **worker** | An agent in its own pane + git **worktree** (isolated branch), working one task. |
|
|
17
|
+
| **sub-worker** | A worker a worker spawned — fleet tracks the chain so you can resume/remove it as a unit. |
|
|
18
|
+
| **skill** | A named prompt template prepended to a task (`research`, `review`, `fix`, or your own). |
|
|
19
|
+
| **mode** | How a worker runs: **once** (one-shot), **loop** (recurring), **goal** (until a condition holds). |
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g git+https://github.com/sanil-23/fleet-agents.git # (or 'fleet-agents' once on npm)
|
|
25
|
+
fleet install-claude # adds the /fleet slash command to ~/.claude/commands
|
|
26
|
+
fleet doctor # check prerequisites
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Requires:** Node ≥ 16, `git`, the `claude` CLI on PATH. `tmux` on macOS/Linux (Windows uses
|
|
30
|
+
separate windows). `fleet pr …` review commands also need `gh` + `jq`.
|
|
31
|
+
|
|
32
|
+
## Quickstart
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cd ~/code/myapp # any git repo
|
|
36
|
+
fleet manager # opens a manager Claude here, in a tmux session
|
|
37
|
+
fleet attach # (in your terminal) hop into the session
|
|
38
|
+
```
|
|
39
|
+
Then, **inside the manager**, just describe work:
|
|
40
|
+
```
|
|
41
|
+
/fleet fix the CSV parser crash and add a test
|
|
42
|
+
/fleet research why the dashboard query is slow
|
|
43
|
+
/fleet food-llm: tune the context window; api: add retry to the upload call
|
|
44
|
+
```
|
|
45
|
+
Each becomes a worker in its own pane + worktree. Detach with `Ctrl-b d` (agents keep
|
|
46
|
+
running); come back any time with `fleet attach`, or after a reboot with `fleet resume`.
|
|
47
|
+
|
|
48
|
+
## Using it from inside Claude — `/fleet`
|
|
49
|
+
|
|
50
|
+
`/fleet <prompt>` runs a **dispatch decision**: the manager picks the repo, **selects a skill**
|
|
51
|
+
(or none), **picks a mode** (once / loop / goal), and launches the worker — then tells you what
|
|
52
|
+
it chose. You can also be explicit:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
/fleet <prompt> # manager auto-picks skill + mode
|
|
56
|
+
/fleet research <thing> # force the read-only research skill
|
|
57
|
+
/fleet keep checking the deploy … # → loop mode (recurring)
|
|
58
|
+
/fleet rm self # (inside a worker) remove me + my sub-workers
|
|
59
|
+
/fleet ls /fleet status /fleet sessions
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Command reference
|
|
63
|
+
|
|
64
|
+
### Sessions
|
|
65
|
+
```bash
|
|
66
|
+
fleet manager [dir] [--name X] [--window] # open a manager (rooted at dir; default cwd)
|
|
67
|
+
# --window: new window in the CURRENT tmux session
|
|
68
|
+
fleet attach [--name X] # attach to a session
|
|
69
|
+
fleet status [session] # one-glance: manager + worker tree, live/saved
|
|
70
|
+
fleet sessions # list all sessions
|
|
71
|
+
fleet resume [session] [--dry-run] # rebuild a session — manager + workers, conversations continued
|
|
72
|
+
fleet kill [--name X] # stop a session's tmux (keeps worktrees + state → resumable)
|
|
73
|
+
```
|
|
74
|
+
`--name` lets you run several independent managers (`billing`, `infra`, …) at once. Bare
|
|
75
|
+
`fleet resume` picks the most recently-active manager.
|
|
76
|
+
|
|
77
|
+
### Launch work
|
|
78
|
+
```bash
|
|
79
|
+
fleet add <repo> <task> "<prompt>|<file.md>" [base] [--skill NAME] [--no-worktree]
|
|
80
|
+
fleet research <repo> <task> "<issue|file.md>" [base] # = --skill research (read-only)
|
|
81
|
+
```
|
|
82
|
+
`<repo>` can be a name (resolved under `PROJECTS_ROOT`), a path, or `.` for the current repo.
|
|
83
|
+
The prompt can be inline text **or a `.md` file path** (its contents become the task).
|
|
84
|
+
`--no-worktree` runs the worker in the repo itself (no branch) — handy for read-only research.
|
|
85
|
+
|
|
86
|
+
### Skills
|
|
87
|
+
```bash
|
|
88
|
+
fleet skill ls
|
|
89
|
+
fleet skill add <name> <file.md> # register your own
|
|
90
|
+
fleet skill show <name> fleet skill rm <name>
|
|
91
|
+
```
|
|
92
|
+
Built-ins: **research** (investigate, read-only), **review** (CodeRabbit-style review),
|
|
93
|
+
**fix** (review + apply + verify + commit). Apply any with `--skill <name>`.
|
|
94
|
+
|
|
95
|
+
### Clean up
|
|
96
|
+
```bash
|
|
97
|
+
fleet rm <repo> <task> [--branch] [--dry-run] # remove a worker + every sub-worker it spawned
|
|
98
|
+
fleet rm --self [--branch] # (inside a worker) remove itself + its chain
|
|
99
|
+
fleet sessions rm <session> [--branch] [--dry-run] # remove a session + ALL its child sessions
|
|
100
|
+
fleet prune [session] [--dry-run] # drop recorded tasks whose worktree is gone
|
|
101
|
+
```
|
|
102
|
+
`kill` is reversible (keeps work for `resume`); `rm` / `sessions rm` are destructive — use
|
|
103
|
+
`--dry-run` to preview, `--branch` to also delete branches.
|
|
104
|
+
|
|
105
|
+
### PR review (`git` + `gh` + `jq`; open a pane, `--here` for foreground)
|
|
106
|
+
```bash
|
|
107
|
+
fleet pr sync <pr> # checkout PR as pr/<num>, merge base, wire push
|
|
108
|
+
fleet pr review <pr> [extra] # CodeRabbit-style review agent
|
|
109
|
+
fleet pr fix <pr> [extra] # review-and-fix agent (commit & push)
|
|
110
|
+
fleet pr coverage <pr> [extra] # fix the coverage gate
|
|
111
|
+
fleet pr merge <pr> [--squash|--merge|--rebase] [--dry-run] [--summary-llm <tool>]
|
|
112
|
+
```
|
|
113
|
+
Run inside the target repo or pass `-C <repo-dir>`. `pr merge` defaults to `--squash` and
|
|
114
|
+
summarizes the body with `gemini` (use `--summary-llm none|claude` if you don't have it).
|
|
115
|
+
(The old top-level `fleet review/fix/…` still work but print a deprecation hint.)
|
|
116
|
+
|
|
117
|
+
### Setup / health
|
|
118
|
+
```bash
|
|
119
|
+
fleet install-claude # (re)install the /fleet command
|
|
120
|
+
fleet doctor # check tmux/gh/jq/claude/caffeinate + whether /fleet is installed
|
|
121
|
+
fleet help
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Configuration (env vars)
|
|
125
|
+
|
|
126
|
+
| Var | Default | Purpose |
|
|
127
|
+
|-----|---------|---------|
|
|
128
|
+
| `FLEET_BACKEND` | auto (`tmux` if available, else `windows`) | Force the spawner backend |
|
|
129
|
+
| `FLEET_MODE` | `pane` | `window` = a tmux window per worker instead of a tiled pane |
|
|
130
|
+
| `PROJECTS_ROOT` | `~/Projects` | Where bare repo names resolve |
|
|
131
|
+
| `WT_ROOT` | `$PROJECTS_ROOT/.worktrees` | Where worktrees are created |
|
|
132
|
+
| `FLEET_SESSION` | `fleet` | Default session name |
|
|
133
|
+
| `FLEET_STATE_DIR` | `~/.fleet` | Where per-session state is stored |
|
|
134
|
+
| `FLEET_SKILLS_DIR` | `~/.fleet/skills` | Where your custom skills live |
|
|
135
|
+
| `FLEET_CLAUDE_FLAGS` | `--dangerously-skip-permissions` | Flags for each launched `claude` (set `""` to restore prompts) |
|
|
136
|
+
| `FLEET_NO_CAFFEINATE` | unset | macOS: `1` to skip the auto keep-awake while a session is alive |
|
|
137
|
+
|
|
138
|
+
> **Safety:** the default flags let agents run unattended (no permission prompts). Each worker
|
|
139
|
+
> is isolated in a throwaway worktree, but they share your real filesystem and credentials —
|
|
140
|
+
> only fan out tasks you'd trust to run on their own.
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
MIT
|