Publish a Knowledge Base
Create, structure, package, and distribute a Knowledge Base for your organization.
You've customized pair for your team. Now you want to codify those practices into a distributable Knowledge Base — so every team in your organization starts from the same foundation. This guide covers the full workflow from creation to distribution.
Plan Your KB
Before writing content, decide what your KB will cover:
Scope: Will it cover the full SDLC (like the pair KB) or focus on a specific concern (e.g., security standards, API design)?
Audience: Who will adopt this KB? A single team, a department, or the whole organization?
Baseline: Are you starting from scratch, or forking an existing KB? Forking the pair KB gives you a working structure to modify.
Create the KB Structure
A Knowledge Base follows the .pair/ directory convention:
Starting from scratch
Create the directory structure manually:
Forking an existing KB
Install the pair KB and modify it:
See KB Structure Reference for the full directory layout and what each file does.
Author Guidelines
Guidelines are the core of your KB. Each guideline file should be:
- Opinionated: State what is adopted, not what could be adopted
- Actionable: AI assistants read these to make decisions — be specific
- Self-contained: Each file should work independently
Writing style
Use the adoption declaration pattern:
The pattern [tool] is adopted for [purpose] tells the AI assistant this is a decision, not a suggestion.
Adoption file templates
Include empty adoption files that adopters will fill in:
These templates guide adopters through customization without requiring them to understand the full structure.
Author Skills (Optional)
If your KB includes AI agent skills, follow the Agent Skills open standard:
Each SKILL.md contains structured instructions the AI discovers and executes. See Skill Management for the format and naming conventions.
Package for Distribution
Package your KB for distribution:
This creates a distributable archive containing your KB's knowledge, adoption templates, and skills. The package includes metadata (name, version, description) for registry listing.
For organizational metadata:
See CLI Commands for the full package reference.
Verify Your Package
Before distributing, validate the package:
Validation checks:
- Required directories exist
- Guideline files are well-formed
- Internal links resolve
- Adoption templates have correct structure
- Skills follow the Agent Skills standard (if present)
See CLI Commands for the full kb validate and kb info reference.
Distribute
Via npm
Publish your KB as an npm package:
Adopters install with:
Via GitHub Releases
Create a GitHub release with the packaged archive:
Adopters install with:
Via Internal Mirrors
For organizations that restrict external package sources, host the package on an internal registry or file share. Adopters use the --url flag to point to the internal location.
See Install from URL for all source options.
Version and Maintain
Versioning strategy
Use semantic versioning:
- Patch (1.0.x): Typo fixes, clarifications, non-breaking guideline updates
- Minor (1.x.0): New guidelines, new skills, new adoption templates
- Major (x.0.0): Breaking changes to directory structure, removed guidelines, renamed files
Update workflow for consumers
When you publish a new version, adopters pull it with:
Their adoption files (.pair/adoption/) are preserved. Only the knowledge layer (.pair/knowledge/) is replaced. This means your updates reach every team without overwriting their project-specific decisions.
Changelog
Maintain a changelog in your KB repository. Document what changed in each version so adopters can decide when to update and review breaking changes before applying them.
Next Steps
- Start from the beginning? Adopt a Knowledge Base — the adopter's perspective.
- CLI reference? CLI Commands — all commands for packaging and distribution.
- Directory reference? KB Structure — full directory layout.