{"content":"# AI Coding Agent Configuration\n\nConfigure AI coding agents like Cursor, GitHub Copilot, or Claude Code with project-specific patterns, coding guidelines, and MCP servers for consistent AI-assisted development.\n\n## Prerequisites\n\nComplete these setup recipes first:\n\n- Code Health, Linting & Formatting\n\n### Step 1: Create an AGENTS.md file\n\nCreate an `AGENTS.md` file in your project root. This file provides coding guidelines and patterns for AI assistants to follow.\n\n```markdown\n// AGENTS.md\n\n# Coding Guidelines\n\n- Strictly follow the Functional Core, Imperative Shell pattern: separate application logic into two parts: a functional core with pure, side-effect-free functions for business rules and data transformation, and an imperative shell that handles impure actions like database I/O, network requests, or user input, making the core logic easily testable and modular\n- Everything is a library: Organize features and domains as self-contained folders in `src/lib/` (e.g., `chat`, `ai`, `db`). Co-locate schema, queries, types, and utilities together. Components go in `components/<feature>/`.\n- Use the web platform: Prefer native APIs and standards. Avoid abstractions that hide what the code actually does.\n\n## Runtime and Package Manager\n\n- Use Bun instead of Node.js, npm, pnpm, or vite.\n- Use `bun install` instead of `npm install` or `yarn install` or `pnpm install`.\n- Use `bun run <script>` instead of `npm run <script>` or `yarn run <script>` or `pnpm run <script>`.\n\n## TypeScript\n\n- Avoid `export default` in favor of `export` whenever possible.\n- Only create an abstraction if it's actually needed\n- Prefer clear function/variable names over inline comments\n- Avoid helper functions when a simple inline expression would suffice\n- Don't use emojis\n- No barrel index files - just export from the source files instead\n- No type.ts files, just inline types or co-locate them with their related code\n- Don't unnecessarily add `try`/`catch`\n- Don't cast to `any`\n- Avoid `enum` and other TypeScript features that fail type stripping (e.g. namespaces, parameter properties); prefer `as const` objects/unions instead\n\n## React\n\n- Avoid massive JSX blocks and compose smaller components\n- Colocate code that changes together\n- Avoid `useEffect` unless absolutely needed\n\n## Tailwind\n\n- Mostly use built-in values, occasionally allow dynamic values, rarely globals\n- Always use v4 + global CSS file format + shadcn/ui\n\n## Next\n\n- Prefer fetching data in RSC (page can still be static)\n- Use next/font + next/script when applicable\n- next/image above the fold should have `sync` / `eager` / use `priority` sparingly\n- Be mindful of serialized prop size for RSC → child components\n\n# Dev Workflow\n\nFollow these steps for every feature. Do not skip verification steps. Repeat the full verification flow for every additional code change.\n\n1. Start on the latest `main` unless instructed otherwise (`git checkout main && git pull`).\n2. Make the changes.\n3. Run `bun run typecheck` and `bun run fmt`. Fix all type errors before moving on.\n4. Verify code health with `bun run fallow`. Fix every issue (dead code, duplication, complexity, etc.) or add a `fallow-ignore` suppression if you judge the warning a false positive. Verify the codebase is clean before moving on.\n5. Verify the changes with `agent-browser`. Address all UI/UX concerns before moving on. Confirm everything looks great and works.\n6. Commit and push to `main`. Pushing to `main` triggers the production deploy.\n7. Check deployment logs. Fix any issues and redeploy via follow-up commits if anything breaks.\n8. Check production with `agent-browser` to verify the changes shipped and look good in production too. Debug any issues via app logs and fix with follow-up commits.\n9. For every additional code change, go through all verification steps again.\n10. Once production looks good, report all changes.\n\n## Delegating to Subagents\n\nThe orchestrating agent owns the intent-heavy, stateful, and destructive steps; delegate the noisy, verifiable, context-light steps to subagents with fresh context windows. This keeps the main context focused and avoids filling it with throwaway tokens (reports, screenshots, logs).\n\n- **Keep in the main agent:** making the changes (step 2), committing and pushing (step 6), driving the per-change verification loop (step 9), and the final report (step 10). These hold the design intent or are deliberate/destructive actions that must be owned, not fired and forgotten.\n- **Delegate to a \"code health\" subagent:** typecheck, format, and Fallow (steps 3–4). Hand it the diff; it fixes or suppresses issues and reports clean/dirty. This work is self-contained and burns tokens reading reports.\n- **Delegate to a \"verification\" subagent:** `agent-browser` UI/UX checks against acceptance criteria (steps 5 and 8). It returns pass/fail plus screenshots instead of dumping navigation noise into the main window.\n- **Delegate to a \"deploy investigator\" subagent:** reading deployment logs and diagnosing failures (step 7). It returns a root-cause summary rather than raw logs.\n\nGive each subagent a self-contained brief with clear acceptance criteria, since it does not share the main conversation's history. Launch independent subagents in parallel when their tasks don't depend on each other.\n\n## Dev Tooling\n\n- Use `agent-browser` for interacting with browsers\n- Use `fallow` to identify dead code and general code health. Don't blindly fix everything - if something seems fine you can always update the `.fallowrc.json` file or just ignore that specific report item.\n```\n\n> This `AGENTS.md` file is based on [Lee Robinson's](https://x.com/leerob) original [shared here](https://x.com/leerob/status/1993162978410004777).\n\n### Step 2: Symlink CLAUDE.md to AGENTS.md\n\nClaude Code reads its instructions from `CLAUDE.md`. Create a symlink so it picks up the same guidelines from `AGENTS.md`, keeping a single source of truth:\n\n```bash\nln -s AGENTS.md CLAUDE.md\n```\n\n### Step 3: Add MCP Servers\n\nUse MCP (Model Context Protocol) servers to enhance your coding agent's capabilities. Add servers with `bunx add-mcp <mcp url> -y` — it updates all detected agents automatically, so no per-agent config files are required.\n\nIf no agents are detected, add `-a cursor -a codex` to the command or prompt the user to specify what agents they want to use for this project.\n\nAdd the `context7` MCP server for up-to-date documentation lookup for any library:\n\n```bash\nbunx add-mcp https://mcp.context7.com/mcp\n```\n\n### Step 4: Install Browser Automation\n\nInstall the `agent-browser` package globally for web automation:\n\n```bash\nbun install -g agent-browser\nagent-browser install  # Download Chrome (first time only)\n```\n\n### Step 5: Install Agent Skills\n\nInstall skills for AI agents:\n\n```bash\nbunx skills add anthropics/skills -s skill-creator -a cursor -a codex -y\nbunx skills add vercel-labs/agent-browser -s agent-browser -a cursor -a codex -y\n```\n\n| Skill | Description |\n| `skill-creator` | Anthropic skill creation guidelines |\n| `agent-browser` | Browser automation for web testing and interaction |"}