From 881e5eb18b4bd978a01b3ffc3b06c04d222e0c23 Mon Sep 17 00:00:00 2001 From: Lourival Vieira Neto Date: Thu, 26 Nov 2026 21:51:03 -0300 Subject: [PATCH] workflows: the three roles run on their agent definitions implement.js names lunatik-groomer for the groomer, lunatik-implementer for the implementer and the fix, and lunatik-reviewer for the verifier, and review.js names lunatik-reviewer for its reviewer, each on the model and at the effort it took before, as D176 B on luainkernel/harness#6 settled. They ran as the built-in workflow agent, whose first request carries 94 KB of tool definitions, the 21 KB skill listing and the list of deferred tools; a defined one's carries 31 KB of tools and neither list, over the same AGENTS.md files and CLAUDE.local.md. The definitions list no Skill tool, so the github line of the groomer's and the implementer's prompts names review-pr's skill by its file. Closes luainkernel/harness#40. luainkernel/harness#6, which it does not close. Co-Authored-By: Claude Opus 5.5 --- .agents/skills/implement-issue/SKILL.md | 5 ++++- .agents/skills/implement-issue/implement.js | 12 ++++++------ .agents/skills/review-pr/SKILL.md | 3 ++- .agents/skills/review-pr/review.js | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.agents/skills/implement-issue/SKILL.md b/.agents/skills/implement-issue/SKILL.md index e9f2a4a..1a12d6d 100644 --- a/.agents/skills/implement-issue/SKILL.md +++ b/.agents/skills/implement-issue/SKILL.md @@ -80,7 +80,10 @@ AGENTS.md is the authority; `implement.js` beside this card is the workflow that - Each phase does what the project's AGENTS.md asks of its step, the build, the suite, the kernel readings and the contract: its prompt says so in a clause and restates none of it, since the groomer, the implementer, the fix, the reviewer and the verifier load that file, and the review's build, whose - agent loads no CLAUDE.md, reads it in its worktree. + agent loads no CLAUDE.md, reads it in its worktree. The groomer runs as `lunatik-groomer`, the + implementer and the fix as `lunatik-implementer`, and the reviewer and the verifier as + `lunatik-reviewer`, which `.agents/agents/` defines with the tools their roles use, the Skill tool not + among them, so a prompt names a skill by its file; each project links the three under `.claude/agents/`. - `repo` has no default either: the review is read from it when the implementer is done, and a relative path then resolves against the session's directory, which may be a worktree removed since or one on another branch. #1538's review did not run, its script not found under a worktree the session had removed. diff --git a/.agents/skills/implement-issue/implement.js b/.agents/skills/implement-issue/implement.js index 130a515..6059f44 100644 --- a/.agents/skills/implement-issue/implement.js +++ b/.agents/skills/implement-issue/implement.js @@ -86,8 +86,8 @@ const MACHINE = a.machine ? `THIS MACHINE: ${a.machine}\n` : '' const FIXES = 2 // where gh is absent curl reads GitHub and writes nothing to it, since no guard reads a write through curl const github = a.gh === false - ? 'curl against https://api.github.com with `Authorization: Bearer $GH_TOKEN`, as the review-pr skill spells it, to read only' - : '`gh api`, as the review-pr skill spells it' + ? `curl against https://api.github.com with \`Authorization: Bearer $GH_TOKEN\`, as \`${a.repo}/${H}.agents/skills/review-pr/SKILL.md\` spells it, to read only` + : `\`gh api\`, as \`${a.repo}/${H}.agents/skills/review-pr/SKILL.md\` spells it` const PUSH = a.push === false ? 'Push nothing: the session that launched this workflow pushes the branch.' : 'Push each commit as a command of its own, as you make it.' @@ -439,7 +439,7 @@ const unrun = (impl, build) => build?.skipped ? [] : (impl.examples || []).filte let groomed = null if ((a.agents || {}).groom) { phase('Groom') - groomed = await agent(GROOM, { label: `groom:${a.issue}`, phase: 'Groom', schema: GROOMED, ...role('groom') }) + groomed = await agent(GROOM, { label: `groom:${a.issue}`, phase: 'Groom', agentType: 'lunatik-groomer', schema: GROOMED, ...role('groom') }) if (groomed?.verdict !== 'implement') { log(`#${a.issue} ${groomed ? `groomed: ${groomed.verdict}` : 'not groomed: the groomer died'}; the session reads the result`) return { issue: a.issue, groomed, pr: 0 } @@ -448,7 +448,7 @@ if ((a.agents || {}).groom) { phase('Implement') const implemented = await agent(IMPLEMENT + (groomed ? GROOMING(groomed) : ''), { - label: `implement:${a.issue}`, phase: 'Implement', schema: IMPLEMENTED, ...implementer, + label: `implement:${a.issue}`, phase: 'Implement', agentType: 'lunatik-implementer', schema: IMPLEMENTED, ...implementer, }) let review = null, build = null, pr = 0, complexity = null, head = implemented?.head || implemented?.base @@ -466,7 +466,7 @@ if (implemented?.branch && a.push !== false) { while (review && !passed(build) && fixes.length < FIXES) { phase('Fix') const fix = await agent(FIX({ totals: build?.totals, clean: build?.clean, notes: build?.notes }, head), { - label: `fix:${a.issue}:${fixes.length + 1}`, phase: 'Fix', schema: FIXED, ...fixer, + label: `fix:${a.issue}:${fixes.length + 1}`, phase: 'Fix', agentType: 'lunatik-implementer', schema: FIXED, ...fixer, }) fixes.push(fix) if (!fix) break @@ -521,7 +521,7 @@ let refuted = [] if (findings_left.length) { phase('Verify') const verified = await agent(VERIFY(findings_left, head, implemented.base), { - label: `verify:${a.issue}`, phase: 'Verify', schema: VERIFIED, model: 'opus', effort: 'high', + label: `verify:${a.issue}`, phase: 'Verify', agentType: 'lunatik-reviewer', schema: VERIFIED, model: 'opus', effort: 'high', }) const refutation = index => (verified?.verdicts || []).find(v => v.index === index && v.verdict === 'refuted') refuted = findings_left.flatMap((f, index) => refutation(index) ? [{ ...f, trace: refutation(index).trace }] : []) diff --git a/.agents/skills/review-pr/SKILL.md b/.agents/skills/review-pr/SKILL.md index 41bf58a..3f36926 100644 --- a/.agents/skills/review-pr/SKILL.md +++ b/.agents/skills/review-pr/SKILL.md @@ -98,7 +98,8 @@ card is the workflow that follows them (`Workflow({scriptPath: '.agents/skills/r that can be filed as they stand, its severity and the open issue it belongs to where there is one; `review.js` returns them together, so they are filed from its answer and not copied out of the checkpoint. -- A review is phases, not one agent: a reviewer, then a build. The reviewer reads first what +- A review is phases, not one agent: a reviewer, then a build. The reviewer, the `lunatik-reviewer` + agent, which loads AGENTS.md and has no Skill tool, reads first what `tools/review-packet.sh` gathers, the commits, the files, every check's lines over the change and the diff with each function it touches whole, and answers each check's line; the build runs in the `lunatik-host` agent, which loads no CLAUDE.md, so `args.machine` says how this machine gets root. diff --git a/.agents/skills/review-pr/review.js b/.agents/skills/review-pr/review.js index eff04a9..434ca13 100644 --- a/.agents/skills/review-pr/review.js +++ b/.agents/skills/review-pr/review.js @@ -400,7 +400,7 @@ const BUILD_OUT = { let reviewer = null if (a.reviewer !== false) { phase('Review') - reviewer = await agent(a.reviewed ? REREAD : REVIEW, { label: `review:${a.pr || a.branch}`, phase: 'Review', effort, schema: FINDINGS, ...model }) + reviewer = await agent(a.reviewed ? REREAD : REVIEW, { label: `review:${a.pr || a.branch}`, phase: 'Review', agentType: 'lunatik-reviewer', effort, schema: FINDINGS, ...model }) } // the title and the body the run returns, the ones the reviewer corrected or, in a run of neither phase, the ones