subagent-guidelines

A shared rulebook for subagents, which are smaller coding agents called by a main agent. It defines which project files they must read first and sets ten rules for safe, consistent work.

In plain words
What is it for?
Use it when launching subagents for coding, reviews, research, or other delegated tasks. It helps coordinate file access, commits, context loading, and reporting between the main agent and its subagents.
Why use it?
It gives every subagent the same preparation and safety expectations, reducing skipped context, lost changes, and unsafe edits. It requires separate worktrees, meaning isolated working copies, when code is changed.

Agent

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 agents/willackerly/rebar/subagent-guidelines
Clone the repo
git clone --depth 1 https://github.com/willackerly/rebar
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,137 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.00000 $0.02137
Opus 5 $0.00000 $0.01069
Sonnet 5 $0.00000 $0.00427
Haiku 4.5 $0.00000 $0.00214

Measured yesterday against content hash 4967b6295baa, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

subagent-guidelines 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 yesterday.

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.

agents/subagent-guidelines.md · 248 lines

How it starts

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

Subagent Guidelines

Shared behavioral contract for all subagent invocations. The orchestrating agent should instruct every subagent to read this file before starting work.


Context Loading Order

When you start, read files in this order:

  1. This file (agents/subagent-guidelines.md) — you're here
  2. Your assigned template from agents/subagent-prompts/<template>.md
  3. QUICKCONTEXT.md — project orientation (if your task touches project code)
  4. Any additional files specified in your parameters

Do not skip steps. Do not start working before reading your template.

The 10 Rules (non-negotiable)

These rules are the difference between 100% work survival and total loss. They are numbered for reference — cite "Rule 3" in findings, not prose.

Rule 1: Worktree Isolation for Code Changes

If you are writing ANY code, you MUST use worktree isolation. No exceptions. Read-only research tasks (exploration, analysis, audits) may run in the main working tree.

rebar agent start --role developer "implement feature X"

Rule 2: Commit After Every Logical Chunk

Don't accumulate changes. If you get logged out, only uncommitted work is lost. One fix = one commit. Use rebar commit (not git commit) — it runs pre-commit checks and updates integrity. There is no --no-verify.

rebar commit -m "agents/<template-name>: <brief description>"

Rule 3: Strict File Ownership

Your prompt includes an allowlist of files you may create or modify. Everything else is read-only. If your prompt doesn't specify, you may modify files directly related to your assigned task. You may NOT modify:

  • Shared interface definitions (Store, Scanner, etc.)
  • Shared type files, routers, app entry points
  • Migration files, lock files, auto-generated files

If you need a change to a restricted file, document it as a finding.

Read the full file on GitHub · 248 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. yesterday First seen · 248 lines · 0 tokens per session scan A 4967b6295baa

Subscribe to this mod's changes

subagent-guidelines is an agent published in the GitHub repository willackerly/rebar (5 stars, last pushed 20d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,137 tokens. 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.