@katyella/legio 0.1.0 → 0.1.3
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/CHANGELOG.md +117 -386
- package/README.md +45 -466
- package/agents/builder.md +5 -15
- package/agents/cto.md +2 -2
- package/agents/gateway.md +23 -0
- package/agents/lead.md +6 -7
- package/agents/merger.md +5 -14
- package/agents/reviewer.md +6 -14
- package/agents/scout.md +3 -3
- package/bin/legio.mjs +13 -2
- package/package.json +2 -2
- package/src/agents/overlay.test.ts +9 -10
- package/src/agents/overlay.ts +35 -17
- package/src/commands/gateway.test.ts +60 -0
- package/src/commands/gateway.ts +6 -2
- package/src/commands/init.test.ts +157 -1
- package/src/commands/init.ts +86 -1
- package/src/commands/sling.ts +92 -38
- package/src/commands/worktree.ts +8 -3
- package/src/config.test.ts +3 -3
- package/src/config.ts +0 -1
- package/src/doctor/config-check.test.ts +68 -1
- package/src/doctor/config-check.ts +54 -0
- package/src/doctor/dependencies.ts +17 -4
- package/src/index.ts +1 -1
- package/src/server/routes.ts +1 -1
- package/templates/CLAUDE.md.tmpl +0 -89
|
@@ -14,14 +14,24 @@ export const checkDependencies: DoctorCheckFn = async (
|
|
|
14
14
|
{ name: "git", versionFlag: "--version", required: true },
|
|
15
15
|
{ name: "node", versionFlag: "--version", required: true },
|
|
16
16
|
{ name: "tmux", versionFlag: "-V", required: true },
|
|
17
|
-
{
|
|
18
|
-
|
|
17
|
+
{
|
|
18
|
+
name: "bd",
|
|
19
|
+
versionFlag: "--version",
|
|
20
|
+
required: true,
|
|
21
|
+
installHint: "https://github.com/steveyegge/beads",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "mulch",
|
|
25
|
+
versionFlag: "--version",
|
|
26
|
+
required: true,
|
|
27
|
+
installHint: "npm install -g @os-eco/mulch-cli — https://github.com/jayminwest/mulch",
|
|
28
|
+
},
|
|
19
29
|
];
|
|
20
30
|
|
|
21
31
|
const checks: DoctorCheck[] = [];
|
|
22
32
|
|
|
23
33
|
for (const tool of requiredTools) {
|
|
24
|
-
const check = await checkTool(tool.name, tool.versionFlag, tool.required);
|
|
34
|
+
const check = await checkTool(tool.name, tool.versionFlag, tool.required, tool.installHint);
|
|
25
35
|
checks.push(check);
|
|
26
36
|
}
|
|
27
37
|
|
|
@@ -121,6 +131,7 @@ async function checkTool(
|
|
|
121
131
|
name: string,
|
|
122
132
|
versionFlag: string,
|
|
123
133
|
required: boolean,
|
|
134
|
+
installHint?: string,
|
|
124
135
|
): Promise<DoctorCheck> {
|
|
125
136
|
try {
|
|
126
137
|
const { exitCode, stdout, stderr } = await new Promise<{
|
|
@@ -170,7 +181,9 @@ async function checkTool(
|
|
|
170
181
|
status: required ? "fail" : "warn",
|
|
171
182
|
message: `${name} is not installed or not in PATH`,
|
|
172
183
|
details: [
|
|
173
|
-
|
|
184
|
+
installHint
|
|
185
|
+
? `Install ${name}: ${installHint}`
|
|
186
|
+
: `Install ${name} or ensure it is in your PATH`,
|
|
174
187
|
error instanceof Error ? error.message : String(error),
|
|
175
188
|
],
|
|
176
189
|
fixable: true,
|
package/src/index.ts
CHANGED
|
@@ -45,7 +45,7 @@ import { worktreeCommand } from "./commands/worktree.ts";
|
|
|
45
45
|
import { LegioError, WorktreeError } from "./errors.ts";
|
|
46
46
|
import { setQuiet } from "./logging/color.ts";
|
|
47
47
|
|
|
48
|
-
const VERSION = "0.1.
|
|
48
|
+
const VERSION = "0.1.3";
|
|
49
49
|
|
|
50
50
|
const HELP = `legio v${VERSION} — Multi-agent orchestration for Claude Code
|
|
51
51
|
|
package/src/server/routes.ts
CHANGED
|
@@ -1141,7 +1141,7 @@ export async function handleApiRequest(
|
|
|
1141
1141
|
const { id } = params;
|
|
1142
1142
|
if (!id) return errorResponse("Missing issue ID", 400);
|
|
1143
1143
|
try {
|
|
1144
|
-
const body = await request.json().catch(() => ({})) as { reason?: string };
|
|
1144
|
+
const body = (await request.json().catch(() => ({}))) as { reason?: string };
|
|
1145
1145
|
const reason = typeof body.reason === "string" ? body.reason : "Closed from dashboard";
|
|
1146
1146
|
const client = createBeadsClient(projectRoot);
|
|
1147
1147
|
await client.close(id, reason);
|
package/templates/CLAUDE.md.tmpl
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# {{PROJECT_NAME}} — Legio Orchestration
|
|
2
|
-
|
|
3
|
-
> Auto-generated by `legio init`. You may edit this file.
|
|
4
|
-
|
|
5
|
-
This project uses **legio** for Claude Code agent orchestration. Your session
|
|
6
|
-
acts as the orchestrator: you decide what work to delegate, spawn worker agents,
|
|
7
|
-
monitor progress, and merge results.
|
|
8
|
-
|
|
9
|
-
## Quick Reference
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
# Spawn a worker agent
|
|
13
|
-
legio sling <bead-id> --capability <type> --name <agent-name> \
|
|
14
|
-
[--spec <path>] [--files file1,file2] [--parent <agent>] [--depth <n>]
|
|
15
|
-
|
|
16
|
-
# Check system status
|
|
17
|
-
legio status # Overview of all agents, worktrees, beads
|
|
18
|
-
legio status --json # Machine-readable output
|
|
19
|
-
legio status --watch # Live updating
|
|
20
|
-
|
|
21
|
-
# Messaging (SQLite-backed, ~1-5ms per query)
|
|
22
|
-
legio mail send --to <agent> --subject "..." --body "..."
|
|
23
|
-
legio mail check # Your inbox
|
|
24
|
-
legio mail list --unread # All unread messages
|
|
25
|
-
legio mail reply <id> --body "..."
|
|
26
|
-
|
|
27
|
-
# Merge completed work
|
|
28
|
-
legio merge --branch <name> # Merge a specific branch
|
|
29
|
-
legio merge --all # Merge all completed branches
|
|
30
|
-
legio merge --dry-run --branch <name> # Preview conflicts
|
|
31
|
-
|
|
32
|
-
# Worktree management
|
|
33
|
-
legio worktree list # Show all worktrees with status
|
|
34
|
-
legio worktree clean --completed # Remove finished worktrees
|
|
35
|
-
|
|
36
|
-
# Context and monitoring
|
|
37
|
-
legio prime # Reload context (config, mulch, recent activity)
|
|
38
|
-
legio watch --background # Start watchdog daemon
|
|
39
|
-
legio metrics # Performance summary
|
|
40
|
-
legio log <event> --agent <name> # Hook-driven event logging
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## How to Spawn Agents
|
|
44
|
-
|
|
45
|
-
1. Identify the work using beads: `bd ready` or `bd create "task title"`
|
|
46
|
-
2. Choose a capability based on the task:
|
|
47
|
-
{{AGENT_DEFINITIONS}}
|
|
48
|
-
3. Assign exclusive file scope so agents do not conflict
|
|
49
|
-
4. Spawn: `legio sling <bead-id> --capability <type> --name <unique-name> --files src/foo.ts,src/bar.ts`
|
|
50
|
-
|
|
51
|
-
Each spawned agent gets its own git worktree, branch, CLAUDE.md overlay, and
|
|
52
|
-
tmux session. Agents communicate via `legio mail` and report completion
|
|
53
|
-
by closing their beads issue (`bd close <id> --reason "summary"`).
|
|
54
|
-
|
|
55
|
-
## Hierarchical Delegation
|
|
56
|
-
|
|
57
|
-
You can spawn **team leads** that themselves spawn sub-workers:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
Orchestrator (this session)
|
|
61
|
-
└── legio sling bd-xyz --capability lead --name build-lead
|
|
62
|
-
├── legio sling bd-abc --capability builder --name auth-login
|
|
63
|
-
├── legio sling bd-def --capability builder --name auth-signup
|
|
64
|
-
└── legio sling bd-ghi --capability builder --name auth-reset
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Depth limit is configurable (default: 2). Leads use `--parent` and `--depth`
|
|
68
|
-
to track hierarchy.
|
|
69
|
-
|
|
70
|
-
## Checking Status
|
|
71
|
-
|
|
72
|
-
Run `legio status` to see:
|
|
73
|
-
- Active agents and their states (booting, working, stalled, zombie)
|
|
74
|
-
- Worktree locations and branches
|
|
75
|
-
- Beads issue progress
|
|
76
|
-
- Unread mail count
|
|
77
|
-
|
|
78
|
-
## Canonical Branch
|
|
79
|
-
|
|
80
|
-
All merges target **{{CANONICAL_BRANCH}}**. Agents work on branches named
|
|
81
|
-
`legio/<agent-name>/<bead-id>`. Never push directly to {{CANONICAL_BRANCH}}.
|
|
82
|
-
|
|
83
|
-
## Conventions
|
|
84
|
-
|
|
85
|
-
- Agents own files exclusively — no two agents modify the same file
|
|
86
|
-
- Use `legio mail` for all inter-agent communication (not beads)
|
|
87
|
-
- Use `bd close` to report task completion (not mail)
|
|
88
|
-
- Merge via `legio merge`, not raw `git merge`
|
|
89
|
-
- Logs live in `.legio/logs/` — never delete them manually
|