Install skills
A skill tells an agent how to carry out one kind of task, step by step, and which rules each step applies. Installing skills with Trailguide gives every checkout of your project the same skills, from the revisions you choose, beside the rules they cite.
Skills come from sources: the repositories your project takes skills and rules from. A source is usually a library, but any Git repository of skill folders works too.
In this guide, you’ll see which skills your sources offer, install a library’s required and recommended skills, and find out where they land. You’ll also install skills from a repository that isn’t a library, resolve a name clash, exclude or fork a skill, write your own, and commit the result.
Start with a project that already has a .trailguide/ directory. If you haven’t created one, follow Set up your first project. To choose rules as well, see Include rules.
Check which agents get skills
Section titled “Check which agents get skills”Trailguide installs a copy of each skill into the folders your agents read. skills.installFor in .trailguide/config.yaml names the agents:
schemaVersion: 3sources: {}skills: installFor: [claude-code, codex]For claude-code, Trailguide installs into .claude/skills/, which Claude Code reads. For codex, it installs into .agents/skills/, which Codex, Cursor, and other agents that follow the shared convention read. On a new project in a terminal, trailguide project init asks which agents your team uses, and it writes both by default, and nothing is written to either folder until the project installs a skill. To skip the question, pass the agents, such as trailguide project init --install-for claude-code,cursor. To change them later, edit installFor, or rerun init with --install-for, then run trailguide project sync to install and remove copies to match.
To record which skills your sources require before you choose agents, set installFor: []. Trailguide still records and checks every skill and lists it in .trailguide/SKILLS.md, but writes no installed copies, and sync warns that it installed nothing. See Install skills for agents.
Add a library
Section titled “Add a library”Add your organization’s library as a source:
trailguide project add source fabrica \ --repository https://github.com/fabricahq/.trailguide.git \ --skills recommended \ --non-interactiveThis records the source in .trailguide/config.yaml, and includes its recommended skills:
sources: fabrica: repository: https://github.com/fabricahq/.trailguide.git ref: release/4skills: installFor: [claude-code, codex] include: [fabrica:recommended]Then sync:
trailguide project syncWhat a library’s skills install depends on the level the library sets for each one:
- Required skills always install. Even a source with no
includeat all installs them, now and after every update that adds one. - Recommended skills install because you included
fabrica:recommended. - Available skills install only when you name them, or include
fabrica:*for everything the library publishes.
A skill the library curates only because its own skills call it is a dependency: it installs with the library’s skills that call it, and you can’t include it on its own. trailguide project list skills shows it with the level dependency.
To add an available skill, name its ID beside fabrica:recommended:
skills: include: [fabrica:recommended, fabrica:skills/deploy-preview]Or run trailguide add skill, which adds the selector to skills.include and syncs, so the skill is installed when it returns. Name a repository the project has no source for, such as fabricahq/public-library:skills/fk-build-ui, and it adds the source too. See add skill and add rule.
trailguide add skill fabrica:skills/deploy-previewIncluding a rule group’s rules never installs a skill, and including a skill never includes a rule group’s rules. See Skill selectors.
Sync takes the source’s newest library release, records it in .trailguide/lock.json, and installs every skill from that one release. Later syncs keep that release, even for skills you include later: a skill that isn’t in the recorded release makes sync fail and name trailguide project update fabrica, the command that moves the source. See Update skills.
See what’s available
Section titled “See what’s available”List the skills in your project, with their levels:
trailguide project list skillsSKILL LEVEL SET BY STATUSfabrica:mattpocock:skills/engineering/to-spec recommended fabrica, release 7 installedfabrica:mattpocock:skills/productivity/grilling available fabrica, release 7 not installedfabrica:skills/build-feature recommended fabrica, release 7 installedfabrica:skills/deploy-preview available fabrica, release 7 installedfabrica:skills/review-change available fabrica, release 7 not installedfabrica:skills/ship-service required fabrica, release 7 installedfabrica:skills/tdd available fabrica, release 7 installedEach row shows a skill’s ID, its level and the library release that set it, and whether the project installs it. installed covers skills you included, required skills, and skills another installed skill uses; not installed means a source publishes it and the project doesn’t install it. The list comes from the library release your project recorded, so it doesn’t show skills a newer release adds until you run trailguide project update fabrica.
The mattpocock: skills are curated: Fabrica’s library publishes them, but their files come from the original repository, at a commit your project resolves when it updates. See Curated skills.
Add --json to get the list for scripts. See project list skills for every column and status.
What lands where
Section titled “What lands where”After sync, each installed skill appears in several places. Trailguide writes all of them, so don’t edit them by hand:
.claude/skills/build-feature/and.agents/skills/build-feature/: the installed copies your agents load, one folder per target..trailguide/vendor/fabrica/skills/build-feature/: the original files, as the library published that version..trailguide/SKILLS.md: one entry per installed skill, with its description, ID and version, level and the library that set it, type, installed paths, how many rules it applies, the skills it calls, and why it’s installed..trailguide/generated/installed-skills.json: which folders in the targets Trailguide installed..trailguide/generated/references/fabrica/: a reading copy of each file an installed skill links to outside its own folder, such as a sibling skill it compares itself with or a shared checklist. These copies aren’t skills: agents reach them only by following the links.
An installed copy matches the library’s folder, scripts and their executable bits included, with two additions to SKILL.md:
- A marker comment as the first line after the frontmatter, naming the skill’s project ID and version, such as
<!-- trailguide:installed fabrica:skills/build-feature 1.3.0. Do not edit; trailguide project sync replaces this copy. -->. - When the skill cites rules, a generated section at the end, Rules this skill applies, which links to your project’s version of each rule the skill cites, and a Skills this skill uses line when it calls others.
Links that leave the skill’s folder are changed so they still reach their file from the installed copy: a link to a skill you also install points at its installed copy, under the name you give it, or at your fork of it, and any other link points at a reading copy in generated/references/. Web links stay as they are.
Don’t edit installed copies: the next sync replaces them, and trailguide project check reports the difference. To change a skill, fork it.
Trailguide writes only the skill folders it installs. Other folders in .claude/skills/ and .agents/skills/, such as a skill another tool installed, stay as they are. When one of them has the name of a skill you install, sync fails with skill-folder-not-managed instead of overwriting it. See Installed skills and Who owns the target folders.
RULES.md gains one line pointing to SKILLS.md, so agents whose tools don’t load skills from the target folders still find them through the instructions in your AGENTS.md.
Skills a skill calls, and the rules it cites
Section titled “Skills a skill calls, and the rules it cites”A skill can call other skills and cite rules. When you install it, Trailguide installs those too:
- Skills it calls. Every skill in its
trailguide-skills-usedlist, and the skills those call, from the same repository and revision, or, for a skill the library curates, from the repository the library curates it from.SKILLS.mdsays each was installed because another skill uses it. - Rules it cites. Every rule in its
trailguide-rules-usedlist, from the same library, even ones your ruleincludedoesn’t name. These cited rules are reference-only: each gets its generated rule file, and the installed skill links to it, butRULES.mddoesn’t list it. Installing a skill never widens the rules your agents apply to all work.
If you exclude or replace a cited rule, the installed skill follows your choice: it links to your replacement, or says the rule is excluded by this project, with your reason. A cited rule your project also includes is an ordinary rule.
When a skill calls another without saying so in trailguide-skills-used, as many third-party skills do, declare the call under skills.uses, so Trailguide installs both:
skills: uses: pstack:skills/architect: [pstack:skills/how]Trailguide doesn’t search skill text for calls it wasn’t told about. See Declare the skills a skill calls.
When a skill links to a skill you exclude
Section titled “When a skill links to a skill you exclude”A skill you install can link to one you exclude, such as attack-the-premise comparing itself with redesign. Excluding redesign keeps it out of your agents’ skills folders and SKILLS.md’s available skills, but the link still works: sync keeps the files the link reaches, from the same revision, as reading copies in generated/references/, and warns, naming both skills:
$ trailguide project sync...Warning: fabrica:skills/attack-the-premise references fabrica:skills/redesign, which this project excludes. fabrica:skills/redesign won't be installed as a skill, but its referenced files will be retained for reading. To leave them out too, add fabrica:skills/attack-the-premise to skills.exclude, or fork it without the link.When the link is reached through other files, such as a shared checklist, the warning adds the chain of files it goes through, by their paths in the source’s repository. A skill that both calls and links to the skill you exclude gets one warning that says both. Build and update give the same warning, and --json output lists each one under excludedSkillLinks.
An agent that follows the link reads the excluded skill’s text, and could act on it. If you excluded the skill because you don’t want agents to see it, exclude or fork the skill that links to it as well.
When a skill links to a file you can’t keep
Section titled “When a skill links to a file you can’t keep”Sometimes a skill links to a file your project can’t deliver: the file doesn’t exist at the revision you install, the link names a folder or a rule file, or it points into a fork that lacks the file. Sync and update check every link before they write anything, so they fail, leave your files as they were, and name the file with the link, the link, the source and revision, and the chain of links that reached it:
$ trailguide project syncError: sources.fabrica: .trailguide/skills/fabrica/redesign/references/steps.md: links to gone.md (.trailguide/skills/fabrica/redesign/references/gone.md) at commit 4c1d2e3..., which the revision doesn't have. The source's maintainer can fix it, and trailguide library check reports it to them. Until then, stop including the skill that links to it, or exclude it. The link is reached through .trailguide/skills/review/SKILL.md -> .trailguide/skills/redesign/SKILL.md -> .trailguide/skills/fabrica/redesign/references/steps.md.Choose the repair the message lists. When the file is missing from the source, the source’s maintainer fixes the link; trailguide library check reports it in their library.
A project synced with an older Trailguide has no copies of the files its skills link to, so build and check fail with reference-not-retained. They work offline, so they never fetch the files themselves. Take them from the revision your lockfile records, without moving any source:
trailguide project syncInstall skills from a repository that isn’t a library
Section titled “Install skills from a repository that isn’t a library”Not every useful skill lives in a library. Any Git repository that holds skill folders works as a source, such as a third party’s collection. Add it the same way:
trailguide project add source pstack \ --repository https://github.com/example/pstack.git \ --ref main \ --skills skills/architect \ --non-interactivesources: pstack: repository: https://github.com/example/pstack.git ref: mainskills: installFor: [claude-code, codex] include: [pstack:skills/architect]Then run trailguide project sync. You don’t declare what kind of source it is: Trailguide finds that the repository has no library manifest, so it’s a non-library source.
- Every skill is available. Nothing installs until you name it, or include
pstack:*for every skill in the repository. - A ref is required. A non-library source has no library releases, so
refmust name a branch, tag, or commit. With a branch, sync installs the newest commit on it the first time and records it; later syncs keep that commit, andtrailguide project updatemoves to the branch’s newest commit and shows which skill folders and files changed. - IDs are paths. Each folder with a
SKILL.mdis a skill, and its ID is the folder’s path in the repository, such asskills/architect. - Expect warnings, not failures. Trailguide checks these skills leniently: where one doesn’t follow the Agent Skills format, sync warns and installs it as it is. A non-library source has no rules or versions, so naming its rules in
rulesis rejected. - Check the license. Trailguide looks for terms in the skill’s
licensefield, then aLICENSE*file in its folder, thenLICENSE*andNOTICE*files at the repository root. When a skill has none, sync fails withlicense-not-found; ask the owner to add a license, or stop including the skill.
Some repositories keep several collections side by side, such as a marketplace that keeps each plugin in its own folder. To take one folder, add --path with a branch, tag, or commit --ref:
trailguide project add source pstack \ --repository https://github.com/example/plugins.git \ --ref main --path pstack \ --skills skills/architect \ --non-interactiveIDs then start from the folder, so pstack:skills/architect names pstack/skills/architect, and pstack:* takes only that folder’s skills. See Take one folder of a repository.
Trailguide never runs a skill’s scripts. Before you install or update a skill from a repository you don’t control, read its files, scripts included: your agents may run them. To help, the trailguide project update preview flags each new or changed executable script and warns you to read it; see Update skills.
Try a newer version of a curated skill
Section titled “Try a newer version of a curated skill”A library chooses the ref it tracks for each repository it curates skills from, and your project resolves that ref when it updates. To take a curated skill from another revision, declare the same repository as your own source, with your own ref:
sources: fabrica: repository: https://github.com/fabricahq/.trailguide.git ref: release/4 mattpocock: repository: https://github.com/mattpocock/skills.git ref: v2.0.0The skills Fabrica curates from that repository now come from v2.0.0, still at the level Fabrica sets and with the same IDs, such as fabrica:mattpocock:skills/engineering/to-spec. Repository identity and path decide the match, not the source name: when the library curates from one folder of a repository, declare that repository with the same path. Remove the source to go back to the library’s ref.
Resolve a name clash
Section titled “Resolve a name clash”Agents find skills by name, so two installed skills can’t share one. When two sources ship skills with the same name, sync fails with skill-name-clash and writes nothing:
Error: skill-name-clash: fabrica:skills/review-change and pstack:skills/review-change both install as review-change. Give one another name in skills.aliases, or exclude one. No files were written.Give one of them another name, an alias:
skills: include: [fabrica:recommended, fabrica:skills/review-change] aliases: fabrica:skills/review-change: fabrica-reviewThe installed copy is now fabrica-review, in .claude/skills/fabrica-review/. Its ID stays fabrica:skills/review-change. Trailguide doesn’t rewrite the old name where other skills mention it, so every sync that applies the alias warns:
Warning: fabrica:skills/review-change is installed as fabrica-review. Mentions of review-change in skill text aren't rewritten; check the skills that call it by that name.Check whether any installed skill tells the agent to use review-change, the aliased skill’s own text included. After the clash, review-change is the other source’s skill, so an agent following that mention runs the wrong one. Fork any skill you need to change. You can give a required skill an alias too, because it stays installed.
Exclude a skill
Section titled “Exclude a skill”Exclude a skill you don’t want, such as one that fabrica:recommended or fabrica:* brings in, with a reason:
skills: include: [fabrica:recommended] exclude: - id: fabrica:skills/write-changelog reason: Release Planner writes our release notes.An excluded skill isn’t installed, but it stays in vendor/, so updates can show you its changes. When another installed skill calls it, sync warns that the skill it calls isn’t installed. When another installed skill links to it, sync keeps the linked files for reading and warns; see When a skill links to a skill you exclude.
You can’t exclude or fork a required skill: sync fails and names the library that requires it. Required skills are your organization’s floor; to diverge from one, stop using the source.
You can’t pin a skill to a version either: all of a source’s skills come from one revision and move together when the source updates. To keep a skill as it is, fork it, or leave the source at the library release its ref names, which holds every rule and skill from that source. See Update skills.
Fork a skill
Section titled “Fork a skill”To change what an included skill says, fork it into your project:
trailguide project fork skill fabrica:skills/fix-bug \ --reason 'We use our own bug workflow.' \ --non-interactiveThe command copies the version your project installs into .trailguide/skills/fix-bug/, beside your own skills, and records the fork:
skills: forks: skills/fix-bug: from: fabrica:skills/fix-bug basedOn: "9f2c4e1a7b3d5f60817a2b4c6d8e0f1a3b5c7d9e" reason: We use our own bug workflow.Edit the fork, then run trailguide project build. Agents get your fork in place of the library’s skill, which the project no longer installs. basedOn is the commit the fork copied. trailguide project update lists the library’s later changes to the skill and can merge them into your fork, keeping your edits, with --merge-fork fabrica:skills/fix-bug. The library’s license still applies to the copied text. For the whole workflow, including changes that conflict with your edits, see Fork a skill.
Write your own skill
Section titled “Write your own skill”Create a skill for this project alone:
trailguide project create skill review-migration \ --description 'Review a database migration for safety before it merges. Use when a change adds or edits a migration.' \ --type review \ --non-interactiveThe command writes a draft .trailguide/skills/review-migration/SKILL.md, beside any other skills your project writes or forks. Authored skills have no versions; they change when you edit them. In trailguide-rules-used, an authored skill cites rules by project ID, such as fabrica:practices/testing/test-behavior-not-implementation or practices/testing/test-project-contracts for one of your own, because it can cite rules from any source. Write its steps and remove the trailguide:draft marker, then run trailguide project build to install it; build fails while the marker is there. Links in the skill can name any file in your repository, such as ../../../docs/schema.md; build fails when one names a file that isn’t there, and points the installed copy’s links at the same files. Follow Write a skill for how to write one that works.
Personal skills with the same name
Section titled “Personal skills with the same name”People also install skills for themselves, outside any repository, such as in ~/.claude/skills/. When one of those personal skills has the same name as a skill your project installs, each agent decides which to use, and some use the personal one without saying so. trailguide project sync, update, and check read the known personal skill folders and warn about each pair, naming both paths and what each agent does:
Warning: your personal skill ~/.claude/skills/build-feature has the same name as this project's build-feature (fabrica:skills/build-feature, installed at .claude/skills/build-feature). Claude Code uses your personal skill. Grok Build reads both, and its docs don't say which it uses. VS Code reads both, and its docs don't say which it uses.Rename or remove your personal skill to use the project's.Trailguide never writes to your home directory, and the warning doesn’t fail the command. See Personal skills with the same name.
Stop using a source
Section titled “Stop using a source”To stop taking skills and rules from a source, remove it:
trailguide project remove source fabricaThe command removes the source from config.yaml, with every skills and rules entry that names it, such as fabrica:recommended in skills.include, and syncs, so its installed skills and generated rules leave the project. A skill you forked from it stays in .trailguide/skills/, as your own. See project remove source.
Commit the installed skills
Section titled “Commit the installed skills”Commit .trailguide/ and the installed skill folders together:
git add .trailguide .claude/skills .agents/skillsCommitted copies give every checkout, CI job, and fresh cloud session the same skills without running sync. Run trailguide project check in CI: it fails when an installed copy differs from what sync would write, when a folder Trailguide installed is missing, or when generated/installed-skills.json is out of date.
If your .gitignore excludes a target folder, such as with /.claude/, check reports the folders as missing in every fresh checkout. Add an exception for the skills folder. Git can’t re-include a folder inside an excluded folder, so first change the ignore line to exclude the folder’s contents instead:
/.claude/*!/.claude/skills/This keeps ignoring the rest of .claude/, such as local settings, while committing installed skills.