Expand description
Embedded default agents & skills (#2895; roster expanded to 31 agents in
Slice E3, #2958; pm added as a 4th tcode-own default for #3437).
Why: A fresh project has no .claude/agents/ or .claude/skills/ yet;
bundling a working default set at compile time (mirroring, not sharing,
trusty-mpm’s embed pattern) gives every project a usable harness before
any project-level config exists. Disk-based config always wins when present.
What: EmbeddedAgent/DEFAULT_AGENTS (32 dispatchable tcode agents: the
original 4 (engineer/qa-agent/code-reviewer/pm), authored as
Markdown+frontmatter as of #2897 Slice C, plus 28 coding-relevant tm
agents wired in as of Slice E, #2958, whose shared texts are read from
instructional content since #9011);
EmbeddedSkill/DEFAULT_SKILLS (trusty-mpm’s universal skill set, minus
the tm-* orchestration skills).
Test: assets::tests::*.
Embedded default agents & skills for trusty-code (#2895).
Why: A fresh project has no .claude/agents/ or .claude/skills/ yet, so
tcode would otherwise start with zero agents and zero skills — a cold,
unusable default. Bundling a working default set at compile time (mirroring
the embed pattern trusty-mpm uses in crates/trusty-mpm/src/core/bundle.rs,
but without trusty-mpm’s disk-materialize install step — these are parsed
in-memory only) gives every project a usable harness out of the box while
disk-based .claude/agents/ and .claude/skills/ always take precedence
when present (see agents::load_all_agents and
skills::discover_skill_metadata’s embedded-fallback branches).
What: EmbeddedAgent/DEFAULT_AGENTS — the 34-agent dispatchable
roster (Slice E3, #2958, plus pm added for #3437, ticketing for
#4027, and the four delivery-workflow agents for #8129): tcode’s own 8
Direct defaults (engineer, qa-agent, code-reviewer, pm,
ticketing, version-control, local-ops, documentation — no
extends: chain, projected via
agents::md_loader::project_embedded_md) plus the 26 tm agents (extends:-chained
through the 5 BASE-* templates — projected via
agents::md_loader::project_embedded_md_with_extends, which resolves
against tm_agent_sources). Authored as Markdown+frontmatter
(.md) as of #2897 Slice C (previously native TOML; Slice D subsequently
retired the TOML loader for USER .claude/agents/*.toml configs entirely
— see agents::mod’s docs). Both projection paths share one
frontmatter->AgentConfig mapping with the disk .md loader
(agents::md_loader::load_md_agent) — see that module’s docs.
EmbeddedSkill/DEFAULT_SKILLS — trusty-mpm’s universal skill set
(format-identical SKILL.md files), reused verbatim per Bob’s reuse
directive; the tm-* orchestration skills are excluded because they drive
trusty-mpm MCP tools tcode does not have.
§Tools-restriction deviation (Slice E3, #2958, Bob’s 2026-07-18 ruling)
Four of the 26 roster agents — qa, code-critic, code-analyzer,
web-qa — carry an explicit restrictive tools: override in their tcode
FORK (assets/agents/{qa,code-critic,code-analyzer,web-qa}.md) that is NOT
present in the shared agent they were derived from (content/agents,
read at runtime since #9011). These four are the only agent .md files
trusty-code still embeds a second copy of: every other roster agent is read
from instructional content through tm_agent_sources, so it cannot
drift. (#8129’s four
delivery-workflow agents also live in assets/agents/, but they are
tcode-AUTHORED, not copies — see the “Delivery-workflow agents” section
below.) This is a
deliberate, Bob-approved deviation, not drift: those four are
reviewer-intent agents and get
the same read-only tool allowlist tcode’s own code-reviewer default uses
(no write_file/edit/bash). research stays byte-identical and
unrestricted per Bob’s explicit ruling — it builds research reports, not
verdicts. documentation was covered by that same ruling until #8129,
which replaced the shared body with a tcode-native one carrying its own
tcode_tools: grant; see the “Delivery-workflow agents” section below for
its real status — that grant is strictly WIDER than the reviewer-intent
four get, so it is not a reversal of the ruling. NOTE for the file itself: the
shared frontmatter parser
(trusty_agents_common::agents::builder::split_frontmatter) does NOT
tolerate #-comment lines inside a frontmatter block (verified
empirically — a bare #-prefixed line there is a hard FrontmatterParse
error, not a tolerated comment), so no inline marker could be added to
those four files without breaking the compose step; this doc comment is
the marker of record. The deferred E4 CI staleness guard (diffing tcode’s
copies against trusty-mpm’s source) MUST whitelist the tools: line in
exactly these four files rather than flagging them as drift.
§Prose deviation follow-up (Slice E3 review round, #3041)
Adding the tools: override alone left three of the four files
internally contradictory: their prose still instructed write/bash actions
the new allowlist denies (web-qa.md’s “Technical Testing Protocol” told
the agent to create test scripts, run CI=true npm test, and shell out to
ps aux; qa.md’s methodology told it to “Implement”/“Execute” test
suites directly; code-analyzer.md’s “Large-Volume Analysis” told it to
generate-and-run a Python script). A code-critic review of PR #3041 (WARN,
two HIGH + one MEDIUM findings) caught this. web-qa.md, qa.md, and
code-analyzer.md were reworded in the SAME PR to a genuinely read-only
frame: findings plus concrete, ready-to-run recommendations (drafted
scenarios, specified test cases, recommended commands) handed off to an
engineer/ops/CI to execute, never executed by the agent itself.
code-critic.md needed no prose change at the time — its review-only body
had no execute-oriented instructions. This is an ADDITIONAL deviation from
trusty-mpm byte-parity beyond the tools: line alone; the deferred E4
staleness guard must whitelist the reworded prose sections in these three
files too, not just the tools: line.
code-critic.md gained its own reworded section later (owner ruling
2026-08-12, PR #5596): trusty-mpm’s upstream copy started instructing the
agent to post its verdict via gh pr review --comment directly. tcode’s
copy has no bash/gh tool, so the “Posting the Verdict” section was
reworded to the same read-only frame as the three files above — it
specifies the exact command for the caller to run, never runs it itself.
code-critic.md now joins web-qa.md/qa.md/code-analyzer.md as a
four-of-four reworded-prose deviation, not three-of-four; the E4 staleness
guard whitelists it the same way (pinned-hash reconciliation, not
byte-parity).
§Non-coding cross-product roster addition (#4027, epic #4021)
ticketing joined this roster (same treatment research got) so
trusty-agents’ widened dispatch_task bridge (#4026) can reach ONE roster
instead of growing a second dispatch leg into trusty-mpm — the owner’s OQ-4
ruling. It was embedded directly from the shared crate until #8129, which
replaced the body with a tcode-native one declaring its own tcode_tools:;
the dispatch NAME the bridge resolves is unchanged, which is all #4026
depends on. Its non-coding property is enforced where the
owner’s OQ-7 ruling put enforcement — the BRIDGE’s fail-closed
NON_CODING_TARGETS floor in
crates/trusty-agents/src/tools/cross_product.rs — not by an asset-level
allowlist that a direct tcode run-task invocation would bypass anyway.
§Delivery-workflow agents (#8129, epic #8127)
ticketing, version-control, local-ops and documentation are the
four roles trusty-mpm’s PM delegates the issue -> branch -> build -> PR
-> changelog steps to. tcode’s PM could not reach any of them: three
(ticketing, local-ops, documentation) were Composed entries
sourced byte-identically from the shared crate, and version-control was
absent from the roster entirely. The shared bodies are written for
trusty-mpm’s harness (Skill(...), tm CLI verbs, MCP servers tcode does
not host) and their tools: frontmatter names Claude Code’s vocabulary,
which this runtime ignores (#7683) — so each one projected to
tools.allowed == None, i.e. EVERY tool allowed, the opposite of the
grant its author wrote.
All four are therefore tcode-NATIVE EmbeddedAgent::Direct agents in
assets/agents/, authored the way pm.md/engineer.md are: a short body
scoped to tcode’s actual tool surface, with an explicit tcode_tools:
allowlist that carries bash (for git/gh/cargo) and finish_task.
They are NOT forks of the same-named shared assets and are NOT pinned
deviations — there is no upstream content to reconcile against, only an
upstream ROLE. scripts/check_agent_assets.sh therefore lists them in
$TCODE_ONLY, never in $DEVIATED_FILES. The three shared sources they
replace are absent from SHARED_TM_AGENT_FILES, so no caller can compose
the trusty-mpm body under the same dispatch name.
§E4 guard (issue #2958, scripts/check_agent_assets.sh)
The byte-parity half of this gate is gone because what it compared is gone:
30 duplicated .md files became one shared copy each (content/agents
since #9011), and a file cannot drift from itself. What the gate still checks is what the compiler cannot
see — it pins the 4 deviated files’ SHARED source hash
(scripts/agent-asset-pins.tsv) so an edit behind one of them fails for
deliberate reconciliation, and it rejects any .md appearing in this
directory that is neither a pinned deviation nor a declared tcode-only
default, which is how a deleted duplicate stays deleted. See that script’s
header and .github/workflows/agent-assets.yml.
Test: assets::tests::* — every embedded agent .md parses and projects
to a field-identical AgentConfig vs. the retired TOML fixtures (the
original 3), every roster name resolves through the extends composer with
no BASE template dispatchable and no name collision, the four restricted
agents’ composed AgentConfig carries the read-only tool list, and
documentation/research remain unrestricted. Every skill name is unique
and every skill’s frontmatter name: matches its table key.
Structs§
- Embedded
Skill - One embedded default skill: its catalog name and raw
SKILL.mdsource.
Enums§
- Embedded
Agent - One embedded default agent: either self-contained (tcode’s own 3
defaults, no
extends:chain) or a roster agent whoseextends:chain is resolved at load time againsttm_agent_sources(Slice E3, #2958).
Constants§
- BASE_
AGENT_ NAMES - The 5
BASE-*extends-template names — composition bases only, never meant to be dispatched directly (issue #3465 follow-up: the Agents catalog listing was surfacing these to end users). - DEFAULT_
AGENTS - The 34-agent dispatchable default roster, embedded at compile time
(Slice E3, #2958, plus
pmadded for #3437,ticketingfor #4027, and the four #8129 delivery-workflow agents): tcode’s 8 ownDirectdefaults plus the 26 tm roster agents. The 5BASE-*extends templates intm_agent_sourcesare deliberately NOT entries here — they are extends-sources only, never dispatchable — and trusty-mpm’s ownengineeragent is excluded from the roster upstream (#2958’s roster decision) precisely because it would collide with tcode’sengineerbelow;assets::tests::no_name_collisions_across_the_33_agent_rosterpins that no collision exists in the final table. - DEFAULT_
SKILLS - trusty-mpm’s universal skill set, embedded at compile time (
tm-*orchestration skills excluded — see module docs). - LOCAL_
TM_ AGENT_ FORKS - tcode’s 4 read-only forks of shared roster agents, still embedded until PHASE_4 (#8390) — see this module’s “Tools-restriction deviation” section.
- PM_
CARD_ BASELINE_ BYTES pm.md’s size before #8287 added the routing block, in bytes.- PM_
ROUTING_ BLOCK_ BEGIN - Opening marker of
pm.md’s contiguous agent-routing block (#8287). - PM_
ROUTING_ BLOCK_ END - Closing marker of
pm.md’s routing block. - PM_
ROUTING_ ORDER - The delegation targets a delegate-mode coding task passes through, in order (#8287).
- SHARED_
TM_ AGENT_ FILES - The 27 shared agent files tcode composes from: the 5
BASE-*extends templates plus 22 roster agents (#9011).
Functions§
- load_
tm_ agent_ sources tm_agent_sourcesover the roster resolved for this process: the trusty-tools checkout above the cwd, else the installed content bundle. Every failure namestm content installortm content update.- pm_
routing_ block - The routing block’s inner text, or
Nonewhen the markers are absent. - tm_
agent_ sources - The 31-entry tm agent catalog the extends-composer resolves against: every
SHARED_TM_AGENT_FILESentry read fromroster, thenLOCAL_TM_AGENT_FORKS.