add-core-subagent

A command for adding a specialized subagent to a core task dispatcher, including the rules that decide when to route work to it.

In plain words
What is it for?
Use it when adding a subagent such as a testing or debugging specialist. It covers the subagent name, recipe, work type, trigger conditions, capabilities, and whether it has slash commands.
Why use it?
A dispatcher needs both a trigger rule and a registered recipe before it can send work to a new subagent. This command gathers the required details and wires those pieces together.

Command for Claude Code

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.

agentmods
npx agentmods add commands/patrickclery/ruly/add-core-subagent
Clone the repo
git clone --depth 1 https://github.com/patrickclery/ruly

Made for: Claude Code.

Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,542 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00025 $0.01542
Opus 5 $0.00013 $0.00771
Sonnet 5 $0.00005 $0.00308
Haiku 4.5 $0.00003 $0.00154

Measured 2d ago against content hash 4512c99999f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-core-subagent 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.

.claude/commands/add-core-subagent.md · 196 lines

How it starts

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

Add Subagent to Core Orchestrator

Overview

Automates wiring a new subagent into the core dispatcher. Core is a slim orchestrator that routes tasks to specialized subagents -- it never does the work itself. Each subagent needs a dispatch rule (so core knows when to route) and a recipe registration (so ruly generates the agent file).

When to Use

  • "Add X as a core subagent"
  • "Wire up the Y subagent to core"
  • "Core should dispatch to Z"
  • "Register W in the core recipe"
  • Creating a new specialized agent that core should delegate to

Gather Information

Before creating anything, collect these from the user (ask if not provided):

Input Example Required
Subagent name qa Yes
Recipe name (if different) qa-testing Only if differs from name
Work type heading QA & Testing Yes
Trigger conditions Test planning, QA reports, test execution Yes
Has slash commands? yes/no Yes
Capabilities summary test planning, execution, QA reports Yes

Naming convention:

  • subagent_type in Task tool uses underscores: core_debugger, context_fetcher
  • recipe name uses hyphens: core-debugger, context-fetcher
  • Dispatch rule filename uses hyphens: use-core-debugger.md
  • Simple names are the same everywhere: bug, comms, merger

Step 1: Create the Dispatch Rule

Create the file at:

/Users/patrick/Projects/ruly/rules/workaxle/core/standards/use-{name}.md

Use this template, filling in the placeholders:

---
description: Forces {task_type} tasks to dispatch {subagent_type} subagent for {capabilities}
alwaysApply: true
---
# {Work Type}: Dispatch to Subagent

## When This Applies

Any time you are asked to or encounter:
{trigger_list -- bullet points of actions, keywords, slash commands}

## The Rule

**You MUST dispatch the `{subagent_type}` subagent.** Do NOT:
{do_not_list -- bullet points of what core must not do itself}

The subagent has {capabilities_description}. You are a dispatcher -- route the work.

## CRITICAL: Slash Command Override

> **Only include this section if the subagent has slash commands.**

When a {work_type_lower} slash command is invoked, the command file content will load into your context. **Do NOT follow those instructions yourself.** Instead:

1. Extract the user's intent and any arguments from the command
2. Dispatch the `{subagent_type}` subagent with those details
3. The subagent will follow the command workflow (it has the same files)

## How to Dispatch

{dispatch_examples -- one or more ### subsections with Task tool examples like:}

### For {Action Name}

```
Task tool:
  subagent_type: "{subagent_type}"
  prompt: |
    {Action description}:
    - {relevant parameters}
```

## After Subagent Returns

1. Present the subagent's results to the user
2. If the subagent needs confirmation, relay to user, then dispatch again
3. If additional work needed, dispatch again with updated context

## Does NOT Apply When

{boundary_conditions -- bullet list deferring to other subagents}

## Red Flags -- You Are Violating This Rule

{red_flags -- bullet list of anti-patterns}

**All of these mean: STOP. Dispatch `{subagent_type}`.**

Read the full file on GitHub · 196 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 First seen · 196 lines · 25 tokens per session scan A 4512c99999f4

Subscribe to this mod's changes

add-core-subagent is a command published in the GitHub repository patrickclery/ruly (5 stars, last pushed 7d ago), licensed MIT. It adds 25 tokens to every session and 1,542 once invoked, about $0.0001 per session on Opus 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-08-31.