Build rules for AI coding agents
Toggle curated rule sets, write your own, analyze a project file, then copy, download or share the result — formatted for each tool’s conventions.
Target AI tool
Programmatic API →AI coding agent CLI that learns your taste and follows memory files on every turn.
How it loads: Reads AGENTS.md from the project root (or .commandcode/AGENTS.md) into the system prompt every request, together with any subdir-level AGENTS.md.
Analyze your project
Drop package.json or requirements.txt — parsing happens in your browser, files never leave your machine.
Rule sets
General
Code Style
Testing
Security
Documentation
Framework & UI
Backend
Custom rules
0 chars · 1 linesRaw markdown appended as its own section — bullets, headings, fenced code blocks all work.
Saved configurations
Stored in this browser only (localStorage) — nothing is uploaded to a server.
Nothing saved yet — save your first configuration above.
Project Rules
General Principles
- Write code for correctness and clarity first; optimize only after measuring.
- Make the smallest change that solves the problem — no drive-by refactors outside the task's scope.
- Never leave dead code, commented-out blocks, or speculative abstractions behind; delete them.
- Prefer boring, well-understood solutions over clever ones.
- When requirements are ambiguous, state your assumptions explicitly; ask before guessing at an interface.
- Keep modules focused: one responsibility per file, one concern per commit.
- Verify your work before declaring it done: run the tests, the type checker, and the linter.
TypeScript Style
- Keep
strictTypeScript enabled; the build must pass with zero type errors. - Avoid
any— useunknownat system boundaries and narrow it deliberately. - Rely on inference for locals; annotate every exported function signature.
- Model state with discriminated unions instead of boolean flag parameters.
constby default; never reassign parameters; prefer pure data flow.- Handle every case in a
switchover a union type — make impossible states unrepresentable. - Keep exported surfaces small: export only what other modules actually consume.
- Prefer
async/awaitover raw promises; only catch errors you can handle, otherwise rethrow with added context. - Limit functions to roughly 50 lines; extract helpers only when the extraction improves clarity.
Testing Principles
- Test behavior through public interfaces, not private implementation details.
- Follow Arrange–Act–Assert; one logical assertion per test.
- Name tests as specifications: "returns 404 when the build artifact is missing".
- Every bug fix ships with a regression test that fails without the fix.
- Tests must be deterministic: no sleeps, no reliance on wall-clock time or iteration order — inject fakable clocks.
- Cover the happy path, edge cases (empty, boundary, invalid), and failure paths.
- Keep tests independent — shared mutable fixture state is a bug factory; build fresh state with factories.
- Mock only at true boundaries (network, filesystem, clock), never the code under test.
Everything on this page lives in your browser: saved configs and share links are encoded in the URL — no server-side storage, no tracking.