agent-builder

agent-builder is a skill for Claude Code from RailtownAI/railtracks. It costs 37 tokens per session (2,453 once invoked), scanned A, original, MIT.

A guide to building AI agents, tool-calling workflows, and multi-agent systems with the Railtracks Python framework. An AI agent is a program that uses a language model to decide what to say or which tools to call.

In plain words
What is it for?
It helps create chat agents, agents with structured output, tool-using agents, and workflows that call agents or other nodes.
Why use it?
It explains how Railtracks combines Python functions, tools, output formats, language-model providers, and execution flows. This reduces the setup work needed to turn those parts into an agent.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents.

Good fit It helps create chat agents, agents with structured output, tool-using agents, and workflows that call agents or other nodes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/railtownai/railtracks/agent-builder
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add RailtownAI/railtracks --skill agent-builder
Clone the repo
git clone --depth 1 https://github.com/RailtownAI/railtracks

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/railtownai/railtracks/agent-builder/github.svg)](https://agentmods.dev/skills/railtownai/railtracks/agent-builder)
Your own site
<a href="https://agentmods.dev/skills/railtownai/railtracks/agent-builder"><img src="https://agentmods.dev/badge/skills/railtownai/railtracks/agent-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/railtownai/railtracks/agent-builder"><img src="https://agentmods.dev/badge/skills/railtownai/railtracks/agent-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,453 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.02453
Opus 5.5 $0.00015 $0.00981
Sonnet 5.5 $0.00007 $0.00491
Haiku 4.5 $0.00004 $0.00245

Measured 2d ago against content hash 055acd57e2a5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agent-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/railtracks/src/railtracks/cli/skills/agent-builder/SKILL.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Build a Railtracks Agent

The user wants to build an agent using the railtracks framework: $ARGUMENTS

How railtracks works

  • Tools are plain Python functions decorated with @rt.function_node. Type hints become the parameter schema; the docstring becomes the description.
  • Agents are created with rt.agent_node(). Its behaviour depends on whether tools or a structured output schema are passed (see below).
  • Flows wrap an agent or async function as the entry point and handle execution, config, and context.
  • rt.call() is used inside async workflows to call agents or nodes directly.
  • Results: flow.invoke(), await flow.ainvoke() and await rt.call() on an agent return a response object. Read it with .content: a str for a text agent, an instance of your schema for an output_schema agent. The full conversation is on .message_history. When the agent was given an output_schema, .structured also returns that instance; otherwise .text also returns the str.

What agent_node builds

rt.agent_node() builds one node behind the scenes — there is no separate named type to pick. What you pass changes what the agent does at runtime:

Passed Behaviour
Neither tool_nodes nor output_schema Plain chat, text output
output_schema only Structured output, no tools
tool_nodes only Tool-calling loop, text output

LLM Providers

# Example model IDs; use the provider and model the project already uses
rt.llm.AnthropicLLM("claude-sonnet-5-5")
rt.llm.OpenAILLM("gpt-6-luna")
rt.llm.GeminiLLM("gemini-3.8-flash")
rt.llm.OpenAICompatibleProvider(
    "my-model", api_base="https://api.example.com/v1", api_key="..."
)

Steps

  1. Read the existing code — check what files already exist in the project. Understand the task before writing anything.
  2. Identify what tools the agent needs — each capability the agent should have becomes a @rt.function_node. Ask the user to clarify if it's not obvious from $ARGUMENTS.
  3. Define the tools — write each tool as a Python function with:
    • Full type hints on all parameters and return value
    • A docstring with a one-line summary and Args: / Returns: sections
    • Real implementation (or a clear stub with a TODO if the user needs to fill it in)
  4. Define the agent — call rt.agent_node() with (note: it returns a class/type, so use PascalCase for the variable name):
    • A descriptive name
    • tool_nodes listing the tools (if any), or output_schema as a Pydantic BaseModel for structured output — one or the other, never both (passing both raises NodeCreationError)
    • llm — follow the provider the project already uses, or one whose API key is configured (providers and their key variables: https://docs.railtracks.org/documentation/getting_started/llm_setup/); otherwise ask the user which LLM to use
    • system_message — a clear, specific system prompt
  5. Wrap in a Flow — create rt.Flow(name="...", entry_point=MyAgent) for simple cases. For multi-step or multi-agent workflows, define an async def function as the entry point and use await rt.call(MyAgent, ...) inside it.
  6. Add invocation code — include a if __name__ == "__main__": block that calls flow.invoke(...) with a representative example and prints result.content, so the user can run it immediately. Use await flow.ainvoke(...) instead if the code is already async.
  7. Check imports — make sure import railtracks as rt is at the top and any Pydantic models import from pydantic import BaseModel.

Read the full file on GitHub · 227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed 055acd57e2a5
  2. 3d ago Changed · +16 lines 82ea200ffdb2
  3. 11d ago Changed · -6 lines d68c31f1128e
  4. 14d ago Changed · +51 lines d83fc6079d60
  5. 22d ago Changed d1a847ac5d6f
  6. 24d ago First seen · 166 lines · 37 tokens per session scan A e13d20f9e96b

Subscribe to this mod's changes

agent-builder is a skill published in the GitHub repository RailtownAI/railtracks (233 stars, last pushed today), licensed MIT. It adds 37 tokens to every session and 2,453 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-23.

Related

Other skills, from other repositories

first-reader

Beta readers for any draft, run by simulating how a real reader experiences it, moment by moment. A skim gate, a no-lookahead timed read producing an attention transcript with quit points, a recall test of what a reader remembers the next day, and a trust ledger of the implied author. Use when the user asks for a beta…

Shubhamsaboo/awesome-llm-apps · 174 tokens

mcp-apps-builder

MANDATORY for ALL MCP server work - mcp-use framework best practices and patterns. READ THIS FIRST before any MCP server work, including: Creating new MCP servers Modifying existing MCP servers (adding/updating tools, resources, prompts, widgets) Debugging MCP server issues or errors Reviewing MCP server code for…

Shubhamsaboo/awesome-llm-apps · 139 tokens

project-graveyard

Scans the developer's machine for dead side projects, autopsies each one from its git history (died at the payments wall, killed by a newer project, finished but never shipped), surfaces their personal death patterns, and picks the corpse most worth resurrecting — then helps ship it. Use when the user mentions…

Shubhamsaboo/awesome-llm-apps · 127 tokens

commit-archaeologist

Reconstructs why code exists from local git history, including the introducing commit, later changes, current authors, repeated companion files, and likely intent. Use when the user asks "why does this code exist", "who wrote this function and why", or to "explain the history of this function" before a rewrite…

Shubhamsaboo/awesome-llm-apps · 82 tokens

dependency-doctor

Checks requirements.txt, pyproject.toml, and package.json dependency manifests for surface-level direct-dependency footguns: standard-library shadowing pins, abandoned backports, unpinned dependencies, and obvious intra-manifest conflicts, plus opt-in PyPI yanked releases. Use when the user asks to check a manifest…

Shubhamsaboo/awesome-llm-apps · 115 tokens

scope-creep-detector

Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad pull requests, changes that grew beyond a fix, dependency additions, public API renames, config or CI edits, oversized hunks, and formatting-only files. Use when the user asks whether a change grew beyond the fix, a PR is too…

Shubhamsaboo/awesome-llm-apps · 98 tokens