trusty_code/assets/mod.rs
1//! Embedded default agents & skills for trusty-code (#2895).
2//!
3//! Why: A fresh project has no `.claude/agents/` or `.claude/skills/` yet, so
4//! `tcode` would otherwise start with zero agents and zero skills — a cold,
5//! unusable default. Bundling a working default set at compile time (mirroring
6//! the embed pattern `trusty-mpm` uses in `crates/trusty-mpm/src/core/bundle.rs`,
7//! but without trusty-mpm's disk-materialize install step — these are parsed
8//! in-memory only) gives every project a usable harness out of the box while
9//! disk-based `.claude/agents/` and `.claude/skills/` always take precedence
10//! when present (see `agents::load_all_agents` and
11//! `skills::discover_skill_metadata`'s embedded-fallback branches).
12//! What: [`EmbeddedAgent`]/[`DEFAULT_AGENTS`] — the 33-agent dispatchable
13//! roster (Slice E3, #2958, plus `pm` added for #3437 and `ticketing` for
14//! #4027): tcode's own 4 defaults (`engineer`, `qa-agent`, `code-reviewer`,
15//! `pm`, no `extends:` chain — projected via
16//! `agents::md_loader::project_embedded_md`) plus the 29 tm agents (the 28
17//! coding-relevant ones Bob selected in #2958, plus `ticketing`) (`extends:`-chained
18//! through the 5 `BASE-*` templates — projected via
19//! `agents::md_loader::project_embedded_md_with_extends`, which resolves
20//! against [`EMBEDDED_TM_AGENT_SOURCES`]). Authored as Markdown+frontmatter
21//! (`.md`) as of #2897 Slice C (previously native TOML; Slice D subsequently
22//! retired the TOML loader for USER `.claude/agents/*.toml` configs entirely
23//! — see `agents::mod`'s docs). Both projection paths share one
24//! frontmatter->`AgentConfig` mapping with the disk `.md` loader
25//! (`agents::md_loader::load_md_agent`) — see that module's docs.
26//! [`EmbeddedSkill`]/[`DEFAULT_SKILLS`] — trusty-mpm's universal skill set
27//! (format-identical `SKILL.md` files), reused verbatim per Bob's reuse
28//! directive; the `tm-*` orchestration skills are excluded because they drive
29//! trusty-mpm MCP tools tcode does not have.
30//!
31//! ## Tools-restriction deviation (Slice E3, #2958, Bob's 2026-07-18 ruling)
32//!
33//! Four of the 28 roster agents — `qa`, `code-critic`, `code-analyzer`,
34//! `web-qa` — carry an explicit restrictive `tools:` override in their tcode
35//! FORK (`assets/agents/{qa,code-critic,code-analyzer,web-qa}.md`) that is NOT
36//! present in the shared asset they were derived from
37//! (`trusty_agents_common::agent_assets`). These four are the only agent `.md`
38//! files trusty-code still keeps a second copy of: every other roster agent is
39//! embedded straight from the shared crate, so it cannot drift. This is a
40//! deliberate, Bob-approved deviation, not drift: those four are
41//! reviewer-intent agents and get
42//! the same read-only tool allowlist tcode's own `code-reviewer` default uses
43//! (no `write_file`/`edit`/`bash`). `documentation` and `research` stay
44//! byte-identical and unrestricted per Bob's explicit ruling — they build
45//! docs and research reports, not verdicts. NOTE for the file itself: the
46//! shared frontmatter parser
47//! (`trusty_agents_common::agents::builder::split_frontmatter`) does NOT
48//! tolerate `#`-comment lines inside a frontmatter block (verified
49//! empirically — a bare `#`-prefixed line there is a hard `FrontmatterParse`
50//! error, not a tolerated comment), so no inline marker could be added to
51//! those four files without breaking the compose step; this doc comment is
52//! the marker of record. The deferred E4 CI staleness guard (diffing tcode's
53//! copies against trusty-mpm's source) MUST whitelist the `tools:` line in
54//! exactly these four files rather than flagging them as drift.
55//!
56//! ## Prose deviation follow-up (Slice E3 review round, #3041)
57//!
58//! Adding the `tools:` override alone left three of the four files
59//! internally contradictory: their prose still instructed write/bash actions
60//! the new allowlist denies (`web-qa.md`'s "Technical Testing Protocol" told
61//! the agent to create test scripts, run `CI=true npm test`, and shell out to
62//! `ps aux`; `qa.md`'s methodology told it to "Implement"/"Execute" test
63//! suites directly; `code-analyzer.md`'s "Large-Volume Analysis" told it to
64//! generate-and-run a Python script). A code-critic review of PR #3041 (WARN,
65//! two HIGH + one MEDIUM findings) caught this. `web-qa.md`, `qa.md`, and
66//! `code-analyzer.md` were reworded in the SAME PR to a genuinely read-only
67//! frame: findings plus concrete, ready-to-run recommendations (drafted
68//! scenarios, specified test cases, recommended commands) handed off to an
69//! engineer/ops/CI to execute, never executed by the agent itself.
70//! `code-critic.md` needed no prose change at the time — its review-only body
71//! had no execute-oriented instructions. This is an ADDITIONAL deviation from
72//! trusty-mpm byte-parity beyond the `tools:` line alone; the deferred E4
73//! staleness guard must whitelist the reworded prose sections in these three
74//! files too, not just the `tools:` line.
75//!
76//! `code-critic.md` gained its own reworded section later (owner ruling
77//! 2026-08-12, PR #5596): trusty-mpm's upstream copy started instructing the
78//! agent to post its verdict via `gh pr review --comment` directly. tcode's
79//! copy has no `bash`/`gh` tool, so the "Posting the Verdict" section was
80//! reworded to the same read-only frame as the three files above — it
81//! specifies the exact command for the caller to run, never runs it itself.
82//! `code-critic.md` now joins `web-qa.md`/`qa.md`/`code-analyzer.md` as a
83//! four-of-four reworded-prose deviation, not three-of-four; the E4 staleness
84//! guard whitelists it the same way (pinned-hash reconciliation, not
85//! byte-parity).
86//!
87//! ## Non-coding cross-product roster addition (#4027, epic #4021)
88//!
89//! `ticketing` joined this roster (same treatment `research` got) so
90//! trusty-agents' widened `dispatch_task` bridge (#4026) can reach ONE roster
91//! instead of growing a second dispatch leg into trusty-mpm — the owner's OQ-4
92//! ruling. It carries no tcode-specific `tools:` restriction and is not a
93//! pinned deviation: it is embedded directly from the shared crate, so it stays
94//! in lockstep by construction. Its non-coding property is enforced where the
95//! owner's OQ-7 ruling put enforcement — the BRIDGE's fail-closed
96//! `NON_CODING_TARGETS` floor in
97//! `crates/trusty-agents/src/tools/cross_product.rs` — not by an asset-level
98//! allowlist that a direct `tcode run-task` invocation would bypass anyway.
99//!
100//! ## E4 guard (issue #2958, `scripts/check_agent_assets.sh`)
101//!
102//! The byte-parity half of this gate is gone because what it compared is gone:
103//! 30 duplicated `.md` files became one shared copy each, and a file cannot
104//! drift from itself. What the gate still checks is what the compiler cannot
105//! see — it pins the 4 deviated files' SHARED source hash
106//! (`scripts/agent-asset-pins.tsv`) so an edit behind one of them fails for
107//! deliberate reconciliation, and it rejects any `.md` appearing in this
108//! directory that is neither a pinned deviation nor a declared tcode-only
109//! default, which is how a deleted duplicate stays deleted. See that script's
110//! header and `.github/workflows/agent-assets.yml`.
111//!
112//! Test: `assets::tests::*` — every embedded agent `.md` parses and projects
113//! to a field-identical `AgentConfig` vs. the retired TOML fixtures (the
114//! original 3), every roster name resolves through the extends composer with
115//! no BASE template dispatchable and no name collision, the four restricted
116//! agents' composed `AgentConfig` carries the read-only tool list, and
117//! `documentation`/`research` remain unrestricted. Every skill name is unique
118//! and every skill's frontmatter `name:` matches its table key.
119//!
120//! [`EmbeddedAgent`]: crate::assets::EmbeddedAgent
121//! [`DEFAULT_AGENTS`]: crate::assets::DEFAULT_AGENTS
122//! [`EMBEDDED_TM_AGENT_SOURCES`]: crate::assets::EMBEDDED_TM_AGENT_SOURCES
123//! [`EmbeddedSkill`]: crate::assets::EmbeddedSkill
124//! [`DEFAULT_SKILLS`]: crate::assets::DEFAULT_SKILLS
125
126/// One embedded default agent: either self-contained (tcode's own 3
127/// defaults, no `extends:` chain) or a roster agent whose `extends:` chain is
128/// resolved at load time against [`EMBEDDED_TM_AGENT_SOURCES`] (Slice E3,
129/// #2958).
130///
131/// Why: `agents::mod`'s embedded-fallback needs a single ordered table
132/// ([`DEFAULT_AGENTS`]) covering both projection strategies tcode's embedded
133/// agents need: tcode's own 3 defaults are flat `.md` strings with no
134/// inheritance (projected via `agents::md_loader::project_embedded_md`); the
135/// 28 tm roster agents inherit from `BASE-*` templates and must be composed
136/// in-memory (`agents::md_loader::project_embedded_md_with_extends`) before
137/// projection. One enum keeps both variants in the same ordered slice rather
138/// than two parallel tables that could silently drift out of sync in count
139/// or ordering.
140/// What: [`EmbeddedAgent::Direct`] carries the dispatch name and the raw
141/// `.md` source (frontmatter fence + prose body) verbatim. [`EmbeddedAgent::Composed`]
142/// carries only the dispatch name — its content is resolved from
143/// [`EMBEDDED_TM_AGENT_SOURCES`] at load time, since the whole point of the
144/// in-memory composer is that no second copy of the raw bytes is needed here.
145/// [`EmbeddedAgent::name`] reads the name back out of either variant.
146/// Test: `assets::tests::default_agents_parse_and_names_match`.
147#[derive(Debug, Clone, Copy)]
148pub enum EmbeddedAgent {
149 /// A self-contained agent: raw `.md` source, no `extends:` chain.
150 Direct {
151 /// Dispatch key, matching the frontmatter `name:` inside `md`.
152 name: &'static str,
153 /// Raw `.md` source (frontmatter fence + prose body), projectable
154 /// via `agents::md_loader::project_embedded_md`.
155 md: &'static str,
156 },
157 /// A roster agent resolved via `agents::md_loader::project_embedded_md_with_extends`
158 /// against [`EMBEDDED_TM_AGENT_SOURCES`] at load time.
159 Composed {
160 /// Dispatch key, and the lookup key into `EMBEDDED_TM_AGENT_SOURCES`
161 /// (after that table's own case-folding).
162 name: &'static str,
163 },
164}
165
166impl EmbeddedAgent {
167 /// The dispatch key, regardless of variant.
168 ///
169 /// Why: callers (the embedded-fallback loader, tests) usually only need
170 /// the name and would otherwise have to `match` on the variant just to
171 /// read one shared field.
172 /// What: returns `name` from either `Direct` or `Composed`.
173 /// Test: `assets::tests::default_agents_parse_and_names_match`.
174 pub fn name(&self) -> &'static str {
175 match self {
176 EmbeddedAgent::Direct { name, .. } => name,
177 EmbeddedAgent::Composed { name } => name,
178 }
179 }
180}
181
182/// One embedded default skill: its catalog name and raw `SKILL.md` source.
183///
184/// Why: `skills::mod`'s embedded-fallback needs both the name (for the
185/// `SkillMetadata` catalog) and the raw Markdown (frontmatter + body, parsed
186/// the same way a disk-based `SKILL.md` is).
187/// What: `name` matches the frontmatter `name:` inside `skill_md`; `skill_md`
188/// is the verbatim embedded file contents (frontmatter fence + body).
189/// Test: `assets::tests::default_skills_names_are_unique`.
190#[derive(Debug, Clone, Copy)]
191pub struct EmbeddedSkill {
192 /// Catalog name, matching the frontmatter `name:` inside `skill_md`.
193 pub name: &'static str,
194 /// Raw `SKILL.md` source (frontmatter fence + Markdown body).
195 pub skill_md: &'static str,
196}
197
198const ENGINEER_MD: &str = include_str!("agents/engineer.md");
199const QA_AGENT_MD: &str = include_str!("agents/qa-agent.md");
200const CODE_REVIEWER_MD: &str = include_str!("agents/code-reviewer.md");
201const PM_MD: &str = include_str!("agents/pm.md");
202
203/// The 33-agent dispatchable default roster, embedded at compile time
204/// (Slice E3, #2958, plus `pm` added for #3437 and `ticketing` for #4027):
205/// tcode's original 3 defaults plus `pm` plus the 29 tm roster agents. The 5
206/// `BASE-*` extends templates in [`EMBEDDED_TM_AGENT_SOURCES`] are
207/// deliberately NOT entries here — they are extends-sources only, never
208/// dispatchable — and trusty-mpm's own `engineer` agent is excluded from the
209/// roster upstream (#2958's roster decision) precisely because it would
210/// collide with tcode's `engineer` below;
211/// `assets::tests::no_name_collisions_across_the_33_agent_roster` pins that
212/// no collision exists in the final table.
213///
214/// Why: gives `agents::load_all_agents`'s embedded-fallback branch a fixed,
215/// ordered table to parse when the disk `.claude/agents/` directory is empty
216/// or absent. `pm` specifically fixes #3437: `task::protocol::task_run`
217/// defaults an omitted `agent_name` to the literal `"pm"`
218/// (`task/protocol.rs`), which resolved against NEITHER a disk
219/// `~/.claude/agents/pm.md` NOR this table before #3437 — so every
220/// daemon-default (including every GUI-initiated, agent-name-omitting) run
221/// failed agent resolution before a single turn executed.
222/// What: `engineer` (general implementation, full read/write tool set),
223/// `qa-agent` (verification — read/inspect/run only, no `write_file`/`edit`,
224/// hands bugs back to the engineer rather than fixing them), `code-reviewer`
225/// (adversarial, read-only review, no `bash`), `pm` (orchestrator/default —
226/// delegates when `delegate_to_agent` is available, executes directly
227/// otherwise; see `assets/agents/pm.md`) — all four [`EmbeddedAgent::Direct`].
228/// Then the 29 [`EmbeddedAgent::Composed`] roster agents, alphabetical,
229/// matching [`EMBEDDED_TM_AGENT_SOURCES`]'s roster ordering. Four of them
230/// (`qa`, `code-critic`, `code-analyzer`, `web-qa`) carry a tcode-only
231/// restrictive `tools:` override in their `.md` source — see this module's
232/// "Tools-restriction deviation" doc section above.
233/// Test: `assets::tests::default_agents_parse_and_names_match`,
234/// `assets::tests::base_templates_are_never_dispatchable`,
235/// `assets::tests::no_name_collisions_across_the_33_agent_roster`,
236/// `assets::tests::ticketing_is_dispatchable_for_cross_product_delegation`,
237/// `assets::tests::restricted_reviewer_agents_carry_read_only_tools`,
238/// `assets::tests::documentation_and_research_remain_unrestricted`,
239/// `assets::tests::default_task_run_agent_resolves_against_default_agents`,
240/// `assets::tests::every_embedded_agent_model_normalizes_to_a_valid_slug`.
241pub const DEFAULT_AGENTS: &[EmbeddedAgent] = &[
242 EmbeddedAgent::Direct {
243 name: "engineer",
244 md: ENGINEER_MD,
245 },
246 EmbeddedAgent::Direct {
247 name: "qa-agent",
248 md: QA_AGENT_MD,
249 },
250 EmbeddedAgent::Direct {
251 name: "code-reviewer",
252 md: CODE_REVIEWER_MD,
253 },
254 EmbeddedAgent::Direct {
255 name: "pm",
256 md: PM_MD,
257 },
258 EmbeddedAgent::Composed { name: "api-qa" },
259 EmbeddedAgent::Composed {
260 name: "code-analyzer",
261 },
262 EmbeddedAgent::Composed {
263 name: "code-critic",
264 },
265 EmbeddedAgent::Composed {
266 name: "dart-engineer",
267 },
268 EmbeddedAgent::Composed {
269 name: "data-engineer",
270 },
271 EmbeddedAgent::Composed {
272 name: "documentation",
273 },
274 EmbeddedAgent::Composed {
275 name: "golang-engineer",
276 },
277 EmbeddedAgent::Composed {
278 name: "java-engineer",
279 },
280 EmbeddedAgent::Composed {
281 name: "javascript-engineer",
282 },
283 EmbeddedAgent::Composed { name: "local-ops" },
284 EmbeddedAgent::Composed {
285 name: "nextjs-engineer",
286 },
287 EmbeddedAgent::Composed {
288 name: "elixir-engineer",
289 },
290 EmbeddedAgent::Composed {
291 name: "phoenix-engineer",
292 },
293 EmbeddedAgent::Composed {
294 name: "php-engineer",
295 },
296 EmbeddedAgent::Composed {
297 name: "prompt-engineer",
298 },
299 EmbeddedAgent::Composed {
300 name: "python-engineer",
301 },
302 EmbeddedAgent::Composed { name: "qa" },
303 EmbeddedAgent::Composed {
304 name: "react-engineer",
305 },
306 EmbeddedAgent::Composed {
307 name: "refactoring-engineer",
308 },
309 EmbeddedAgent::Composed { name: "research" },
310 EmbeddedAgent::Composed {
311 name: "ruby-engineer",
312 },
313 EmbeddedAgent::Composed {
314 name: "rust-engineer",
315 },
316 EmbeddedAgent::Composed { name: "security" },
317 EmbeddedAgent::Composed {
318 name: "svelte-engineer",
319 },
320 EmbeddedAgent::Composed {
321 name: "tauri-engineer",
322 },
323 // #4027: non-coding ticketing specialist, reachable from trusty-agents'
324 // widened cross-product bridge (#4026). See this module's "Non-coding
325 // cross-product roster addition" doc section.
326 EmbeddedAgent::Composed { name: "ticketing" },
327 EmbeddedAgent::Composed {
328 name: "typescript-engineer",
329 },
330 EmbeddedAgent::Composed { name: "web-qa" },
331 EmbeddedAgent::Composed {
332 name: "web-ui-engineer",
333 },
334];
335
336// -- Slice E2 (#2958): embedded tm agent catalog, for `md_loader`'s in-memory
337// extends-composer. Slice E3 wires the 28 roster names above into
338// `DEFAULT_AGENTS` as `EmbeddedAgent::Composed` entries; this table remains
339// their content source, resolved at load time via
340// `agents::md_loader::project_embedded_md_with_extends`. --
341
342const BASE_AGENT_MD: &str = trusty_agents_common::agent_assets::BASE_AGENT;
343const BASE_ENGINEER_MD: &str = trusty_agents_common::agent_assets::BASE_ENGINEER;
344const BASE_OPS_MD: &str = trusty_agents_common::agent_assets::BASE_OPS;
345const BASE_QA_MD: &str = trusty_agents_common::agent_assets::BASE_QA;
346const BASE_RESEARCH_MD: &str = trusty_agents_common::agent_assets::BASE_RESEARCH;
347
348/// The 5 `BASE-*` extends-template names — composition bases only, never
349/// meant to be dispatched directly (issue #3465 follow-up: the Agents
350/// catalog listing was surfacing these to end users).
351///
352/// Why: single source of truth for "is this name a composition base"
353/// (issue #3449's `agents.list`) instead of a scattered `starts_with`
354/// check re-implemented per call site — `assets::tests::
355/// base_templates_are_never_dispatchable` (this table never leaks into
356/// [`DEFAULT_AGENTS`]) and `agents::protocol::is_base_agent` (the disk-tier
357/// catalog listing never surfaces one of these names even when a project's
358/// `.claude/agents/` dir has real `BASE-*.md` files on disk, as trusty-mpm's
359/// own bundle installs them — see `crates/trusty-mpm/src/core/bundle_all.rs`)
360/// both key off this list rather than duplicating it. Matched
361/// case-insensitively against a lowercased candidate — the on-disk filename
362/// convention is `BASE-QA.md` while frontmatter `name:`/`extends:` values
363/// are lowercase `base-qa`.
364/// Test: `assets::tests::base_templates_are_never_dispatchable`,
365/// `agents::protocol::tests::list_excludes_base_agents_but_resolve_agent_still_finds_them`.
366pub const BASE_AGENT_NAMES: &[&str] = &[
367 "base-agent",
368 "base-engineer",
369 "base-ops",
370 "base-qa",
371 "base-research",
372];
373
374const API_QA_MD: &str = trusty_agents_common::agent_assets::API_QA;
375const CODE_ANALYZER_MD: &str = include_str!("agents/code-analyzer.md");
376const CODE_CRITIC_MD: &str = include_str!("agents/code-critic.md");
377const DART_ENGINEER_MD: &str = trusty_agents_common::agent_assets::DART_ENGINEER;
378const DATA_ENGINEER_MD: &str = trusty_agents_common::agent_assets::DATA_ENGINEER;
379const DOCUMENTATION_MD: &str = trusty_agents_common::agent_assets::DOCUMENTATION;
380const GOLANG_ENGINEER_MD: &str = trusty_agents_common::agent_assets::GOLANG_ENGINEER;
381const JAVA_ENGINEER_MD: &str = trusty_agents_common::agent_assets::JAVA_ENGINEER;
382const JAVASCRIPT_ENGINEER_MD: &str = trusty_agents_common::agent_assets::JAVASCRIPT_ENGINEER;
383const LOCAL_OPS_MD: &str = trusty_agents_common::agent_assets::LOCAL_OPS;
384const NEXTJS_ENGINEER_MD: &str = trusty_agents_common::agent_assets::NEXTJS_ENGINEER;
385const ELIXIR_ENGINEER_MD: &str = trusty_agents_common::agent_assets::ELIXIR_ENGINEER;
386const PHOENIX_ENGINEER_MD: &str = trusty_agents_common::agent_assets::PHOENIX_ENGINEER;
387const PHP_ENGINEER_MD: &str = trusty_agents_common::agent_assets::PHP_ENGINEER;
388const PROMPT_ENGINEER_MD: &str = trusty_agents_common::agent_assets::PROMPT_ENGINEER;
389const PYTHON_ENGINEER_MD: &str = trusty_agents_common::agent_assets::PYTHON_ENGINEER;
390const QA_MD: &str = include_str!("agents/qa.md");
391const REACT_ENGINEER_MD: &str = trusty_agents_common::agent_assets::REACT_ENGINEER;
392const REFACTORING_ENGINEER_MD: &str = trusty_agents_common::agent_assets::REFACTORING_ENGINEER;
393const RESEARCH_MD: &str = trusty_agents_common::agent_assets::RESEARCH;
394const RUBY_ENGINEER_MD: &str = trusty_agents_common::agent_assets::RUBY_ENGINEER;
395const RUST_ENGINEER_MD: &str = trusty_agents_common::agent_assets::RUST_ENGINEER;
396const SECURITY_MD: &str = trusty_agents_common::agent_assets::SECURITY;
397const SVELTE_ENGINEER_MD: &str = trusty_agents_common::agent_assets::SVELTE_ENGINEER;
398const TAURI_ENGINEER_MD: &str = trusty_agents_common::agent_assets::TAURI_ENGINEER;
399// #4027: byte-parity copy of trusty-mpm's ticketing agent.
400const TICKETING_MD: &str = trusty_agents_common::agent_assets::TICKETING;
401const TYPESCRIPT_ENGINEER_MD: &str = trusty_agents_common::agent_assets::TYPESCRIPT_ENGINEER;
402const WEB_QA_MD: &str = include_str!("agents/web-qa.md");
403const WEB_UI_ENGINEER_MD: &str = trusty_agents_common::agent_assets::WEB_UI_ENGINEER;
404
405/// The embedded tm agent catalog's raw sources (Slice E2, #2958): the 5
406/// `BASE-*` extends templates plus the 29 roster agents (the 28
407/// coding-relevant ones Bob selected in #2958, plus `ticketing` from #4027) (mpm/memory/cloud-vendor agents excluded -- see the
408/// issue's roster decision). Keyed by each asset's ORIGINAL embedded
409/// filename (`"BASE-QA.md"`, `"rust-engineer.md"`, ...) rather than a
410/// pre-lowercased bare name, because
411/// `trusty_agents_common::agents::builder_in_memory::InMemorySources::insert`
412/// already lowercases and strips a trailing `.md` on both insert and lookup
413/// (Slice E1, PR #3013) -- so `("BASE-QA.md", ...)` resolves an
414/// `extends: base-qa` reference with no extra normalisation needed here.
415///
416/// Why: `agents::md_loader::project_embedded_md_with_extends` needs a single
417/// batch source for `build_in_memory_source_map` instead of 34 individual
418/// `insert` calls; this table is that source. Kept separate from
419/// [`DEFAULT_AGENTS`] (rather than folded into it) because this table's key
420/// space includes the 5 `BASE-*` templates, which must remain resolvable as
421/// `extends:` targets while staying permanently non-dispatchable -- merging
422/// the two tables would require a third state ("resolvable but not listed")
423/// that the current `Direct`/`Composed` enum has no need to express.
424/// What: 34 `(original_filename, raw_md_content)` pairs: 5 `BASE-*` templates
425/// (never dispatchable) plus the 29 roster agents (dispatchable as of Slice
426/// E3 via [`DEFAULT_AGENTS`]'s `EmbeddedAgent::Composed` entries, which
427/// resolve against this table at load time).
428/// Test: `assets::tests::embedded_tm_agent_sources_has_34_entries_and_unique_keys`,
429/// `assets::tests::base_templates_are_never_dispatchable`,
430/// `md_loader::tests::project_embedded_md_with_extends_resolves_rust_engineer_from_base_engineer`.
431pub const EMBEDDED_TM_AGENT_SOURCES: &[(&str, &str)] = &[
432 ("BASE-AGENT.md", BASE_AGENT_MD),
433 ("BASE-ENGINEER.md", BASE_ENGINEER_MD),
434 ("BASE-OPS.md", BASE_OPS_MD),
435 ("BASE-QA.md", BASE_QA_MD),
436 ("BASE-RESEARCH.md", BASE_RESEARCH_MD),
437 ("api-qa.md", API_QA_MD),
438 ("code-analyzer.md", CODE_ANALYZER_MD),
439 ("code-critic.md", CODE_CRITIC_MD),
440 ("dart-engineer.md", DART_ENGINEER_MD),
441 ("data-engineer.md", DATA_ENGINEER_MD),
442 ("documentation.md", DOCUMENTATION_MD),
443 ("golang-engineer.md", GOLANG_ENGINEER_MD),
444 ("java-engineer.md", JAVA_ENGINEER_MD),
445 ("javascript-engineer.md", JAVASCRIPT_ENGINEER_MD),
446 ("local-ops.md", LOCAL_OPS_MD),
447 ("nextjs-engineer.md", NEXTJS_ENGINEER_MD),
448 ("elixir-engineer.md", ELIXIR_ENGINEER_MD),
449 ("phoenix-engineer.md", PHOENIX_ENGINEER_MD),
450 ("php-engineer.md", PHP_ENGINEER_MD),
451 ("prompt-engineer.md", PROMPT_ENGINEER_MD),
452 ("python-engineer.md", PYTHON_ENGINEER_MD),
453 ("qa.md", QA_MD),
454 ("react-engineer.md", REACT_ENGINEER_MD),
455 ("refactoring-engineer.md", REFACTORING_ENGINEER_MD),
456 ("research.md", RESEARCH_MD),
457 ("ruby-engineer.md", RUBY_ENGINEER_MD),
458 ("rust-engineer.md", RUST_ENGINEER_MD),
459 ("security.md", SECURITY_MD),
460 ("svelte-engineer.md", SVELTE_ENGINEER_MD),
461 ("tauri-engineer.md", TAURI_ENGINEER_MD),
462 ("ticketing.md", TICKETING_MD),
463 ("typescript-engineer.md", TYPESCRIPT_ENGINEER_MD),
464 ("web-qa.md", WEB_QA_MD),
465 ("web-ui-engineer.md", WEB_UI_ENGINEER_MD),
466];
467
468const API_DESIGN_PATTERNS_SKILL: &str = include_str!("skills/api-design-patterns/SKILL.md");
469const API_DOCUMENTATION_SKILL: &str = include_str!("skills/api-documentation/SKILL.md");
470const ARTIFACTS_BUILDER_SKILL: &str = include_str!("skills/artifacts-builder/SKILL.md");
471const BRAINSTORMING_SKILL: &str = include_str!("skills/brainstorming/SKILL.md");
472const CODE_PRODUCTION_PROCESS_SKILL: &str = include_str!("skills/code-production-process/SKILL.md");
473const CODE_REVIEW_STANDARDS_SKILL: &str = include_str!("skills/code-review-standards/SKILL.md");
474const CONDITION_BASED_WAITING_SKILL: &str = include_str!("skills/condition-based-waiting/SKILL.md");
475const CONTRACT_DRIVEN_TESTING_SKILL: &str = include_str!("skills/contract-driven-testing/SKILL.md");
476const DATABASE_MIGRATION_SKILL: &str = include_str!("skills/database-migration/SKILL.md");
477const DOCUMENTATION_STYLE_SKILL: &str = include_str!("skills/documentation-style/SKILL.md");
478const ENV_MANAGER_SKILL: &str = include_str!("skills/env-manager/SKILL.md");
479const GIT_WORKFLOW_SKILL: &str = include_str!("skills/git-workflow/SKILL.md");
480const INTERNAL_COMMS_SKILL: &str = include_str!("skills/internal-comms/SKILL.md");
481const JSON_DATA_HANDLING_SKILL: &str = include_str!("skills/json-data-handling/SKILL.md");
482const MODEL_CONTEXT_BUILDER_SKILL: &str = include_str!("skills/model-context-builder/SKILL.md");
483const REQUESTING_CODE_REVIEW_SKILL: &str = include_str!("skills/requesting-code-review/SKILL.md");
484const ROOT_CAUSE_TRACING_SKILL: &str = include_str!("skills/root-cause-tracing/SKILL.md");
485const SECURITY_SCANNING_SKILL: &str = include_str!("skills/security-scanning/SKILL.md");
486const SOFTWARE_PATTERNS_SKILL: &str = include_str!("skills/software-patterns/SKILL.md");
487const SYSTEMATIC_DEBUGGING_SKILL: &str = include_str!("skills/systematic-debugging/SKILL.md");
488const TEST_DRIVEN_DEVELOPMENT_SKILL: &str = include_str!("skills/test-driven-development/SKILL.md");
489const TEST_QUALITY_INSPECTOR_SKILL: &str = include_str!("skills/test-quality-inspector/SKILL.md");
490const TESTING_ANTI_PATTERNS_SKILL: &str = include_str!("skills/testing-anti-patterns/SKILL.md");
491const VERIFICATION_BEFORE_COMPLETION_SKILL: &str =
492 include_str!("skills/verification-before-completion/SKILL.md");
493const WEB_PERFORMANCE_OPTIMIZATION_SKILL: &str =
494 include_str!("skills/web-performance-optimization/SKILL.md");
495const WEBAPP_TESTING_SKILL: &str = include_str!("skills/webapp-testing/SKILL.md");
496const WRITING_PLANS_SKILL: &str = include_str!("skills/writing-plans/SKILL.md");
497const XLSX_SKILL: &str = include_str!("skills/xlsx/SKILL.md");
498
499/// trusty-mpm's universal skill set, embedded at compile time (`tm-*`
500/// orchestration skills excluded — see module docs).
501///
502/// Why: gives `skills::discover_skill_metadata`'s embedded-fallback branch a
503/// fixed, ordered table to build a `SkillMetadata` catalog from when the disk
504/// `.claude/skills/` directory is empty or absent.
505/// What: 28 skills, sorted by name, each an `EmbeddedSkill { name, skill_md }`.
506/// Test: `assets::tests::default_skills_names_are_unique`.
507pub const DEFAULT_SKILLS: &[EmbeddedSkill] = &[
508 EmbeddedSkill {
509 name: "api-design-patterns",
510 skill_md: API_DESIGN_PATTERNS_SKILL,
511 },
512 EmbeddedSkill {
513 name: "api-documentation",
514 skill_md: API_DOCUMENTATION_SKILL,
515 },
516 EmbeddedSkill {
517 name: "artifacts-builder",
518 skill_md: ARTIFACTS_BUILDER_SKILL,
519 },
520 EmbeddedSkill {
521 name: "brainstorming",
522 skill_md: BRAINSTORMING_SKILL,
523 },
524 EmbeddedSkill {
525 name: "code-production-process",
526 skill_md: CODE_PRODUCTION_PROCESS_SKILL,
527 },
528 EmbeddedSkill {
529 name: "code-review-standards",
530 skill_md: CODE_REVIEW_STANDARDS_SKILL,
531 },
532 EmbeddedSkill {
533 name: "condition-based-waiting",
534 skill_md: CONDITION_BASED_WAITING_SKILL,
535 },
536 EmbeddedSkill {
537 name: "contract-driven-testing",
538 skill_md: CONTRACT_DRIVEN_TESTING_SKILL,
539 },
540 EmbeddedSkill {
541 name: "database-migration",
542 skill_md: DATABASE_MIGRATION_SKILL,
543 },
544 EmbeddedSkill {
545 name: "documentation-style",
546 skill_md: DOCUMENTATION_STYLE_SKILL,
547 },
548 EmbeddedSkill {
549 name: "env-manager",
550 skill_md: ENV_MANAGER_SKILL,
551 },
552 EmbeddedSkill {
553 name: "git-workflow",
554 skill_md: GIT_WORKFLOW_SKILL,
555 },
556 EmbeddedSkill {
557 name: "internal-comms",
558 skill_md: INTERNAL_COMMS_SKILL,
559 },
560 EmbeddedSkill {
561 name: "json-data-handling",
562 skill_md: JSON_DATA_HANDLING_SKILL,
563 },
564 EmbeddedSkill {
565 name: "model-context-builder",
566 skill_md: MODEL_CONTEXT_BUILDER_SKILL,
567 },
568 EmbeddedSkill {
569 name: "requesting-code-review",
570 skill_md: REQUESTING_CODE_REVIEW_SKILL,
571 },
572 EmbeddedSkill {
573 name: "root-cause-tracing",
574 skill_md: ROOT_CAUSE_TRACING_SKILL,
575 },
576 EmbeddedSkill {
577 name: "security-scanning",
578 skill_md: SECURITY_SCANNING_SKILL,
579 },
580 EmbeddedSkill {
581 name: "software-patterns",
582 skill_md: SOFTWARE_PATTERNS_SKILL,
583 },
584 EmbeddedSkill {
585 name: "systematic-debugging",
586 skill_md: SYSTEMATIC_DEBUGGING_SKILL,
587 },
588 EmbeddedSkill {
589 name: "test-driven-development",
590 skill_md: TEST_DRIVEN_DEVELOPMENT_SKILL,
591 },
592 EmbeddedSkill {
593 name: "test-quality-inspector",
594 skill_md: TEST_QUALITY_INSPECTOR_SKILL,
595 },
596 EmbeddedSkill {
597 name: "testing-anti-patterns",
598 skill_md: TESTING_ANTI_PATTERNS_SKILL,
599 },
600 EmbeddedSkill {
601 name: "verification-before-completion",
602 skill_md: VERIFICATION_BEFORE_COMPLETION_SKILL,
603 },
604 EmbeddedSkill {
605 name: "web-performance-optimization",
606 skill_md: WEB_PERFORMANCE_OPTIMIZATION_SKILL,
607 },
608 EmbeddedSkill {
609 name: "webapp-testing",
610 skill_md: WEBAPP_TESTING_SKILL,
611 },
612 EmbeddedSkill {
613 name: "writing-plans",
614 skill_md: WRITING_PLANS_SKILL,
615 },
616 EmbeddedSkill {
617 name: "xlsx",
618 skill_md: XLSX_SKILL,
619 },
620];
621
622// -- Tests --------------------------------------------------------------------
623// Split into `tests.rs` (not inlined) to keep this include-table file thin;
624// see `tests.rs` module docs.
625
626#[cfg(test)]
627mod tests;