Bootstrap Metric Insights Linear CLI setup files for both Cursor and Claude.
Shared (every run): LINEAR_CLI.md, AGENTS.md, .dev-environment.md, .assistant-setup/page-workflow-context.md, .assistant-setup/ca-ai-tools-setup.json
Cursor rules (Cursor and/or Claude): .cursor/rules/*.mdc — Claude Code follows the same rules. Emitted for Claude-only runs too.
| Path | When |
|---|---|
setup-cursor-assistant.md |
Cursor selected |
.cursorrules, .cursorignore |
Cursor selected |
.cursor/rules/* (code-style, linear-cli, linear-task-gates, portal-env-credentials, test-case-rules, test-suite-template, README; figma-mcp.mdc if Figma MCP) |
Cursor and/or Claude |
.cursor/skills/* (ai-development + DOD-FULL, testing-flow, testing-with-linear, ui-check-simple, linear-report, linear-workflow, test-documentation, playwright-mcp, figma-implementation, form-builder; figma-code-connect + references if Figma MCP) |
Cursor selected |
.cursor/prompts/react-component-unit.md |
Cursor selected |
.cursor/mcp.json, .cursor/ca-ai-tools-setup.json |
Cursor + MCP option |
setup-claude-assistant.md, CLAUDE.md, .claude/settings.json |
Claude selected |
.claude/skills/* (same skill set as Cursor, under .claude/skills/) |
Claude selected |
.claude/agents/code-style.md |
Claude selected |
.claude/agents/figma-mcp.md |
Claude + Figma MCP |
.mcp.json (repo root) |
Claude + MCP option |
Skip/--force behavior: setup assistant markdown is always refreshed; most other paths are created once, then skipped unless --force (see package docs below).
This package is private and consumed directly from its GitHub repository (not the public npm registry). Push changes to the repo; consumers install with npm’s GitHub shorthand.
Authenticate to the private repo the same way you clone it (SSH, or HTTPS with a personal access token and credential helper).
Optional: pin a branch, tag, or commit after # (for example github:mi-examples/ca-ai-tools-setup#main or github:mi-examples/ca-ai-tools-setup#v0.1.0).
The prepare script runs npm run build after npm install (including installs from github:… and npm pack), so dist/ is generated and is not committed to git. dist/ contains only compiled src/ (the CLI and library JS); tests stay in tests/*.ts and are run with tsx — they are not emitted into dist/.
Binary name: ca-ai-tools-setup. Package spec: github:mi-examples/ca-ai-tools-setup (optional pin: #main, #v0.1.0, commit hash). Below, TARGET is another repo path; omit --target to use the current directory.
The subsections Interactive through Local clone show npx invocations; swap the npx -p github:… ca-ai-tools-setup prefix for pnpm --package=… exec, yarn dlx …, or bunx … as in Fetching the CLI with pnpm, Yarn, or Bun — all other flags stay the same.
One-shot install + run from GitHub (equivalent to npx -p … ca-ai-tools-setup):
pnpm --package=github:mi-examples/ca-ai-tools-setup exec ca-ai-tools-setup --assistants cursor,claude --yesyarn dlx github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --assistants cursor,claude --yesbunx github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --assistants cursor,claude --yes- pnpm:
pnpm execruns thebinfrom the temporary--packageinstall; add--beforeca-ai-tools-setuponly if your shell swallows flags meant for the CLI. - Yarn: requires Yarn 2+ (
yarn dlx). Yarn 1 (Classic) has no equivalent — usenpxorpnpm execfor GitHub one-shots. - Bun:
bunx(same idea asnpx). You can also trybun x …if you standardize on Bun’s CLI.
npx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setuppnpm --package=github:mi-examples/ca-ai-tools-setup exec ca-ai-tools-setupyarn dlx github:mi-examples/ca-ai-tools-setup ca-ai-tools-setupbunx github:mi-examples/ca-ai-tools-setup ca-ai-tools-setupnpx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-apppnpm --package=github:mi-examples/ca-ai-tools-setup exec ca-ai-tools-setup --target ../my-appyarn dlx github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-appbunx github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-appSelects both assistants, Playwright MCP on, Figma MCP off, QA AI rules off. Emits .cursor/mcp.json / .mcp.json when MCP is enabled for the selected assistants.
npm:
npx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --assistants cursor,claude --yespnpm / Yarn / Bun: use the same shape as in Fetching the CLI with pnpm, Yarn, or Bun (same flags: --assistants cursor,claude --yes). Example with --target:
pnpm --package=github:mi-examples/ca-ai-tools-setup exec ca-ai-tools-setup --target ../my-app --assistants cursor,claude --yesyarn dlx github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-app --assistants cursor,claude --yesbunx github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-app --assistants cursor,claude --yesnpx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-app --assistants cursor,claude --yesNo files written; QA AI rules init is not executed.
npx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-app --assistants cursor,claude --yes --dry-runpnpm --package=github:mi-examples/ca-ai-tools-setup exec ca-ai-tools-setup --target ../my-app --assistants cursor,claude --yes --dry-runnpx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --assistants cursor --yesnpx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --assistants claude --yesDisable Playwright MCP (no .cursor/mcp.json / .mcp.json from this run unless Figma is on):
npx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --assistants cursor,claude --yes --mcp-playwright noneEnable both Playwright and Figma MCP (requires FIGMA_API_KEY where Figma is used):
npx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --assistants cursor,claude --yes --mcp-playwright yes --mcp-figma yesAfter generating files, runs init for the package using the detected runner (pnpm dlx, yarn dlx, bunx, or npx) with --cursor / --claude aligned to --assistants. Needs package.json in the target repo.
npx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --assistants cursor,claude --yes --qa-ai-rules yesnpx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-app --assistants cursor --yes --qa-ai-rules yesnpx -p github:mi-examples/ca-ai-tools-setup ca-ai-tools-setup --target ../my-app --assistants cursor,claude --yes --forceFrom this repository after npm install:
node dist/cli.js --target ../my-app --assistants cursor,claude --dry-run--target <path>: target repo directory (resolved from the current working directory; omit or press Enter in the prompt to use the current directory)--assistants <list>: comma-separated assistants, e.g.cursor,claude--dry-run: preview created/skipped/overwritten files without writing--force: overwrite existing generated files (no merge prompts; MCP files are fully replaced)--yes/-y: non-interactive defaults (existingsetup-cursor-assistant.md/setup-claude-assistant.mdare always replaced; existing.cursor/mcp.json/.mcp.jsonare left unchanged unless you pass--force)--mcp-playwright <yes|no>: add or skip Playwright MCP files for the assistants you selected (yes/true/1/cursor/onvsnone/no/false/0/off). Cursor →.cursor/mcp.json; Claude →.mcp.jsonat repo root. With--yesand no flag, defaults to yes--mcp-figma <yes|no>: add or skip Figma MCP files for the assistants you selected (yes/true/1/figma/onvsnone/no/false/0/off). Cursor →.cursor/mcp.json; Claude →.mcp.jsonat repo root. With--yesand no flag, defaults to no (requiresFIGMA_API_KEY)--qa-ai-rules <yes|no>: after generating files, run@metricinsights/qa-ai-rulessetup in the target repo (yes/true/1/onvsnone/no/false/0/off). Uses--cursor/--claudeflags aligned with--assistants. The CLI picks a one-shot runner frompackage.jsonpackageManager(Corepack) and lockfiles:pnpm dlxwhen pnpm,yarn dlxfor Yarn 2+ / Berry layout,bunxwhen Bun, otherwisenpx. Skipped when--dry-runis set. If there is nopackage.jsonin the target, the CLI skips with a warning (you can runnpx/pnpm dlx/yarn dlx/bunxmanually). With--yesand no flag, defaults to no
The generator creates .assistant-setup/page-workflow-context.md as a lightweight working document for page-focused tasks.
Use it to capture:
- Key routes/page entry points
- Primary user flows
- Preconditions (auth, env, feature flags, seed data)
- Expected stable UI markers and known caveats
The file is template-first by design and should be updated per repository.
Use Metric Insights API docs as a baseline reference: API Access.
Important:
- Documentation coverage is helpful but not always complete for every environment.
- Request/response shapes and validation rules may differ by instance version.
- Validate assumptions against the target instance (token + representative API checks) and record confirmed differences in
.dev-environment.md(under API compatibility notes).
npm install
npm testnpm install runs prepare and builds dist/. Use npm run build alone when you only need a compile without reinstalling. Use npm run typecheck for tsc --noEmit over src/ and tests/ (no output).
- Interactive MCP conflicts: If any MCP server is enabled and
.cursor/mcp.jsonor.mcp.jsonalready exists, the CLI asks per file: Skip (keep as-is), Merge (union ofmcpServers; generated server names override duplicates), or Overwrite (replace with the template).--dry-runand--yesskip these prompts;--forceoverwrites every generated path without merging. - Legacy metadata migration: old files
.cursor/linear-cli-setup.jsonand.assistant-setup/linear-cli-setup.jsonare migrated to new names on update when possible; with--force, old legacy files are removed. - Obsolete QA flow cleanup (PP-3640): every re-run removes legacy
ai-testing/ui-checkskills and.claude/workflows/ui-check.mdif they still exist from older bootstraps, then deletes any empty parent folders left behind (e.g..cursor/skills/ai-testing/). - Setup assistant markdown files are always refreshed on each run; use
--forceto update other generated files in place. RootAGENTS.md,CLAUDE.mdand.claude/settings.json(Claude only), and.cursorrules(Cursor only), follow the same rules as.dev-environment.md: created when missing, skipped if they already exist unless--force. .dev-environment.mdis generated as a personal local profile (including Authentication:MI_ACCESS_TOKENfor the dev proxy,/data/page/index/auth/infosmoke check on localhost, session cookies); keep it up to date and add it to.gitignore. StoreMI_USERNAME/MI_PASSWORDonly in.mi-credentials.local.env(gitignored), never in.dev-environment.md.- Page workflow context file (
.assistant-setup/page-workflow-context.md) is generated as a shared artifact and can be refined per project. - Node.js: This package keeps
engines.node>=20for running the bootstrap CLI. Repositories that use current@metricinsights/pp-devshould use Node.js 22+ for dev and CI (recent pp-dev requires it); alignenginesand workflow images in those app repos when you adopt newer pp-dev. - CI: Consumer app repositories may not have GitHub Actions (or other CI) yet—that is still often the exception—but the goal is for build / lint / test on every change to become the default. This tool does not generate CI files; add workflows in each app repo when you standardize, and pin the same Node version you use locally (see above for pp-dev).