@fusebase/harness-lead 0.3.3 → 0.3.5
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 +9 -0
- package/dist/lead.mjs +148 -5
- package/package.json +1 -1
- package/skills/lead/SKILL.md +2 -1
- package/skills/lead/references/help.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.5 — 2026-12-04
|
|
4
|
+
|
|
5
|
+
- `lead commands [--json]`: the /lead commands with their argument and options (mode auto/approve/readonly, watch start/stop/interval, delegate check, qa milestone, activity analyze) as data, for interfaces that offer them in a menu. A test keeps it equal to `references/help.md`. Allowed in readonly mode.
|
|
6
|
+
- `lead suggest [--json]`: the command a person would most likely type next, from the next step of `status` (`/lead init`, `/lead plan`, `/lead task T-003`, `/lead qa T-005` …), with up to four other options as buttons. Interfaces offer it as a suggestion in the field; nothing runs by itself. Read-only.
|
|
7
|
+
|
|
8
|
+
## 0.3.4 — 2026-12-04
|
|
9
|
+
|
|
10
|
+
- `lead mode readonly`: lead reads and reports and changes nothing in the project. The CLI refuses every command that writes (exit 3, an allow-list, so a new command is refused until listed): task and board changes, `scaffold`, `spec`, `install`/`update`, `adopt --write`, `waves --write`, `sync-plan` without `--preview`, `watch` start/stop/ack/probe shadow. Reads, previews, `watch probe report|--dry`, the switches (`enable`, `mode`, `use`) and the local notes (`improve`, `activity`) still work. The session-start hook and the skill tell the agent to stay read-only. Editing files by the agent's own tools is held by those instructions, not by the CLI.
|
|
11
|
+
|
|
3
12
|
## 0.3.3 — 2026-12-04
|
|
4
13
|
|
|
5
14
|
- `watch probe`: a token-free pass over delegated tasks (merge requests through `glab`, the tracker through a command the person provides) that fingerprints the facts and says whether an agent would have anything to do. `watch probe shadow` records its decision beside each clock tick without skipping any check; `watch probe report` compares it with what agents did. `watch ack --acted|--idle` records whether the check led to action. Nothing gates a real check yet.
|
package/dist/lead.mjs
CHANGED
|
@@ -7549,7 +7549,7 @@ var TEMPLATES = {
|
|
|
7549
7549
|
"workspace-crew.md": "---\nname: crew-lead\ndescription: Run the lead workflow. Use only when the user invokes /crew-lead or $crew-lead.\n---\n<!-- evercrew:workspace-entry -->\nFollow the adjacent `../lead/SKILL.md` entry point as if the user invoked lead. Pass through the request and its arguments.\n",
|
|
7550
7550
|
"workspace-entry.md": "---\nname: lead\ndescription: Run lead for this project or show the workspace overview. Use when the user types /lead or $lead, asks to use lead, or asks for an overview of all workspace projects.\n---\n<!-- evercrew:workspace-entry -->\nIf the session context already names the lead launcher and kit, use them and skip the next two steps. Otherwise find the nearest `.lead/lead.mjs` from the directory this conversation started in. Preserve that starting directory as `--cwd` on the first call. Run `node <launcher> kit-path`, then read `skills/lead/SKILL.md` from the returned kit directory and follow it. References are relative to that kit directory. Keep the same session ID throughout this conversation. The launcher and kit path are local setup, not product state.\n",
|
|
7551
7551
|
"workspace-goal.md": "---\nname: lead-goal\ndescription: Record lead activity and keep the heartbeat for an active Cursor goal.\n---\n<!-- evercrew:workspace-entry -->\nRun `node .lead/lead.mjs kit-path` from the lead workspace or target checkout, then read `skills/lead-goal/SKILL.md` from the returned kit directory. Use the same repository scope and session ID as lead.\n",
|
|
7552
|
-
"workspace-launcher.mjs": "#!/usr/bin/env node\n// evercrew:workspace-entry\n// Portable entry point. The runtime belongs to the workspace or to the user's npm cache.\nimport { spawnSync } from 'node:child_process';\nimport { existsSync, mkdirSync, realpathSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst args = process.argv.slice(2);\nconst here = dirname(dirname(fileURLToPath(import.meta.url)));\nconst hook = args[0] === 'stop-check' || args[0] === 'session-start';\nconst cwdFlag = args.indexOf('--cwd');\nconst cwd = cwdFlag >= 0 && args[cwdFlag + 1] ? resolve(args[cwdFlag + 1]) : process.cwd();\nconst cli = (kit) => join(kit, 'dist/lead.mjs');\n\nfunction workspaceKit(start) {\n let dir = realpathSync(start);\n while (true) {\n if (existsSync(join(dir, '.lead/workspace.yml'))) {\n const kit = join(dir, '.lead/workspace-kit');\n if (existsSync(cli(kit))) return kit;\n if (hook) return;\n throw new Error(`The lead workspace at ${dir} has no runtime. Deploy its kit first.`);\n }\n if (dirname(dir) === dir) return;\n dir = dirname(dir);\n }\n}\n\nfunction run(bin, argv, diagnosticsOnly = false) {\n const result = spawnSync(bin, argv, { stdio: diagnosticsOnly ? ['inherit', 2, 2] : 'inherit', env: bin === 'npm' ? { ...process.env, 'npm_config_@fusebase:registry': 'https://registry.npmjs.org/' } : process.env });\n if (result.error) throw result.error;\n return result.status ?? 1;\n}\n\nfunction main() {\n const shared = workspaceKit(cwd) ?? workspaceKit(here);\n const installed = join(here, 'node_modules/@fusebase/harness-lead');\n const cache = join(process.env.XDG_CACHE_HOME || join(homedir(), '.cache'), 'harness-lead', 'standalone');\n const cached = join(cache, 'node_modules/@fusebase/harness-lead');\n let kit = shared ?? (existsSync(cli(cached)) ? cached : installed);\n if (!shared && (args[0] === 'update' || !existsSync(cli(kit)))) {\n if (hook) return 0;\n if (args[0] === 'update' && args.length > 1) throw new Error('Standalone launcher update refreshes the user cache. Run the chosen kit directly for an explicit source.');\n mkdirSync(cache, { recursive: true });\n const status = run('npm', ['install', '--prefix', cache, '--no-save', '--no-package-lock', '--ignore-scripts', '--no-audit', '--no-fund',\n args[0] === 'update' ? '@fusebase/harness-lead@latest' : '@fusebase/harness-lead@0.3.
|
|
7552
|
+
"workspace-launcher.mjs": "#!/usr/bin/env node\n// evercrew:workspace-entry\n// Portable entry point. The runtime belongs to the workspace or to the user's npm cache.\nimport { spawnSync } from 'node:child_process';\nimport { existsSync, mkdirSync, realpathSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst args = process.argv.slice(2);\nconst here = dirname(dirname(fileURLToPath(import.meta.url)));\nconst hook = args[0] === 'stop-check' || args[0] === 'session-start';\nconst cwdFlag = args.indexOf('--cwd');\nconst cwd = cwdFlag >= 0 && args[cwdFlag + 1] ? resolve(args[cwdFlag + 1]) : process.cwd();\nconst cli = (kit) => join(kit, 'dist/lead.mjs');\n\nfunction workspaceKit(start) {\n let dir = realpathSync(start);\n while (true) {\n if (existsSync(join(dir, '.lead/workspace.yml'))) {\n const kit = join(dir, '.lead/workspace-kit');\n if (existsSync(cli(kit))) return kit;\n if (hook) return;\n throw new Error(`The lead workspace at ${dir} has no runtime. Deploy its kit first.`);\n }\n if (dirname(dir) === dir) return;\n dir = dirname(dir);\n }\n}\n\nfunction run(bin, argv, diagnosticsOnly = false) {\n const result = spawnSync(bin, argv, { stdio: diagnosticsOnly ? ['inherit', 2, 2] : 'inherit', env: bin === 'npm' ? { ...process.env, 'npm_config_@fusebase:registry': 'https://registry.npmjs.org/' } : process.env });\n if (result.error) throw result.error;\n return result.status ?? 1;\n}\n\nfunction main() {\n const shared = workspaceKit(cwd) ?? workspaceKit(here);\n const installed = join(here, 'node_modules/@fusebase/harness-lead');\n const cache = join(process.env.XDG_CACHE_HOME || join(homedir(), '.cache'), 'harness-lead', 'standalone');\n const cached = join(cache, 'node_modules/@fusebase/harness-lead');\n let kit = shared ?? (existsSync(cli(cached)) ? cached : installed);\n if (!shared && (args[0] === 'update' || !existsSync(cli(kit)))) {\n if (hook) return 0;\n if (args[0] === 'update' && args.length > 1) throw new Error('Standalone launcher update refreshes the user cache. Run the chosen kit directly for an explicit source.');\n mkdirSync(cache, { recursive: true });\n const status = run('npm', ['install', '--prefix', cache, '--no-save', '--no-package-lock', '--ignore-scripts', '--no-audit', '--no-fund',\n args[0] === 'update' ? '@fusebase/harness-lead@latest' : '@fusebase/harness-lead@0.3.5'], true);\n if (status || !existsSync(cli(cached))) return status || 1;\n kit = cached;\n if (args[0] === 'update') return run(process.execPath, [cli(kit), 'version']);\n }\n if (args[0] === 'kit-path') {\n console.log(realpathSync(kit));\n return 0;\n }\n return run(process.execPath, [cli(kit), ...args]);\n}\n\ntry { process.exitCode = main(); }\ncatch (error) {\n if (!hook) console.error(`lead: ${error.message}`);\n process.exitCode = hook ? 0 : 1;\n}\n",
|
|
7553
7553
|
"backlog-index.md": '# <Project> Backlog\n\n[One Pager](one-pager.md)\n\n## Reviewed backlog\n\n<!-- evercrew:view kind="proposals" -->\n<!-- /evercrew:view -->\n\n## Needs triage\n\n<!-- For each candidate, link the task note and record what needs clarification. -->\n\n## Triage decisions\n\n<!-- Link source evidence and explain why an item was linked, completed, deferred or superseded. -->\n\n## History\n\n<!-- Link the complete source reconciliation, including repeated entries. -->\n',
|
|
7554
7554
|
"one-pager.md": '---\nmilestones:\n - id: mvp\n title: MVP\n shows: ""\n status: current\n---\n# <Project> \u2014 One Pager\n\n## Status now\n\n<!-- 3\u20134 sentences, written by a human. -->\n\n**What to show.**\n\n**What landed.**\n\n**Evidence.** <!-- Add the date, source revision, checks and open verification. -->\n\n<!-- evercrew:view kind="stats" -->\n<!-- /evercrew:view -->\n\n## Needs attention\n\n<!-- Decisions and immediate checks. Link the evidence and name the owner when known. -->\n\n## Product bet\n\n<!-- One sentence. -->\n\n## Research\n\nConclusions only. The long note is [the research](spec/01-research.md).\n\n<!-- Paste ### Conclusions from spec/01-research.md. Do not paste the rest. -->\n\n## Readiness\n\n<!-- evercrew:view kind="readiness" -->\n<!-- /evercrew:view -->\n\n## Roadmap\n\n<!-- evercrew:view kind="order" -->\n<!-- /evercrew:view -->\n\n## Next 3 steps\n\n<!-- evercrew:view kind="next-steps" -->\n<!-- /evercrew:view -->\n\n## Inbox triage\n\nTick an item when the team agrees to take it into the plan. Review higher priorities first, then use list order within each priority.\n\n<!-- Example: add real rows and remove this comment.\n:::checklist[Take into the plan]\n::check[:badge[Feature request]{tone="info"} :badge[High]{tone="danger"} Task summary \xB7 [Task note](tasks/T-001-example.md)]{done="false"}\n:::\n-->\n\n## Next versions (do not promise on a demo)\n\n## Reference\n\n- [Execution board](board.md)\n- [Backlog and triage decisions](backlog.md)\n<!-- Link history, architecture and QA evidence once available. -->\n',
|
|
7555
7555
|
"task-note.md": "# <Task summary>\n\n## Links\n\n<!-- Fill the links or document permitted exceptions before publishing. -->\n\n- [Epic](https://example.invalid/epic)\n- [Jira Story](https://example.invalid/story)\n- [Proposal](https://example.invalid/proposal)\n- [Mockup](https://example.invalid/mockup)\n- [One Pager](https://example.invalid/one-pager)\n\n## Goal\n\n<!-- Describe the user need and intended outcome. -->\n\n## User flow\n\n<!-- Add a Mermaid diagram covering the requested path. -->\n\n## Technical design\n\n<!-- Describe changes, interfaces, and relevant constraints. -->\n\n## Decisions\n\n<!-- Record agreed decisions and tradeoffs. -->\n\n## Acceptance criteria\n\n<!-- State observable checks and expected results. -->\n\n## Out of scope\n\n<!-- Name exclusions or say whether there are none. -->\n"
|
|
@@ -8297,7 +8297,7 @@ function ensureCodexHooks(root) {
|
|
|
8297
8297
|
}
|
|
8298
8298
|
|
|
8299
8299
|
// src/install.ts
|
|
8300
|
-
var VERSION = true ? "0.3.
|
|
8300
|
+
var VERSION = true ? "0.3.5" : "dev";
|
|
8301
8301
|
var LOCK_PATH = ".lead/kit.lock";
|
|
8302
8302
|
var SKILLS = ["lead", "crew-lead", "lead-goal"];
|
|
8303
8303
|
var SKILL_DIRS = [".agents/skills", ".claude/skills"];
|
|
@@ -9266,6 +9266,76 @@ function writeEntrypoints(root) {
|
|
|
9266
9266
|
}
|
|
9267
9267
|
}
|
|
9268
9268
|
|
|
9269
|
+
// src/commands.ts
|
|
9270
|
+
var COMMANDS = [
|
|
9271
|
+
{ name: "", summary: "state and next step \u2014 answer in plain words" },
|
|
9272
|
+
{ name: "status", summary: "state, plus a live check of every delegated task" },
|
|
9273
|
+
{ name: "", arg: "<url>", summary: "a teams.microsoft.com/l/message, Discord, or Slack message URL only" },
|
|
9274
|
+
{ name: "init", summary: "set up lead in this repo" },
|
|
9275
|
+
{ name: "plan", summary: "spec by stages (research or reverse \u2192 flows \u2192 mockups \u2192 acceptance) \u2192 architecture \u2192 tasks" },
|
|
9276
|
+
{ name: "reverse", arg: "<x>", summary: "study a running product in Docker and write how it works" },
|
|
9277
|
+
{ name: "task", arg: "[id]", summary: "work on a task (checks and independent review included)" },
|
|
9278
|
+
{ name: "qa", arg: "<id>", summary: "independent re-check of a task (browser QA when configured)", options: [{ name: "milestone", summary: "QA of the whole milestone" }] },
|
|
9279
|
+
{ name: "sync", summary: "mirror work/ to FuseBase notes and Jira (when configured)" },
|
|
9280
|
+
{ name: "delegate", summary: "hand a task to a service, or check one already handed off", options: [{ name: "check", summary: "check the tasks already handed off" }] },
|
|
9281
|
+
{
|
|
9282
|
+
name: "watch",
|
|
9283
|
+
summary: "clock for delegated tasks: start, stop, interval 15m|30m|1h",
|
|
9284
|
+
options: [
|
|
9285
|
+
{ name: "start", summary: "start the clock" },
|
|
9286
|
+
{ name: "stop", summary: "stop the clock" },
|
|
9287
|
+
{ name: "interval 15m", summary: "check every 15 minutes" },
|
|
9288
|
+
{ name: "interval 30m", summary: "check every 30 minutes" },
|
|
9289
|
+
{ name: "interval 1h", summary: "check every hour" }
|
|
9290
|
+
]
|
|
9291
|
+
},
|
|
9292
|
+
{ name: "how", summary: "how to work with lead: the scheme and where you are needed" },
|
|
9293
|
+
{ name: "improve", summary: "notes this project collected: where lead stopped, asked, or could have avoided it" },
|
|
9294
|
+
{ name: "activity", summary: "agent run log (.lead/activity/*.jsonl); `activity analyze` summarises waits and tasks", options: [{ name: "analyze", summary: "summarise waits and tasks" }] },
|
|
9295
|
+
{ name: "score", summary: "sample past runs, apply rubrics, or review recurring findings (references/score.md)" },
|
|
9296
|
+
{ name: "help", summary: "this list" },
|
|
9297
|
+
{
|
|
9298
|
+
name: "mode",
|
|
9299
|
+
summary: "auto, approve or readonly: whether a step inside the plan runs, waits, or nothing is changed (local, not in git)",
|
|
9300
|
+
options: [
|
|
9301
|
+
{ name: "auto", summary: "carry out the procedure and say what was done" },
|
|
9302
|
+
{ name: "approve", summary: "ask before each step" },
|
|
9303
|
+
{ name: "readonly", summary: "read and report, change nothing" }
|
|
9304
|
+
]
|
|
9305
|
+
},
|
|
9306
|
+
{ name: "enable", summary: "turn lead on for you in this repo (off by default; local, not in git)" },
|
|
9307
|
+
{ name: "disable", summary: "turn it off again" }
|
|
9308
|
+
];
|
|
9309
|
+
function suggest(next) {
|
|
9310
|
+
const task = (id2) => `/lead task ${id2}`;
|
|
9311
|
+
const each = (ids, label) => ids.slice(0, 4).map((id2) => ({ command: task(id2), label: label(id2) }));
|
|
9312
|
+
const one = (command) => ({ command, reason: next.reason, options: [] });
|
|
9313
|
+
switch (next.kind) {
|
|
9314
|
+
case "init":
|
|
9315
|
+
return one("/lead init");
|
|
9316
|
+
case "plan":
|
|
9317
|
+
case "milestone_done":
|
|
9318
|
+
return one("/lead plan");
|
|
9319
|
+
case "confirm_spec":
|
|
9320
|
+
return { ...one("/lead plan"), options: [{ command: "/lead plan", label: "Confirm the spec" }] };
|
|
9321
|
+
case "continue_task":
|
|
9322
|
+
return one(task(next.task));
|
|
9323
|
+
case "resume":
|
|
9324
|
+
return { command: task(next.tasks[0]), reason: next.reason, options: each(next.tasks, (id2) => `Continue ${id2}`) };
|
|
9325
|
+
case "answer":
|
|
9326
|
+
return { command: task(next.tasks[0]), reason: next.reason, options: each(next.tasks, (id2) => `Answer ${id2}`) };
|
|
9327
|
+
case "task":
|
|
9328
|
+
return { command: task(next.tasks[0]), reason: next.reason, options: each(next.tasks, (id2) => `Start ${id2}`) };
|
|
9329
|
+
case "review":
|
|
9330
|
+
return { command: `/lead qa ${next.tasks[0]}`, reason: next.reason, options: [...next.tasks.slice(0, 3).map((id2) => ({ command: `/lead qa ${id2}`, label: `Re-check ${id2}` })), { command: "/lead status", label: "Status of merges" }] };
|
|
9331
|
+
case "choose_project":
|
|
9332
|
+
case "mark_merged":
|
|
9333
|
+
case "adopted_project":
|
|
9334
|
+
case "fix":
|
|
9335
|
+
return one("/lead");
|
|
9336
|
+
}
|
|
9337
|
+
}
|
|
9338
|
+
|
|
9269
9339
|
// src/cli.ts
|
|
9270
9340
|
import { execFileSync as execFileSync6, spawnSync as spawnSync4 } from "node:child_process";
|
|
9271
9341
|
import { existsSync as existsSync31, mkdtempSync as mkdtempSync3, rmSync as rmSync6 } from "node:fs";
|
|
@@ -9275,7 +9345,7 @@ import { tmpdir as tmpdir3 } from "node:os";
|
|
|
9275
9345
|
import { existsSync as existsSync17, mkdirSync as mkdirSync6, readFileSync as readFileSync15, rmSync as rmSync3, writeFileSync as writeFileSync7 } from "node:fs";
|
|
9276
9346
|
import { join as join18 } from "node:path";
|
|
9277
9347
|
var MODE_PATH = ".lead/mode";
|
|
9278
|
-
var MODES = ["auto", "approve"];
|
|
9348
|
+
var MODES = ["auto", "approve", "readonly"];
|
|
9279
9349
|
function isMode(v) {
|
|
9280
9350
|
return MODES.includes(v);
|
|
9281
9351
|
}
|
|
@@ -9294,6 +9364,53 @@ function clearMode(root) {
|
|
|
9294
9364
|
rmSync3(join18(root, MODE_PATH), { force: true });
|
|
9295
9365
|
}
|
|
9296
9366
|
|
|
9367
|
+
// src/readonly.ts
|
|
9368
|
+
var READS = /* @__PURE__ */ new Set([
|
|
9369
|
+
"help",
|
|
9370
|
+
"--help",
|
|
9371
|
+
"version",
|
|
9372
|
+
"how",
|
|
9373
|
+
"commands",
|
|
9374
|
+
"suggest",
|
|
9375
|
+
"status",
|
|
9376
|
+
"check",
|
|
9377
|
+
"projects",
|
|
9378
|
+
"doctor",
|
|
9379
|
+
"inbox",
|
|
9380
|
+
"docs",
|
|
9381
|
+
"similarity",
|
|
9382
|
+
"sync-one-pager",
|
|
9383
|
+
"delegate",
|
|
9384
|
+
"adapters",
|
|
9385
|
+
"session-start",
|
|
9386
|
+
"stop-check",
|
|
9387
|
+
"enabled",
|
|
9388
|
+
"enable",
|
|
9389
|
+
"disable",
|
|
9390
|
+
"mode",
|
|
9391
|
+
"use",
|
|
9392
|
+
"improve",
|
|
9393
|
+
"activity"
|
|
9394
|
+
]);
|
|
9395
|
+
function writeReason(cmd, args, flags) {
|
|
9396
|
+
if (cmd === void 0 || READS.has(cmd)) return void 0;
|
|
9397
|
+
if (cmd === "waves") return flags.write ? "waves --write rewrites task files" : void 0;
|
|
9398
|
+
if (cmd === "adopt") return flags.write ? "adopt --write creates the initiative files" : void 0;
|
|
9399
|
+
if (cmd === "initiative") return args[0] === "waves" && flags.write ? "initiative waves --write rewrites task files" : void 0;
|
|
9400
|
+
if (cmd === "sync-plan") return flags.preview ? void 0 : "sync-plan saves the plan; use --preview to read it";
|
|
9401
|
+
if (cmd === "score") return args[0] === "record" ? "score record stores a result" : void 0;
|
|
9402
|
+
if (cmd === "watch") {
|
|
9403
|
+
const [sub, next] = args;
|
|
9404
|
+
if (sub === void 0 || sub === "status") return void 0;
|
|
9405
|
+
if (sub === "probe" && (next === "report" || next === void 0 && flags.dry === true)) return void 0;
|
|
9406
|
+
return `watch ${[sub, next].filter((x) => x && !x.startsWith("-")).join(" ")} changes the clock state; read with watch status, watch probe --dry or watch probe report`;
|
|
9407
|
+
}
|
|
9408
|
+
return `${cmd} changes the project`;
|
|
9409
|
+
}
|
|
9410
|
+
function readonlyRefusal(reason) {
|
|
9411
|
+
return `lead is read-only here: ${reason}. Nothing was changed. Only the person leaves this mode: node .lead/lead.mjs mode clear (or mode auto|approve).`;
|
|
9412
|
+
}
|
|
9413
|
+
|
|
9297
9414
|
// src/status.ts
|
|
9298
9415
|
import { existsSync as existsSync19 } from "node:fs";
|
|
9299
9416
|
import { join as join21 } from "node:path";
|
|
@@ -11641,6 +11758,8 @@ Usage: node .lead/lead.mjs <command> [options]
|
|
|
11641
11758
|
install <repo> [--keep-modified] copy kit files into a repo (run from the kit)
|
|
11642
11759
|
update [--from GIT_URL|PATH] [--force] fetch the latest npm package and update kit files
|
|
11643
11760
|
how how to work with lead: the scheme, where a person is needed
|
|
11761
|
+
commands [--json] the /lead commands with their options, for an interface menu
|
|
11762
|
+
suggest [--json] the command a person would most likely type next, and other options
|
|
11644
11763
|
enable | disable | enabled turn lead's hooks on or off for you in this repo (local, not in git)
|
|
11645
11764
|
mode [auto|approve|clear] how lead treats a step inside the plan (local, not in git)
|
|
11646
11765
|
adopt --input FILE --id ID --home REPO [--flag KEY] [--write] [--force] [--json]
|
|
@@ -11708,7 +11827,7 @@ function main(argv, out = (s) => console.log(s)) {
|
|
|
11708
11827
|
const session = hookInput.session_id ?? str2(flags.session) ?? process.env.LEAD_SESSION;
|
|
11709
11828
|
let scope;
|
|
11710
11829
|
let sharedKit;
|
|
11711
|
-
if (cmd && !["help", "--help", "version", "how", "install"].includes(cmd)) {
|
|
11830
|
+
if (cmd && !["help", "--help", "version", "how", "install", "commands"].includes(cmd)) {
|
|
11712
11831
|
try {
|
|
11713
11832
|
const runningKit = kitRoot();
|
|
11714
11833
|
const deployed = basename3(runningKit) === "workspace-kit" && basename3(dirname6(runningKit)) === ".lead";
|
|
@@ -11760,6 +11879,7 @@ ${entry.source}:${entry.line}
|
|
|
11760
11879
|
}
|
|
11761
11880
|
if (args[0] === "attach" && args[1]) {
|
|
11762
11881
|
const target = routeScope(ws, ws.root, void 0, args[1]).root;
|
|
11882
|
+
if (readMode(target) === "readonly") throw new Error("that repository is read-only (mode readonly)");
|
|
11763
11883
|
if (existsSync31(join33(target, ".lead/lead.mjs")) && !isPortableLauncher(target)) throw new Error("a lead entry point already exists; review and migrate it before attaching");
|
|
11764
11884
|
writeEntrypoints(target);
|
|
11765
11885
|
for (const line of [...ensureGitIgnore(target), ...ensureClaudeSettings(target), ...ensureCodexHooks(target)]) out(line);
|
|
@@ -11805,6 +11925,14 @@ ${entry.source}:${entry.line}
|
|
|
11805
11925
|
return 2;
|
|
11806
11926
|
}
|
|
11807
11927
|
}
|
|
11928
|
+
if (cmd) {
|
|
11929
|
+
const reason = writeReason(cmd, args, flags);
|
|
11930
|
+
const guarded = cmd === "install" && args[0] ? resolve3(cwd, args[0]) : repoRoot(cwd);
|
|
11931
|
+
if (reason && readMode(guarded) === "readonly") {
|
|
11932
|
+
out(readonlyRefusal(reason));
|
|
11933
|
+
return 3;
|
|
11934
|
+
}
|
|
11935
|
+
}
|
|
11808
11936
|
switch (cmd) {
|
|
11809
11937
|
case void 0:
|
|
11810
11938
|
case "help":
|
|
@@ -11814,6 +11942,16 @@ ${entry.source}:${entry.line}
|
|
|
11814
11942
|
case "version":
|
|
11815
11943
|
out(VERSION);
|
|
11816
11944
|
return 0;
|
|
11945
|
+
case "suggest": {
|
|
11946
|
+
const gctx = loadContext(cwd, project);
|
|
11947
|
+
const g = suggest(status(gctx, { session, isMerged: gitMergedChecker(gctx.root) }).next);
|
|
11948
|
+
if (flags.json) out(JSON.stringify(g, null, 2));
|
|
11949
|
+
else {
|
|
11950
|
+
out(`${g.command} \u2014 ${g.reason}`);
|
|
11951
|
+
for (const o of g.options) out(` ${o.command} ${o.label}`);
|
|
11952
|
+
}
|
|
11953
|
+
return 0;
|
|
11954
|
+
}
|
|
11817
11955
|
case "status": {
|
|
11818
11956
|
const sctx = loadContext(cwd, project);
|
|
11819
11957
|
const s = status(sctx, { session, isMerged: gitMergedChecker(sctx.root) });
|
|
@@ -11935,7 +12073,7 @@ ${entry.source}:${entry.line}
|
|
|
11935
12073
|
return 0;
|
|
11936
12074
|
}
|
|
11937
12075
|
if (!isMode(arg)) {
|
|
11938
|
-
out("usage: mode [auto|approve|clear]");
|
|
12076
|
+
out("usage: mode [auto|approve|readonly|clear]");
|
|
11939
12077
|
return 2;
|
|
11940
12078
|
}
|
|
11941
12079
|
writeMode(root, arg);
|
|
@@ -11955,6 +12093,7 @@ ${entry.source}:${entry.line}
|
|
|
11955
12093
|
}
|
|
11956
12094
|
case "session-start": {
|
|
11957
12095
|
const pointer = sharedKit && scope ? [`lead: this project runs with lead, no /lead needed. Launcher: ${join33(repoRoot(cwd), ".lead/lead.mjs")}; kit: ${sharedKit} (start from skills/lead/SKILL.md; references are relative to the kit). When the person asks about plans, tasks, status, handoffs or the board, read that SKILL.md and follow it; do not search for the launcher or run kit-path.`] : [];
|
|
12096
|
+
if (readMode(repoRoot(cwd)) === "readonly") pointer.push("lead: READ-ONLY mode. Read and report only: do not edit files, create branches or worktrees, commit, push, write to the tracker or FuseBase, or run lead commands that write (the CLI refuses them). Only the person leaves this mode.");
|
|
11958
12097
|
if (!isEnabled(repoRoot(cwd))) {
|
|
11959
12098
|
if (pointer.length) out(JSON.stringify({ hookSpecificOutput: { hookEventName: "SessionStart", additionalContext: [...pointer, `lead: this session id is ${session ?? "unknown"}; pass --session ${session ?? "<id>"} to lead.mjs commands.`].join("\n") } }));
|
|
11960
12099
|
return 0;
|
|
@@ -12303,6 +12442,10 @@ start the builder with: ${r.launch}`);
|
|
|
12303
12442
|
case "how":
|
|
12304
12443
|
out(TEMPLATES["how.md"].trim());
|
|
12305
12444
|
return 0;
|
|
12445
|
+
case "commands":
|
|
12446
|
+
if (flags.json) out(JSON.stringify({ version: VERSION, prefix: "/lead", commands: COMMANDS }, null, 2));
|
|
12447
|
+
else for (const c of COMMANDS) out(`/lead${c.name ? ` ${c.name}` : ""}${c.arg ? ` ${c.arg}` : ""} \u2014 ${c.summary}${c.options ? ` (${c.options.map((o) => o.name).join(", ")})` : ""}`);
|
|
12448
|
+
return 0;
|
|
12306
12449
|
case "adopt": {
|
|
12307
12450
|
const root = repoRoot(cwd);
|
|
12308
12451
|
const input = typeof flags.input === "string" ? flags.input : "";
|
package/package.json
CHANGED
package/skills/lead/SKILL.md
CHANGED
|
@@ -28,7 +28,7 @@ lead is opt-in for each developer. `node .lead/lead.mjs enabled` prints `on` or
|
|
|
28
28
|
## Every /lead
|
|
29
29
|
|
|
30
30
|
1. Run `node .lead/lead.mjs status --json --session <id> --project <name>`. Take `<name>` only from this conversation, after the person picked or created it here. A line from a previous thread, `.lead/current`, or a remembered app does not count. If this conversation has not chosen one, replace `--project <name>` with `--cwd <the folder this session started in>`. If `.lead/lead.mjs` is missing, say lead is not installed in this repo and stop.
|
|
31
|
-
2. Arguments decide directly, without asking: a `teams.microsoft.com`, Discord, or Slack message link → `references/intake.md` (do not pass the URL to the CLI); `how` → show the output of `node .lead/lead.mjs how` as markdown, not inside a code fence, so its mermaid diagram renders; `help` → read `references/help.md`; `init` → `references/init.md`; `plan` → `references/plan.md`; `task [id]` → `references/task.md`; `qa <id>` → `references/review.md`; `sync` → `references/sync.md`; `status` → `references/status.md` and `references/visual.md`; `delegate` → `references/delegate.md`; `watch` → `references/watch.md`; `reverse <x>` → `references/reverse.md`; `qa milestone` → `references/qa.md`; `improve` → print `node .lead/lead.mjs improve` as markdown; `activity` → print `node .lead/lead.mjs activity` (or `--day YYYY-MM-DD`); `score` → `references/score.md`; `adopt` → `references/adopt.md` (also for refreshing an adopted epic and settling open items with `map:`); `initiative <id> --in <repo>` shows one repository's tasks and tracker records; `initiative [id]` → print `node .lead/lead.mjs initiative` (read-only: milestones, repositories, tasks, adapter of each large feature in `work/initiatives/`); `initiative check [id]` and `initiative waves <id> [--write]` check and order its tasks across repositories (task ids are unique in the initiative; `repo:` says where the code is; `blocked_by` takes `T-001` or `<repo>:T-001`); `adapters [name]` → print `node .lead/lead.mjs adapters` (or the named adapter); read the adapter that covers the epic or story before following any reference that reads this project's existing records; `mode` → `node .lead/lead.mjs mode` with no argument prints the mode, `mode auto` or `mode
|
|
31
|
+
2. Arguments decide directly, without asking: a `teams.microsoft.com`, Discord, or Slack message link → `references/intake.md` (do not pass the URL to the CLI); `how` → show the output of `node .lead/lead.mjs how` as markdown, not inside a code fence, so its mermaid diagram renders; `help` → read `references/help.md`; `init` → `references/init.md`; `plan` → `references/plan.md`; `task [id]` → `references/task.md`; `qa <id>` → `references/review.md`; `sync` → `references/sync.md`; `status` → `references/status.md` and `references/visual.md`; `delegate` → `references/delegate.md`; `watch` → `references/watch.md`; `reverse <x>` → `references/reverse.md`; `qa milestone` → `references/qa.md`; `improve` → print `node .lead/lead.mjs improve` as markdown; `activity` → print `node .lead/lead.mjs activity` (or `--day YYYY-MM-DD`); `score` → `references/score.md`; `adopt` → `references/adopt.md` (also for refreshing an adopted epic and settling open items with `map:`); `initiative <id> --in <repo>` shows one repository's tasks and tracker records; `initiative [id]` → print `node .lead/lead.mjs initiative` (read-only: milestones, repositories, tasks, adapter of each large feature in `work/initiatives/`); `initiative check [id]` and `initiative waves <id> [--write]` check and order its tasks across repositories (task ids are unique in the initiative; `repo:` says where the code is; `blocked_by` takes `T-001` or `<repo>:T-001`); `adapters [name]` → print `node .lead/lead.mjs adapters` (or the named adapter); read the adapter that covers the epic or story before following any reference that reads this project's existing records; `mode` → `node .lead/lead.mjs mode` with no argument prints the mode, `mode auto`, `mode approve` or `mode readonly` sets it, `mode clear` removes it. When a Cursor goal is active in this conversation, also follow `references/goal.md`.
|
|
32
32
|
3. Without arguments: tell the state in one to three lines (project, milestone, wave, what is ready, in review, waiting for a human) and draw it (`references/visual.md`). Then follow **Mode**. Do not ask "What next?" when the mode says to act.
|
|
33
33
|
|
|
34
34
|
| `next.kind` | Recommend | Read |
|
|
@@ -69,6 +69,7 @@ A command the host may hold for approval is the last command of the turn. Before
|
|
|
69
69
|
- No mode yet: the first time you would pause, ask once and save it. Options, recommended first: auto — carry out the procedure and say what you did; approve — ask before each step. `node .lead/lead.mjs mode auto` or `mode approve`. If they pick auto, do the step.
|
|
70
70
|
- `auto`: carry out the procedure. One line on what you did, then the following step. Do not end the turn on a menu.
|
|
71
71
|
- `approve`: ask before each step, recommended option first, then do what they pick. The four stops above are asked in either mode.
|
|
72
|
+
- `readonly`: look and report, change nothing. Allowed: `status`, `check`, `inbox`, `initiative` (not `waves --write`), `adapters`, `adopt` and `sync-plan --preview` as previews, `watch status`, `watch probe --dry|report`, `workspace overview`, reading the tracker and merge requests. Not allowed: editing files, branches or worktrees, commits and pushes, `start`/`finish`/`review`/`claim`, `scaffold`, `board`, `spec`, `adopt --write`, `sync`, any write to the tracker or FuseBase, merging. The CLI refuses its own writing commands (exit 3); the rest is on you. Do not run `mode auto|approve|clear` yourself: only the person leaves this mode. If a step needs a write, say which one and stop. This overrides the rest of this section.
|
|
72
73
|
|
|
73
74
|
## Context: do not ask again
|
|
74
75
|
|
|
@@ -19,7 +19,7 @@ Show this list, then the state from `status --json`: project, milestone, wave, n
|
|
|
19
19
|
/lead activity agent run log (.lead/activity/*.jsonl); `activity analyze` summarises waits and tasks
|
|
20
20
|
/lead score sample past runs, apply rubrics, or review recurring findings (references/score.md)
|
|
21
21
|
/lead help this list
|
|
22
|
-
/lead mode auto or
|
|
22
|
+
/lead mode auto, approve or readonly: whether a step inside the plan runs, waits, or nothing is changed (local, not in git)
|
|
23
23
|
/lead enable turn lead on for you in this repo (off by default; local, not in git)
|
|
24
24
|
/lead disable turn it off again
|
|
25
25
|
```
|