Skip to content

Building with AI agents

The kit ships tested surfaces for coding agents: six prompt recipes, a shared instructions file, machine-readable docs, and an MCP preset for debugging in a live Chrome.

Six tested recipes live in .claude/commands/*.md. Each encodes the kit’s invariants: exact file paths, the store-policy guard, the definition of done.

RecipeWhat it does
/add-featureScaffold a feature off YourFeature.tsx, including gate wiring and the 2-file paywall edit.
/add-surfaceAdd a WXT entrypoint following the shadow-UI and module conventions.
/change-gate-presetSwitch paywall presets in background/gates.ts with the policy guard restated.
/add-permissionAdd a chrome.* permission: manifest + module.json rationale + e2e guard, permission before code.
/prep-store-submissionPre-flight a store submission: zips, remote-code audit, assets, privacy answers.
/add-migrationChange a chrome.storage shape with a numbered defineMigrations bump and tests.

In Claude Code they are slash commands; open a session at the repo root and type:

Terminal window
/add-feature summarize-page

In Cursor or any other agent, each file is a self-contained prompt: open .claude/commands/<recipe>.md, paste the body, and replace $ARGUMENTS.

  • AGENTS.md: the single source of agent instructions: architecture map, verified MV3 pitfalls, gate policy guard, security invariants. CLAUDE.md and .cursor/rules/ are symlinks to it.
  • llms.txt + markdown mirror: this site publishes /llms.txt and every page as plain markdown, so agents can fetch any guide by URL.
  • Docs bundle: one concatenated markdown file (and a zip of the pages) for pasting the whole docs set into a context window.

The repo ships a project-scope preset in .mcp.json for Google’s chrome-devtools-mcp server, which lets an agent drive and inspect a live Chrome: read service-worker console output, screenshot the popup, watch the background’s network calls, click through a gate wall.

Claude Code detects .mcp.json automatically and asks for approval on first use. To add it explicitly:

Terminal window
claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest

Cursor: add the same server in Cursor Settings → MCP:

{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}

Useful variants (append to args): --isolated for a throwaway profile, or --browser-url http://127.0.0.1:9222 to attach to a Chrome you started yourself with your unpacked extension loaded; pair that with pnpm dev for extension debugging.

Everything in AGENTS.md binds agent-written code exactly as it binds yours. The failure modes agents hit most are the MV3 service-worker rules and hand-writing paywall UI instead of using the gate engine. Review agent diffs against the pitfalls.

The definition of done is the same for agents as for humans:

Terminal window
pnpm typecheck && pnpm lint && pnpm turbo run test
pnpm --filter @extensionstart/extension e2e

Don’t let an agent declare victory without the e2e run.