9 community-ranked rules
Validate all external inputs at system boundaries. Trust nothing from users, APIs, or files.
Saves time by specifying all three untrusted input sources (users, APIs, files) as requiring validation at system boundaries.
Write rules for yourself that prevent the same mistake
This belongs in automated testing or linting pipelines, not in agent instructions.
Use plan mode for verification steps, not just building
Adds minimal value over the 0922494eee667d5d rule as it restates plan mode use without distinct actionable guidance.
Design a minimal, intuitive public API. Every exported symbol is a commitment — keep the surface area small.
Avoid N+1 query patterns — use batch loading, JOINs, or DataLoader patterns.
Organize code in layered structure: Domain (entities/interfaces), Application (services/DTOs), Infrastructure (repositories/external), Api/Presentation.
Saves time by establishing the four-layer clean architecture (Domain, Application, Infrastructure, Api/Presentation) as the mandated project structure.
Prefer `var` when type is apparent from context.
Enforce `var` usage via `.editorconfig` (`csharp_style_var_when_type_is_apparent = true`) rather than relying on an agent rule.
Write E2E tests for critical user journeys: signup, login, checkout, core workflows.
Employ file-scoped namespaces (`namespace X;`).
Enforce file-scoped namespaces via `.editorconfig` (`csharp_style_namespace_declarations = file_scoped`) rather than an agent rule.
Have a rule that helps your AI coding agent? Share it with the community.
Suggest a Rule