Working with agents
The generators, skills and hooks every project gets, and how agents use them.
Every project is set up so a coding agent can add features the same way each time, and check its own work before it says it's done. This works the same for every backend and auth provider.
Generators
New code starts from a generator, so every feature looks like the sample todo list:
pnpm gen feature --args bookmarks "title:text,url:text,note:text?,favourite:boolean"Fields are name:type pairs. Types are text, integer, boolean and timestamp; a trailing
? makes a field optional. pnpm gen table, endpoint, page and screen create one part at
a time.
Every backend gets the same page, screen and data hook. Only the backend part differs:
| Drizzle + Postgres | Supabase | Convex | |
|---|---|---|---|
| Table | packages/db/src/schema/bookmarks.ts and its migration | A migration with row-level security, and its types in packages/db | A table in apps/server/convex/schema.ts |
| API | tRPC router in packages/api/src/routers/ | Typed queries in packages/api/src/ | Functions in apps/server/convex/bookmarks.ts |
| Both apps | hooks/use-bookmarks.ts, the web page /bookmarks, the Android screen bookmarks | same | same |
Calling the API
pnpm api proves a change works, not just that it compiles. It calls the API as signed-in test
users, the way the apps do:
pnpm api bookmarks.create '{"title":"Docs","url":"https://example.com"}' \
bookmarks.update '{"id":"$last.id","favourite":true}' bookmarks.list- A procedure name can be followed by its input as JSON.
"$last.<field>"is replaced by that field of an earlier result, which is handy for ids. as:<name>switches to another user, so you can check they can't see the first user's data.as:nobodysigns out: protected calls must fail.- The command exits with 1 if any call failed.
With Drizzle it boots the server on a throwaway in-memory database, with nothing to start. With
Convex it runs your functions against the local deployment pnpm dev created. With Supabase,
the test-api skill checks the row-level security policies with SQL instead.
Skills
Skills are short recipes an agent loads when a task matches. Their steps follow your backend's files and commands.
| Skill | Used for |
|---|---|
add-feature | A whole feature: generate, adapt, link, check, test |
add-table | New tables and columns |
add-endpoint | API procedures, queries or functions |
add-page | Web pages (when the project has a web app) |
add-screen | Android screens (when the project has an Android app) |
test-api | Proving a feature works and that other users can't see its data |
They are written where your agents look for them: .claude/skills/ for Claude Code (Cursor,
OpenCode and VS Code read it too), .agents/skills/ for Codex and Gemini CLI, and .github/skills/
for Copilot.
Hooks
Claude Code, Codex, Gemini CLI and Cursor support project hooks. Each gets a settings file that
runs one script, scripts/agent-hooks.mjs:
| Claude Code | Codex | Gemini CLI | Cursor | |
|---|---|---|---|---|
| Settings | .claude/settings.json | .codex/hooks.json | .gemini/settings.json | .cursor/hooks.json |
| Blocks edits to generated files | ✓ | ✓ | ✓ | |
| Formats each edited file | ✓ | at the end | ✓ | ✓ |
Runs pnpm check before finishing, sends errors back | ✓ | ✓ | ✓ | ✓ |
Generated files are migrations, convex/_generated, the lockfile, next-env.d.ts,
uniwind-types.d.ts and the local database. Claude Code's settings also allow the project's own
commands (pnpm check, pnpm gen, pnpm api, pnpm --filter …) without asking, and deny npm,
npx, yarn and bun. OpenCode gets the same allow and deny rules in opencode.json.
Agents only load project hooks and permissions in folders you've trusted. Accept the trust prompt the first time you open the project.
AGENTS.md
AGENTS.md is the first thing every agent reads. It maps the project, lists the rules (pnpm only,
shadcn/ui, Biome), shows how the todo feature flows from table to screens, and lists the
generators, skills and hooks. CLAUDE.md and GEMINI.md point to it, and so do
.github/copilot-instructions.md and .cursor/rules/project.mdc when those agents are picked.