agentleFS
dragoscvdragoscv/axiom/.github/skills/add-mcp-tool/SKILL.md

add-mcp-tool

Skill0 starsChanged 54 days agoMITView on GitHub

Add or change a tool on the @codai/axiom-mcp stdio server — Zod input/output schemas, annotations, handler that never throws, registry mirror in spec/tools.json + README + docs/reference/mcp-tools.md, smoke test, changeset. Use when a user wants agents to be able to call a new AXIOM capability over MCP or a new CLI verb.

  • Reads credentials

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every tool is one entry in the registry (packages/mcp/src/tools.ts or packages/mcp/src/tools/<name>.ts) with annotations + outputSchema, …

    line 8

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add an MCP tool

Every tool is one entry in the registry (packages/mcp/src/tools.ts or packages/mcp/src/tools/<name>.ts) with annotations + outputSchema, and is mirrored by hand into three documents. scripts/check-tool-parity.mjs fails CI when any of the four disagree; .copilot-ripple.json reminds you while editing.

Steps

  1. Name it axiom_<noun>_<verb> (snake_case, e.g. axiom_manifest_diff). Decide risk: reads → readOnlyHint: true; anything that writes a root → destructiveHint: true, idempotentHint as appropriate, openWorldHint: false.
  2. Schemas — input and output as Zod built from @codai/axiom-schema types (import the schema, don't redefine Plan/ManifestBundle). Output must be small: digests, counts, paths, ERR_* codes. Bulk data goes behind an axiom://… resource.
  3. Handler — parse input with the Zod schema; on failure return a structured error { code: "ERR_INVALID_INPUT", details }. Resolve every path through the roots allowlist (--root), never process.cwd(). Call into @codai/axiom-plan / -checks / -apply; map AxiomError → { code, message, details }. Never throw out of the handler; log with console.error only.
  4. Register the tool in the registry array; the server iterates it for tools/list. If a CLI verb should exist too, add it in packages/mcp/src/cli.ts (the only file allowed to use stdout / process.env).
  5. Mirror (all three, same commit):
    • packages/mcp/spec/tools.json — { name, riskClass, description } (this is what codai registers; apply-class = SENSITIVE, reads = READ).
    • packages/mcp/README.md — tool table row.
    • docs/reference/mcp-tools.md — tool table row (name, risk, purpose, input, output).
  6. Tests — extend the in-process smoke in packages/mcp/src/*.test.ts: tools/list includes the name with annotations + outputSchema; a malformed input returns an ERR_* code; one happy path against a tmp root. Do not spawn dist/cli.js in unit tests.
  7. Budgets — after pnpm --filter @codai/axiom-mcp build, run node scripts/run-guards.mjs bundle cold --strict: bin ≤ 950 KB, cold start p50 ≤ 250 ms. A new heavy dependency that breaks this needs a lazy import().
  8. Changeset — pnpm changeset → @codai/axiom-mcp minor.
  9. Verify — pnpm exec biome check packages/mcp, pnpm --filter @codai/axiom-mcp test, node scripts/run-guards.mjs tool-parity no-stdout no-shell — paste output.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.