# pair > AI-assisted software development — structured Knowledge Base, Agent Skills, and adoption files for AI coding assistants. ## Welcome Source: https://pair.foomakers.com/docs
Welcome to pair
pair gives your AI coding assistant a Knowledge Base, skills and your project's decisions, so it develops software your way, from PRD to code review, in every session. ![The process lifecycle: four phases, two workflows, three modes](/diagrams/lifecycle-overview.svg) *Figure: pair's whole flow on one picture. Phases along the ground; the refinement and delivery workflows on top; Assisted, Supervised and Autonomous are three ways to run the same thing.* ## Pick your journey - **[Getting Started](/docs/getting-started)**: what pair is and how to install it, five to ten minutes. - **[Process Lifecycle](/docs/process-lifecycle)**: the flow for developing with pair: phases, workflows, modes, skills, with links to the configuration and the commands. - **[Tutorials](/docs/tutorials)**: guided end-to-end walkthroughs, first project, existing project, team, enterprise, automation (20 to 60 minutes). - **[What's new](/docs/whats-new)**: everything new in v0.5.1, most important first. ## Top tasks | I want to... | Go to | | --- | --- | | Install pair and run my first command | [Quickstart](/docs/getting-started/quickstart) | | Add pair to a repository that has its own `AGENTS.md` | [Adopt pair in an existing repository](/docs/guides/adopt-existing-repo) | | Configure card states, gates, autonomy or the Knowledge Base | [Guides](/docs/guides) | | Understand how pair works | [Concepts](/docs/concepts) | | Connect my AI coding assistant or my PM tool | [AI coding tools](/docs/integrations), [PM tools](/docs/pm-tools) | | Look up a command, a skill or a setting | [Reference](/docs/reference) | | Upgrade `.pair/` after a pair release | [Migrations](/docs/migrations) | | Fix an install or setup problem, or contribute | [Support](/docs/support), [Contributing](/docs/contributing) | --- ## Concepts Source: https://pair.foomakers.com/docs/concepts These pages explain **how pair works**. Read them when you want understanding, not steps; the steps are in [Guides](/docs/guides) and the flow in the [Process Lifecycle](/docs/process-lifecycle). Every page ends with a Next link, so the whole section reads top to bottom. ## Core Start here if you are new to pair. 1. **[AI-assisted SDLC](/docs/concepts/ai-assisted-sdlc)**: the problem pair solves and how structured context changes AI collaboration end to end. 2. **[Knowledge Base](/docs/concepts/knowledge-base)**: the documents installed into `.pair/` that give your assistant persistent context. 3. **[Skills](/docs/concepts/skills)**: the actions on top, structured instructions your assistant discovers and runs. 4. **[Adoption files](/docs/concepts/adoption-files)**: your project's decisions, recorded so they never drift. ## Work and state - **[Canonical states](/docs/concepts/canonical-states)**: how skills reason about work-item state across any board vocabulary. - **[Definition of Ready and Done](/docs/concepts/definition-of-ready-and-done)**: the criteria that make a card Ready and a story Done. - **[Code host and PM tool](/docs/concepts/code-host)**: why cards and pull requests may live in different tools, and how pair routes between them. ## Quality and review - **[Tag-driven quality gates](/docs/concepts/tag-driven-gates)**: the risk tier, the tag it projects and the gate matrix it scales. - **[PR state flow](/docs/concepts/pr-state-flow)**: the three PR states, the required checks and why a label is a view, not the authority. - **[Review identity](/docs/concepts/review-identity)**: running reviews under a dedicated identity, and light auto-approval. ## Tooling - **[Package-local adoption](/docs/concepts/package-local-adoption)**: rules next to the code in a monorepo, loaded by scope. - **[Agent integration](/docs/concepts/agent-integration)**: the bridge pattern that connects any AI coding tool to the single source of truth. - **[llms.txt](/docs/concepts/llms-txt)**: the standard pair uses to make documentation and project context consumable by assistants. ## Glossary - **[Glossary](/docs/concepts/glossary)**: card, macrostate, tier, harness, engine, seal, handoff and the rest, defined once. The mechanics of delivery (stages, realizations, hooks, the merge stage) live with the flow they belong to: [The delivery cycle in depth](/docs/process-lifecycle/delivery-cycle). --- ## Adoption Files Source: https://pair.foomakers.com/docs/concepts/adoption-files Adoption files are your project-specific decisions, recorded in `.pair/adoption/`. They tell AI assistants what your team chose, which tech stack, architecture pattern, way of working, and product requirements define your project. While the [Knowledge Base](/docs/concepts/knowledge-base) provides general guidelines and process guides, adoption files provide the **constraints**. Together, they ensure the AI generates code that follows both industry best practices and your team's specific decisions. ## Structure ```text .pair/adoption/ product/ # Product decisions PRD.md # Product Requirements Document context-map.md # Domain glossary, entities, common rules (optional) subdomain/ # Domain-Driven Design subdomains .md # Subdomain catalog entry .context.md # Lazy per-subdomain context split (optional) tech/ # Technical decisions architecture.md # Architecture pattern and style tech-stack.md # Languages, frameworks, libraries infrastructure.md # Hosting, CI/CD, deployment way-of-working.md # Process, methodology, quality gates ux-ui.md # Design system, component library automation.md # Unattended-automation policy (optional) risk-matrix.md # Project delta to the quality model (optional) adr/ # Architectural Decision Records ``` ## What Each File Records ### architecture.md Documents your chosen architecture pattern, API style, and data storage approach: ```text - Monolith with REST API - SQLite for data storage - All components self-hosted ``` ### tech-stack.md Lists every approved technology with exact versions: ```text - TypeScript v5.x - React ^19.0.0 - Vitest v3.x for testing - pnpm v10 for package management ``` When the AI generates code, it only uses libraries listed here. During code review, unlisted dependencies are flagged. ### way-of-working.md Defines your development process: ```text - Kanban workflow - Feature branches with squash merges - Quality gate: pnpm quality-gate - Code review required before merge ``` It also hosts an optional `## State Mapping` section: only needed if your board's column names differ from pair's [canonical states](/docs/concepts/canonical-states). Omitted by default. #### `## Process Profile`: running a subset of the process Optional. Not every team runs every step. A `## Process Profile` section declares which **process steps** this project does, and no disabled step is ever proposed. ```text ## Process Profile - `profile`: `poc` ``` | Profile | What it enables | | --------- | ---------------------------------------------------------------------------------------------------------------------- | | `default` | Every step. **This is what an absent section means**: a team running the full process configures nothing. | | `poc` | No DDD mapping and no strategic planning layer: `specify-prd`, `bootstrap`, `brainstorm`, `plan-stories`, `refine-story`, `plan-tasks`, `implement`, `review`. | | `custom` | Exactly the steps you name in a `whitelist`. | ```text ## Process Profile - `profile`: `custom` - `whitelist`: `brainstorm`, `plan-stories`, `refine-story`, `plan-tasks`, `implement`, `review` ``` **The unit is the step, not the skill.** A step has up to two representations, a how-to guide (the manual path) and an executable skill, and the profile governs the step, so a project with **no skills installed**, working from the how-to guides by hand, gets exactly the same behaviour. The mapping lives in the [step catalogue](https://github.com/foomakers/pair/blob/main/packages/knowledge-hub/dataset/.pair/knowledge/guidelines/technical-standards/ai-development/step-catalogue.md); the schema and the built-in profiles in [process-profiles.md](https://github.com/foomakers/pair/blob/main/packages/knowledge-hub/dataset/.pair/knowledge/guidelines/technical-standards/ai-development/process-profiles.md). What a disabled step does, in the three places you can meet one: - `/pair-next` never proposes it. - Invoked **directly**, the skill warns that the step is disabled and asks for confirmation: a profile is a project convention, not a permission system. - Reached as a **composition** from an enabled step, it is silently skipped, exactly like a skill that is not installed. It never stops to ask about a step you did not name. A profile is **validated, not trusted**: a misread profile does not surface as an error anyone sees: it removes a step from every suggestion, which looks exactly like that step not being due yet. Every case below **HALTs** instead of quietly resolving to `default`. | Case | Outcome | | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Unknown profile name, or an unknown step id in a `whitelist` | **HALT**, listing the valid values, in two deliberately different messages: a typo in a step id is not the same mistake as naming a profile that does not exist. | | `custom` with **no** `whitelist`, or with an **empty** one | **HALT**, again in two messages, "you wrote none" is not "you wrote an empty one". An empty whitelist is a misconfiguration, never "everything off". | | A line the schema can't read (`- profile: poc`, value unbackticked) | **HALT** restating the shape. The key is detected loosely and its value accepted strictly: reading the line as "no declaration" resolves to `default` and re-enables the whole process. | | A **partially** readable whitelist (`` - `whitelist`: `implement`, review ``) | **HALT** on the whole line, never on the readable half, keeping the backticked ids and dropping the bare one would remove a step with nothing reported. | | The section declared **twice**, at a level other than `##`, or as a **setext** heading | **HALT**. Only the first section is read, and a heading at another level (`### Process Profile`) is not this section at all. | | The same key on **two lines**, or a key with no bullet or a numbered one (`1.`) | **HALT**. Only the last line would be read; a bullet-less key would be passed over as prose and resolve to `default`. Backticks are optional behind a marker and required without one, so `1. profile: poc` HALTs too: the two errors compose. | | A value that **spills** past its key's line (wrapped, or ending on a dangling `,`) | **HALT**. Read up to the wrap the line looks complete, so the ids after it vanish from every suggestion with nothing reported. | | A key **indented** by four spaces or a tab | **HALT**, at that indent it is indistinguishable from a sublist item, and the same key indented by two spaces IS read. | | A key inside a **blockquote** (`` > - `profile`: `poc` ``) | **HALT**. `>` is not indentation, so the line would be passed over as prose and resolve to `default`. A key inside a documentation **table row** is the deliberate opposite: no declaration, and no HALT either. | | A key under **no `## Process Profile` section at all**, `## Process Profiles` (plural), `## ProcessProfile`, an unrelated heading, or none | **HALT** naming the line. Every heading rule above closes only the spellings it names; a key outside every section was read by nothing and reported by nothing, which is the same silent `default`. A key-shaped line in a code block, an HTML comment or a table row is not a key. | | The same step id named **twice** in one whitelist | **HALT** naming it, never deduped in silence: a repeat is as likely an unfinished edit as a harmless one, and unread it doubles that step's warning and every "N steps enabled" count. | | An **unterminated** fence or HTML comment anywhere in the file | **HALT**. Everything after it reads as non-content, so the real section is never found and nothing else would report that the file went unread. | | A whitelist that disables a step another enabled step depends on | **Reported** with the minimal fix: the one case that is not fatal, and never silently repaired. | What the reader accepts without complaint: - **Heading**: spelled as loosely as the keys (`## Process profile`, `## Process Profile (optional)`, the closed-ATX `## Process Profile ##`, up to three spaces of indent), so decorating it cannot make the declaration evaporate. - **Key in any case**: `` - `Profile`: `poc` ``, `` - `Whitelist`: … ``. Case is part of the key's spelling, so it is detected like any other decoration. The **value** stays strict: `` `POC` `` is an unknown profile name and HALTs. - **CRLF files**: normalized before anything is read. Read literally, a Windows checkout would match no key and no heading at all. - **Code blocks**: all three CommonMark forms (```` ``` ````, `~~~` and four-space indent) are examples, never declarations. A fence closes only on a run of the same character at least as long as the one that opened it. - **HTML comments**: masked, so neither an illustrative block nor a commented-out section can become the project's profile. Guidelines are **not** steps: testing, security, code design and the quality gates apply to whatever process you run, so `poc` shortens the process without loosening the bar on the code. ### PRD.md Your Product Requirements Document: the source of truth for what the project does, who it serves, and what features are prioritized (P0/P1/P2). ### context-map.md An optional, living domain model: dispatcher + subdomain index + core (glossary, entities, common rules and invariants). Unlike the other adoption files, it isn't scaffolded during bootstrap: it's created and updated inline the first time a brainstorm or refine session sharpens a domain term, per the [Context Map Maintenance](https://github.com/foomakers/pair/blob/main/packages/knowledge-hub/dataset/.pair/knowledge/guidelines/architecture/design-patterns/context-map-maintenance.md) guideline. There's no dedicated skill for it: no ceremony, just an embedded step in the skills that already touch domain scope. For a worked example, see Pair's own map: the framework dogfoods this artifact to register its canonical terms (macrostate, risk matrix, DDR, checkpoint, working area, marketplace…): [`.pair/adoption/product/context-map.md`](https://github.com/foomakers/pair/blob/main/.pair/adoption/product/context-map.md). ```text - Subdomain Index: which subdomains have their own context file, classification, Volatility (mirrored from the subdomain catalog) - Glossary: ubiquitous language, one row per term - Entities: domain entities and aggregates - Common Rules and Invariants: domain-wide business rules ``` The unit is the **subdomain**, not a separate "domain" taxonomy. When a subdomain's inline context grows too large, the session proposes moving it to a co-located `subdomain/.context.md` file, lazy, and only after you approve. The map keeps the index entry and the domain-wide rules; everything subdomain-specific (glossary, entities) moves to the sibling file. If the file doesn't exist, AI assistants skip the domain check entirely: this is the expected state for most projects, not an error. ### automation.md Optional. `tech/automation.md` declares how much of the delivery flow may run **unattended**. Every section has its own fail-closed default: an absent file or section never widens automation; only a project that writes the section opts in. The sections below are the ones you write by hand; `## Harness` and `## Model Policy` (supported engines, per-tier model class) are written by `/pair-capability-setup-harness` and documented in the [guideline](https://github.com/foomakers/pair/blob/main/packages/knowledge-hub/dataset/.pair/knowledge/guidelines/collaboration/automation/automation-policy.md). ```markdown ## Autonomy filter: risk:green, risk:yellow assignee: @me status: Draft, Ready until: merged merge: when; has: cost:red; lacks: risk:green ``` **`## Autonomy`**: one declaration for which cards an unattended run works on, how far it takes them and when a human takes over. Keys: `filter` (any-of labels, matched by plain string equality against the labels classification already put on the card, no AND/OR/NOT grammar), `assignee` (`@me` or a login), `status` (macrostates), `root`, `until` (`ready` | `pr` | `merged`, default `pr`) and two gates, `prepare` and `merge`: `[; has: ][; lacks: ]` (`has`/`lacks` only with `when`). Under `until: merged`, `merge: always` parks the card for a human (the default), `never` and `when` enter the merge stage, and a `when` card carrying a `has` label or lacking a `lacks` label **escalates** instead (status `escalated`, exit 1, `on-halt`, one comment on the card; the PR stays open). The merge stage's own checks (reviewed head, `pair-review`, explicit approval, green gate set) always stay mandatory. No `filter`: every open card is a candidate for a driver given an explicit root; nothing runs unattended until the section exists. The `prepare` gate says who prepares a Draft card: `always` (default) keeps the human alignment gate; `never` proceeds alone, recording every self-answer under `## Assumptions`; `when` proceeds alone unless a stage boundary (before refinement, after it, after the task breakdown) escalates: the card then stays Draft with a `needs-review` label and one comment, and is not re-picked until a human acts. Precedence is argument > `## Autonomy` > KB default, and every run prints each effective value with its source. `pair-implement-batch` honours the same keys and, under `until: merged`, merges a card only when the merge gate allows it; `pair-loop` selects, hands the gates to the batch and owns no merge call. **Legacy sections** (projects written for v0.4): `## Eligibility` (one label) reads as `filter`, `## Auto-Advance` as the `merge` gate (`(none)` is `always`, a tier is `when; lacks: `). Both keep working; a `## Autonomy` section that contradicts them is refused. Write `## Autonomy` only in a new project. See [Tag-driven automation](/docs/process-lifecycle/tag-driven-automation). ```text ## Stop Predicate tag:risk:red ⇒ Done max-iterations: 20 ``` **`## Stop Predicate`**: when an unattended run stops. ` ⇒ ` (selector: `root` / `tag: