Imported from moeghashim/PI-Starter (
AGENTS.md). Install upstream withnpx skills add moeghashim/PI-Starter. Copyright stays with the author.
Development Rules
Code Quality
- No
anytypes unless absolutely necessary. - Check
node_modulesfor external API type definitions instead of guessing. - NEVER use inline imports:
- no
await import("./foo.js") - no
import("pkg").Typein type positions - no dynamic imports for types
- always use standard top-level imports
- no
- Never remove functionality to fix type errors from outdated dependencies; upgrade dependencies instead.
- Always ask before removing functionality that appears intentional.
Style
- ESM TypeScript.
- Relative imports must include
.jsextension. - Keep public APIs in
src/index.ts(re-export), keep internals in separate modules. - No emojis in commit messages or code comments.
React App Rules
- In
apps/web, do not importuseEffectdirectly. - Prefer render-time derivation, event handlers, and framework data loading over effects.
useMountEffectis the only allowed mount-only escape hatch for synchronizing with an external system.
Commands
- After code changes (not docs changes):
npm run check npm run checkdoes not apply source fixes. Usenpm run fixexplicitly, then review its changes.- Before handoff or ship, run
npm run fallow:auditto block newly introduced dead code, duplication, and complexity findings againstorigin/main. - Fix all errors, warnings, and infos before committing.
- After changing bindings or
varsinapps/web/wrangler.jsonc, runnpm run typegen:cloudflareand commit the regeneratedapps/web/cloudflare-env.d.ts. - Keep
node_modulesmachine-local. After moving betweendarwin-x64,darwin-arm64, Linux, or Rosetta/native modes, runnpm installornpm run reinstall:cleanbefore using native-tooling commands.
Database Deployments
- Treat app deployment and database deployment as separate release surfaces.
- Before shipping an app, check whether the diff touches schema, migrations, ORM configuration, seed data, database clients, or database environment variables.
- If database changes are present, identify and run the project-specific database deploy or migration command before reporting the app as fully shipped.
- If the database deploy cannot be run, call that out as a blocking or pending release step with the exact command or owner needed.
Agent Workflow
- Agent workflow docs live in
docs/agent-workflow.md, skill guidance indocs/agent-skills.md, and command index indocs/commands.md. - At task start, review recent entries in
progress.mdto understand prior learnings. - Treat
progress.mdas part of the starter contract for forks; keep it tracked, preserve the append-only history, and continue the log in derived repos. - Keep
CLAUDE.mdas a tracked symlink toAGENTS.md;AGENTS.mdremains the canonical source of agent instructions. - Run
npm run docs:listwhenever docs are added or updated. - Run
npm run skills:verify-syncafter changing vendored Vercel skills or their pinned manifest. - Run
npm run skills:addy:verify-syncafter changing vendored Addy Osmani skills or their pinned manifest. - Run
npm run skills:matt:verify-syncafter changing vendored Matt Pocock skills or their pinned manifest. - Run
npm run skills:chrome:verify-syncafter changing vendored Chrome DevTools skills or their pinned manifest. - Run
npm run agent:checkbefore handoff to validate docs front matter, AGENTS structure, and vendored file integrity. It runs offline by hashing vendored files against their manifests. - Run
npm run agent:verify-upstreamafter editing any skill manifest to confirm the pinned hashes still match upstream. CI runs it on every push. - Use
npm run commit:selective -- "type(scope): summary" "path/one" "path/two"for path-scoped commits. - For agent-requested commits, use
npm run commit:with-progress -- "type(scope): summary" --learning "what was learned" -- "path/one" "path/two"soprogress.mdis appended in the same commit. - The
memory-leak-debuggingskill requires thechrome-devtoolsMCP server configured in.mcp.jsonfor heap-snapshot capture, andmemlabvianpx memlabfor analysis. Without the MCP server, only the memlab and fallback-script analysis steps are usable. Never read raw.heapsnapshotfiles directly.
Git
- Never commit unless explicitly requested.
- Push branches through
git push no-mistakes, never directly toorigin. The gate runs review, test, docs, and lint in a disposable worktree, forwards the branch only when everything passes, and opens the PR. Use/no-mistakes <task>to do-and-gate, or bare/no-mistakesto gate already-committed work. Safe mechanical fixes are auto-applied; intent-level findings are escalated for human approval. - Keep commit subjects as normal, human-readable summaries (for example
feat(core): add retry guard). - Every commit must carry a
Signed-off-by:trailer matching the author because the DCO check blocks unsigned PRs. Usegit commit -s; the Huskyprepare-commit-msghook adds it automatically where hooks are installed. - Do not replace commit messages with prompt text.
progress.mdis append-only: only add new entries at the end; never edit prior entries.- For substantial agent-generated changes, add a
Repro-Prompt:trailer in the commit message body.
