Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Authoring?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/antoinedc-authoring)
---
name: authoring
description: The shape of a good agent, the admission table, routing, pruning, and the agent_propose fields.
---
# Writing an agent
## Admission (before writing anything)
Mark every candidate rule:
- **General** — supported by good evidence across contexts.
- **Scoped** — true only in a named situation; write it with its condition ("When X, do Y").
- **Excluded** — weak, single-source or contradicted.
A Scoped rule whose situation is "in the project this request came from" goes into the project brief (below), not the instructions.
Write only General and Scoped rules. Put every candidate in the admission table you pass to `agent_propose`, with a
one-line why, so the user sees what you left out.
## Shape of the agent file
What the file is made of; how to write it well is for your research to decide.
- **Frontmatter:** `name` (≤ 40), `description` (one line, what it does, ≤ 200), `use_when` and `not_for` (≤ 200
each), `isolation` (`worktree` = works on its own branch and can edit files, the default; `none` = read-only). Leave `model` empty unless the
charter names one.
- **Body:** the agent's instructions, without frontmatter. Never write a model name in the instructions or in a skill you write:
an agent is dispatched on its own model setting, and whoever dispatches it may pick another.
- **No research section.** Manta adds the generic research-library guidance to every
agent's task prompt; don't write a research section into the file.
- **Isolation:** agents work on their own branch and can edit files by default (`worktree`), so they can deliver
finished work such as mockups, docs, specs and code. Use `none` (read-only) only when the job is purely advisory and
the user asked for that; a hard limit is better as isolation than as prose.
## Any project, and the project brief
An agent's instructions and skills are written for any project. They hold no product name, repo path, price or offer, confidentiality
rule that is only about one project, or teammate that doesn't exist yet; routing lines name only agents in the roster or created in
this task. Method goes into the instructions or skills; the facts of the project the request came from go into `draft.brief`.
- `draft.brief` is text (1 to 4,000 characters) on a create or an update; an update may carry nothing else. It is that agent's brief for
the project this task was started in, written as the agent will read it ("Your brief for this project"): what the product is, where its
files and sources of truth are, project-only rules, what to avoid there. When one fact the agent works with (a price, a claim, a
limit) is stated in several places in the project, the brief lists every place, so a change reaches all of them. You never name the project: the server uses the task's own,
and refuses a brief when the task isn't in a project (then leave it out).
- The brief is part of the change: applied, held, shown on the card (beside the old brief when one exists, which the user may have
written) and undone with it. Trial cases that run in that project (`project` on the case) are given it. The trial must run with the
brief you propose; change it and you run the trial again.
- Exception: a role that makes no sense outside one project is written for that project; say so in the problem's `why`. Rare.
- **The brief's items are requirements for that project.** The draft must not drop something the brief lists (a signal to use, a
source, a rule) on its own judgement; when you think one doesn't belong, leave it in and say so in the summary. Trial cases check the
brief's key items were used.
- **Confidential material.** When the project has confidential material (a client, a deal, private files), the brief states that the
rule covers files and messages to the user, not only files, and one trial case checks it: a task whose natural answer would name it.
## Instructions budget
The always-loaded instructions (the body, without frontmatter) stay within 6,000 characters. The live agents that did well in the
comparison runs use from 5,512 to 6,725 characters; drafts 20–60% longer investigated less deeply and were no better. Put method depth
(step-by-step procedure, checklists, templates, how experts check their work) in skills the agent reads when it needs them, and keep
in the instructions what it needs on every task: the job, the order of work, what it must never do, when it hands work back, what a
finished deliverable contains. A draft over budget says why in the problem's `why`. Remove or merge redundant wording before adding.
## Agents that need outside facts
An agent whose work depends on facts that change (prices, versions, rules, a competitor, the state of a field) uses the research
tools and names them in its instructions: `research_library_find` first, `research_search` to look, `research_fetch` to read the page
it relies on. It says when to use them (before relying on a number, a version or a claim it can't check in the project) and what to do when they find
nothing. Naming them is what makes agents use them: a draft that only says "research it" doesn't. A trial case for such an agent
checks they were used.
## Skills
An agent's `skills/<name>/` folder holds method files it reads when it needs them.
- **Files:** `SKILL.md` with frontmatter `name` (the folder name, 1–50 lowercase letters, digits and dashes) and `description`,
plus up to 20 text files in all (paths are relative, up to 4 folders deep, compared without regard to case). A skill is at most
256 KiB, an agent's skills at most 1 MiB, and an agent has at most 15 skills. The `description` is at most 300 characters. The
Architect's own and Manta's own skills ship with Manta: a draft that changes them is refused.
- **Draft:** `draft.skills` is a list of `{name, op, files?, provenance?, installed?}`. `op` is `add`, `replace` (the skill's whole folder is
swapped for the files you send) or `remove` (no files). Each file is `{path, content, origin, sourceId?}`; `origin` is `copied`
(text unchanged from a page you fetched, with that page's `sourceId`; at least 20 characters, never from a private source) or
`written` (yours). `SOURCE.md` and `LICENSE` are written by the server; don't send them. A copied file must be a contiguous piece
of its page: only line endings and trailing spaces may differ, never newlines or indentation, so a shell line stays the line it
was. All copied files of one skill come from the provenance page or from other pages of the same GitHub repository. A written
file that holds a passage of 400 or more characters found verbatim in a page you fetched is refused: label it copied, with provenance.
- **A skill installed on this box** (listed by `skills_installed`) is taken by reference, with no file text from you:
`{name, op, installed: {skill, taken, take?}}`. `skill` is its name or folder as listed (pass the folder when two share a name);
`taken` is `whole` (every file; the usual choice, scripts included) or `part` (SKILL.md plus the paths in `take`, files or folders
such as `["reference"]`) only to leave out files that are irrelevant to the job. The server copies the files and writes `SOURCE.md` from the folder itself
(its licence is read from its SKILL.md frontmatter, its own `SOURCE.md` or its licence file, and must be one of the allowed ones
below). It takes no `files` and no `provenance`; the skill's own frontmatter name is the `name`. The 20-file and 256 KiB limits
don't apply (you type nothing), the agent's 250 files and 1 MiB do; links, non-text files and paths the rules above refuse
are named in the refusal, and a hidden file is left out. Scripts that come along are read by the independent script review like any other; that review, not you, decides whether they are safe.
- **Provenance** (needed when any file is copied): `{url, sourceId, repo, ref, licence, taken, licenseSourceId?, registry?}` —
`url` is the address of the page `sourceId` was fetched from and must be a github.com (or raw.githubusercontent.com) page of the
repository; `repo` is `owner/repo` and `ref` the commit (40 hex characters) or tag, and both must agree with the address (the
server reads them from it, and a `/blob/<ref>/` in the address is the ref); `taken` is `whole` or `part`, `registry` the installs
/ stars you saw, if any.
- **Licences you may copy under:** MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, Unlicense, CC0-1.0, CC-BY-4.0,
MPL-2.0 (the SPDX id). Any other, unknown or missing licence can't be copied: write your own and cite what you learned as
research. Every one of them except 0BSD, Unlicense and CC0-1.0 needs `licenseSourceId`, the source id of the fetched licence file:
a page of the same repository that holds that licence's own text. For those three, a licence file isn't needed, but the licence must
be stated on a fetched page of the repository (the provenance page, or a licence file you pass as `licenseSourceId`).
- **`skillSearch`** goes with an added skill: `{queries: [{source, query}], candidates: [{ref, installs, stars, licence, verdict,
why}]}`. Each query must be one you ran with `research_search` in this task; each candidate `ref` (`owner/repo@skill`,
`owner/repo`, an address, or an installed skill's name) must have appeared in a result or in `skills_installed`; `verdict` is
`used-whole`, `used-part` or `rejected`.
- A skill change needs a trial like any change to the agent: the skill files are part of the draft that runs.
- A skill with a script (`.sh`, `.py`, `.js`, `.mjs`, `.ts`, `.rb`, `.pl`, `.ps1`, `.bat`, `.cmd`, or a file starting with `#!`), copied or
written, is read first by an independent check: another model, no tools, seeing only the scripts, the SKILL.md, the origin and the agent's
name and description (never your transcript or the pages you read). A clean verdict lets the change follow the user's setting; a flagged
one, or a check that couldn't run, waits for the user's click. A skill of text only is not checked.
## Routing
`use_when` decides whether Manta hands work to this agent; `not_for` sends near-misses elsewhere. Write both the way
your research says routing works best, and check them against the roster in your brief.
## Improving an existing agent
The roster in your brief gives the agent's identity and its hash, not its text: the hash in the brief is what you pass as `baseHash`, and read the
files (instructions, skills, brief for this task's project and learned preferences with their `lr_<id>`) with `agent_read`. Fold a learned
preference into the instructions with `replaces: "lr_<id>"` in its admission item. For a small change the user dictates to a named agent (not a
rebuild), read it with `agent_read` first: a simple edit needs no blind draft.
The live agent is evidence of what works, not a draft to patch and not something to ignore. The order is: craft research, your first
draft, `agent_read`, then compare:
1. Do the craft research and write your first draft without it, so the draft isn't anchored on the live text.
2. Read the live agent with `agent_read` after the craft research and your first draft: its instructions, skills and brief (and its learned
preferences).
3. List what the live agent does that your draft doesn't: habits, checks, deliverables (templates, change logs, set-ups for recurring
runs), things it caught in trials or failures. Keep each unless your research says it's wrong; if you drop one, say why in the
admission table. A replacement must not lose something the live agent does well without saying why.
4. Trial the live agent unchanged on the same cases in the same project as the draft, and report the comparison in your result:
which does better on each case, what the live one does that the draft doesn't, and what you merged.
## Trials
A trial is evidence only when it is stable. Every case runs twice and passes only if both runs pass; a pass on one run and a fail on
the other is a fail (the instruction is unreliable), so fix the draft rather than re-run until it passes. Choose 1 to 3 cases that
cover, in this order of priority:
- **Routing.** When the routing line's `not_for` is easy to get wrong (a neighbour's work, a near-miss request), always include a
declines or hand-back case for it: the task is the near-miss, and the check is that the agent stops and says who should do it.
- **The brief.** A case in the project, checking its key items were used, not only that a deliverable appeared.
- **Research tools.** For an agent that needs outside facts, a case that can't be done right without them: check they were used.
- **Confidentiality.** When the brief has confidential material, the case from "Confidential material" above.
- **Depth.** A real task in the project where the problem behind the request matters; check the agent opened the real code, data
or page and verified before claiming.
Judge a case from the transcript (`agent_trial_read`), not from the agent's own summary.
## `agent_propose` fields
- `action`: "create" or "update"; `agent` and `baseHash` (the hash in the roster) for an update.
- `draft`: the fields you change (for create: name, description, isolation, instructions, and the routing lines), `skills` and `brief`.
Instructions are the body only, without frontmatter. A draft may change only its skills.
- `summary` (≤ 600): what this changes and why, in plain words for the user.
- `evidence` (1–12): `{sourceId, quote, claim}` — the quote copied exactly from the fetched text.
- `admission` (≤ 40): `{rule, verdict, why}` for every candidate, including excluded ones. On an update, an item may add
`replaces` (10–600 characters of the current instructions that this rule replaces: they must be in the current
instructions and gone from the new ones) or `revises` (the same, for a rule that is reworded: it must be in the current
instructions; it may stay in some form). One of the two at most. A quote that isn't in the current instructions is refused.
- `problem`: `{userWords, statement, shapes, chosen, why}` — `userWords` (10–600) is copied exactly from the request any round
of your task was given; `statement` (≤ 300) is the problem; `shapes` are the 2–5 shapes you listed, each `{shape,
wouldBuild}` (1–5 in a refresh or check-up round); `chosen` is the index of the one you picked; `why` (≤ 600). Refused
when the words aren't in the request.
- `trial`: `{trialId, verdicts}` — required for a new agent and for an update of instructions, skills, isolation or model. It is the
trial you ran on exactly this draft (`agent_trial`), with one verdict `{case, pass, quote, note}` per run: every case runs twice, and each run
is a case of its own named `<case name> (run 1)` and `<case name> (run 2)` (`case` in the verdict is that exact name; `agent_trial_read`
takes it too). `quote` is 20–300 characters copied exactly from what the agent did in that run, its messages or tool calls in the
transcript, never the task text. Refused when the trial belongs to another task, ran on a different draft (the refusal names the files),
has a run that didn't finish, lacks a verdict or has one that isn't a pass ("Case <name> failed: fix the draft and run a trial again").
- `fitCheck`: `{researchSays, matches, why, basis}` — your fit check, also the first block of your result: what your research says
about this kind of request, whether the request matches it (`matches`, true or false), and why. A proposal with no fit
check is refused. When `matches` is false, ask the user with the question tool first; the proposal is refused until you have.
`basis` lists the library entries the fit check rests on (entry ids or exact topics, 1–10), at least one per topic you
researched for this request. Each must exist, be fresh and rest on at least 3 independent sources; a missing, stale or
thin entry refuses the proposal, naming it. Research more and save it again with `keep`; if you still can't reach the
bar, ask the user and say you couldn't establish it, and the thin entry is then allowed (the card shows the evidence was thin).
## Core and periphery
Sort every admitted rule by how central it is to the agent's job, and write only the core into the agent.
- **Core:** how a strong practitioner does this job well and efficiently, for someone who usually starts small: the method,
its steps and checks, what a good deliverable contains, and the hard limits that protect the user (never send, publish or
spend on their behalf; never invent facts). This is the agent's instructions and skills.
- **Periphery:** concerns around the job that matter only in some situations: laws and regulations of particular countries,
compliance regimes, operating at scale, infrastructure, rare technical cases. Don't build them into the method. Keep at most
one line telling the agent when to flag such a concern to the user, and list each in your result under "Also worth
considering" (one line, why it might matter), so the user decides whether the agent should cover it.
- **Core includes:**
- **A method per deliverable.** For each deliverable the job names (a plan, a spec, a review, a page), the agent's instructions
or a skill say how to build it: its sections, their order, and what evidence each part needs. A rule list without that method
leaves the main output to chance.
- **Re-checking other agents' work.** When the agent receives another agent's work (a report, a branch, a spec), it treats what that
work says about itself ("tests pass", "done", "verified") as claims and re-checks the ones it relies on before building on them.
Library: "Writing agents that receive other agents' work and own named deliverables: verify inputs, give each deliverable a method".
- **Why:** prioritisation practice keeps the minimum that makes the work succeed and drops the rest first (MoSCoW; Shape Up
"declare out of bounds", "cut back"), and models do worse as their input grows, most of all with related material that
doesn't answer the task (Chroma context-rot report). Library: "Core versus peripheral knowledge when writing an agent".