/collet:task-harnessfrom collet
Mounts the collet harness into a project — the task ledger, the rules block in AGENTS.md/CLAUDE.md/.cursor/rules, and the checks directory — or reports on a project that already has one. Use when asked to set up a harness, guardrails, scope enforcement or session continuity for a repository, to adopt collet, or to see what the current task is, what it may touch, and what a session is not allowed to touch. ONLY on an explicit request, never from ordinary project work, from a new or empty repository, or from "set up this project". Not for writing a new check, which the check-writer skill does.
Ships in collet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The whole design is one sentence: prose is read, a hook is executed, and a check that has never been shown to fire is not a check. Everything below follows from that.
Read the plugin's README.md — two directories up — for what ends up in the project. This file is how to mount it,
and the mounting itself is a command — mount.mjs, in the plugin's scripts folder — because the part that must be
identical every time has no business being a list of instructions someone follows by hand.
Copy this checklist into your reply and tick it as you go:
ROADMAP.jsonl, .foreman/)mount.mjs run, written and kept paths shown.collet/config.json filled intask.mjs status and checks/run.mjs run, results reportedAsk. Do not infer. Read the repository first — its README, its test command, its decisions docs, its git log — so the questions you ask are only the ones the repository cannot answer:
Every answer comes from this project's own files or from the person. Never read outside the
project root to find one, sibling projects included: another project's .collet/config.json
describes that project, not this one.
For question four, offer the bundle for the languages the project uses: JavaScript/TypeScript,
Python, Go, Rust, JVM or .NET. From the corresponding catalogue/<id>.json in the plugin root, extract only title,
example and gapNotes for this conversation; the fixture bodies belong to the runner.
Show one short example per mistake and one plain limit drawn from its gapNotes. Keep
the internal ids out of the conversation. The choices are the whole bundle or none for now;
another mistake can be added later with check-writer.
The bundle is optional. Include it when the person asks for it or accepts that choice; do not ask again when their request already covers it. These are source-pattern checks; they do not install compilers, linters or language runtimes. Do not offer coverage for languages outside that list.
For question five, look in the project's README, contributing guide, decisions docs and lint and
format configuration, and ask when they state none. A project can have no conventions to record:
with no answer, leave the conventions list in .collet/config.json empty rather than borrow one.
Then derive the task's scope by reading the code the task touches. Not from the task's title.
This is the one mistake worth spending time on: a scope one file too narrow does not merely block
work, it pushes the session to work around the constraint, and a scope one file too wide never
fires at all. Open the modules the task names, follow what they import, and list what genuinely
has to change. For JavaScript/TypeScript, task.mjs add follows relative imports one level deep,
stops after 12 added files and prints what it added. Other languages need that scope derived and
listed explicitly; a language bundle does not add import analysis for its language.
The accept command is a decision, not a formality. If you cannot name a command that can tell
you the task worked, the task is not defined yet — say so instead of inventing one. echo ok is
not an accept command.
Look for a ROADMAP.jsonl at the project root or a .foreman/ directory. If either is there,
a planning tool owns the plan and collet enforces the session boundary. Mount as usual.
The planning tool decides what work comes next, which files an entry expects to touch and when
the entry is done. collet decides what the open session may write and which command finishes the
task. Derive the collet task's scope from the code, as above; never copy it from the roadmap
entry's planned_touches, which is that tool's forecast and is never enforced. When the session
works a Foreman entry, pass its id with --foreman <id> on task.mjs add: the id is recorded on
the task and shown by status, and it changes nothing about the scope. When the entry's handoff
names a verification command, it can be the task's --accept. When a task with that id closes
with its checks passing, close prints a Foreman update-status step that marks the entry
awaiting_acceptance. Commit the work, replace <commit sha> with the new commit's sha and
<Foreman plugin root> with Foreman's plugin root, and run the step; collet does not run it. A
failing close, or a task without the id, prints no step. For a task with that id, what
nobody checked belongs in the entry's unverified: note lines: a passing close prints the
--unverified and --left-out texts for the entry's notes and adds neither to
.collet/unverified.md; the task ledger keeps both. While such a task is open, the session start
and the compaction note still name .collet/unverified.md when earlier tasks left claims there. A task without the id appends both texts to
.collet/unverified.md. Do not edit
ROADMAP.jsonl or .foreman/ from this skill; the scope check never refuses the planning tool's
own writes to them.
node "<plugin root>/scripts/mount.mjs" <project-directory> --accept "<the command that proves a task worked>"
<plugin root> is ${CLAUDE_PLUGIN_ROOT} on Claude Code. On Codex and Antigravity, resolve
../../ from this SKILL.md.
On Antigravity, give every command the project root the person named as its working directory, the
Cwd of run_command. Without it, commands can run in Antigravity's own scratch directory instead
of the project. When the person named no project root, ask for it before running anything.
When the person chose the checks, append --checks. Root marker files select every matching
language, including project/solution filename patterns for .NET. Read those markers and the
source so the selected set is part of the person's choice. For packages below the root or a
deliberate subset, repeat --edition <id> for each requested language; this replaces automatic
selection. The ids are javascript-typescript, python, go, rust, jvm and dotnet.
--edition requires --checks. With no supported bundle detected, --checks refuses before
writing anything; explain that result and do not silently fall back to mounting without checks.
type-widened-to-any is opt-in: add --with javascript-typescript.type-widened-to-any when the
person wants it.
Pass the answer to question three as --ask-first <thing>, once per thing, for example
--ask-first deploy --ask-first "publish a release". The mount stores the list as ask_first in
.collet/config.json, and the rules block and the session start state it as a fact about the
project, with a line that every other step goes ahead until the accept command exits zero, or
until a missing input or a broken environment means it cannot pass as the task stands, which ends
the work as a blocker named in the summary. With no answer, pass nothing: the config and the rules
block stay exactly as they were.
On Claude Code, when the person gave that list, offer host ask rules for it, so the host records
their approval instead of the session claiming it. For each thing with a clear command, propose two
rules in Claude Code's permission syntax, one per shell tool, such as Bash(npm publish *) and
PowerShell(npm publish *) for publishing to npm, or Bash(git push *) and
PowerShell(git push *) for pushing. Say that a rule guards only the shell tool it names: the
project's settings are shared by contributors whose Claude Code may run commands through either
tool, so offer both rather than guessing. A thing with no clear command pattern, such as "publish
a release", gets no rule: say so and do not guess one. Show every proposed rule, and before the
person confirms, say that a headless or automated run cannot answer an ask prompt and stops at
that command. Pass only the rules they confirm, once each as --ask-rule "<rule>". The mount adds
them to permissions.ask in the project's .claude/settings.json, creating the file when it is
missing and keeping every other key and rule. With no list or no yes, pass none and nothing is
written there. Never write the person's user settings, .claude/settings.local.json or any Codex
or Antigravity configuration, and make no such offer on those hosts.
It prints every path it wrote and every path it kept. A re-run refreshes collet's own scripts —
task.mjs, state.mjs, the check runner and the built-in scope check with its examples — and keeps the project's config.json,
unverified.md, generated bundle checks and their examples. It refreshes .collet/source.mjs
while that file still holds what collet wrote; a copy with edits of its own is kept, and the mount
prints that this version's fixes to it were not applied and that removing it and mounting again
takes them. After a refresh it proves the checks against their examples. Preserved checks keep
their own revision; newly shipped patterns and examples are not automatically applied to them.
A missing module or missing kind of example refuses the mount before writes; valid older pairs
and custom fixture suffixes are preserved and rechecked. The rules block goes
between its own markers, so a re-run replaces the block and leaves everything around it exactly
as it was. An existing AGENTS.md or CLAUDE.md keeps its text.
The block always goes into AGENTS.md. It goes into CLAUDE.md only when the project already has
one that does not import AGENTS.md, and into .cursor/rules/collet.md only when .cursor/
exists. A CLAUDE.md that imports AGENTS.md already loads the block from there, so it gets no
copy; one an earlier mount left there is emptied to its markers. Do not create a CLAUDE.md to
receive it. Claude Code reads AGENTS.md only while no CLAUDE.md exists, so a new one holding
just the block would hide the project's own instructions from that host.
Then fill in .collet/config.json — the one-line description of the project and the conventions a
change here has to respect. A task cannot be opened while the project line or the accept command
still holds its placeholder, because a session is told that file before it reads anything and
REPLACE ME is not a fact. Conventions are optional: an empty list is valid, and a leftover
convention placeholder is dropped rather than stated.
Then open the first task:
node .collet/task.mjs add --title "..." --why "..." --scope "src/cli.mjs,test/**"
Then prove the harness works before saying it does:
node .collet/task.mjs status
node .collet/checks/run.mjs
The second one runs each check against its own violation and near-miss fixtures. Mounting with
--checks also runs this proof before reporting success. Report the actual number of bundle
checks that caught their planted mistake and left their look-alike alone, separately from scope.
If any fail, name them in plain words and say that setup did not pass. A failed check already in
the mounted project is recorded in .collet/checks/discarded.json; that file does not disable
the check, so never claim a failing check has stopped running. A fresh mount without the bundle
adds only scope; report any existing checks separately on a rerun.
Explain the bundle's limits before stopping:
Write, Edit and MultiEdit can be checked while a task is open. Shell writes, Codex patch
text, Antigravity file text and unsupported notebook edits are checked only by the later
working-tree check, when their resulting files match the bundle's paths.node:test
inline options such as { skip: true } and { only: true }. Dynamic/aliased calls, quoted
option keys and complex option objects are not covered. A tiny Edit without the test call's
surrounding context can escape the editor check and is caught by the later full-file check.HEAD and refuses an
increase. It does not locate each newly added mistake; replacing one existing match with
another can leave the count unchanged. Untracked files have no prior matches.--live --strict: unavailable baselines, missing working-tree checks and checks
reported as skipped leave the task open and prevent the accept command from running. Restore
the real prerequisite instead of weakening the check or substituting a quiet pass.Then stop. Do not start executing the task you just created. Show what you wrote, name the
first task, and let the person decide. Say that the mount's files are left uncommitted and that
committing them is the person's call. The first task can close before that commit: closing does not
count .collet/, the rules block between its markers or a planning tool's ROADMAP.jsonl and
.foreman/, while any other change outside the task,
the project's own text in those files included, still keeps it open.
When asked what is going on, answer from the ledger, not from the conversation:
node .collet/task.mjs status
It prints the open task, the files it may touch, the accept command, any widening already recorded,
and the last few writes the guard refused. Say also whether the harness is actually running: a
project with .collet/ and no hooks wired is a project where nobody enforces anything, and that is
worth knowing before trusting it. .collet/off is the kill switch — if it exists, every session
guard is deliberately silent while the committed checks keep running.
Three things, in your own words:
.collet/config.json sets refuse_out_of_scope_writes to true.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
collet@foundry is listed by v-songbird/foundry — review the source before installing
npx claudepluginhub v-songbird/foundry --plugin collet2 skills in this plugin