Repository navigation
chore(agents): Replace the agent rules with the shared set - #114
Conversation
The old file mixed real project facts with rules already stated elsewhere, and two of its lines no longer matched how the owner works: "build without check-ins" came from a one-off build, and the 400-line stacked PR split had no source. Those are gone, along with anything lint, tests or the README already cover. The rules the owner picked for this repository are added, adapted to PRs going straight into main, and the review rule now matches .coderabbit.yaml, which turns automatic CodeRabbit reviews off. Changes: - Keep the verified facts: sites, deploys, data rules, plain shadcn, locale handling - Add ask-first, done-means, worktree, review, merge, board, i18n voice and writing rules - Add the free-services ask and the two plain-words rules
Recent PRs here used five different shapes, so a reader could not tell where to find the reason or the test results. The template requires only Why and Tested and drops the rest when it does not apply, plus one line for the bundle size budget and the review result, which every PR in this repository has to report.
The old template made every commit list its changes, even when the list held one bullet that repeated the subject. The reason is the part git cannot show later, so the why paragraph is now the required part, and the lists appear only when a commit has separable parts.
Long comments had grown into paragraphs: 217 blocks across 179 files ran over one line or tripped the history check. Each now keeps only the reason the code cannot show. This also drops a dead reference to a private spec and the name of another project from two comments. Compiling each changed file with comments stripped gives identical output, so behaviour is unchanged. Notes: some blocks described what the code does as well as why. Only the why survived, so that detail now lives in the code alone.
Without a check, long comments come back. A small rule kept in this repository, with no new dependency, fails any comment over one line and any comment saying "used to", "previously" or "originally", since history belongs in the commit. Tool directives such as eslint-disable and @ts-expect-error are exempt, and so is the vendored shadcn code in src/components/ui.
A new worktree starts without .env.local because git ignores it, so the app and the database scripts fail until someone copies it by hand. Listing it in .worktreeinclude makes the copy automatic. It is the only gitignored env file the main checkout holds.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…omments Any comment starting with a word like "global" or "exported" skipped both checks, because the rule took it for a tool directive. Two trailing comments on neighbouring lines also failed as one long comment, although each is its own note. Changes: - Match directives by their exact form, with global and exported only in block comments - Join comments into one only when each starts its own line - Say in the history message that a phrase may only sound like history
The review rules told agents to wait for both bots on big PRs, and also that the agent review is enough when CodeRabbit's quota is out. Waiting on an empty quota never ends, so the wait now stops there.
Review of the cleanup found comments that had become false, such as one saying every guard reads the database when only authorising guards do, and warnings a future editor needs, such as why outside-partner stubs are never purged. Each comment stays on one line. Compiling every changed file with comments stripped still gives identical output.
|
Automatic CodeRabbit review is off on purpose in |
Agents sometimes gave up on pages that refuse automated fetches, or reached for other browser tools. The owner wants the T3 Code preview browser used for these whenever it is available.
|
@greptileai review |
The commit template was only prose, so nothing stopped a wrong type, a long subject, dashes or attribution lines. A plain sh hook in .githooks rejects them with no new dependency, and a prepare script points git at that folder on install. A second small hook passes post-checkout on to any global hook, because a repository hooks path replaces the global one and would otherwise stop new worktrees being prepared. Changes: - Add .githooks/commit-msg, exempting subjects git writes itself - Add .githooks/post-checkout and the prepare script - Replace the prose type and length rules in AGENTS.md with a pointer to the hook
Variables nobody reads pile up in three places and make it unclear what the app really needs. The rule says where to delete them, and to print names only so values never reach a log.
The plain shadcn rule banned the styling the frontend-design skill asks for, so agents got two opposite instructions. The owner chose frontend-design: agents may style freely now, and the brand theme replaces that styling later.
A new worktree has no usable dependencies, so the first check in it fails until someone remembers to install them. t3.json runs the install as soon as T3 creates the worktree.
Five places sent readers to a private spec or a checklist file nobody can open from this repository, so the pointers explained nothing. The facts stay and only the pointers go. One of the five is a test title, so no test logic changes.
A `pkill -f` or `pgrep -f` pattern also matches the shell running the command, so pkill kills the agent's own command and a pgrep wait loop never ends. A Claude Code hook now refuses these and points to killing by PID or port, so the protection lives in this repository and does not depend on anyone's personal settings. Changes: - Add the hook and its test in .claude/hooks, wired in .claude/settings.json - Add the matching rules to AGENTS.md
A review of the rules found some too long, some pointing at the wrong place, and some assuming tools this repository does not have installed. The owner approved these fixes; none changes a decision. Changes: - Split the rules over 25 words - Say Greptile applies when installed, and frontend-design when available - Add where map colours live, because MapLibre cannot read CSS variables - Limit the date format to prose, so UI dates keep the locale formatter - Reword generated files, the type-check paths and the isSuppressed rule - Say merges use a merge commit, once CI is green on the latest commit
Many one-line comments still ran past the screen, which defeats the point of keeping them short. The owner set a limit of 120 characters. All 141 longer lines are shortened to one short reason, keeping the security, privacy and race warnings. Compiling every changed file with comments stripped gives identical output, so behaviour is unchanged.
Without a check, long comment lines come back. The local comment rule now counts where a comment ends on its line, so code before a trailing comment counts too. Tool directives stay exempt.
A bare number tells a reader nothing until they look it up, so lists and comments full of numbers are hard to follow. Every reference now carries a short name, and the Part of and Closes guidance shows that shape.
Finished work kept leaving worktrees, branches, test data and running containers behind, and a later session had to work out what was safe to remove. These rules say what to confirm, what to remove, and what a subagent must report.
The rule to ask before any visual change contradicted the rule that lets agents style freely. The owner chose "free everywhere", so the ask is gone.
The checks were a list of commands in AGENTS.md, so it was easy to skip one or forget the bundle size step after a build. pnpm check runs them in order and stops at the first failure, with no new dependency.
The two sites share one inlang project, so Paraglide's baseLocale is wrong for one of them, and only a written rule stopped agents importing it. Lint now rejects the import everywhere, server function files included, and the written rule just points at it. Nothing imports it today.
With automatic review off on purpose, every PR got a "Review skipped" comment that someone had to read and settle. Turning off review_status should stop it. The header comment also shrinks to one line.
Migrations and deploys only run for a commit whose CI passed on main. Two quick merges could cancel the first run, so that commit's migration run would never happen. Runs on pull requests still cancel, because only the latest commit there matters.
The guard blocked ordinary commit and PR text that mentioned the banned commands inside single quotes or a heredoc, where the shell never runs them. It also took the value of a bundled option for the pattern, and missed commands started through exec, setsid, watch, eval, ssh or docker. Each case is now in the guard's test.
The hook rejected any body line starting with "Generated with", including an honest note about a generated migration, and missed an indented Co-Authored-By line. It now matches only a plain tool name or link after those words, and catches indented trailers. The dash check also stops relying on a GNU-only grep feature.
Review of the 120-character cleanup found comments that had lost a warning or no longer made sense, such as the step to re-add addresses after rotating a secret and the list of image segments that can hold personal data. Each stays on one short line. Compiling these files with comments stripped gives identical output.
One bundle budget comment still cited the private spec, and two runbook lines cited a "decision on record" that readers here cannot find. The facts stay and only the pointers go.
The owner chose to replace this file with the shared rules every repository now carries, reviewed rule by rule on 2026-11-09, so another machine or contributor gets the same rules. Three repository rules stay on top because they stop real harm: no manual deploys, no claims mail without the owner, and mail to imported contacts only through the suppression check.
The rules route work to the coder, reviewer, researcher and search agents and name the big-change, research and unslop skills, so they ship with the repository.
The owner asks for short replies most of the time but sometimes wants the full version, and personal letters and forms need personal details on purpose, so the privacy rule now covers what goes into a repository or public site.
The two waiting rules read as opposites, the dash rule read as chat-only although the hooks apply it everywhere, and the big-change skill could only be started by hand although the rules ask agents to propose with it; it still stops at a proposal and builds nothing until approved.
The file rule said to write nowhere else, which read as forbidding repository docs, so it now covers only places outside the repository. The big-change skill pointed at a plan-tracking rule that no longer exists, so it now says to open a tracking issue.
Why
AGENTS.mdis the file that tells coding agents how to work in this repository. It had drifted: about 60% of it repeated what lint, tests, the README or the owner's personal settings already say, and two of its rules no longer matched how the owner works. Agents were also free to write comments of any length, andmaincould take a merge with failing checks.Decisions
All choices below are the owner's, made on 04.11.2026.
t3.jsonwhen T3 creates a worktree. Remove pointers to private notes.checkjob and bothbuildjobs onmainthrough a ruleset (a GitHub setting that blocks merges)..worktreeinclude(a list of ignored files copied into each new worktree, a second working folder of the same repository).AGENTS.mdword for word.Three rules had to change to fit this repository. They wait on the owner:
.coderabbit.yamlturns automatic review off here. The rule says to run its command line tool instead, and that the agent review is enough when its quota is out.main. The stricter review meant for releases now applies to big or sensitive PRs.What changed
AGENTS.mdrewritten as single-action rules of 25 words or fewer.eslint-rules/one-line-comments.js. The cleanup came first so every commit passes lint..worktreeinclude, listing.env.local..githooks/commit-msgand apreparescript that points git at that folder. The hook rejects an unknown type, a subject over 72 characters, em or en dashes, and attribution trailers. Subjects git writes itself are exempt from the type and length checks: merges, reverts, and fixup, squash and amend commits..githooks/post-checkout, which was not in the owner's request. A repository hooks path replaces a global one, so without this a global hook that prepares new worktrees would stop running.AGENTS.mdandREADME.md, andt3.json.docs/runbook.md, a test title,src/lib/auth/auth.server.tsand both site configs..claude/hooks/guard-process.py, a Claude Code hook wired in.claude/settings.json, with a test. It blockspkill -fandpgrep -fpatterns that match their own shell, and points to killing by PID or port.AGENTS.md: rules over 25 words split, Greptile "when installed",frontend-design"when available", where map colours live, dates "in prose", generated files,netlify/in the type-check paths,isSuppressed, merge commits.Part ofandClosesguidance inAGENTS.mdand the PR template showing that shape.AGENTS.md.pnpm check, which runs the required checks in order withpnpm sizeafter each build. "Done means" now points at it.baseLocale, everywhere including server function files. The written rule is now a pointer..coderabbit.yaml:review_status: false, and the header comment on one line..github/workflows/ci.yml: only pull request runs cancel, so a push tomainno longer cancels a run in progress. GitHub can still drop a run that is only waiting in the queue; the next commit's run then applies its migrations.AGENTS.mdgrew from 952 to 1,490 words, because the rules the owner picked add more than the deletions remove.Tested
Run locally on the final commit, with CI's placeholder env file and a throwaway Postgres 18:
pnpm checkon the final commit: passes, with 793 tests passed and 14 skipped. An earlier run on the same commit failed once whentests/emails.test.tsxhit its 10-second setup timeout while the machine was under load; the rerun passed.pnpm db:checkandpnpm db:migrateon an empty database: pass.pnpm build:rpcc,pnpm build:dnz: pass, and the client bundle scan found no server secrets.Comment cleanup: the 179 cleaned files compile to identical output with comments stripped, so behaviour is unchanged.
Second comment cleanup: the 121 files shortened to 120 characters also compile to identical output with comments stripped.
Process hook: 53 of 53 test cases pass (
python3 .claude/hooks/guard-process.test.py), and the exact command form insettings.jsonrefused a real pattern.Lint rule: planted test comments failed for stacked lines, multi-line blocks and history wording; trailing comments and tool directives passed.
Commit hook: 19 bad and 14 good test messages all gave the expected result. In a scratch clone, a fresh install set the hooks path, real bad commits were refused, a good commit and a real merge passed, and a new worktree still got its env file through the global hook.
baseLocalelint: planted imports failed through the alias, a relative path and a server function file;getLocalepassed.Not run: the T3 browser check, because nothing rendered changed. Whether T3 runs
t3.jsonon a real new worktree was not tried.Steps and risks
Ruleset on
main: created after this PR opened, id 26574421, active. It requires thecheck,build (rpcc)andbuild (dnz)checks from GitHub Actions (app id 15368). Nobody can bypass it, admins included, and the API accepted that. A branch does not have to be up to date withmainto merge. Direct pushes tomainnow fail unless the commit already passed those checks. The owner also added force-push and deletion blocks to this ruleset.After the merge:
pnpm installskipspreparewhen dependencies are already up to date, so runpnpm prepareonce in the main checkout to turn the hook on. Git stores the setting for all worktrees of this clone. A branch cut before this change has no.githooksfolder, so a worktree made from it gets neither hook until it mergesmain.No deploy step. Only comments changed in application code.
Bundle budget and review:
pnpm sizeis within budget on both sites (for example 275.09 of 280 kB and 452.55 of 460 kB). Review: one agent review of the code. Fixed from it: two lint rule bugs, comments that had become false or lost a warning, plus the same mistake in other comments, and a rule conflict about waiting on a bot whose quota is out. Left as is: the history check also flags "used to" in the sense of "used for", because the owner chose that wording, and the error message now says to reword. A second agent review covered every commit after79a2734. Fixed from it: guard false blocks and misses, two commit hook gaps, comments that lost meaning, and the last pointers to notes outside the repository. Left as is: custom merge subjects andfeat!:stay rejected, because the owner asked to exempt only git's own subjects. The owner requested a Greptile review and it has not replied. The CodeRabbit CLI did not run.Update 2026-11-09: rules rewrite
Why
The owner replaced this file with the shared rule set every repository now carries, reviewed rule by rule, because "i might not have it on the other pc". The earlier repository-specific rules were set aside by the owner ("i did no work with it basically"); three stay on top because they stop real harm.
Decisions
pnpm claims:sendonly on the owner's word, and mail to imported contacts only through the suppression-checked template.big-changeskill, which builds nothing until approved.What changed
AGENTS.mdreplaced by the three repository rules plus the shared rules..claude/agents/: the coder, reviewer, researcher and search agents the rules route work to..agents/skills/:big-change,researchandunslop, linked from.claude/skills/.Tested
AGENTS.md; the new.claude/skills/links resolve.Docs touched:
AGENTS.md.