agentleFS
rgoerwitrgoerwit/ai-investment-agent/.claude/skills/add-agent/SKILL.md

add-agent

Skill71 starsChanged 36 days agoMITView on GitHub

Add a new agent or LLM seat to the graph. Covers the prompt file, seat registry, node factory, graph wiring, ticker-isolated memory, and the tests that must accompany it.

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    setup

    Set up Vercel CLI and project configuration. Use when the user says "set up Vercel", "configure Vercel", "link to Vercel", or "vercel init".

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Create prompts/<agent_key>.json with agent_key, agent_name, version, category, requires_tools, system_message, and a metadata block …

    line 18
  2. Very specific:

    Add a SeatId and SeatSpec in src/llm_runtime/seats.py.

    line 25
  3. Very specific:

    Add the factory in the owning module under src/agents/, following the sibling patterns.

    line 49
  4. Distinctive:

    If the node runs in parallel with others, three things are mandatory: give it its own state field rather than sharing one under a …

    line 53
  5. Distinctive:

    If the agent needs memory, add its instance through the ticker-isolated factory so it gets its own per-ticker collection.

    line 72
  6. Very specific:

    Add tests/agents/test_<agent>.py, and extend the legacy-parity test if the seat has a legacy construction path.

    line 78

“Common” is measured: kept by at least 6 in 10 of the 7 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

Adding an agent

Six steps, in order. Each one is load-bearing; skipping the seat registry in particular produces an agent that constructs but is never dispatched, and that failure is silent.

1. Prompt

Create prompts/<agent_key>.json with agent_key, agent_name, version, category, requires_tools, system_message, and a metadata block carrying last_updated and a changes line. Edit it only through Python's json module — the prompt-contract rule loads automatically when you touch that directory.

2. Seat

Add a SeatId and SeatSpec in src/llm_runtime/seats.py. Three keys must line up with name spaces that already exist; do not invent a second one:

  • prompt_key matches the JSON filename
  • budget_key matches an AGENT_OUTPUT_BUDGET_FRACTIONS entry
  • callback_name matches the token-tracking display name

Choose the binding group deliberately. A verification seat belongs in review, where vendor diversity is the point; an analysis input belongs in base. Declare requires honestly — capability validation is what catches a chat-only model bound to a tool-calling seat, before the run rather than during it.

Per-seat call semantics — temperature, client timeout, tier pins — are SeatExecutionPolicy data, never an if seat == ... at a call site. Putting a pin at the call site means only that caller gets it.

Choose the seat's TimeoutClass from src/llm_runtime/timeouts.py. The runtime owns total application attempts; transports configure one SDK attempt per dispatch. Do not add a per-seat retry setting or a construction-time flex deadline. Google's aiohttp connection recovery may resend internally; verify effective sends and application retry/rate-limit branch counts rather than model fields alone.

3. Node factory

Add the factory in the owning module under src/agents/, following the sibling patterns. Construct the model with build_model_for_seat(SeatId.NEW_AGENT, ...) — never a provider constructor directly. An architecture test enforces that boundary.

If the node runs in parallel with others, three things are mandatory: give it its own state field rather than sharing one under a last-write-wins reducer, tag its outgoing messages with the agent key, and filter incoming messages to its own history. Remember the retry path — tagging applied only to the main response is a recurring bug here.

Bound every artifact write with cap_state_value, and every blocking call with the repository's hard-timeout wrapper.

4. Graph

Register the node in src/graph/ with its routing and tool-node wiring. Every gate that decides whether a seat runs must read the binding plan, not a legacy credential. A gate keyed on a provider key that a newer configuration legitimately does not set will wire the node and never dispatch to it, raising nothing; the only evidence is a NOT_RUN status in the saved artifact.

5. Memory

If the agent needs memory, add its instance through the ticker-isolated factory so it gets its own per-ticker collection. Never reach for a global memory object — that is what lets one company's data contaminate another's analysis.

6. Tests

Add tests/agents/test_<agent>.py, and extend the legacy-parity test if the seat has a legacy construction path. Cover the edge cases this system actually hits: missing data, a refused or empty provider response, malformed output, and the timeout path.

Then run the owning directory, make test-prompts, and poetry run ruff check src/.

Full history: docs/AGENT_ROSTER.md.

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.