agent-builder

agent-builder is a skill for Claude Code from RailtownAI/railtracks. It costs 37 tokens per session (2,808 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,808 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.02808
Opus 5.5 $0.00015 $0.01123
Sonnet 5.5 $0.00007 $0.00562
Haiku 4.5 $0.00004 $0.00281

Measured 6d ago against content hash 164126f22714, 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 6d 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 · 246 lines

How it starts

The opening of the file, as written. The whole thing — 246 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 a text agent's reply with .text (a str) and an output_schema agent's with .structured (an instance of your schema). The full conversation is on .message_history. Don't read a text agent's .content: it becomes a list of parts in railtracks 1.9.0. Read messages with message.text too.

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.text, 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 · 246 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. 6d ago Changed 164126f22714
  2. 1mo ago Changed · +19 lines e052364858b2
  3. 1mo ago Changed 055acd57e2a5
  4. 1mo ago Changed · +16 lines 82ea200ffdb2
  5. 1mo ago Changed · -6 lines d68c31f1128e
  6. 2mo ago Changed · +51 lines d83fc6079d60
  7. 2mo ago Changed d1a847ac5d6f
  8. 2mo 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 (235 stars, last pushed today), licensed MIT. It adds 37 tokens to every session and 2,808 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

agent-builder compared with skills from other repositories

agent-builder next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-builderRailtownAI/railtracksSkill235todayMITA37Claude Code
first-readerShubhamsaboo/awesome-llm-appsSkill147kyesterdayApache-2.0A174Claude Code, Codex
mcp-apps-builderShubhamsaboo/awesome-llm-appsSkill147kyesterdayApache-2.0A139Claude Code, Codex
project-graveyardShubhamsaboo/awesome-llm-appsSkill147kyesterdayApache-2.0A127Claude Code, Codex
commit-archaeologistShubhamsaboo/awesome-llm-appsSkill147kyesterdayApache-2.0A82Claude Code, Codex
dependency-doctorShubhamsaboo/awesome-llm-appsSkill147kyesterdayApache-2.0A115Claude Code, Codex
scope-creep-detectorShubhamsaboo/awesome-llm-appsSkill147kyesterdayApache-2.0A98Claude Code, Codex