agentleFS
vstorm-covstorm-co/agenticos/.claude/skills/agent-capability/SKILL.md

agent-capability

Skill241 starsChanged 29 days agoApache-2.0View on GitHub

Add or change what an agent can do — a new tool the model can call, a new capability (knowledge, web search, charts, a guardrail, a compaction strategy), a tool rename, or a per-tool approval gate. Use whenever the ask is "give the agent a new tool/function/action", "add a capability", "let the agent do X". There is no @agent.tool and no assistant module in this project; every tool arrives through the capability registry.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Read clock/ for the smallest complete example, knowledge/ for one with a config schema, resources and a scope, web_research/ for a …

    line 51
  2. Very specific:

    A bare raise ModelRetry: Use steer(ctx, ...) from capabilities/_failures.py.

    line 91
  3. Very specific:

    Add the module to load_builtins() in _registry.py.

    line 103
  4. Distinctive:

    Write the README.md. Reasoning goes there, not in the commit message.

    line 104
  5. Very specific:

    Test it — app/agents/ is at 100% and CI fails below it.

    line 105
  6. Very specific:

    If the capability needs a credential, declare it as a SecretRequirement *kind*, never an instance.

    line 111
  7. Very specific:

    Update docs/reference/capabilities.md — it is the human-readable catalog and it is a snapshot of the registry.

    line 113

≈ “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

Capabilities — the only way a tool reaches a model

Read docs/howto/add-capability.md first. It is the walkthrough and it is current. This file is the decision layer around it: what shape the work should take, and the traps that are silent.

An agent here is data. There is no module with an Agent object to decorate — @agent.tool, RunContext[Deps] and app/agents/assistant.py do not exist. An agent is assembled per run from the capabilities its spec names, so a new tool is always part of a capability.

Pick the shape first

The askDo this
A tool that belongs to a decision somebody already makesAdd it to that capability's _toolset.py and its tools= tuple
A genuinely new switch an agent author would wantNew capability package
Behaviour change, not a tool (reasoning, a guard, injected context)New capability with tools=() — see clock/, thinking/
A third-party SaaS that already publishes an MCP serverNo code. See the mcp-connections skill and docs/mcp.md
Same tool, different wording for one agentNot code either — tool_overrides in that agent's spec

That last row catches a lot of requests. A tool's name and description are prompt, and an agent needing different behaviour from the same tool usually needs them reworded per agent, not a second tool written.

Layout, which a test enforces

backend/app/agents/capabilities/<name>/
  __init__.py       @register(...) — and nowhere else
  _capability.py    the AbstractCapability subclass
  _toolset.py       the tools, and the text the model reads
  README.md         why this exists and what it deliberately does not do

tests/test_capability_layout.py enforces all four. @register in a submodule only fires if something imports that module, which is how a capability vanishes from the Builder with every test still green.

A capability whose tools come from a library has no _toolset.py — skills and sandbox are both in the test's EXTERNAL_TOOLSET set. The tool text is still this repository's: declare it once in _capability.py and hand the same descriptions to the library, so the catalog and the model read the same sentence rather than two copies drifting in two repositories.

Read clock/ for the smallest complete example, knowledge/ for one with a config schema, resources and a scope, web_research/ for a conditional secret requirement, sandbox/ for per-tool approval and a resource the runner resolves.

When one flag cannot describe the whole capability

side_effecting on @register is the capability's answer, and CapabilityToolInfo.side_effecting overrides it per tool. Use the per-tool form when a capability genuinely both reads and writes: marking the whole of sandbox side-effecting makes an agent ask permission to list a directory, and not marking it lets a write run unattended. An author would then hand-write a tool_approval override per tool in every spec, and the one they forget is the dangerous one.

None — the default — defers to the capability, so every capability that declares nothing behaves exactly as it did. A binding's tool_approval still beats both: that is the operator's decision, and it wins over the code's.

The three things that fail silently

1. A tool missing from tools=. It still runs. It just cannot be approved, cannot be renamed per agent, and does not appear in the Builder. The dangerous half is that an author adds a side-effecting tool, forgets to declare it, and it runs unattended forever. tests/test_capability_registry.py is the drift test that catches this — it builds every registered capability and compares the declared list against the tools the model is actually offered.

2. A module missing from load_builtins(). The capability does not exist as far as the Builder is concerned. Registration is an import, not a scan.

3. A changed id. Ids are in every published spec and in clients' git repositories. Rename the class freely; never re-id.

What the tool says, and what it says when the call was wrong

Both are prompt, and both have a house shape - references/tool-text-and-failures.md has it, with the worked examples. The two things that keep being missed:

  • A docstring with no Returns:. The model cannot infer the shape of the answer, that a list stopped at 100 entries, or that a failure still carries output. Every tool here now says so; a new one that does not is the odd one out.
  • A bare raise ModelRetry. Use steer(ctx, ...) from capabilities/_failures.py. A retry past a tool's budget - one attempt, by default - does not fail the call, it ends the run with UnexpectedModelBehavior, so the same malformed chart sent twice takes the conversation with it. steer returns the message on the last attempt instead. A tool that needs it takes ctx; RunContext never reaches the schema.

And what stays a returned string: a result that is bad news, and a refusal. A retry prompt on a refusal invites the model to look for a way around it.

Then

  • Add the module to load_builtins() in _registry.py.
  • Write the README.md. Reasoning goes there, not in the commit message.
  • Test it — app/agents/** is at 100% and CI fails below it. See the backend-tests skill.
  • Give every config field Field(title=..., description=...) written for the person in the Builder, and add both under capabilityConfig.<id>.<field> in frontend/messages/{en,pl,de}.json — the English entry equal to the schema. TestCapabilitySettingsCopy fails on any of the three missing (#2098).
  • If the capability needs a credential, declare it as a SecretRequirement kind, never an instance. See the vault-secrets skill.
  • Update docs/reference/capabilities.md — it is the human-readable catalog and it is a snapshot of the registry.

Depth

  • references/registry-contract.md — every @register argument, ctx.resources, returning None, scopes, conditional secrets, returning a capability we did not write.
  • references/tool-text-and-failures.md — the four parts of a tool's docstring, and which failures steer the model rather than answering it.
  • references/approval-and-overrides.md — how side_effecting, approval, tool_approval and tool_overrides resolve, and why everything keys on the stable tool id.
  • docs/reference/capabilities.md — what ships today.

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.