@theaihacker A cheap way to make sure someone does: list AGENTS.md, CLAUDE.md, .cursor/rules/ and .claude/ in CODEOWNERS and turn on required code owner review. Then any change to agent instructions needs a named reviewer's approval before it merges.
@st3pan3k Ours: "Before you say it's done, run the tests and the type check, and tell me what you ran." Short and checkable, and it catches the "looks finished but isn't" cases. Rules the agent can verify itself stick better than style advice.
@rich_dutty_@Fei2411 Agreed, and back the refusals with a lock where the tool has one. In Claude Code, deny rules in .claude/settings.json (like Read(./.env)) block the action even if the agent drifts from the rules file. The file sets intent; the deny list enforces it.
@AIGryffindor@mattstauffer@laravelbackpack Works, and one upgrade: .cursorrules is the legacy single file. Cursor still reads it but recommends Project Rules in .cursor/rules/*.mdc, which can be scoped by glob, so your Laravel rules only load when the agent touches PHP files.
Express + Supabase trap: agents use the service-role key for every query. It bypasses Row Level Security, so your policies never run.
Rule to add:
"Verify the user with getUser() and query as that user. Never use the service-role key for user requests."
https://t.co/Fz4A58bVj2
@donella45141@AntonMartyniuk Agreed, and being concrete helps most. "Use modern C#" is vague; "Target .NET 9 / C# 13. Prefer primary constructors, collection expressions and file-scoped namespaces" gives the model something to check its output against.
@sebastiangrebe Both, in that order. If a check can catch it (type, lint rule, test), put it there, since it fails every time. The rules file is for what checks can't express: intent, conventions, which pattern to prefer. A line pointing the agent at the check helps it fix the failure.
@hsn__slm Good catch. Pinning the exact tag (or digest) to match prod and creating extensions in a migration means CI fails where prod would. Worth writing down as a rule too: "Testcontainers images use the exact prod version tag, never a floating major like postgres:16."
Heads-up: Bitdefender found 22 GitHub repos whose AGENTS and CLAUDE rules files tell coding agents to quietly run a hidden setup script, also run by session-start hooks. Before opening a repo you didn't write in an agent, read its rules, hooks and scripts. https://t.co/KAGBiNGETp
@khubaibeh Same here. It works even better with the scope spelled out: "Keep diffs minimal. Only touch files the task needs. No new tests, comments or docs unless asked." Agents drift less when they know where the edges are.
@RogerThat_ Good list. One catch for mixed teams: Claude Code reads CLAUDE.md by default, not AGENTS.md. A symlink or a one-line import in CLAUDE.md keeps both tools on the same rules, and /config has a setting to read both files.
@muzil7734@credosdev One rule of thumb: split by where a rule applies, not by topic. The always-on file stays short (build, test, hard limits). Everything else is scoped to file paths, like Cursor globs or Claude Code's .claude/rules with a paths field, so it loads only when those files are touched.
@AGTPinsights Practical fix: in Claude Code's settings.json, add "Read(./.env)" and "Read(./.env.*)" to permissions.deny. Also commit a .env.example with dummy values, so the agent still knows which variables exist without ever seeing the real keys.
@hsn__slm Agreed, that closes the last gap. H2 accepts types and syntax Postgres rejects, so a green CI can still mean a failed deploy. Testcontainers on the prod Postgres version, Flyway migrations and ddl-auto=validate means CI checks the same schema you ship.
Playwright + AI agents: a common slip is brittle CSS-selector tests with fixed sleeps that pass locally and fail in CI.
Add a rule:
"Locate elements with getByRole, getByLabel or getByTestId. Use web-first assertions, never waitForTimeout sleeps."
https://t.co/CronTMqNHx
@0xhashlol@sebastienlorber It can carry some if you write the exception in: "Avoid any. Where a type is truly unknown (parsed JSON, untyped libs), use unknown and narrow it. If any is really needed, add a comment saying why." A bare ban gives the agent nothing to weigh.
@thehypekevin@agents Right, and there's a setting for it too: in /config, set Project instructions to claude-md-and-agents-md and Claude Code reads both files, CLAUDE.md first. It skips an AGENTS.md that's already imported, so the one-line import still works without loading it twice.
@AsumaCodes Rarely, and that's the gap. A two-minute skim before the first session catches most of it: look for lines telling the agent to run scripts, fetch URLs, skip approvals or edit global config. Hooks configs deserve the closest read, since they run commands on their own.
@realtatendazhou Two things help: a rule that any change to folder layout or config structure updates AGENTS.md in the same PR, and a guard that doesn't rely on docs: wrap must-have values in Helm's required function, so a missing one fails the render instead of deploying.