Skip to content

Configuration

Every repository that uses Trailguide as a project has one configuration file, .trailguide/config.yaml. It records the repository’s sources, the skills and rules it includes from them, its exceptions, and the agents to install skills for. A repository with a manifest, .trailguide/library.yaml, is a library, and publishes its authored rules and skills for other repositories. A repository can be a project, a library, or both: config.yaml says what it uses, and library.yaml what it publishes.

Initialize from the repository root. In Git repositories, other commands find the nearest Git root and use its .trailguide/config.yaml. Outside Git, run commands from the repository root. See Working directories. Sync, build, and check validate the fields below.

Use one YAML document. Duplicate keys, anchors, aliases, and explicit tags are rejected. Quote selectors that start with *, such as "*".

schemaVersion: 3
sources:
fabrica:
repository: https://github.com/fabricahq/.trailguide.git
ref: release/4
pstack:
repository: https://github.com/example/plugins.git
ref: main
path: pstack
skills:
installFor: [claude-code, codex]
include: [fabrica:recommended, fabrica:skills/deploy-preview, pstack:*]
aliases:
fabrica:skills/review-change: fabrica-review
uses:
pstack:skills/architect: [pstack:skills/how]
rules:
include: [fabrica:techs/go/*, fabrica:practices/testing/*]
exclude:
- id: fabrica:practices/testing/table-tests
reason: Our test style is documented in CONTRIBUTING.md.
pins:
- id: fabrica:practices/testing/verify-retry-limits
version: "1.3.0"
reason: Waiting on the author's response to fabricahq/.trailguide#45.

This project takes Fabrica’s library release 4, and installs its skills for Claude Code and Codex. It installs the skills Fabrica requires, the ones it recommends, and one other available skill, and installs Fabrica’s review-change skill under another name. From pstack, a plugin that the example/plugins repository keeps in its pstack/ folder, it installs every skill in that folder from the newest commit on main at its last update. It includes every Go rule and every testing rule from Fabrica except one, and keeps one rule at an older version.

Sources say only where each repository is, which revision the project takes, and optionally which folder of it. The top-level skills and rules sections choose from all of them, and name each skill and rule by its source, as <source>:<id>, such as fabrica:skills/deploy-preview.

Repository names, rule IDs, and skill IDs in examples are illustrative. Replace them with libraries, rules, and skills your project can access.

FieldMeaning
schemaVersionRequired. 3. A configuration of version 2, which Trailguide 0.10 and earlier wrote, needs trailguide project migrate.
minTrailguideVersionOptional. The oldest Trailguide release that may work on this repository, such as 0.11.0. Init writes it, and update raises it, as do migrate and, for provenance, the commands that write it. See Minimum Trailguide version.
manageAgentsFileOptional. true, the default, has init, build, sync, and update keep a Trailguide section in the repository’s AGENTS.md, and check verify it. false leaves AGENTS.md alone. See AGENTS.md section.
sourcesMap of stable source names to sources. Use an empty object for a repository that uses only its authored rules and skills.
sources.<name>.repositoryRequired. Explicit HTTPS or SSH Git address, including scp-style SSH. See Repository addresses.
sources.<name>.refRequired. The library release to take the source from, such as release/4, or latest-release, or a branch, tag, or commit. See Refs.
sources.<name>.pathOptional. One folder of the repository to take as the source, such as pstack. IDs in the source are relative to it. Missing means the whole repository. See Take one folder of a repository.
skills.installForOptional. The agents to install skills for, such as [claude-code, codex]. Missing means []. See Install skills for agents.
skills.includeOptional skill selectors: <source>:recommended, <source>:*, or skill IDs.
skills.excludeOptional list of skills to leave out, each with an id and a reason. See Exclude a skill.
skills.forksOptional map of your authored skill’s ID to the source’s skill it’s installed in place of, with from, a reason, and optionally basedOn. See Fork a skill.
skills.aliasesOptional map of a skill ID to the install name it gets in this repository. See Give a skill another name.
skills.usesOptional map of a skill ID to the skill IDs it calls that its own metadata doesn’t declare. See Declare the skills a skill calls.
rules.includeOptional rule selectors: rule IDs, prefixes ending in /*, or <source>:*.
rules.excludeOptional list of rules to leave out, each with an id selector and a reason. See Exclude a rule.
rules.pinsOptional list of rules to hold at one version, each with an id, a version, and a reason. See Pin a rule.
rules.forksOptional map of your authored rule’s ID to the source’s rule agents read it in place of, with from, a reason, and optionally basedOn. See Fork a rule.

Unknown fields are rejected, at every level. Each ID in skills and rules starts with the name of a source the configuration declares; your own authored skills and rules appear only as the keys of forks. A source that skills and rules never name still installs the skills its library requires, and still supplies the skills and rules it is forked from. Authored rules, rule groups, and skills are discovered from rules/ and skills/ in the Trailguide directory; they need no configuration entry. See Project files.

The selection from a source is everything include names in it, minus everything exclude names. Skills and rules each have their own lists, so a skill selector never includes a rule, and a rule selector never installs a skill.

SelectorInstalls
(none for the source)The skills the library requires.
fabrica:recommendedThe skills the library requires and those it recommends.
"fabrica:*"Every skill the source publishes, at any level, but not a dependency.
fabrica:skills/deploy-previewThat skill, whatever its level, plus the required ones.

Skill selectors have no prefixes: fabrica:skills/* and fabrica:recommended/* are rejected. A library’s required skills always install, whatever include says; see Skill levels. A skill a library curates from another repository is named with the library’s name, then the curated source’s name as the library’s manifest gives it, such as fabrica:mattpocock:skills/engineering/to-spec; see Curated skills.

exclude leaves skills out, each entry with a reason. An entry names one skill by its ID, or a level:

EntryLeaves out
fabrica:skills/deploy-previewThat skill.
fabrica:recommendedEvery skill the library recommends, even one include names. Use it with include: ["fabrica:*"] to install the available skills without the recommended ones.
"fabrica:*"Every skill of the source that isn’t required, so the project installs only the library’s required skills. Use it to take a library’s rules without its optional skills.

An exclusion wins over include, but never over a required skill: excluding a required skill by ID fails validation, and a level exclusion leaves required skills installed. A level exclusion also leaves in a skill that another installed skill uses, so the installed skill works; to leave such a skill out, exclude it by ID. recommended fails for a source that isn’t a library, since such a repository recommends nothing; exclude its skills by ID, or exclude "<source>:*" to install none of them.

SelectorIncludes
fabrica:practices/testing/verify-retry-limitsOne rule, by its ID.
fabrica:practices/testing/*Every rule in the practices/testing rule group, at any depth, including rules the library adds to it later.
fabrica:practices/*Every practice rule, in every practice group. fabrica:techs/* is every technology rule.
"fabrica:*"Every rule in the source.

After the source’s name, a selector is a rule ID, or a prefix that ends in /*. The * is allowed only at the end, after a /, or alone: techs/go*, techs/*/testing, and ** are rejected. A rule ID names the rule’s path in its library’s rules/ folder, without .md.

exclude entries take the same forms. Use a prefix to leave out a whole rule group that a wider include brings in:

rules:
include: [fabrica:practices/*]
exclude:
- id: fabrica:practices/observability/*
reason: This CLI has no hosted service to observe.

pins and forks take single rule IDs only.

Each rule ID in include must name a rule the source publishes, and each prefix must match at least one rule, except "<source>:*". A rule included by an ID and also by a prefix is included once. When a rule brings in its rule group, it brings the rule group’s metadata, so the rule group appears in the generated index with only the included rules.

A library sets one of three levels for each skill it publishes, in its manifest:

LevelInstalled in a project that uses the source when
RequiredAlways, whatever skills.include says. The project can’t exclude or fork it.
Recommendedskills.include lists <source>:recommended or <source>:*, or names the skill.
Availableskills.include lists <source>:*, or names the skill.

A library’s own skill that no level lists is available. A source without a manifest, a non-library source, makes every skill it has available and requires none. Libraries of library schema version 2 called this level offered; a project reads it as available.

A curated skill that no level lists, but that one of the library’s own skills names in its trailguide-skills-used, is a dependency: the library has it only because its skills call it, and projects shouldn’t choose it on its own. The library doesn’t list it anywhere; Trailguide infers it from the skills that use it. A dependency isn’t a level, and a skill is either at a level or a dependency, never both:

  • It installs only with the skills that call it. A project installs a dependency when it installs a skill that names it in trailguide-skills-used, or in the project’s skills.uses, and not otherwise.
  • A project can’t choose it. <source>:* and <source>:recommended never include it, and naming it in include fails validation with a message that names the library’s skills that call it, so the project can include one of those instead.
  • It shows as a dependency. trailguide project list skills, SKILLS.md, and the source’s entry in lock.json give it the level dependency, with the skills that use it.
  • A project diverges from it as from any skill a skill uses. Excluding it by ID leaves it uninstalled, and sync warns that the skills that call it lose it. Forking it installs the fork in its place, for the skills that call it.

A library’s own skill that only its other skills use stays available, since a project that names it can use it alone. Libraries of library schema version 2 listed dependencies in library.skills.dependencies, own skills among them; a project still reads that list from their releases.

A project sees only the levels of the libraries it names as sources. When a library curates a skill from another library, the project sees the level the curating library sets, not the one the original library sets: levels don’t chain.

Because required skills install with no include, a source declared with only a repository and a ref installs its library’s required skills, now and after every update that adds one:

sources:
fabrica:
repository: https://github.com/fabricahq/.trailguide.git
ref: release/4

Giving a required skill another name is allowed, since it stays installed.

rules.exclude leaves rules out of the generated guidance. Each entry records why:

rules:
exclude:
- id: fabrica:practices/testing/avoid-snapshot-tests
reason: Contract snapshots follow our separate review policy.
FieldMeaning
idRequired. A rule selector.
reasonRequired non-blank text explaining why the repository leaves the rule out.

An excluded rule is still kept in the source’s vendor snapshot, so you can review its changes. To have agents read a rule of yours instead, fork it.

rules.forks has agents read an authored rule of yours in place of a source’s rule, and records where it came from:

rules:
forks:
techs/typescript/prefer-interfaces:
from: fabrica:techs/typescript/prefer-type-aliases
basedOn: "2.0.0"
reason: Our public extension API relies on declaration merging.
FieldMeaning
(key)The ID of your authored rule in rules/, which agents read in place of the source’s rule. It must be in the same rule group as the rule it replaces, and each authored rule can replace only one rule.
fromRequired. The source’s rule, one rule ID such as fabrica:techs/typescript/prefer-type-aliases.
reasonRequired non-blank text explaining why the repository uses its own rule.
basedOnOptional. The library version of the source’s rule that your rule is based on, in quotes, such as "2.0.0". Forking a rule records the forked version here, and so does replacing a fork with the newest version. Offline commands check only that it’s a version; trailguide project sync checks that the library published that version of the rule, and otherwise fails with version-not-found, listing the versions it did publish.

The source’s rule leaves the generated guidance, and is still kept in the source’s vendor snapshot. The trailguide project update preview lists a forked rule as replaced so you can decide whether your rule needs the same change:

  • With basedOn, whenever the library’s newest version of the rule is newer than basedOn, whatever version the project includes. The preview lists every change after basedOn. To replace your rule with a fork of the newest version, overwriting your edits, pass trailguide project update --update-fork SOURCE:RULE, or answer yes when a terminal update asks whether to replace it; either sets basedOn to that version. If you merge the changes into your rule by hand instead, edit basedOn to the version you merged. Trailguide never advances it otherwise, because only you know whether your rule took the changes in.
  • Without basedOn, such as for a replacement you wrote yourself, whenever the library’s newest version of the rule is newer than the version the project includes, also when a pin holds the vendored copy there. The preview lists the changes since that version, which your rule may already have. Replacing your rule with a fork, as above, also records basedOn.

A rule can’t be both forked and excluded.

skills:
exclude:
- id: fabrica:skills/write-changelog
reason: Release Planner writes our release notes.

An excluded skill isn’t installed into the agents’ folders, and SKILLS.md lists it under its excluded skills with your reason. An entry takes only an id and a reason; to install your own skill in its place, fork it instead.

Excluding a required skill fails validation and names the library that requires it. To stop using a required skill, stop using the source.

When another installed skill calls a skill you exclude, trailguide project sync warns that the skill it calls isn’t installed. Fork the skill instead to give the calling skill your version.

Excluding a skill decides only what’s installed. When an installed skill links to a skill you exclude, by ID or by level, sync keeps the files the links reach as reading copies and warns; it doesn’t stop an agent that follows the link from reading them. See When a skill links to a skill you exclude.

You can also exclude a rule that an installed skill cites, such as one outside your rule include. The skill’s installed copy then says the rule is excluded by this repository, with your reason.

skills.forks installs an authored skill of yours in place of a source’s skill, and records where it came from:

sources:
pocock:
repository: https://github.com/mattpocock/skills.git
ref: main
skills:
forks:
skills/fix-bug:
from: pocock:skills/engineering/fix-bug
basedOn: "9f2c4e1a7b3d5f60817a2b4c6d8e0f1a3b5c7d9e"
reason: We use our own bug workflow.
FieldMeaning
(key)The ID of your authored skill, skills/<name>, installed in place of the source’s skill under its own name. Its folder is .trailguide/skills/<name>/.
fromRequired. The source’s skill, such as pocock:skills/engineering/fix-bug, or a skill a library curates, such as fabrica:mattpocock:skills/to-spec.
reasonRequired non-blank text explaining why the repository uses its own skill.
basedOnOptional. The full 40-character commit SHA, in quotes, of the source’s copy your skill was made from. For a curated skill, it’s a commit of the repository the library curates it from. Leave it out for a skill you wrote from scratch.

Forking a skill copies it into .trailguide/skills/<name>/ and writes the entry for you, with the commit it copied as basedOn. To fork one by hand, copy its folder there, correct its frontmatter, and add the entry. The entry is the record of where a fork came from: SKILLS.md names each fork’s source, and the fork’s installed SKILL.md records it as trailguide-forked-from, so agents and tools reading the installed copy see it too. See Skill folders.

A fork needs no skills.include entry. The source supplies each skill it is forked from at its recorded revision, whatever include selects, so updates can compare it with your fork, and never installs it, nor the skills only the source’s copy uses: your fork’s own trailguide-skills-used decides what it needs. A source can exist only for its forks. If the source deletes the skill, your fork stays installed, even when include still names the skill, and the next update says the source no longer has it.

Each authored skill can be the fork of only one skill, and a rule can’t replace a skill or the reverse. A skill can’t be both forked and excluded, and a fork installs under its own name, so a forked skill can’t have an alias either. Forking a required skill fails validation, as excluding one does.

When another installed skill calls a skill you fork, its installed copy lists your skill instead in its “Skills this skill uses” line.

The trailguide project update preview lists a forked skill as replaced whenever the source’s copy at the revision the update takes differs from the copy basedOn names, or, without basedOn, from the copy at the commit the project recorded. The preview lists the files that changed and, with basedOn, whether merging them into your fork finds text conflicts with your edits. When it finds none, --merge-fork merges them and sets basedOn to the commit merged. When your edits and the source’s changes touch the same lines, the preview lists the conflicting files and --merge-fork refuses; merge the changes by hand, then set basedOn to the commit the preview names, so later updates list only newer changes.

A library records the skills it forked in its manifest’s skills.forks, in the same shape; see Forks. trailguide library check lists the source’s changes to such a skill whenever the source’s ref moves past basedOn, and says so when the source deletes it. Projects that use the library install the library’s own skill and never the source’s.

Agents find skills by their install name, the name in SKILL.md, so two installed skills can’t share one. When two sources ship skills with the same name, give one of them an alias:

skills:
include: [fabrica:skills/review-change]
aliases:
fabrica:skills/review-change: fabrica-review

The installed copy’s name becomes fabrica-review, and it’s installed in <agent folder>/fabrica-review/. The skill’s ID doesn’t change, so configuration, provenance, and update previews still call it fabrica:skills/review-change. Each key must be a skill the project installs, and each new name follows the name grammar.

Trailguide doesn’t rewrite the old name where skill text mentions it, such as in a skill that tells the agent to use review-change. Every sync, update, and build that applies an alias prints the same warning:

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.

The aliased skill’s own text and other skills from its source may still say review-change, such as a step that says to use the review-change skill or runs /review-change. After a clash, that name usually belongs to the other skill, so an agent following the old mention can run the wrong one. Check those skills, and fork any you need to change; a fork of an aliased skill takes its new name, and the fork’s entry replaces the alias. Trailguide doesn’t rewrite mentions for you, because a bare word, /review-change, and ordinary prose look alike, and a wrong match would corrupt the skill.

A required skill can have an alias too, because it stays installed, without an include entry.

A library can give a curated skill an alias of its own, the name projects install it under. An alias in your configuration wins over it. The library’s alias prints no warning, since the library chose the name; SKILLS.md says which library offers the skill under it.

When two installed skills still have the same install name, from any sources or your authored skills, sync fails with skill-name-clash, naming both, and writes nothing. Give one of them an alias, or exclude it. See Who owns the target folders.

A skill can call other skills without listing them in trailguide-skills-used, especially one from a non-library source, whose skills rarely have that metadata. Declare those calls in skills.uses:

skills:
uses:
pstack:skills/architect: [pstack:skills/how]

Each key is a skill ID the project installs, and each value lists skill IDs from the same source. Every ID must exist there. uses adds to what the skill declares itself; it can’t remove a call the skill declares. Trailguide installs the listed skills alongside the skill that calls them, and the installed copy’s “Skills this skill uses” line includes them. Calls can’t form a cycle. Trailguide doesn’t look for calls a skill doesn’t declare: trailguide-skills-used and uses are the only ways it learns of them.

Every source has a ref, which says which revision of its repository the project takes. For a library, that is usually a library release, so config.yaml itself says which release each library source is at, and a reviewer sees a move to a new release as a one-line change.

refSync takesUpdate moves to
A library release, such as release/4 or refs/tags/release/4That library release.The newest library release, and writes it to ref, such as ref: release/5.
latest-releaseThe recorded library release, or the newest for a new source.The newest library release, and leaves ref as it is.
A branch, such as main or refs/heads/mainThe recorded commit.The branch’s newest commit.
Another tag, such as v1.2 or refs/tags/v1.2The recorded commit.For a non-library source, the commit the tag names now, warning when the tag moved since the last update. A library source stays.
A full 40-character commit SHAThat commit.Nowhere; it never moves.

A library release ref such as release/4 records which release the project is at. It isn’t a pin: the next trailguide project update moves the source to the newest release and rewrites ref to match. To hold one rule at its version through updates, pin it. To hold the whole source, don’t update it.

Sync resolves a branch, tag, or commit to a commit when it first reads the source, records that commit in .trailguide/lock.json, and keeps it on every later trailguide project sync and trailguide project build, so installs stay reproducible. For a library release, the lockfile records the release and each rule’s version, and sync keeps them too. Sync never moves a source: only trailguide project update does, after a preview.

latest-release names the newest library release, not the newest commit on a branch such as main. It moves like a branch: sync keeps the release the project records, and each update moves the source to the newest release. config.yaml then doesn’t say which release the project is at, so a reviewer finds the move in .trailguide/lock.json, vendor/, and generated/. Use a release, such as release/4, when you want the release in config.yaml.

When you edit a library source’s ref to name another release than the one the project records, sync refuses, writes nothing, and names the command that takes it:

Error: sources.fabrica.ref names release/7, but the project records library release 4, and sync doesn't move a source to another release. Run trailguide project update fabrica to review the move to release 7 and take it, or set sources.fabrica.ref back to release/4. No files were written.

trailguide project update fabrica then previews and takes release 7, and no further, even when the library has published a newer one. The preview says so, such as Release 9 is available; run trailguide project update fabrica again to move to it., and the next update, with ref unchanged, moves the source to the newest release.

Update moves a source only forward. To go back to an older release, restore .trailguide/config.yaml, .trailguide/lock.json, and vendor/<source-name>/ from the commit that recorded it, such as with git revert, then run trailguide project sync.

A source without a ref fails trailguide project sync, update, build, and check with ref-required, and nothing is written. For a library, the error names the release to write: the one the project records, or for a new source, the library’s newest:

Error: sources.fabrica has no ref, so .trailguide/config.yaml doesn't say which library release the project takes. Add ref: release/4 to sources.fabrica, the release this project records, or ref: latest-release to take the newest release at each update, then run the command again. No files were written.

Adding the release the project records changes nothing else: sync, build, and check accept the existing vendor snapshot as it is.

A bare name, such as main, means the repository’s branch or tag of that name. When the repository has both, sync and update fail with ambiguous-ref; write refs/heads/<name> or refs/tags/<name> to say which one you mean. Abbreviated SHAs aren’t accepted.

A branch suits a non-library source, such as a third party’s skill collection with no tags, and a curated source. A library source can follow a branch too, such as ref: main to always take a library’s newest commit, which frees the library from publishing library releases. The cost is change notes: rules and skills changed since the library’s last library release have no change notes, and no version either, so update can’t ask whether to keep a major change or apply a pin to them, and its preview lists the commit move and skill changes but not each rule. Sync and update warn about such a source every time they resolve its branch; set ref to a library release, such as release/4, to follow the library’s releases instead.

When the commit a branch’s snapshot records is no longer in the repository, such as after a force-push, sync fails with version-not-found and asks you to run trailguide project update SOURCE, which takes the branch’s newest commit. When the branch itself is renamed or deleted, update fails with version-not-found and names the ref; sync keeps working while the repository still has the recorded commit.

Sources have no declared type. Trailguide decides when it fetches a source:

  • A source whose repository has a manifest is a library. It publishes skill levels, and versioned rules and skills once it has library releases. A library without release/<number> tags needs a branch, tag, or commit as its ref.
  • A source without a manifest is a non-library source, such as a third party’s skill collection. Every skill in it is available, it has no rules or versions, and its ref names a branch, tag, or commit, because it has no library releases. Naming its rules in rules is rejected.

All of a source’s skills come from its one recorded revision, so skills that call each other always come from the same commit. Skills have no pins. To hold a skill back, exclude or fork it, or keep the source’s ref where it is, which holds everything from that source. When a source’s repository gains or loses its manifest, so that the source’s fields no longer fit it, trailguide project update fails and names the fields to change.

Taking a library at a revision other than a library release, such as a tag or commit with unreleased changes, opts that source out of versions for what changed: rules and skills whose files match a published version record that version, and the rest record null, have no version to cite, and update previews list the files that changed but no summaries of the changes. trailguide project sync and trailguide project update warn about such a source, naming its unreleased rules and skills, and trailguide project list rules shows those rules without a version. trailguide project check still passes. Update doesn’t move a library source whose ref is a tag other than a library release, or a commit; change ref and run trailguide project sync to take another revision. A library source whose ref names a branch moves to the branch’s newest commit, as Refs describes.

Pins need a ref that names a library release, or latest-release. A branch, another tag, or a commit imports one revision, so rules.pins with one of those fails; set ref to a library release to pin individual rules.

Some repositories keep several collections of skills side by side, such as a marketplace of plugins that keeps each plugin in its own folder. To take one of them, give the source a path:

sources:
pstack:
repository: https://github.com/example/plugins.git
ref: main
path: pstack
skills:
include: [pstack:skills/architect]

Trailguide then reads the folder as if it were the whole repository. Every ID in the source starts from it, so pstack:skills/architect names pstack/skills/architect in the repository, and "pstack:*" takes only the skills in pstack/. A manifest at pstack/.trailguide/library.yaml makes the folder a library, with its rules in pstack/rules/; without one, the folder is a non-library source.

path is a folder relative to the repository root, written with /, such as pstack or plugins/pstack, at most 32 folders deep, without a leading or trailing /, . or .. segments, \, :, or control characters. A folder the repository doesn’t have at the revision fails sync and update with path-not-found, naming the path, and writes nothing.

Library releases tag a whole repository, so a source with a path takes a branch, tag, or commit as its ref. A missing ref, release/4, or latest-release there fails validation. Rules from such a folder have no versions, as Take one revision describes, and sync and update warn about it for a folder that holds a library. For the same reason, trailguide project fork rule refuses a rule from a folder source; write your own rule with trailguide project create rule instead, starting from its text in vendor/<source-name>/.

The folder is all Trailguide reads, so a link in one of its skills that climbs out of the folder, such as ../../shared/checklist.md, fails sync like a link that leaves the repository. Link within the folder, or to a web address.

One repository can supply several sources, one for each folder, and one for the whole repository too; declare each folder once. trailguide add skill with a repository address takes the whole repository; to take a folder, add its source with trailguide project add source --path, then name the source. The lockfile records each source’s path, so changing it makes the source out of date until trailguide project sync takes the new folder. Generated links to a rule’s file name its path in the repository, such as pstack/rules/techs/go/errors.md. A library’s manifest can take one folder of a repository in the same way; see Sources.

Trailguide 0.11 and earlier don’t know path, and fail on it as an unknown field. When teammates may run an older release, set minTrailguideVersion to the first release with path, so they get an upgrade message instead.

rules:
pins:
- id: fabrica:practices/testing/verify-retry-limits
version: "1.3.0"
reason: Waiting on the author's response to acme/.trailguide#45.
FieldMeaning
idRequired. One rule ID the project includes. Prefixes aren’t accepted.
versionRequired. An exact published version of the rule, such as "1.3.0". Quote it so YAML reads it as text.
reasonRequired non-blank text explaining why the rule stays at this version. trailguide project update shows it next to any newer version, so the decision keeps its context.

A pin holds the rule at exactly that version:

  • trailguide project update never moves a pinned rule. Its preview lists the pin, the newest available version, and your reason.
  • When you add or change a pin, trailguide project sync moves the rule to the pinned version, up or down, when the library release ref names or an earlier one published it. A pin to a version published after that release fails and names the release to set ref to.
  • When you change ref to another library release, a pinned rule stays at its version, and every other rule moves to the new release.
  • Removing a pin doesn’t move the rule; the next trailguide project update offers its newest version.

To hold a rule at the version you have, pin it to the version .trailguide/lock.json records for the source, which also appears in the rule’s generated file. trailguide project update --keep writes that pin for you. Skills can’t be pinned; see Refs.

A pinned rule that its library retires stays at its version, and update reports the retirement. To keep a rule the library is retiring, pin it before or during the update that retires it.

skills.installFor names the agents to install skills for. Trailguide installs each skill into the folder each agent reads:

ValueFolder
claude-code.claude/skills/ at the repository root
codex, copilot, cursor, gemini-cli, opencode.agents/skills/ at the repository root, the shared folder these agents read
schemaVersion: 3
sources: {}
skills:
installFor: [claude-code, codex]

On a new project, trailguide project init asks which agents your team uses when it runs in a terminal, and writes [claude-code, codex] by default, which is also what it writes without a terminal or with --non-interactive. --install-for names them instead, such as --install-for claude-code,cursor, or none. Rerunning init keeps the list unless you pass --install-for. Each agent can appear once. Agents that read the same folder share one installed copy.

installFor: [] is valid, and so is leaving the field out. With no agents, Trailguide still records every skill the repository includes, required skills too, lists them in SKILLS.md, and checks them, but writes no installed copies, and sync warns that it installed nothing. Use it to record what your sources require before you choose agents.

Each installed skill gets a folder <agent folder>/<install-name>/. Trailguide writes and removes only the skill folders it installed, and leaves every other folder there alone, such as a skill another tool installed. Trailguide never writes to your home directory. See Who owns the target folders.

By default, project commands keep a section in the repository’s AGENTS.md that tells agents to read the project’s rules and skills; see Where agents start. To manage your agent instructions yourself, turn it off:

schemaVersion: 3
manageAgentsFile: false
sources: {}

Commands then neither write nor check AGENTS.md. They don’t remove a section they wrote earlier: delete it yourself, along with its markers, and tell your agent to read .trailguide/RULES.md in your own words.

Everyone who works on a repository runs their own copy of Trailguide, and a newer release can write configuration, the lock, or generated files that an older one reads differently. minTrailguideVersion names the oldest release that may work on the repository:

schemaVersion: 3
minTrailguideVersion: 0.11.0
sources: {}

You don’t need to maintain it in config.yaml. trailguide project init writes the version that created the configuration, and trailguide project update raises it to the version that ran the update, never lowering it, in the same step that writes the lock. Because a raise makes everyone else upgrade, the update’s preview lists it, such as Sets minTrailguideVersion to 0.10.0 in .trailguide/config.yaml, and asks you to confirm it even when nothing else changes. trailguide project migrate, and a sync that moves a version 2 configuration or a project out of the layout of Trailguide 0.8 and 0.9, its _managed/ folders or its skills’ origin folders, raise it the same way, because those releases can’t read version 3 or would move the folders back; see Migrate from Trailguide 0.9. In a project that forks a skill, trailguide project fork skill, build, and sync raise it too while it names a release before 0.13.0, because those releases would strip the origin a fork’s installed copy records; see Provenance. Otherwise sync, build, and check never change it. Raise it by hand when you want everyone off an older release sooner, such as one with a bug that affects your repository.

A library’s manifest, .trailguide/library.yaml, has its own minTrailguideVersion, the oldest release its author’s tools may use. trailguide library init and trailguide library migrate write the version that ran them, and trailguide library build raises it to the version that ran it when the built skills record provenance and it names a release before 0.13.0, or when the sources have an overview page other than a starter page, or a file in a media/ folder, or library.yaml sets skills.overviewPages, and it names a release before 0.14.0, warning when the check workflow pins an older release. A development build of Trailguide never raises it. trailguide library check fails with stale-build while overview pages or media are present and the field names a release before 0.14.0, or none. Otherwise nothing raises it: raise it by hand when the library needs a newer release, such as for a library schema feature. The library’s check workflow installs the release it names, so CI moves only when you raise it. Projects don’t read it, and the library doesn’t publish it.

Every project and library command reads minTrailguideVersion before anything else in the configuration, and again after it recovers an interrupted command, so a configuration with settings or values an older release doesn’t know still gets a clear answer. An older release fails with upgrade-required and writes nothing of its own, though recovering an interrupted command may already have restored or finished that command’s files:

Error: .trailguide/config.yaml: minTrailguideVersion is 0.10.0, but this is trailguide 0.9.2; upgrade trailguide to 0.10.0 or newer, then run the command again.

Upgrade Trailguide, as Install Trailguide describes, and run the command again. Development and prerelease builds don’t check the field and never write it.

Releases that predate the field, such as 0.8.0, can’t give that answer: they reject it like any field they don’t know, with Error: unknown field minTrailguideVersion. and Location: configuration. The fix is the same: upgrade Trailguide.

A library’s manifest is its own file, .trailguide/library.yaml, beside config.yaml. It publishes the repository’s authored rules, rule groups, skills, and assets, sets the level of each skill, and declares the sources it curates and forks skills from:

.trailguide/library.yaml
schemaVersion: 3
name: fabrica
license:
spdxExpression: MIT
file: LICENSE.md
notices: []
sources:
mattpocock:
repository: https://github.com/mattpocock/skills.git
ref: main
skills:
required: [skills/ship-service]
recommended:
- skills/build-feature
- mattpocock:skills/engineering/to-spec
aliases:
mattpocock:skills/engineering/to-spec: fabrica-to-spec

Library schema describes each field. Each level lists authored skills, such as skills/ship-service, and curated skills, <source>:<skill-id>, where <source> names an entry in the manifest’s sources. An authored skill that no level lists is available. skills.aliases gives a curated skill the name projects install it under; see Aliases.

trailguide library check validates the manifest, and fails when two published skills, authored or curated, have the same install name, counting aliases, so projects never inherit a clash from one library.

The manifest’s sources are the library’s, not the project’s: they say where its curated and forked skills come from, and the library repository installs nothing from them. To install skills in the library repository itself, declare a source in config.yaml too, as any project does. Projects ignore a library’s config.yaml.

A library of library schema version 2 kept its manifest in a library section of config.yaml. trailguide library migrate moves it to library.yaml. The manifest replaces the separate rule-library.yaml that earlier versions used; see Move from version 2.

A library can publish skills from another repository, such as a third party’s skill it wants its projects to use. The repository it takes them from is a curated source: an entry in its manifest’s sources, with the ref the library tracks. A library curates skills only; rules in its sources are for its own use, and it never publishes them.

  • Every curated skill is named. A skill from a curated source reaches projects only when a level lists it, or when one of the library’s skills uses it, which makes it a dependency.
  • Files come from the original repository. A skill’s identity is its repository plus its path. Projects fetch a curated skill’s files from the curated source, not from the library, and SKILLS.md records which library published it, and at which level.
  • Refs resolve per project. A library release doesn’t lock a curated source’s ref, which can name a branch, a tag, a commit, a library release of the curated repository, or latest-release for its newest library release. Each project resolves it when it first syncs and again when it runs trailguide project update, and locks the commit in the library source’s entry in lock.json, so ref: main gives each project the newest commit at its own update, without a new library release. trailguide project sync keeps the locked commit. trailguide library check resolves the ref on every run to check the skills the library lists, and fails, naming the ref, when the repository has no such branch, tag, or commit.
  • A project can fork a curated skill. trailguide project fork skill fabrica:mattpocock:skills/to-spec copies it into the project and replaces it, as for a library’s own skill, recording the curated repository’s commit as basedOn; see Fork a skill. A library that wants its own version of a skill it curates forks it with trailguide library fork skill, which lists the fork in its place.
  • A project can override the ref. When a project declares a source with the same repository and path as a curated source, its own ref decides which commit the curated skills come from. Repository identity and path decide the match, not the source name; see Repository addresses. A source of the whole repository doesn’t override a curated source of one of its folders, nor the reverse.
  • The library’s skills can call them. A skill the library authors can name a curated skill in its trailguide-skills-used, such as anthropic:skills/skill-creator, with the name of a source the manifest declares. A project that installs the calling skill installs the curated skill too, whatever its level, and provenance records which of the library’s skills use it. A curated skill that no level lists is a dependency, so projects get it with those skills but can’t choose it alone.

The library repository is a project too, but its manifest’s sources install nothing in it. When the library’s own skills call a curated skill there, also declare the source in config.yaml and include the skill in its skills.include.

For example, Fabrica’s library authors add-skill, which calls Anthropic’s skill-creator. Fabrica wants projects to install add-skill, which wraps skill-creator in Fabrica’s workflow, not skill-creator alone. The manifest declares Anthropic’s repository and recommends add-skill:

.trailguide/library.yaml
schemaVersion: 3
name: fabrica
sources:
anthropic:
repository: https://github.com/anthropics/skills.git
ref: main
skills:
recommended: [skills/add-skill]

The repository’s configuration installs skill-creator for its own use:

.trailguide/config.yaml
schemaVersion: 3
sources:
anthropic:
repository: https://github.com/anthropics/skills.git
ref: main
skills:
installFor: [claude-code]
include: [anthropic:skills/skill-creator]

add-skill names the curated skill with the manifest’s source name, which makes it a dependency that installs only with add-skill:

skills/src/skills/add-skill/SKILL.md
---
name: add-skill
description: Add a skill to this library.
metadata:
trailguide-skills-used: |
anthropic:skills/skill-creator
---

A project that uses the library names only the library and the skill it wants:

.trailguide/config.yaml
schemaVersion: 3
sources:
fabrica:
repository: https://github.com/fabricahq/.trailguide.git
ref: release/4
skills:
installFor: [claude-code]
include: [fabrica:skills/add-skill]

trailguide project sync installs add-skill from Fabrica’s library and skill-creator from anthropics/skills, though the project never names either skill-creator or Anthropic’s repository.

Use a complete Git address so the host is explicit:

repository: https://gitlab.com/my-team/engineering/rules.git

Supported forms include:

https://github.com/my-team/rules.git
https://gitlab.com/my-team/engineering/rules.git
ssh://git@git.example.org:2222/srv/rules.git
git@git.example.org:engineering/rules.git
git@git.example.org:/srv/rules.git

Nested GitLab namespaces, private hosts, and explicit ports are supported. The .git suffix is optional. Git uses the caller’s credentials; do not embed HTTPS credentials or SSH passwords in configuration. SSH usernames are allowed.

Repository addresses do not accept query strings, fragments, git:: prefixes, getter options, or //subdirectory selection. To take one folder of a repository, set the source’s path. Local paths, file:, unauthenticated git:, plain HTTP, and remote-helper protocols are outside this format. The owner/name shorthand isn’t accepted; use https://github.com/owner/name.git instead.

Trailguide preserves the supplied address in lock.json and requires the snapshot to match it exactly. Two addresses name the same repository when they match after normalizing host spelling, standard GitHub.com and GitLab.com transport aliases, and optional .git suffixes. This decides duplicate sources, with each source’s path, and, with the same path, which project source overrides a curated source’s ref. GitHub path matching ignores case; generic repository paths and GitLab paths retain case. Other hosts retain their transport, username, port, and path distinctions. For example, git@host:rules.git is home-relative, while ssh://git@host/rules.git is absolute. Trailguide does not equate them.

Validation rejects ambiguous paths, including dot segments, encoded separators in URLs, malformed URI escapes, raw whitespace, and backslashes. SCP paths are literal Git paths, so percent signs in that form are not URI escapes. Syntax validation does not fetch or authenticate a repository.

Generated source links use pinned GitHub.com or GitLab.com URLs for recognized standard endpoints. For other hosts, they point to the retained source file under vendor/<source>/. If a relative document or image is missing from that snapshot, generation fails with instructions to retain it or supply an explicit URL. Trailguide does not infer a host’s web interface from its name. See How sources work.

Choose stable source names such as fabrica or acme. Names must match [a-z][a-z0-9-]*. techs and practices are reserved, because authored rules use those names in generated/rules/, and so is local, which names a project’s own skills and rules. Declare each repository once.

Everywhere, in the configuration’s skills and rules, generated files, provenance, review findings, and commands such as trailguide project update fabrica:skills/build-feature, a rule or skill from a source has a project ID that starts with its source name:

fabrica:practices/testing/verify-retry-limits
acme:practices/testing/verify-retry-limits
fabrica:skills/build-feature
fabrica:mattpocock:skills/engineering/to-spec
practices/testing/test-project-contracts
skills/fix-bug
  • A rule ID is the rule’s path in its repository’s rules/ folder, without .md. For a source with a path, that’s the rules/ folder inside the path.
  • A skill ID is skills/<name> for a skill a repository authors, in a library or a project, whatever folder holds it, and the folder’s path from the repository root, or from the source’s path, for a non-library source’s skill, such as skills/engineering/to-spec.
  • A curated skill’s project ID adds the curated source’s name after the library’s, as the manifest lists it. It keeps that ID when the project declares the curated repository, with the same path, as its own source, which only decides the commit the skill comes from.
  • Authored rules and skills have no source name.

The source name keeps identical IDs from different sources distinct. Renaming a source changes its project IDs, so rename them in skills and rules too, and in any external references to them. Replacing a repository under an existing source name also requires reviewing the exclude, pins, forks, uses, and aliases entries that name it.

The installed copy of a skill goes in a folder named only by its install name, because agents find skills by name. See Give a skill another name.

Each rule and skill in a library has its own version. A project takes each source from one library release or commit, its lock. For a library, ref names the release, and only you, or trailguide project update, change it:

  • .trailguide/lock.json records the library release or commit, and the exact version of every included rule and skill. trailguide project sync restores exactly that, so every checkout has the same content.
  • trailguide project update previews newer versions, new rules and skills, level changes, and retirements, and applies them after you confirm, writing the new release to ref.

trailguide project sync never moves a source. When you change its ref to another library release, sync fails and names trailguide project update SOURCE, which takes it; when you change it to a branch, tag, or commit, sync takes the revision the new ref names. A rule or skill you newly include comes from the release ref names, or from the recorded commit. When it isn’t there, such as a skill the library published after your last update, sync fails and names the command that moves the source, trailguide project update SOURCE.

A project chooses rule versions one by one, with pins, but not skill versions. All of a source’s skills come from its one recorded revision, and move together when it moves. A skill’s version still says what changed, in release notes, SKILLS.md, the installed copy’s marker line, provenance, and the update preview.

Each rule’s Markdown file and asset directory come from the library release that published its version. Library-wide files, such as rule group metadata, shared assets, the manifest, and license files, and every skill’s whole folder come from the source’s one recorded library release, or from the revision your ref names. That library release is never older than the one that published any included rule version. When it no longer has the metadata of an included rule’s rule group, such as the rule group of a retired rule you pinned, that rule group’s metadata comes from the newest library release among its included rule versions that still has it.

Offline trailguide project build, trailguide project check, and ordinary agent work use the recorded versions without contacting the repository.

Rules from the same rule group ID combine into one generated rule group, whatever source supplies them. Including practices/testing/* from two sources combines both sets of rules into one effective testing rule group, with a rule group page and individual resolved rule files. Source order never establishes precedence.

Every valid authored rule in rules/ joins its rule group, and needs no configuration entry. An authored rule with the same ID as an included rule doesn’t replace it; fork the included rule to do that. A rule fork’s authored rule appears once under its own ID; the source’s rule is removed from active output. The complete authored definition supplies the metadata, guidance, attribution, and assets. Configuration retains the fork relationship, and the generated rule names the rule it replaces. An authored _group.yaml defines a rule group, including an empty one, without any configuration entry. If authored metadata exists for an included rule group, its complete description and reading cues take precedence for discovery. Otherwise, descriptions from every contributing library remain source-labeled. Provenance retains all rule group metadata and identifies the sources supplying the effective discovery guidance. Authored rules without either authored or included rule group metadata are errors, with the missing _group.yaml path in the diagnostic. When a sync or update removes the last source supplying an authored rule’s rule group, it writes that rule group’s last vendored metadata to rules/<group-id>/_group.yaml instead of failing; see Keep the rule group of an authored rule.

The generated index shows rule group names, applicability guidance, and explicit Open group links. Without authored metadata, guidance from multiple libraries remains labeled by source. Trailguide does not silently choose one library’s description over another’s.

Source-qualified IDs prevent naming collisions, but distinct rules can still require incompatible behavior in the same situation. Both remain active unless the repository explicitly excludes or replaces a rule under its owning source. Trailguide does not infer priority from source order or interpret prose to resolve contradictions.

See Resolve conflicting rules for examples, an agent review prompt, and ways to resolve competing instructions.

Skill decisions layer in this order, each overriding the ones before it: a library’s levels, then an org library’s, then the project’s configuration, then each person’s personal skills. Required skills are a floor: the project can add, rename, and replace around them, but can’t remove them.

A personal skill with the same name as a skill the repository installs wins in some agents, even over a required skill. Trailguide can’t prevent that, and doesn’t write to your home directory. It warns instead; see Personal skills with the same name.

Trailguide 0.10 and earlier wrote configuration of version 2, where each source held its own rules and skills, and skillTargets named the folders to install into. trailguide project migrate moves it to version 3, and so does trailguide project sync, for a configuration you changed since the last sync. Every other command fails on it with config-migration-needed and writes nothing:

Error: .trailguide/config.yaml: schemaVersion: the configuration is of version 2, which Trailguide 0.10 and earlier wrote. Run trailguide project migrate once to move it to version 3, which moves each source's rules and skills to the top-level rules and skills sections, and commit the result; if you changed the configuration since the last sync, run trailguide project sync instead, which moves it too

trailguide project migrate rewrites it in place, keeping your comments, and raises minTrailguideVersion, since older releases can’t read version 3. It changes nothing else a sync would, so trailguide project check passes afterwards. Run trailguide project migrate --dry-run first to see what it changes. When a version 2 configuration is invalid in a way version 3 can’t hold, such as one rule of yours replacing rules of two sources, migrate and sync fail with config-migration-failed, writing nothing: fix the entry it names in config.yaml, or rewrite the file in the version 3 shape the table below shows.

Version 2Version 3
skillTargets: [claude, agents]skills: {installFor: [claude-code, codex]}
sources.fabrica.skills.include: [recommended]skills.include: [fabrica:recommended]
sources.fabrica.skills.exclude, usesskills.exclude, uses, with every ID written fabrica:<id>
sources.fabrica.skills.renameskills.aliases
sources.fabrica.skills.forks.<source skill>: {as: skills/x, ...}skills.forks.skills/x: {from: fabrica:<source skill>, ...}
sources.fabrica.rules.include, exclude, pinsrules.include, exclude, pins, with every ID written fabrica:<id>
A rules.exclude entry with replacedBy: techs/go/x and basedOnrules.forks.techs/go/x: {from: fabrica:<id>, basedOn, reason}

A library’s config.yaml with a library section, of library schema version 2, still loads, so its releases stay readable; trailguide library migrate moves the manifest to library.yaml and the rest of the configuration to version 3.

Trailguide doesn’t read version 1 configuration, or a repository with a rule-library.yaml, at all. A version 1 configuration fails with a message that shows the version 2 shape: rewrite it in that shape by hand, then run trailguide project migrate. A library replaces rule-library.yaml and root-level techs/, practices/, and assets/ with a library manifest, .trailguide/library.yaml, and the library layout.

The top-level schemaVersion describes this configuration. A library’s manifest, .trailguide/library.yaml, has its own schemaVersion, which describes what it publishes, and projects that import the library never read its config.yaml, so this schema can change without breaking a library’s consumers. minTrailguideVersion says which Trailguide releases may work on the repository; the files Trailguide writes don’t record the release that wrote them.

Each source’s ref and pins state which versions the project wants: ref names the library release or revision, and every rule without a pin follows the source’s lock, which trailguide project update moves together with ref. The lockfile records each included rule’s and skill’s version, library release, and commit, or a non-library source’s commit, used by offline commands. It is output Trailguide owns, not a second version the project chooses.

See Library schema for library contents and Include rules for examples of exceptions.

Fabrica TrailguideMIT licensedPrivacy

Built with Fabrica.