Skip to main content

Module skill_refs

Module skill_refs 

Source
Expand description

Skill files a composed tcode agent body points at by absolute path (#7727).

Why: the shared BASE-AGENT.md tells an agent to open a skill file with its read tool at {{TM_SKILLS}}/<skill>/SKILL.md. trusty-mpm resolves that placeholder to its own deployed skills tier; tcode has no such tier, and its read_file is confined to the run’s project or scratch root, so a pointer into any other real directory is one the agent cannot open. What: REFERENCED_SKILL_FILES embeds every file a roster pointer names. Two resolutions exist:

  • The project roster deploy writes the files beneath <project>/.trusty-code/skill-refs (project_skill_refs_dir, materialize_skill_refs); the pointers land inside the project root.
  • An in-process compose (embedded fallback, a disk agent carrying the placeholder) resolves to user_skill_refs_dir with no disk I/O (resolve_skill_refs). read_file built with ReadFileTool::with_skill_refs serves exactly those paths from embedded_skill_ref, so the pointer opens in bound and projectless runs alike and compose never depends on a writable home.

Neither directory is a skill-discovery directory, so these copies never shadow the embedded skill catalog. Test: agents::skill_refs::tests, tools::fs::read::tests::skill_ref_*.

Constants§

REFERENCED_SKILL_FILES
(path relative to the skills root, file content) for every skill file a shared roster pointer names. Byte copies of trusty-mpm’s bundled skills, pinned by referenced_copies_match_trusty_mpm_skills.
SKILL_REFS_DIRNAME
Directory name, beneath a .trusty-code root, holding the referenced files.

Functions§

embedded_skill_ref
The embedded content for relative, a path beneath a skill-refs root.
materialize_skill_refs
Write every REFERENCED_SKILL_FILES entry beneath a pinned dir.
project_skill_refs_dir
<project>/.trusty-code/skill-refs — the root the project roster deploy uses.
resolve_skill_refs
Resolve the skills-root placeholder in a composed body against dir.
user_skill_refs_dir
~/.trusty-code/skill-refs — the address in-process composes resolve to.