$npx -y skills add paleo/alignfirst --skill alignfirst-setup-guideSetup-time companion to install or upgrade any subset of {docmap, workspace, alignfirst skills} in a consumer repo. Use when asked to install, set up, or upgrade docmap, the workspace worktree system, or the AlignFirst skills.
| 1 | # AlignFirst Setup Guide |
| 2 | |
| 3 | A one-time companion for setting up a consumer repository. It installs any subset of three independent tools: |
| 4 | |
| 5 | - **docmap** — agent-discoverable documentation under `docs/`. |
| 6 | - **workspace** — worktree-based concurrent local dev environments. |
| 7 | - **alignfirst skills** — collaborative spec/plan/AAD/review protocols. |
| 8 | |
| 9 | Pick any combination. Each has its own reference; this skill investigates the repo, agrees on scope, then follows the matching reference(s). |
| 10 | |
| 11 | Follow these four steps in order. Do not skip ahead: complete each before starting the next. |
| 12 | |
| 13 | ## Step 1 — Investigate |
| 14 | |
| 15 | Detect the stack and **package manager**: check the `packageManager` field in `package.json`, else the root lockfile — `package-lock.json` → npm, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `bun.lockb`/`bun.lock` → bun — falling back to npm. Record the result — every reference in Step 3 reuses this one detection rather than repeating it. |
| 16 | |
| 17 | **Commands in this guide are written for npm; convert each one to the detected manager** — both when you run it and when you write it into project files. Only npm needs a `--` separator to pass flags to a script (`npm run docmap -- --guide`); pnpm and yarn drop the `run` and the separator (`pnpm docmap --guide`), and bun keeps `run` but needs no separator (`bun run docmap --guide`). Install verbs differ too (`npm install -D` vs `pnpm add -D` / `yarn add -D` / `bun add -D`). |
| 18 | |
| 19 | Then detect each tool's existing footprint: |
| 20 | |
| 21 | - **docmap**: a `docmap` script, a `@paleo/docmap` dependency, or a `docs/` directory. |
| 22 | - **workspace**: a `workspace` script or a `@paleo/workspace` dependency. |
| 23 | - **alignfirst skills**: an installed alignfirst skill, a `.plans/` directory, or an `## AlignFirst` section in `AGENTS.md` / `CLAUDE.md`. |
| 24 | |
| 25 | ## Step 2 — Discuss |
| 26 | |
| 27 | Present the findings and agree with the user on which tools to install or upgrade. Any combination is valid. |
| 28 | |
| 29 | ## Step 3 — Set up |
| 30 | |
| 31 | Require a clean working tree first (`git status`). If it isn't clean, stop and ask the user to commit or stash. Then follow the matching reference(s): |
| 32 | |
| 33 | - [docmap-setup.md](references/docmap-setup.md) — install the docmap CLI, then optionally bootstrap or migrate docs. |
| 34 | - [workspace-setup.md](references/workspace-setup.md) — implement the worktree system (adapt the [asset scripts](assets/), install `@paleo/workspace`). |
| 35 | - [alignfirst-skills-setup.md](references/alignfirst-skills-setup.md) — install the AlignFirst skills and configure the project. |
| 36 | |
| 37 | **Upgrading from an older AlignFirst** (v1/v2): route through [alignfirst-upgrade.md](references/alignfirst-upgrade.md), which detects the version and follows [alignfirst-upgrade-from-v1.md](references/alignfirst-upgrade-from-v1.md) or [alignfirst-upgrade-from-v2.md](references/alignfirst-upgrade-from-v2.md). |
| 38 | |
| 39 | ## Step 4 — After setup |
| 40 | |
| 41 | This skill is temporary. Once setup is done, the user can uninstall it. Provide them the command: |
| 42 | |
| 43 | ```sh |
| 44 | npx skills remove alignfirst-setup-guide --yes |
| 45 | |
| 46 | # prune the entry in skills-lock.json |
| 47 | node --input-type=module -e 'import {readFileSync as r,writeFileSync as w} from "node:fs";const f="skills-lock.json",j=JSON.parse(r(f));delete j.skills["alignfirst-setup-guide"];w(f,JSON.stringify(j,null,2)+"\n")' |
| 48 | ``` |