Compass Adopt — set up an existing project
Mission: an existing repository leaves this playbook with the agent contract,
command registry, specs/memory starters, provider pointers, MCP examples, and
only the skills/templates that fit its stack — verified, with a readiness
report.
Paths below assume you run from the agent-compass checkout; from a host that
vendors it, prefix with the submodule path (usually docs/agent-compass/).
Inputs (ask only for what detection cannot answer)
- Host path — required. Everything else has a detectable default.
- Vendoring mode — submodule (tracked updates; default when the user wants
to keep receiving improvements) vs standalone copy (no submodule). Ask once
if the user gave no signal.
- Team shape — maps to a policy pack:
solo-dev (default), startup-fast,
strict-enterprise, regulated-api. Infer from context before asking.
Fast path
When the defaults fit (detected stacks, fit-based skill subset, solo-dev-ish
setup), one command does steps 3–7:
node scripts/adopt.mjs /path/to/host
Then jump to step 6 (fill the command registry with real commands) and step 8
(report). Use the granular steps when the user stated preferences or something
fails.
Steps
Inspect the host. Read its package.json, lockfiles, and top-level
directories. Confirm it is a git repo. Then let detection do the work:
node scripts/recommend.mjs /path/to/host --json
This reports detected stacks and setup gaps. Do not re-derive by hand.
Vendor (submodule mode only). From the host root:
git submodule add <agent-compass-url> docs/agent-compass
Skip for standalone mode — the scripts work from any checkout.
Run non-interactive setup. Detection fills the answers; --yes skips
prompts:
node scripts/setup-wizard.mjs /path/to/host --yes
If the user stated preferences (scope, providers, skill sync mode), write
agent-compass.answers.json in the host first, run the wizard with
--no-run, review the plan, then run
node scripts/setup-host.mjs /path/to/host --strict.
Apply the policy pack matching the team shape:
node scripts/apply-recommendations.mjs /path/to/host --policy solo-dev
Select what fits — do not install everything. Fit-based selection is
data-driven (scripts/lib/profiles.mjs): detection maps the host to stack
ids, profiles map stack ids to assets. Get the selection and sync exactly it:
node scripts/recommend.mjs /path/to/host --json # → assets.skills/templates/docs
node scripts/skills-sync.mjs /path/to/host --only <assets.skills, comma-joined>
Working-style skills (caveman, ponytail, …) are user preference — add
them only if the user wants them. Point the host's docs/instructions at the
assets.docs list rather than copying those files. Browse everything else
with node scripts/catalog.mjs --md.
Fill the command registry with real commands. Open the host's
agent-compass.commands.json and replace placeholders with the actual
install/lint/typecheck/test/build commands from the host's package.json.
This is the step agents depend on most; never leave placeholders.
Verify.
node scripts/agent-onboard.mjs /path/to/host
node scripts/install.mjs --doctor --deep /path/to/host
Read .agent/doctor-report.md and .agent/recommendations.md in the host;
fix criticals (missing pointers, empty registry, broken MCP placeholders).
Recover missing project knowledge. If the host has code but no reviewed
specifications or architecture documents, offer codebase-to-specs. Keep
every generated document marked as inferred until a human reviews it. Do not
run this step when reviewed specifications already exist.
Report against the Completion Gate: files created, commands run,
verification results, skipped recommendations with reasons, and the top
remaining follow-ups from .agent/recommendations.md.
Failure handling
- A script exits non-zero → read its output, fix the cause (usually a missing
file or non-git host), re-run. Scripts are idempotent and never overwrite.
- Host already has
AGENTS.md or other agent config → keep it; the installer
skips existing files. Offer a diff-style summary of what compass would add.
- No
package.json (non-Node host) → core assets still apply; skip stack
skills and note that the command registry needs the host's real build/test
commands regardless of language.
1---2name: compass-adopt3description: Wire agent-compass into an existing project end-to-end with minimal user input: detect the stack, run non-interactive setup, install only what fits, verify, and report. Use when the user asks to "set up", "adopt", "install agent-compass into", or "make agentic" an existing repository.4---56# Compass Adopt — set up an existing project78Mission: an existing repository leaves this playbook with the agent contract,9command registry, specs/memory starters, provider pointers, MCP examples, and10only the skills/templates that fit its stack — verified, with a readiness11report.1213Paths below assume you run from the agent-compass checkout; from a host that14vendors it, prefix with the submodule path (usually `docs/agent-compass/`).1516## Inputs (ask only for what detection cannot answer)17181. **Host path** — required. Everything else has a detectable default.192. **Vendoring mode** — submodule (tracked updates; default when the user wants20 to keep receiving improvements) vs standalone copy (no submodule). Ask once21 if the user gave no signal.223. **Team shape** — maps to a policy pack: `solo-dev` (default), `startup-fast`,23 `strict-enterprise`, `regulated-api`. Infer from context before asking.2425## Fast path2627When the defaults fit (detected stacks, fit-based skill subset, `solo-dev`-ish28setup), one command does steps 3–7:2930```bash31node scripts/adopt.mjs /path/to/host32```3334Then jump to step 6 (fill the command registry with real commands) and step 835(report). Use the granular steps when the user stated preferences or something36fails.3738## Steps39401. **Inspect the host.** Read its `package.json`, lockfiles, and top-level41 directories. Confirm it is a git repo. Then let detection do the work:4243 ```bash44 node scripts/recommend.mjs /path/to/host --json45 ```4647 This reports detected stacks and setup gaps. Do not re-derive by hand.48492. **Vendor (submodule mode only).** From the host root:5051 ```bash52 git submodule add <agent-compass-url> docs/agent-compass53 ```5455 Skip for standalone mode — the scripts work from any checkout.56573. **Run non-interactive setup.** Detection fills the answers; `--yes` skips58 prompts:5960 ```bash61 node scripts/setup-wizard.mjs /path/to/host --yes62 ```6364 If the user stated preferences (scope, providers, skill sync mode), write65 `agent-compass.answers.json` in the host first, run the wizard with66 `--no-run`, review the plan, then run67 `node scripts/setup-host.mjs /path/to/host --strict`.68694. **Apply the policy pack** matching the team shape:7071 ```bash72 node scripts/apply-recommendations.mjs /path/to/host --policy solo-dev73 ```74755. **Select what fits — do not install everything.** Fit-based selection is76 data-driven (`scripts/lib/profiles.mjs`): detection maps the host to stack77 ids, profiles map stack ids to assets. Get the selection and sync exactly it:7879 ```bash80 node scripts/recommend.mjs /path/to/host --json # → assets.skills/templates/docs81 node scripts/skills-sync.mjs /path/to/host --only <assets.skills, comma-joined>82 ```8384 Working-style skills (`caveman`, `ponytail`, …) are user preference — add85 them only if the user wants them. Point the host's docs/instructions at the86 `assets.docs` list rather than copying those files. Browse everything else87 with `node scripts/catalog.mjs --md`.88896. **Fill the command registry with real commands.** Open the host's90 `agent-compass.commands.json` and replace placeholders with the actual91 install/lint/typecheck/test/build commands from the host's `package.json`.92 This is the step agents depend on most; never leave placeholders.93947. **Verify.**9596 ```bash97 node scripts/agent-onboard.mjs /path/to/host98 node scripts/install.mjs --doctor --deep /path/to/host99 ```100101 Read `.agent/doctor-report.md` and `.agent/recommendations.md` in the host;102 fix criticals (missing pointers, empty registry, broken MCP placeholders).1031048. **Recover missing project knowledge.** If the host has code but no reviewed105 specifications or architecture documents, offer `codebase-to-specs`. Keep106 every generated document marked as inferred until a human reviews it. Do not107 run this step when reviewed specifications already exist.1081099. **Report** against the Completion Gate: files created, commands run,110 verification results, skipped recommendations with reasons, and the top111 remaining follow-ups from `.agent/recommendations.md`.112113## Failure handling114115- A script exits non-zero → read its output, fix the cause (usually a missing116 file or non-git host), re-run. Scripts are idempotent and never overwrite.117- Host already has `AGENTS.md` or other agent config → keep it; the installer118 skips existing files. Offer a diff-style summary of what compass would add.119- No `package.json` (non-Node host) → core assets still apply; skip stack120 skills and note that the command registry needs the host's real build/test121 commands regardless of language.