agentleFS
theseus-runtheseus-run/theseus/.agents/skills/tool-authoring/SKILL.md

tool-authoring

Skill1 starsChanged 6 months agoMITView on GitHub

Use when creating, modifying, reviewing, or debugging Theseus Tool primitives or concrete tools in packages/theseus-core/src/tool and packages/theseus-tools.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    Use this skill for Tool primitive work and concrete tools.

    line 8
  2. Very specific:

    Run tool.execute, applying tool.retry if present.

    line 24
  3. Very specific:

    Use Tool.defineTool; do not create ad hoc tool objects unless testing a boundary directly.

    line 34
  4. Very specific:

    Use Effect Schema for input, output, and failure.

    line 35
  5. Very specific:

    Use Tool.Defaults.NoFailure only when the tool has no declared domain failure.

    line 36
  6. Distinctive:

    Keep tool names stable and LLM-callable.

    line 37
  7. Distinctive:

    Keep descriptions operational: what the tool does, not implementation trivia.

    line 38
  8. Distinctive:

    If a tool touches the filesystem, shell, network, or process state, model that risk in policy and failure shape.

    line 40
  9. Distinctive:

    Prefer small concrete tools over a generic "do anything" tool.

    line 41
  10. Very specific:

    Run the package-local test when changing packages/theseus-tools: bun test src/ from that package or root bun run test when impact crosses …

    line 45
  11. Very specific:

    Run root bun run typecheck when signatures, schemas, exports, or Effect environments change.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Tool Authoring

Use this skill for Tool primitive work and concrete tools.

Read First

  • packages/theseus-core/src/Tool.ts
  • packages/theseus-core/src/tool/index.ts
  • packages/theseus-core/src/tool/run.ts
  • For concrete tools: the relevant file in packages/theseus-tools/src/

Contract

A tool is typed world access for the model. It declares input, output, known failure, execution, presentation, and interaction policy.

Preserve this pipeline:

  1. Decode raw model args with tool.input.
  2. Run tool.execute, applying tool.retry if present.
  3. Validate success output with tool.output.
  4. Validate known failure with tool.failure.
  5. Present success or known failure as Presentation.
  6. Convert defects into ToolDefect.

Known failures are tool-result content for the model, not runtime exceptions. Runtime errors are decode, output-shape, failure-shape, and defect errors.

Authoring Rules

  • Use Tool.defineTool; do not create ad hoc tool objects unless testing a boundary directly.
  • Use Effect Schema for input, output, and failure.
  • Use Tool.Defaults.NoFailure only when the tool has no declared domain failure.
  • Keep tool names stable and LLM-callable.
  • Keep descriptions operational: what the tool does, not implementation trivia.
  • Set policy.interaction intentionally. Do not default write-like behavior to observe/read semantics.
  • If a tool touches the filesystem, shell, network, or process state, model that risk in policy and failure shape.
  • Prefer small concrete tools over a generic "do anything" tool.

Verification

  • Run the package-local test when changing packages/theseus-tools: bun test src/ from that package or root bun run test when impact crosses packages.
  • Run root bun run typecheck when signatures, schemas, exports, or Effect environments change.

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.