Packaging a Knowledge Base
Package your KB for distribution using source or target layout modes.
Overview
The pair package command creates a distributable ZIP from your Knowledge Base. It supports two layout modes that determine which files are included:
| Layout | Flag | What it packages | When to use |
|---|---|---|---|
| Target (default) | --layout target | Files from installed target directories (e.g., .pair/knowledge/, .claude/skills/) | Packaging an installed KB for redistribution |
| Source | --layout source | Files from the single source directory defined in config.json | Packaging the original KB dataset before installation |
Source vs Target Layout
Source Layout
Packages from the source directory defined in each registry's source field in config.json. This is the canonical, pre-installation structure.
Use source layout when:
- You maintain a KB dataset and want to distribute the original files
- You want a clean package without installation-time transformations (prefix, flatten)
- You're building a CI/CD pipeline that packages from the dataset directly
Example: A KB with config.json registry skills.source: ".skills" packages from .skills/category/name/SKILL.md.
Target Layout
Packages from installed target directories — the files as they appear after pair install. This is the default.
Use target layout when:
- You want to package the KB as users see it after installation
- You need to include prefix/flatten transformations applied during install
- You're redistributing a customized KB from a project
Example: The same skills registry with flatten: true, prefix: "pair" packages from .claude/skills/pair-category-name/SKILL.md.
Target layout excludes symlink targets automatically — only canonical (physical copy) targets are included.
Packaging Walkthrough
1. Validate before packaging
2. Package
3. Verify the package
Organizational Packaging
For enterprise distribution, add organizational metadata:
See Organization Customization for the full enterprise workflow.
Layout and config.json
The layout mode maps to the source and targets fields in your config.json registries:
--layout sourcereads from.skills/--layout targetreads from.claude/skills/(canonical target only —.cursor/skills/is excluded because it's a symlink)