Skip to content

Library

A library is a repository whose manifest publishes its authored rule groups and skills for other repositories. Libraries let you share engineering practices across projects, within your organization, or with third parties.

You can publish your team’s rules and skills in a library, or take them from libraries others publish. Rules and skills needed by only one project can live in that project.

A library lives in a Git repository. It contains:

  • The manifest, .trailguide/library.yaml, which makes the repository a library, declares its license, sets the level of each skill it publishes, and names the repositories it takes curated and forked skills from.
  • Rule groups under rules/techs/ and rules/practices/ at the repository root, each with rule group metadata and Markdown rule files.
  • Skills, optional. You write them in skills/src/, alone or in stacks of related skills, and trailguide library build builds the copies projects install into skills/dist/, one folder per skill.

For example, a repository named “engineering-rules” might contain:

engineering-rules/
LICENSE.md
rules/
practices/testing/
_group.yaml
test-changed-behavior.md
skills/
README.md
src/
skills/
build-feature/
SKILL.md
README.md
dist/
build-feature/
SKILL.md
.trailguide/
library.yaml

Rules and skills sit at the root, where anyone who opens the repository sees them first, and each skill’s README.md is its page for people browsing the repository, beside an optional overview page that catalogs such as Skillmart show. See Library layout.

The repository name is your choice. Rules can also include supporting assets. A library can also be a project: its .trailguide/config.yaml can take rules and skills from other sources for the library’s own work, and projects that use the library never read it.

A library sets a level for each skill it publishes, saying how strongly it asks its projects to install it:

LevelWhat a project that uses the library gets
RequiredAlways installed. The project can’t exclude or fork it.
RecommendedInstalled when the project includes the library’s recommendations.
AvailableInstalled only when the project names it.

A skill that no level lists is available, so a library lists only the skills it has an opinion about. An organization can publish an org library, such as <organization>/.trailguide, whose required and recommended skills become the shared default for its projects.

A library can also publish skills from another repository, curating them, such as a third party’s skill its teams should use. See Curated skills.

Each project names the libraries it uses as sources in .trailguide/config.yaml, and includes skills and rules from them with selectors that name the source, such as fabrica:recommended or fabrica:practices/testing/*. A project can use several libraries and add its own rules and skills.

Running trailguide project sync downloads the included rules and skills, generates the guidance agents read, and installs the skills. Rule groups with the same ID combine, and the project’s exclusions and replacements determine which rules appear.

A project records the library release it took from each library, and the version of every rule and skill. Running trailguide project update moves them to newer versions and reports every one that changed, so each project takes updates on its own schedule. A project can also pin a rule to a version, with a reason, or include only specific rules instead of whole rule groups. Skills aren’t pinned: all of a library’s skills come from one library release, and move together when the project updates. See Include rules, Install skills, and Update rules and skills for the steps.

A library doesn’t have one version for all of its rules and skills. Each rule and skill has its own version (rules, skills), so a project can see exactly which rules changed in a library release and whether work that complied with the previous version could fail the new one.

When an author changes a rule or skill, they add a change note saying how large the change is and what changed. A library release turns the pending notes into new versions at once, and can hold one change or many. Projects take only published versions, unless one deliberately takes an exact commit, so they never see changes that haven’t been published.

trailguide library release publishes a library release as one Git tag that records every rule’s and skill’s version, along with one GitHub Release page that lists the changes. A library release has a number for reference, but it isn’t a version of the library: projects choose versions rule by rule, and take a library’s skills together from one library release. See Version your rules.

Libraries can be public or private. Projects keep a vendor snapshot of what they take, so use private libraries only in projects allowed to hold and share that content.

Trailguide preserves declared license text and notices with the rules and skills projects take. For choosing terms, see License rules.

To publish your own, follow Create your first library. For file details, see Library schema.

Fabrica TrailguideMIT licensedPrivacy

Built with Fabrica.