Rules¶
Every key rule by ID, grouped by file and sorted by score. The scoring criteria are in RANKING.md.
IDs are stable: a rule keeps its ID when it is reworded, re-scored or re-sorted, and the ID of a removed rule is never reused.
Cite rules by ID in reviews, ADRs and pull requests, for example SEC-3.
Source is the first source the rule cites; the guideline file lists all of them.
Checked by lists tools from the files' "How to enforce" sections that check the rule automatically.
This file is generated by python3 scripts/rank.py fix. Edit the guideline files, not this file.
general/accessibility¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
A11Y-1 |
9 | Strongly recommended | Use WCAG 2.2 Level AA as the accessibility baseline for every user interface, not only websites: apply it to native apps, desktop software and documents through WCAG2ICT, and through EN 301 549 where EU law applies. | W3C WAI, WCAG 2 Overview | axe-core rules |
A11Y-2 |
7 | Recommended | If you sell to consumers in the EU, check whether the European Accessibility Act covers your products or services, and if it does, design them to its requirements from the start. | Directive (EU) 2019/882 | |
A11Y-3 |
7 | Recommended | In the US, check which federal accessibility rules apply to what you build: Section 508 for ICT that federal agencies develop, buy or use, the ADA Title II rule for state and local governments' websites and apps, and the CVAA for software with communication features. | US Access Board, Revised 508 Standards: E207.2 WCAG Conformance | |
A11Y-4 |
7 | Recommended | Build accessibility into the design system and into the definition of done: make and test the shared components accessible once, and test each new feature for accessibility, automatically and by hand, before it counts as done. | GOV.UK Design System, Accessibility strategy | |
A11Y-5 |
7 | Recommended | Involve people with disabilities in research, design reviews and testing from the start of a project, with a range of disabilities and assistive technologies. | W3C WAI, Involving Users in Web Projects for Better, Easier Accessibility | |
A11Y-6 |
6 | Recommended | Publish an accessibility statement for each website, app or product, saying how far it meets the standard, which parts don't and why, how to get an accessible alternative, and how to report a problem, and answer the reports you get. | W3C WAI, Developing an Accessibility Statement | |
A11Y-7 |
7 | Recommended | Test each new feature by hand with the assistive technologies and settings people use, on every platform you ship: at least a screen reader, a keyboard or switch access, and the largest text size. | W3C WAI, Selecting Web Accessibility Evaluation Tools | |
A11Y-8 |
7 | Recommended | Don't rely on accessibility overlays or widgets to make a product accessible or compliant: fix the barriers in its own code and content. | European Disability Forum and IAAP, Joint statement on accessibility overlays | |
A11Y-9 |
9 | Strongly recommended | Expose every control's name, role, state and value to assistive technologies through the platform's accessibility API: use the standard controls of the platform or UI toolkit, which do this for you, and implement the API yourself for custom-drawn UI, such as a canvas or a game engine's UI. | W3C, Understanding SC 4.1.2 Name, Role, Value | |
A11Y-10 |
8 | Recommended | Make every function work through a keyboard interface, without precise timing, because switch devices, alternative keyboards and other input that emulates a keyboard depend on it. | W3C, Understanding SC 2.1.1 Keyboard | |
A11Y-11 |
7 | Recommended | Never convey information or instructions by colour alone or by sound alone, or only through shape, size, position or orientation: add text, icons, patterns or captions. | W3C, Understanding SC 1.4.1 Use of Color | |
A11Y-12 |
7 | Recommended | Follow the platform's accessibility settings instead of overriding them, such as text size, bold text, contrast and colour filters, reduced motion and forced colours. | EN 301 549 V4.1.1, clause 11.7 User preferences | |
A11Y-13 |
8 | Recommended | Don't show anything that flashes more than three times in any one second, unless the flashes stay below the general flash and red flash thresholds. | W3C, Understanding SC 2.3.1 Three Flashes or Below Threshold | |
A11Y-14 |
7 | Recommended | Give people enough time: let them turn off, adjust or extend each time limit, and pause, stop or hide anything that moves, blinks or scrolls on its own for more than five seconds. | W3C, Understanding SC 2.2.1 Timing Adjustable |
general/ai-systems¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
AI-1 |
9 | Strongly recommended | Treat model inputs and outputs as untrusted. | OWASP Top 10 for LLM Applications | |
AI-2 |
7 | Recommended | Start with the simplest solution, such as a single model call with retrieval. | Anthropic, Building effective agents | |
AI-3 |
7 | Recommended | Build evaluations early and run them on every change to prompts, models or tools. | Anthropic, Demystifying evals for AI agents | |
AI-4 |
7 | Recommended | Use workflows (predefined code paths) for well-defined tasks, and agents only where the model must decide the steps itself. | Anthropic, Building effective agents | |
AI-5 |
7 | Recommended | Design tools specifically for agents, and put as much effort into the agent interface as you would into a human one: clear, distinct names, focused scope and actionable error messages. | Anthropic, Writing effective tools for agents | |
AI-6 |
6 | Recommended | Treat context as a finite resource and curate what goes into it. | Anthropic, Effective context engineering for AI agents | |
AI-7 |
5 | Conditional | Budget for the hidden technical debt of ML systems: data dependencies, feedback loops and glue code. | Sculley et al., Hidden Technical Debt in Machine Learning Systems | |
AI-8 |
5 | Conditional | Don't be afraid to launch without machine learning. | Google, Rules of ML, rule #1 |
general/api-design¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
API-1 |
9 | Strongly recommended | Make operations safe to retry, using idempotency keys where the method isn't naturally idempotent. | AWS Builders' Library, Making retries safe with idempotent APIs | |
API-2 |
9 | Strongly recommended | Evolve APIs in backward-compatible ways. | AIP-180, Backwards compatibility | buf breaking, oasdiff, breaking changes |
API-11 |
8 | Recommended | Limit what each client can consume: cap the size of request bodies, strings, arrays and uploads, the number of records (API-6) and operations one request can ask for, and the execution time of every request, and rate-limit each client or user, with stricter limits on costly or sensitive operations. |
OWASP API Security Top 10, API4:2023 Unrestricted Resource Consumption | |
API-3 |
8 | Recommended | Use HTTP methods and status codes as their specification defines them. | RFC 9110, HTTP Semantics | Spectral OpenAPI rules |
API-4 |
7 | Recommended | Design the API contract first and review it before implementing it. | Zalando, API First | |
API-5 |
7 | Recommended | Model HTTP APIs around resources and standard methods, not ad-hoc RPC verbs. | AIP-121, Resource-oriented design | Google API Linter |
API-6 |
7 | Recommended | Paginate list endpoints from day one. | AIP-158, Pagination | Google API Linter |
API-7 |
6 | Recommended | Return machine-readable errors in the Problem Details format. | RFC 9457, Problem Details for HTTP APIs | |
API-8 |
6 | Recommended | With enough users, every observable behaviour will be depended on by someone, whether documented or not (Hyrum's law). | Hyrum's Law | |
API-9 |
6 | Recommended | Verify compatibility between providers and consumers with consumer-driven contract tests. | Robinson, Consumer-Driven Contracts | Pact can-i-deploy |
API-10 |
5 | Conditional | For gRPC and Protocol Buffers, follow the official dos and don'ts on field numbering and evolution. | Protocol Buffers, dos and don'ts | buf breaking |
general/architecture-styles¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
STYLE-1 |
8 | Recommended | Start with a well-structured monolith and split it once the boundaries are understood. | Fowler, Monolith First | |
STYLE-3 |
8 | Recommended | Organise services around business capabilities and let each service own its data. | Lewis and Fowler, Microservices | |
STYLE-2 |
7 | Recommended | Have rapid provisioning, basic monitoring and rapid deployment in place before adopting microservices. | Fowler, Microservice Prerequisites | |
STYLE-4 |
7 | Recommended | Treat microservices as a premium you pay to manage complexity. | Fowler, Microservice Premium | |
STYLE-5 |
6 | Recommended | Consider a modular monolith: one deployable with strictly enforced module boundaries. | Shopify Engineering, Deconstructing the Monolith | |
STYLE-6 |
9 | Strongly recommended | Keep the domain independent of UI, frameworks and databases, so that dependencies point inwards. | Cockburn, Hexagonal Architecture | |
STYLE-7 |
7 | Recommended | Layer presentation, domain and data, but in larger systems make domain modules the top-level split. | Fowler, Presentation Domain Data Layering | |
STYLE-8 |
7 | Recommended | Apply CQRS only to the specific parts of a system that need it. | Fowler, CQRS | |
STYLE-9 |
7 | Recommended | Use event sourcing where a full history of changes is a requirement, not as a default persistence model. | Fowler, Event Sourcing | |
STYLE-10 |
5 | Conditional | Say which event-driven pattern you mean: event notification, event-carried state transfer, event sourcing or CQRS. | Fowler, What do you mean by "Event-Driven"? | |
STYLE-11 |
6 | Recommended | Replace legacy systems incrementally behind a facade (Strangler Fig) rather than with a big-bang rewrite. | Fowler, Strangler Fig | |
STYLE-12 |
6 | Recommended | Put an anti-corruption layer between your model and legacy or external models. | Azure, Anti-corruption Layer pattern | |
STYLE-13 |
5 | Conditional | When extracting services, start with a simple, loosely coupled capability and decouple by business capability, not by technical layer. | Dehghani, How to break a Monolith into Microservices |
general/authentication¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
AUTH-1 |
9 | Strongly recommended | In browser apps, keep tokens out of reach of JavaScript: use a server-side session in a cookie, or a Backend for Frontend (BFF) that holds the OAuth tokens. | RFC 10017, Backend for Frontend | |
AUTH-2 |
9 | Strongly recommended | Use the authorization code flow with PKCE for every OAuth client. Don't use the implicit grant, and never use the resource owner password credentials grant. | RFC 9700, Recommendations | |
AUTH-3 |
8 | Recommended | Use an established identity provider, or your framework's built-in authentication and session management, instead of writing your own. | OWASP, Built-in session management implementations | |
AUTH-4 |
8 | Recommended | Sign users in through an external identity provider with OpenID Connect, not plain OAuth, and identify each federated user by issuer and subject (iss and sub). |
OpenID Connect Core, Claim stability and uniqueness | |
AUTH-5 |
9 | Strongly recommended | Set session cookies with Secure, HttpOnly and SameSite=Strict or Lax, and prefer the __Host- name prefix. |
OWASP, Session Management: Cookies | CodeQL, Sensitive server cookie exposed to the client, ZAP baseline scan |
AUTH-6 |
9 | Strongly recommended | Issue a new session ID when a user signs in, re-authenticates or changes privilege level, and invalidate the old one. | OWASP, Renew the session ID after any privilege level change | |
AUTH-7 |
8 | Recommended | Enforce idle and absolute session timeouts on the server, and invalidate the session on the server when the user logs out. | OWASP, Session expiration | |
AUTH-17 |
8 | Recommended | Protect every state-changing request that browsers send with credentials they attach automatically, such as session cookies or HTTP Basic authentication, against cross-site request forgery (CSRF), and keep GET, HEAD and OPTIONS requests free of side effects. |
Spring Security, When to use CSRF protection | |
AUTH-8 |
7 | Recommended | Make sessions revocable: end all of a user's sessions when the account is disabled, and offer to end the other sessions after a password or MFA change. | ASVS 5.0, V7 Session Management | |
AUTH-9 |
7 | Recommended | Ask for the current credentials again before sensitive changes, such as a new password or email address, and before sensitive transactions. | OWASP, Require re-authentication for sensitive features | |
AUTH-10 |
9 | Strongly recommended | Store passwords only as salted hashes from a slow password-hashing function: Argon2id, scrypt, bcrypt or PBKDF2. | OWASP Password Storage Cheat Sheet | CodeQL, Use of password hash with insufficient computational effort |
AUTH-11 |
9 | Strongly recommended | Follow NIST's password rules: require at least 15 characters for passwords used alone (8 with MFA), allow at least 64, and reject passwords on a blocklist of common and breached ones. | NIST SP 800-63B-4, Passwords | |
AUTH-12 |
9 | Strongly recommended | Offer multi-factor authentication to all users, and require it for administrators and other privileged accounts. | OWASP, MFA quick recommendations | |
AUTH-13 |
7 | Recommended | Offer a phishing-resistant authenticator, preferably passkeys. When a passkey counts as a second factor, require user verification and check its flag on the server. | NIST SP 800-63B-4, AAL2 requirements | |
AUTH-14 |
7 | Recommended | Give the same response, in about the same time, whether the account doesn't exist, the password is wrong or the account is locked, and limit failed attempts per account. | OWASP, Authentication responses | |
AUTH-15 |
8 | Recommended | Protect account recovery as strongly as sign-in: use random, single-use, short-lived reset tokens, answer the same whether or not the account exists, and notify the user after every recovery. | OWASP Forgot Password Cheat Sheet | |
AUTH-16 |
6 | Recommended | Encourage users to register more than one passkey or authenticator, or to keep single-use recovery codes, so that losing one device doesn't force a weaker recovery. | OWASP, Passkeys: account recovery |
general/data¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
DATA-1 |
9 | Strongly recommended | Give each service or module exclusive ownership of its data. | microservices.io, Database per service | |
DATA-2 |
9 | Strongly recommended | Evolve database schemas through small, versioned migrations kept in source control. | Sadalage/Fowler, Evolutionary Database Design | |
DATA-8 |
9 | Strongly recommended | Set recovery point and recovery time objectives for each data store, back up to meet them with copies kept outside the primary system, and test restores regularly. | Google SRE book, Data Integrity | |
DATA-9 |
8 | Recommended | Assume every message can arrive more than once: acknowledge it only after processing it, and make consumers idempotent, for example by recording the IDs of processed messages. | microservices.io, Idempotent Consumer | |
DATA-3 |
7 | Recommended | Keep data consistent across services with sagas, not distributed transactions. | microservices.io, Saga | |
DATA-4 |
7 | Recommended | Publish events atomically with state changes using a transactional outbox. | microservices.io, Transactional outbox | |
DATA-5 |
7 | Recommended | Choose the consistency level per use case and make eventual consistency visible in the design. | Vogels, Eventually Consistent | |
DATA-10 |
7 | Recommended | Load the related data that an operation needs in one query or one batched request, not with a query per item (the N+1 problem), and check how many queries each operation makes when you test or profile it. | Azure Architecture Center, Chatty I/O antipattern | |
DATA-6 |
6 | Recommended | Choose storage technology per need, but count the operational cost of every extra datastore. | Fowler, Polyglot Persistence | |
DATA-7 |
3 | Conditional | At organisational scale, treat analytical data as a product owned by domain teams (data mesh). | Dehghani, Data Mesh Principles |
general/decisions¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
ADR-1 |
7 | Recommended | Write an ADR for every architecturally significant decision. | Nygard, Documenting Architecture Decisions | |
ADR-2 |
7 | Recommended | Keep ADRs in the repository next to the code as numbered Markdown files, for example docs/decisions/0001-use-postgresql.md. |
MADR | |
ADR-3 |
7 | Recommended | Record the options you considered and why you rejected them, not just the option you chose. | MADR template | |
ADR-4 |
6 | Recommended | Don't rewrite accepted decisions. Supersede them with a new ADR and link the two. | Nygard, Documenting Architecture Decisions | |
ADR-5 |
5 | Conditional | Say how compliance will be confirmed, for example with a design or code review, an architecture test such as ArchUnit, or a fitness function. | MADR template, "Confirmation" section | |
ADR-6 |
4 | Conditional | Decentralise decisions with an advice process. | Harmel-Law, Scaling the Practice of Architecture, Conversationally |
general/documentation¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
DOC-1 |
7 | Recommended | Start with a system context diagram and a container diagram. | C4 model, diagrams | |
DOC-2 |
7 | Recommended | Store, version and review documentation alongside the code. | Write the Docs, Docs as Code | |
DOC-3 |
6 | Recommended | Give every diagram a title, a key or legend, and labelled, directed relationships. | C4 model, notation | |
DOC-4 |
6 | Recommended | Keep diagrams as text in the repository so they can be reviewed and diffed. | Write the Docs, Docs as Code | |
DOC-5 |
5 | Conditional | Use the C4 abstractions (person, software system, container, component) consistently, whatever the notation. | C4 model, abstractions | |
DOC-6 |
5 | Conditional | Don't mix tutorials, how-to guides, reference and explanation in one document. | Diรกtaxis, The map |
general/domain-driven-design¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
DDD-1 |
7 | Recommended | Build a ubiquitous language with domain experts and use it everywhere: in conversations, documents and code. | Fowler, Ubiquitous Language | |
DDD-2 |
7 | Recommended | Split large domains into bounded contexts, each with its own model, and make the relationships between them explicit. | Fowler, Bounded Context | |
DDD-3 |
7 | Recommended | Spend modelling effort on the core domain; buy or simplify generic subdomains. | Evans, DDD Reference | |
DDD-4 |
7 | Recommended | Use aggregates as consistency boundaries. | Vernon, Effective Aggregate Design | |
DDD-5 |
6 | Recommended | Put behaviour next to the data it changes and avoid anemic domain models. | Fowler, Anemic Domain Model | |
DDD-6 |
6 | Recommended | Model concepts that are defined by their attributes as immutable value objects. | Fowler, Value Object |
general/localization¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
I18N-1 |
7 | Recommended | Keep every user-visible string, including error messages and console output, in resource files outside the code, so that it can be translated without changing the code, from the first release. | Microsoft, Externalize localizable resources | Android Lint, SetTextI18n, eslint-plugin-i18next, no-literal-string, FormatJS ESLint plugin |
I18N-2 |
7 | Recommended | Never build a sentence by joining strings or fragments in code: put each complete message in one string, with named placeholders that translators can move. | Microsoft, Message formatting | Android Lint, SetTextI18n |
I18N-3 |
7 | Recommended | Choose plural and gender forms with a message format that applies each language's CLDR plural rules, such as ICU MessageFormat, instead of testing count == 1 in code. |
Unicode CLDR, Language plural rules | |
I18N-4 |
7 | Recommended | Give translators context: a comment on every short or ambiguous string and on every placeholder that says where the text appears and what the placeholder will contain, plus screenshots or a test build where you can. | Microsoft, Contextual metadata | FormatJS ESLint plugin |
I18N-5 |
6 | Recommended | Write source text that is easy to translate: full sentences, plain words and consistent terms, without slang, jargon or cultural references, and proofread it before it goes to translators. | Microsoft, Contextual metadata | |
I18N-6 |
9 | Strongly recommended | Use Unicode, encoded as UTF-8, wherever text is stored or exchanged: source and resource files, databases, files, APIs and protocols. | WHATWG, Encoding Standard | |
I18N-8 |
8 | Recommended | Store and exchange points in time as UTC timestamps, and convert them to the user's time zone only for display. For future and recurring events, such as meetings, also store the IANA time zone ID. | W3C, Working with Time and Timezones | |
I18N-7 |
7 | Recommended | Format and parse dates, times, numbers, currencies and units, and sort text, with locale-aware APIs that use CLDR data, such as ICU, JavaScript Intl or your platform's globalization API, never with hand-written patterns or rules. |
Microsoft, Design software for international markets: locale support | Android Lint, SetTextI18n |
I18N-9 |
7 | Recommended | Treat the user-interface language, the regional formats and the user's country or region as separate settings: start from the operating system's or browser's preferences, let users change each one in the app, and be wary of guessing the language from the user's location or IP address. | Microsoft, Identifying user preferences | |
I18N-10 |
7 | Recommended | Design layouts that adapt to the length and height of the text: let text wrap and controls grow, avoid fixed-width containers and text fitted tightly into graphics, and expect short strings to become two to three times as long as in English. | W3C, Text size in translation | |
I18N-11 |
6 | Recommended | Lay out the user interface with start and end instead of left and right, so that it mirrors for right-to-left languages such as Arabic and Hebrew. | Microsoft, Mirroring | Android Lint, SetTextI18n, Stylelint, property-layout-mappings |
I18N-12 |
6 | Recommended | Use fonts that contain the glyphs of every script you ship, set fallback fonts for other scripts, and keep font names out of translatable strings. | Microsoft, Customize font selection with font fallback and font linking | |
I18N-13 |
6 | Recommended | Keep text out of images, textures and videos: draw it at run time from string resources, or use images without text. | Microsoft, Design software for international markets: user interface | |
I18N-14 |
7 | Recommended | Test with pseudo-localization from early in development: an automatic fake translation that accents each string, makes it about 40% longer and puts markers around it, plus a pseudo locale for formats. | Microsoft, Pseudolocalization | |
I18N-15 |
5 | Conditional | Localize continuously: send new and changed strings to translation as soon as they're written, through an automated connection between the repository and the translation system, in a standard exchange format such as XLIFF. | Microsoft, Continuous localization |
general/operations-reliability¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
OPS-2 |
8 | Recommended | Monitor the four golden signals for every user-facing service: latency, traffic, errors and saturation. | Google SRE book, Monitoring Distributed Systems | |
OPS-1 |
7 | Recommended | Define SLOs from user-facing SLIs, and use the error budget to balance reliability against release speed. | Google SRE book, Service Level Objectives | |
OPS-3 |
9 | Strongly recommended | Put a timeout on every remote call, and retry only with capped exponential backoff and jitter. | AWS Builders' Library, Timeouts, retries and backoff with jitter | |
OPS-4 |
8 | Recommended | Design to prevent cascading failures, for example with load shedding and by avoiding retry storms. | Google SRE book, Addressing Cascading Failures | |
OPS-13 |
8 | Recommended | Run production across at least two independent failure domains, such as availability zones, with enough spare capacity to lose one without scaling up. | AWS Builders' Library, Static stability using Availability Zones | |
OPS-5 |
7 | Recommended | Stop calling a failing dependency with a circuit breaker, and isolate resources with bulkheads. | Fowler, Circuit Breaker | |
OPS-6 |
6 | Recommended | Avoid fallback paths that are rarely exercised. | AWS Builders' Library, Avoiding fallback in distributed systems | |
OPS-7 |
5 | Conditional | Buffer bursts of load with queues between producers and consumers. | Azure, Queue-Based Load Leveling pattern | |
OPS-8 |
4 | Conditional | Verify resilience with controlled chaos experiments. | Principles of Chaos Engineering | |
OPS-9 |
8 | Recommended | Keep config in the environment, treat backing services as attached resources, and run stateless processes. | OWASP Secrets Management Cheat Sheet | |
OPS-14 |
8 | Recommended | Define infrastructure and platform configuration as code in version control, and change it only through a reviewed pipeline, not by hand in a console or dashboard. | Fowler, Infrastructure as Code | |
OPS-10 |
7 | Recommended | Expose health endpoints that load balancers and orchestrators can probe. | Azure, Health Endpoint Monitoring pattern | |
OPS-11 |
7 | Recommended | Instrument with OpenTelemetry and follow its semantic conventions, so telemetry is portable and correlated. | OpenTelemetry, Observability primer | Weaver live check |
OPS-12 |
7 | Recommended | Run blameless postmortems and track their action items. | Google SRE book, Postmortem Culture | |
OPS-15 |
7 | Recommended | Make processes disposable: on SIGTERM, stop taking new work, finish or hand back the work in flight, and exit within the platform's grace period. |
Twelve-Factor App, IX Disposability | |
OPS-16 |
7 | Recommended | Write structured logs that carry the trace context, to stdout or through a log appender, and ship them to a central store with the retention you need. | Twelve-Factor App, XI Logs | |
OPS-17 |
7 | Recommended | Set a spending limit on every cloud account, project and paid third-party service, and where the provider offers no hard limit, billing alerts that reach the owners, so that an attack can't run up unlimited charges. | OWASP API Security Top 10, API4:2023 Unrestricted Resource Consumption |
general/principles¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
PRIN-1 |
8 | Recommended | Spend architecture effort on the decisions that are hard to change. | Fowler, Software Architecture Guide | |
PRIN-2 |
8 | Recommended | Treat internal quality as a speed investment, not a cost. | Fowler, Is High Quality Software Worth the Cost? | |
PRIN-3 |
7 | Recommended | Reduce irreversibility where you can. | Fowler, Who Needs an Architect? | |
PRIN-4 |
9 | Strongly recommended | Separate concerns and encapsulate decisions behind interfaces. | Microsoft, Architectural principles | |
PRIN-5 |
7 | Recommended | Gather together the things that change for the same reasons; separate those that change for different reasons. | Martin, The Single Responsibility Principle | |
PRIN-6 |
7 | Recommended | Point dependencies at abstractions and make them explicit. | Microsoft, Architectural principles | |
PRIN-7 |
7 | Recommended | Decompose by design decisions likely to change, not by processing steps. | Parnas, On the Criteria to Be Used in Decomposing Systems into Modules | |
PRIN-8 |
7 | Recommended | Keep each piece of knowledge in one place (DRY). | Microsoft, Architectural principles | |
PRIN-9 |
7 | Recommended | Don't build capabilities for presumed future needs (YAGNI), but do keep the code easy to change. | Fowler, Yagni | |
PRIN-10 |
7 | Recommended | Prefer the simplest design that passes the tests, reveals intention, has no duplication and has the fewest elements. | Beck Design Rules | |
PRIN-11 |
6 | Recommended | Take on technical debt deliberately and prudently, and know when you're doing it. | Fowler, Technical Debt Quadrant | |
PRIN-16 |
7 | Recommended | Start every concurrent task in a scope, such as a task group, that waits for it to finish or cancels it before the scope ends (structured concurrency), so that no task outlives the code that owns it. | Smith, Notes on structured concurrency, or: Go statement considered harmful | Ruff flake8-async (ASYNC) rules, typescript-eslint no-floating-promises |
PRIN-12 |
7 | Recommended | Expect system structure to mirror communication structure (Conway's law). | Fowler, Conway's Law | |
PRIN-13 |
7 | Recommended | Aim for an architecture where teams can test and deploy independently. | DORA, Loosely coupled teams | |
PRIN-14 |
5 | Conditional | Shape teams to get the architecture you want (Inverse Conway Maneuver). | Thoughtworks Technology Radar | |
PRIN-15 |
5 | Conditional | Draw team boundaries to manage cognitive load, using clear team types and interaction modes. | Team Topologies key concepts |
general/privacy¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
PRIV-1 |
9 | Strongly recommended | Collect only the personal data that a feature needs for a purpose you have stated, and don't reuse it for a new purpose that isn't compatible with that one. | European Commission, Purpose limitation | |
PRIV-2 |
8 | Recommended | Keep an inventory of the personal data each system processes: what data, about whom, for which purpose and on which lawful basis, where it is stored, which services and third parties receive it, and how long it is kept. | ICO, Documentation | Bearer CLI privacy report, Privado |
PRIV-3 |
7 | Recommended | Pseudonymise personal data that analytics and other secondary uses need to link but not to identify: replace direct identifiers with the output of a keyed one-way function or a random lookup table, and keep the key or table separate, with tighter access (SEC-2). |
EDPB Guidelines 01/2025 on Pseudonymisation | |
PRIV-4 |
7 | Recommended | Use made-up test data in development, test and demo environments, not copies of production personal data. | NIST SP 800-53 Rev. 5, SA-3(2) and PM-25 | Presidio |
PRIV-5 |
9 | Strongly recommended | Make the privacy-protective setting the default: run only the processing each purpose strictly needs, and don't make profiles or user content visible to everyone until the user chooses to. | EDPB Guidelines 4/2019 | |
PRIV-6 |
7 | Recommended | Record each consent with who gave it, when, for which purposes and what they were shown, and make withdrawing it as easy as giving it, in the same interface. | EDPB Guidelines 05/2020 on consent | |
PRIV-7 |
6 | Recommended | If children are likely to use the service, give them high-privacy defaults: profiling, geolocation and sharing of their data off unless there is a compelling reason, and only the data that the feature they are using needs. | ICO, Children's code standards | |
PRIV-8 |
8 | Recommended | Set a retention period for each kind of personal data, including the copies in logs, backups, analytics and caches, and enforce it automatically: delete or anonymise the data when its period ends. | EDPB Guidelines 4/2019, Storage limitation | |
PRIV-9 |
8 | Recommended | Design erasure so that one request removes a user's personal data everywhere it is kept: in every service and replica, search indexes, caches, analytics and data warehouses, and at the processors and other recipients you shared it with. | ICO, Right to erasure | |
PRIV-10 |
7 | Recommended | Let users get a copy of their personal data, and download the data they gave you in a structured, commonly used, machine-readable format, such as JSON or CSV, preferably through a self-service tool. | ICO, Right to data portability | |
PRIV-11 |
8 | Recommended | Before adding a third-party SDK or service that receives personal data, such as analytics, advertising, crash reporting or customer support, find out what it collects, switch off what you don't need, and add it to the inventory (PRIV-2). |
EDPB Guidelines 4/2019 | Bearer CLI privacy report, Privado |
PRIV-12 |
8 | Recommended | Be able to detect a personal data breach and notify the supervisory authority within 72 hours of becoming aware of it, unless it is unlikely to put people at risk: alert on unusual access to personal data (SEC-4), keep a runbook that names who assesses and notifies, and require processors to report breaches to you. |
EDPB Guidelines 9/2022 on personal data breach notification | |
PRIV-13 |
7 | Recommended | Do a data protection impact assessment before building processing that is likely to be high risk, such as large-scale profiling, tracking people's location or behaviour, combining datasets, or offering online services directly to children, and update it as the design changes. | ICO, When do we need to do a DPIA? | |
PRIV-14 |
7 | Recommended | Know in which countries each service and processor stores or accesses personal data, and cover every transfer out of the EEA or the UK with an adequacy decision or appropriate safeguards, such as standard contractual clauses. | European Commission, Rules on international data transfers |
general/quality-attributes¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
QA-1 |
7 | Recommended | Write quality requirements as concrete, measurable scenarios, not adjectives. | arc42 Quality Model | |
QA-2 |
7 | Recommended | Pick the few (three to five) quality goals that drive the design and make the trade-offs between them explicit. | arc42, section 1: quality goals | |
QA-3 |
6 | Recommended | Protect key characteristics with automated architectural fitness functions that run in the delivery pipeline. | Thoughtworks Technology Radar, Architectural fitness function | |
QA-4 |
4 | Conditional | When the architecture is a key business asset, evaluate it with stakeholders against prioritised scenarios early, before committing. | SEI, ATAM: Method for Architecture Evaluation |
general/releases¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
REL-1 |
8 | Recommended | Version libraries, SDKs and other packages that others depend on with Semantic Versioning, and declare what their public API is. | Semantic Versioning | API Extractor API report, cargo-semver-checks |
REL-2 |
6 | Recommended | Release 1.0.0 as soon as others use the software in production or depend on its API; stay on 0.y.z only while the API is still unstable. | SemVer FAQ, When to release 1.0.0 | |
REL-3 |
5 | Conditional | Consider calendar versioning for applications and products that release on a schedule, have a large or shifting scope, or serve users who shouldn't need to know whether a change is breaking. | CalVer, When to use CalVer? | |
REL-4 |
9 | Strongly recommended | Never change a published release: its version, tag and artifacts stay as they are, and every fix ships as a new version. | Semantic Versioning | GitHub immutable releases |
REL-5 |
7 | Recommended | Build releases with an automated, hermetic build, so that building the same commit again gives the same result, and stamp every artifact with the commit and build it came from. | Google SRE, Release Engineering | |
REL-6 |
7 | Recommended | Release from trunk. If you must maintain older versions, cut a release branch from trunk, fix bugs on trunk first and cherry-pick the fixes into the branch, and never merge the branch back. | Trunk Based Development, Branch for release | |
REL-7 |
6 | Recommended | Automate version bumps, changelogs, tags and publishing with a release tool that reads the commit history or change files, such as Release Please, semantic-release or Changesets. | Release Please | |
REL-8 |
5 | Conditional | If releases are derived from commits, write commit messages, or the titles of squash-merged pull requests, in the Conventional Commits format. | Conventional Commits 1.0.0 | action-semantic-pull-request, commitlint |
REL-9 |
7 | Recommended | Deprecate before you remove: mark the feature deprecated in a minor release, with a warning in the code and docs that says what to use instead and when it goes away, and remove it only in a later major release. | SemVer FAQ, Deprecating functionality | |
REL-10 |
6 | Recommended | Keep a changelog or release notes written for users: one entry per version with its date, newest first, with changes grouped as Added, Changed, Deprecated, Removed, Fixed and Security. | Keep a Changelog | Changesets, blocking check |
REL-11 |
6 | Recommended | If a release breaks users by mistake, publish a new version that restores compatibility and mark the bad one as yanked or deprecated, instead of replacing it. | SemVer FAQ, Accidental breaking change |
general/repositories¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
REPO-1 |
7 | Recommended | Keep one version of each dependency across the code you build together (the One-Version Rule), whatever the repository layout. | Software Engineering at Google, The "One-Version" Rule | Syncpack lint |
REPO-2 |
7 | Recommended | In a monorepo, make each project a package with declared dependencies and a public entry point, and don't import another project's internal files. | monorepo.tools, What is a monorepo? | turbo boundaries, dependency-cruiser, Import Linter independence contracts, Nx enforce-module-boundaries rule |
REPO-3 |
6 | Recommended | Choose between one repository and several on purpose, and record the decision in an ADR: a monorepo suits projects that change together and share code, but needs build tooling that scales with it. | Software Engineering at Google, Monorepos | |
REPO-4 |
6 | Recommended | In a monorepo, let CI build and test only the projects a change affects, with a tool that knows the project graph, and cache task results. | Nx, Run only tasks affected by a PR | |
REPO-5 |
8 | Recommended | Protect the default branch: merge only through pull requests with passing status checks, block force pushes and deletion, and don't let administrators bypass the rules. | GitHub, About protected branches | OpenSSF Scorecard checks |
REPO-6 |
6 | Recommended | Give every part of the repository an owner in a CODEOWNERS file, including the file itself, and require review from code owners on the default branch. |
GitHub, About code owners | OpenSSF Scorecard checks |
REPO-7 |
6 | Recommended | Keep changes small and respond to review requests within one business day, so that branches stay short-lived. | Google, Speed of code reviews | |
REPO-8 |
5 | Conditional | When many people merge into one busy branch, use a merge queue, so that each change is tested together with the changes merged ahead of it before it lands. | GitHub, Managing a merge queue |
general/security¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
SEC-1 |
10 | Strongly recommended | Deny by default, enforce least privilege, and check authorisation server-side on every request. | OWASP Authorization Cheat Sheet | |
SEC-2 |
10 | Strongly recommended | Keep secrets out of code and repositories. | OWASP Secrets Management Cheat Sheet | GitHub secret scanning push protection, Gitleaks |
SEC-3 |
9 | Strongly recommended | Threat model early and revisit it as the design changes. | Threat Modeling Manifesto | |
SEC-10 |
9 | Strongly recommended | Validate all input that crosses a trust boundary on the server, against a schema or an allowlist, before using it, and never deserialize untrusted data with a mechanism that can create arbitrary objects or run code. | OWASP Input Validation Cheat Sheet | |
SEC-11 |
9 | Strongly recommended | Treat everything you ship to a client as public, including browser bundles, page payloads, mobile apps and game builds, and never build secrets into it. | OWASP ASVS 5.0, V13 Configuration | |
SEC-19 |
9 | Strongly recommended | On users' devices, keep tokens, passwords and keys only in the operating system's secure storage, such as the Keychain on Apple platforms or the Android Keystore, or encrypted with a key kept there or derived from a passphrase the user enters, never in plain files, preferences or other unencrypted app storage. | OWASP MASWE-0001, Sensitive Data Stored Unencrypted in Private Storage | |
SEC-12 |
9 | Strongly recommended | Never keep one user's or one request's data in state that a server process shares between requests, such as module-level variables or singletons: scope it to the request, or keep it in a backing service. | MITRE, CWE-488: Exposure of Data Element to Wrong Session | |
SEC-18 |
9 | Strongly recommended | Never build SQL by concatenating or formatting values into the statement: define the statement's structure in code, bind every value as a query parameter, and map choices of table, column or sort direction to a fixed allowlist of values in code. | OWASP SQL Injection Prevention Cheat Sheet, Primary defenses | |
SEC-20 |
9 | Strongly recommended | Never expose databases, caches, message brokers or telemetry collectors to the internet: bind them to private interfaces or networks, let only the hosts that need them through a firewall or security group, and require authentication even inside the network. | OWASP Database Security Cheat Sheet, Protecting the backend database | Atlas Resource Policies |
SEC-4 |
8 | Recommended | Log security-relevant events, and keep secrets and sensitive personal data out of logs by removing, masking, hashing or encrypting them. | OWASP Logging Cheat Sheet | CodeQL, clear-text logging of sensitive data |
SEC-5 |
8 | Recommended | Give each application and service its own identity, with only the permissions it needs, on every system it connects to, and never let it use a shared, default or administrator account. | OWASP Microservices Security Cheat Sheet | |
SEC-6 |
8 | Recommended | Ship secure defaults so customers don't have to harden the product themselves. | CISA Secure by Design | |
SEC-13 |
8 | Recommended | Encrypt every network connection with TLS, including internal connections to databases, caches, message brokers and telemetry collectors, and make clients verify the server's certificate. | OWASP ASVS 5.0, V12 Secure Communication | |
SEC-14 |
8 | Recommended | Authenticate workloads and pipelines with short-lived credentials issued for their identity, such as cloud managed identities or OpenID Connect workload identity federation, instead of long-lived keys or stored secrets. | OWASP Top 10 CI/CD Security Risks, CICD-SEC-6 | |
SEC-15 |
8 | Recommended | Pin every dependency, including packages, base images, CI actions and infrastructure modules, to an immutable version, such as a lock file with hashes, an image digest or a commit SHA, install exactly what is pinned, and let a bot propose updates. | OWASP Software Supply Chain Security Cheat Sheet | |
SEC-16 |
8 | Recommended | Separate production from non-production, and workloads from each other, with their own accounts or projects, credentials and data stores. | NIST SP 800-218, Secure Software Development Framework | |
SEC-17 |
8 | Recommended | Run only releases of runtimes, frameworks, databases and other platform software that still receive security fixes, apply their patch releases promptly, and plan each upgrade before the end-of-life date. | OWASP Top 10:2025, A03 Software Supply Chain Failures | |
SEC-7 |
7 | Recommended | Don't grant implicit trust based on network location. Authenticate and authorise every access (zero trust). | NIST SP 800-207, Zero Trust Architecture | |
SEC-8 |
7 | Recommended | Protect the software supply chain with build provenance and continuous dependency health checks. | SLSA | Dependabot alerts, GitHub artifact attestations, OpenSSF Scorecard checks |
SEC-9 |
6 | Recommended | Use STRIDE to enumerate threats per component, data flow and trust boundary. | Microsoft, Threat Modeling Tool threats (STRIDE) |
general/testing-delivery¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
TEST-2 |
8 | Recommended | Keep the software deployable at all times, and prioritise that over new features. | Fowler, Continuous Delivery | |
TEST-1 |
7 | Recommended | Write many fast unit tests, fewer integration tests and very few end-to-end tests. | Vocke, The Practical Test Pyramid | |
TEST-3 |
7 | Recommended | Integrate small changes into the main branch at least daily. | Trunk Based Development | |
TEST-4 |
6 | Recommended | Enforce architecture rules such as layering and dependency direction with automated tests. | ArchUnit | ArchUnit, ArchUnitNET, dependency-cruiser, Import Linter, Konsist |
TEST-5 |
6 | Recommended | Test service boundaries with contract tests rather than relying on slow, brittle end-to-end integration suites. | Pact, Introduction | Pact can-i-deploy |
TEST-6 |
6 | Recommended | Decouple deployment from release with feature toggles, and remove toggles once they've served their purpose. | Hodgson, Feature Toggles | |
TEST-7 |
6 | Recommended | Measure software delivery throughput and instability with the DORA metrics, and use them to improve, not to compare teams. | DORA metrics guide |
specific/android¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
ANDROID-1 |
9 | Strongly recommended | Use a UI layer and a data layer, and add a domain layer only when logic is complex or reused. | Guide to app architecture | Konsist, architecture assertions |
ANDROID-2 |
9 | Strongly recommended | Keep a single source of truth for each data type, and use unidirectional data flow: state flows down, events flow up. | Guide to app architecture | Slack compose-lints |
ANDROID-3 |
9 | Strongly recommended | Expose UI state from ViewModels as observable streams, and keep UI elements free of business logic. | UI layer | Konsist, architecture assertions |
ANDROID-4 |
8 | Recommended | Access data only through repositories in the data layer. | Data layer | Konsist, architecture assertions |
ANDROID-5 |
8 | Recommended | Use dependency injection (Hilt). | Dependency injection in Android | |
ANDROID-6 |
7 | Recommended | Follow the coroutine best practices: inject dispatchers, make suspend functions main-safe, and don't expose mutable state. | Best practices for coroutines | detekt, coroutines rules |
ANDROID-7 |
6 | Recommended | Build offline-first where possible, with the local database as the source of truth. | Guide to app architecture | |
ANDROID-8 |
5 | Conditional | Modularise by feature and layer as the app and team grow. | Modularization guide | Module Graph Assert |
ANDROID-9 |
7 | Recommended | Make every screen usable with TalkBack and Switch Access: describe each meaningful image and icon with a contentDescription, pass null for decorative ones, expose the role and state of custom components through Compose semantics, and make each touch target at least 48dp by 48dp. |
Android, Make apps more accessible | Android Lint, ContentDescription, Compose accessibility checks |
ANDROID-10 |
6 | Recommended | Set text sizes in sp, and test every screen at the largest font size, which is 200% since Android 14, so that text follows the user's setting without being cut off. |
Android 14, Non-linear font scaling to 200% | Android Lint, ContentDescription |
specific/angular¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
ANGULAR-1 |
7 | Recommended | Keep the current defaults in new code: standalone components, OnPush change detection and zoneless change detection. Don't set standalone: false, ChangeDetectionStrategy.Eager or provideZoneChangeDetection(). |
Angular, NgModules | Angular extended diagnostics, angular-eslint |
ANGULAR-2 |
7 | Recommended | Derive state with computed(), or with linkedSignal() when the user can also set it, and use effect() only to sync signals with APIs that aren't reactive, such as storage, logging, or a canvas or third-party UI library. |
Angular, Use cases for effects | |
ANGULAR-3 |
6 | Recommended | Declare inputs, outputs and queries with the signal-based functions, such as input(), output(), model() and viewChild(), and name outputs in camelCase, without an on prefix and without the name of a DOM event such as click. |
Angular, Accepting data with input properties | angular-eslint |
ANGULAR-4 |
6 | Recommended | Use the built-in control flow (@if, @for and @switch) instead of the deprecated *ngIf, *ngFor and *ngSwitch, and give every @for a track expression with a property that uniquely identifies the item, such as its ID. |
Angular, Why is track in @for blocks important? | angular-eslint |
ANGULAR-5 |
7 | Recommended | Keep components focused on presentation, and move business logic, data access and state that several components share into services. Keep that state in private writable signals, and expose it as read-only signals, with asReadonly() or computed(), plus methods that change it. |
Angular style guide, Keep components and directives focused on presentation | |
ANGULAR-6 |
6 | Recommended | Declare app-wide services with @Service(), or with @Injectable({providedIn: 'root'}) before Angular 22, inject dependencies with inject(), and provide a service in a route's providers instead when only one feature uses it. |
Angular, When to use @Service vs @Injectable | angular-eslint |
ANGULAR-7 |
6 | Recommended | Read data that depends on signals with httpResource(), convert Observables that templates read with toSignal(), and send changes, such as POST and PUT requests, with HttpClient directly. |
Angular, Using httpResource | |
ANGULAR-8 |
7 | Recommended | Lazy-load every route except the main landing pages with loadComponent or loadChildren, and wrap heavy components that aren't visible on the first render in @defer blocks. |
Angular, Should I use an eager or a lazy route? | Angular CLI size budgets |
ANGULAR-9 |
7 | Recommended | In server-rendered apps, set a render mode for each route in the server routes: RenderMode.Prerender for pages that are the same for every user, RenderMode.Server for pages with user-specific data, and RenderMode.Client only where load performance and SEO matter less. |
Angular, Server routing | |
ANGULAR-10 |
6 | Recommended | Set the title property of every route, and move focus to the main content in a listener for the router's NavigationEnd event. |
Angular, Page titles | |
ANGULAR-11 |
9 | Strongly recommended | Never use route guards as access control: check authorization on the server for every request. | Angular, Control route access with guards | |
ANGULAR-12 |
9 | Strongly recommended | Never build Angular templates from user input: ship only templates that the CLI compiles ahead of time, and don't generate Angular templates with a server-side templating language. | Angular, Security: XSS security model | |
ANGULAR-13 |
9 | Strongly recommended | Insert untrusted values through template bindings, so that Angular sanitizes them, never pass them to the DomSanitizer.bypassSecurityTrust*() methods, and don't write to the DOM through ElementRef.nativeElement or document. |
Angular, Sanitization and security contexts | Semgrep angular-bypasssecuritytrust |
ANGULAR-14 |
9 | Strongly recommended | Never put secrets, such as API keys, in the files in src/environments/: the build bundles them into the client, where anyone who loads the page can read them. |
Angular, Build environments | |
ANGULAR-15 |
7 | Recommended | Send a Content Security Policy with a unique, unpredictable nonce for each response, and pass the nonce to Angular with the ngCspNonce attribute or the CSP_NONCE token. On static hosting that can't add a nonce, turn on autoCsp or avoid inline scripts, instead of hard-coding a nonce. |
Angular, Content security policy | |
ANGULAR-16 |
8 | Recommended | Run a major version that is still supported, update with ng update one major version at a time, and plan each yearly major update before your version's long-term support ends. |
Angular, Actively supported versions | |
ANGULAR-17 |
7 | Recommended | Keep strict template type checking on (strictTemplates, the default) together with TypeScript's strict (TS-1), and make the extended diagnostics fail the build by setting their defaultCategory to error. |
Angular, Template type checking: strict mode | Angular extended diagnostics |
ANGULAR-18 |
6 | Recommended | Test components the way users use them, and let Angular schedule change detection: drive shared UI components through component harnesses, await fixture.whenStable() instead of calling fixture.detectChanges(), and answer HTTP requests with HttpTestingController, then call verify(). |
Angular, Component harnesses overview |
specific/astro¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
ASTRO-1 |
7 | Recommended | Keep Astro's default static output, and render a route on demand with export const prerender = false only when it needs request data, such as cookies or a session. Switch to output: 'server' only when most pages are rendered on demand. |
Astro, Enabling on-demand rendering | |
ASTRO-2 |
7 | Recommended | Add a client:* directive only to framework components that must be interactive, and choose the lowest priority that works: client:idle, client:visible or client:media for most islands, and client:load only for visible UI that must be interactive at once. |
Astro, Client islands | |
ASTRO-3 |
6 | Recommended | Render personalized parts of an otherwise static or cached page as server islands with server:defer and fallback content, pass them only the props they need, and set a constant ASTRO_KEY from astro create-key for rolling or multi-region deployments and CDN-cached pages. |
Astro, Server island fallback content | |
ASTRO-4 |
7 | Recommended | Manage sets of structured content in content collections with a schema, and prefer build-time collections: use live collections only when content must be fresh on every request. | Astro, Defining the collection schema | Content collection schema validation |
ASTRO-5 |
6 | Recommended | Keep local images in src/ and render them with <Image /> or <Picture /> from astro:assets, and list only trusted remote hosts in image.domains or image.remotePatterns. |
Astro, src/ vs public/ | |
ASTRO-6 |
9 | Strongly recommended | Treat every action as a public endpoint: give it an input schema, and check authorization in its handler, not only in middleware or on the page that calls it. |
Astro, Security when using actions | |
ASTRO-7 |
9 | Strongly recommended | Declare environment variables in the env.schema of the Astro config, give a variable context: "client" or the PUBLIC_ prefix only if its value may be public, and read secrets with access: "secret" from astro:env/server. |
Astro, Variable types | astro:env validation |
ASTRO-8 |
7 | Recommended | Render every page that depends on the visitor, such as pages behind a login or with personalized content, on demand, and check authentication on each request in middleware or in the page. | Astro, Middleware | |
ASTRO-9 |
7 | Recommended | Pass request data, such as the current user, from middleware to pages and endpoints in context.locals, and keep data that must last between requests in Astro sessions or a database. |
Astro, Storing data in context.locals | |
ASTRO-10 |
7 | Recommended | Keep security.checkOrigin on, which is the default, and when a trusted proxy sets X-Forwarded-Host, list your hosts in security.allowedDomains instead of allowing all. |
Astro, security.checkOrigin | |
ASTRO-11 |
7 | Recommended | Turn on security.csp, which adds hashes for Astro's own scripts and styles to a CSP <meta> element on every page, add your other directives in its options, and don't add 'unsafe-inline'. Test it with astro build and astro preview, because it doesn't work in the dev server. |
Astro, security.csp | eslint-plugin-astro |
ASTRO-12 |
6 | Recommended | Prefer the browser's native cross-document view transitions, and add <ClientRouter /> only for features that need it. With it, run code that must run on every page in an astro:page-load listener, and give every page a <title>, which the router announces to screen readers after each navigation. |
Astro, Differences between native view transitions and <ClientRouter /> |
|
ASTRO-13 |
7 | Recommended | Type-check in CI with astro check, for example as astro check && astro build, and use the strict or strictest tsconfig template (TS-1). |
Astro, Type checking | astro check |
ASTRO-14 |
6 | Recommended | Test .astro components with Vitest through getViteConfig() and the Container API, and run end-to-end tests with Playwright against a production build served by astro preview. |
Astro, Vitest and Container API |
specific/aws¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
AWS-2 |
9 | Strongly recommended | Use a multi-account structure with AWS Organizations, separating workloads and environments into their own accounts. | Organizing your AWS environment | |
AWS-1 |
8 | Recommended | Give people access through IAM Identity Center federation and workloads through IAM roles, so that both use temporary credentials instead of IAM users with long-term access keys. | IAM security best practices | cdk-nag rules, IAM Access Analyzer policy validation, Security Hub, AWS Foundational Security Best Practices |
AWS-3 |
8 | Recommended | Design for Availability Zone failure, and understand AWS fault isolation boundaries. | AWS fault isolation boundaries | AWS Resilience Hub, cdk-nag rules, Security Hub, AWS Foundational Security Best Practices |
AWS-4 |
8 | Recommended | Define AWS infrastructure with the CDK or CloudFormation, and follow the CDK best practices for structuring apps, constructs and stacks. | AWS CDK best practices | AWS Config, required-tags rule, cdk-nag rules |
AWS-6 |
8 | Recommended | Choose a disaster recovery strategy from your RTO and RPO: backup and restore, pilot light, warm standby, or multi-site active/active. | Disaster recovery of workloads on AWS | AWS Resilience Hub |
AWS-5 |
7 | Recommended | Review each workload against the Well-Architected Framework at key milestones of its lifecycle, such as its design, before go-live and after significant architecture changes. | AWS Well-Architected Framework, Architecture governance | |
AWS-7 |
7 | Recommended | Set organisation-wide guardrails with service control policies. | AWS Organizations, SCPs | IAM Access Analyzer policy validation |
AWS-8 |
6 | Recommended | In Lambda functions, separate the handler from the core logic, and reuse the execution environment for clients and connections. | AWS Lambda best practices | |
AWS-9 |
6 | Recommended | Tag resources consistently for ownership, cost allocation and automation. | Tagging best practices | AWS Config, required-tags rule, Security Hub, AWS Foundational Security Best Practices |
AWS-10 |
3 | Conditional | Contain the blast radius of failures with cell-based or shuffle-sharded designs where scale demands it. | Reducing the scope of impact with cell-based architecture |
specific/azure¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
AZURE-1 |
8 | Recommended | Deploy workloads into an Azure landing zone: put platform services such as management, connectivity and identity in their own subscriptions, and give each workload environment its own subscriptions. | CAF, What is an Azure landing zone? | |
AZURE-2 |
7 | Recommended | Agree on a naming convention and a set of required tags, such as application, environment and cost center, before you deploy, and enforce the tags with Azure Policy. | CAF, Define your naming convention | Azure Policy, Microsoft cloud security benchmark initiative, PSRule for Azure rules |
AZURE-3 |
7 | Recommended | Set guardrails with Azure Policy: prefer built-in policies and initiatives, assign them at the highest suitable scope, and roll out each new assignment in audit mode before you switch it to deny. | CAF, Azure governance design area | |
AZURE-4 |
6 | Recommended | Keep the management group hierarchy flat, ideally three or four levels, and group subscriptions by workload type, such as corp and online, not by environment or org chart. | CAF, Management groups | |
AZURE-5 |
8 | Recommended | Authenticate workloads with managed identities, and pipelines and workloads outside Azure with workload identity federation, instead of client secrets, certificates or access keys. | Managed identities for Azure resources | Azure Policy, Microsoft cloud security benchmark initiative, Checkov Terraform policies, PSRule for Azure rules |
AZURE-7 |
8 | Recommended | Assign Azure RBAC roles to groups rather than users, at the narrowest scope, keep at most three subscription owners, and give administrators just-in-time access with Privileged Identity Management. | Best practices for Azure RBAC | |
AZURE-6 |
7 | Recommended | Use one Key Vault per application, environment and region, authorize access with Azure RBAC rather than legacy access policies, and turn on purge protection. | Secure your Azure Key Vault: identity and access management | Azure Policy, Microsoft cloud security benchmark initiative, Checkov Terraform policies, PSRule for Azure rules |
AZURE-8 |
7 | Recommended | Reach PaaS data services, such as Storage, SQL Database and Key Vault, through private endpoints, and block public traffic with the service firewall or turn public network access off. | Well-Architected Framework, Private endpoints | Azure Policy, Microsoft cloud security benchmark initiative, Checkov Terraform policies, PSRule for Azure rules |
AZURE-9 |
8 | Recommended | Deploy production workloads across availability zones in regions that have them, and prefer zone-redundant service configurations. | What are Azure availability zones? | Azure Policy, Microsoft cloud security benchmark initiative, Checkov Terraform policies, PSRule for Azure rules |
AZURE-10 |
8 | Recommended | Define all Azure resources as code in Bicep or Terraform, deploy them from a pipeline, and build on Azure Verified Modules. | Well-Architected Framework, Infrastructure as code | |
AZURE-11 |
7 | Recommended | In Bicep, mark secret parameters and outputs with @secure(), don't give secure parameters default values, and read secrets from Key Vault with getSecret() or the existing keyword instead of passing them through outputs. |
Bicep best practices: outputs | Bicep linter, PSRule for Azure rules |
AZURE-12 |
7 | Recommended | Route resource logs to a central Log Analytics workspace with diagnostic settings, deployed at scale with Azure Policy, and start with a single workspace. | Monitor Azure resources: diagnostic settings | Azure Policy, Microsoft cloud security benchmark initiative |
AZURE-13 |
7 | Recommended | Create a budget with actual and forecasted cost alerts for every subscription. | Cost Management, Create and manage budgets | |
AZURE-14 |
6 | Recommended | Assess each workload with the Azure Well-Architected Review, and act on Azure Advisor recommendations, which Advisor scores by pillar. | Azure Well-Architected Review |
specific/desktop¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
DESKTOP-1 |
9 | Strongly recommended | Keep Electron's secure renderer defaults: context isolation, the sandbox and webSecurity on, and Node.js integration off. Call app.enableSandbox() so that no window can turn the sandbox off. |
Electron, Security: do not enable Node.js integration for remote content | app.enableSandbox() |
DESKTOP-2 |
9 | Strongly recommended | In Electron preload scripts, expose a narrow API with contextBridge.exposeInMainWorld: one function per IPC message, using ipcRenderer.invoke for requests. Never expose ipcRenderer or its send, invoke or on methods, and don't pass the IPC event object to callbacks in the page. |
Electron, Security: do not expose Electron APIs to untrusted web content | |
DESKTOP-3 |
9 | Strongly recommended | In Electron's main process, check the sender of every IPC message, for example the origin of event.senderFrame, and validate its arguments before acting on them. |
Electron, Security: validate the sender of all IPC messages | |
DESKTOP-4 |
8 | Recommended | Treat the arguments of every Tauri command as untrusted input: deserialize them into specific types, check their values in the command, and enforce your own scopes in the command itself. Keep secrets and as much business logic as you can in the Rust core. | Tauri, Trust boundaries | |
DESKTOP-5 |
7 | Recommended | Never block Electron's main process: use the asynchronous versions of Node.js APIs, avoid ipcRenderer.sendSync and @electron/remote, and move CPU-heavy, crash-prone or untrusted work to a worker thread or a utility process. |
Electron, Performance: blocking the main process | |
DESKTOP-8 |
8 | Recommended | Scope every Tauri plugin permission that reaches the system: allow file system access only to the base directories the app needs, such as $APPDATA, with deny scopes for sensitive paths, allow the shell plugin to run only named programs with argument validators, and allow the opener plugin only the URLs and paths it needs. |
Tauri, File System: scopes | |
DESKTOP-9 |
8 | Recommended | Limit where Electron windows can go: block navigation in a will-navigate handler unless a parsed URL matches the pages you expect, deny new windows in setWindowOpenHandler by default, and pass only checked, allowlisted URLs to shell.openExternal. |
Electron, Security: disable or limit navigation | |
DESKTOP-6 |
7 | Recommended | Give every window a Content Security Policy that allows only your own scripts, such as script-src 'self': in Electron, send it as a header from session.webRequest.onHeadersReceived, or in a <meta> tag for pages that can't get headers; in Tauri, set app.security.csp in tauri.conf.json, because Tauri's CSP protection is off until you set it. |
Electron, Security: define a Content Security Policy | |
DESKTOP-7 |
7 | Recommended | Grant each Tauri window only the permissions it needs: give windows with different privileges separate capabilities, add a window to several capabilities only if it needs all their permissions, declare your own commands with AppManifest::commands in build.rs so that a window can call them only when a capability allows it, and let only higher-privileged windows create windows. |
Tauri, Capabilities | |
DESKTOP-10 |
7 | Recommended | Serve Electron's local pages from a custom protocol with protocol.handle instead of file://, and flip the fuses you don't need when packaging, before code signing: turn off RunAsNode, EnableNodeOptionsEnvironmentVariable, EnableNodeCliInspectArguments and GrantFileProtocolExtraPrivileges, and turn on EnableEmbeddedAsarIntegrityValidation and OnlyLoadAppFromAsar. |
Electron, Security: avoid the file:// protocol | @electron/fuses |
DESKTOP-11 |
6 | Recommended | Use Tauri's isolation pattern when the front end has many dependencies or loads third-party content, and keep the isolation application small, with few dependencies and build steps. | Tauri, Isolation pattern: when | |
DESKTOP-12 |
9 | Strongly recommended | Store users' credentials and tokens with Electron's asynchronous safeStorage API, which uses the operating system's cryptography, or in Tauri, for example, with the Stronghold plugin, and never build API keys or other secrets into the app. |
Electron, ASAR Archives | |
DESKTOP-13 |
8 | Recommended | Sign every release in the release pipeline: sign macOS apps with a Developer ID Application certificate and notarize them, and sign Windows executables and installers with one consistent identity, as STEAM-16 describes. |
Electron, Code Signing | SignTool verify |
DESKTOP-14 |
8 | Recommended | Deliver updates only through a signed update mechanism over HTTPS: Electron's autoUpdater, for example through update-electron-app, in a signed app, or the Tauri updater with its signing key pair. Keep the update signing key in the CI secret store, and never set the Tauri updater's dangerousInsecureTransportProtocol. |
Electron, Updating Applications | Tauri updater signature check |
DESKTOP-15 |
8 | Recommended | Stay on an Electron major that the Electron team still supports, which is one of the latest three, on its latest minor release, and upgrade one major at a time. Update Tauri, the Rust compiler and Node.js just as promptly. | Electron, Security: use a current version of Electron | npm audit |
DESKTOP-16 |
6 | Recommended | Run end-to-end tests against the built app, for example with WebdriverIO's Electron or Tauri service, or with Playwright's experimental Electron support, and mock the IPC layer in front-end unit tests, for example with Tauri's mockIPC. |
Electron, Automated Testing |
specific/docker¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
DOCKER-1 |
9 | Strongly recommended | Run the application as a non-root user: create a user in the Dockerfile and switch to it with USER. |
Docker, Building best practices: USER | Docker Scout policy evaluation, Hadolint |
DOCKER-2 |
9 | Strongly recommended | Never pass secrets to a build through ARG, ENV or copied files. Use secret mounts or SSH mounts. |
Docker, Build secrets | Docker build checks, Trivy |
DOCKER-3 |
8 | Recommended | Pin base images to a tag plus digest, and let a bot such as Dependabot update both. | Docker, Pin base image versions | Hadolint |
DOCKER-4 |
7 | Recommended | Use multi-stage builds so that the final image contains only what the application needs to run, on a small base image from a trusted source. | Docker, Multi-stage builds | |
DOCKER-5 |
7 | Recommended | Rebuild images often, with --pull to fetch fresh base images, so that security fixes in the base image reach production. |
Docker, Rebuild your images often | Docker Scout policy evaluation |
DOCKER-6 |
7 | Recommended | Start the main process with the exec form, such as ENTRYPOINT ["app"], so that it runs as PID 1 and receives SIGTERM. |
Dockerfile reference, ENTRYPOINT | Docker build checks, Hadolint |
DOCKER-7 |
6 | Recommended | Order Dockerfile instructions from least to most often changed: copy the dependency manifests and install dependencies before copying the source code. | Docker, Optimize cache usage: order your layers | |
DOCKER-8 |
6 | Recommended | Keep the build context small with a .dockerignore file. |
Docker, Build context: .dockerignore files | |
DOCKER-9 |
6 | Recommended | Give each container one concern: run the web app, the database and the cache as separate containers. | Docker, Decouple applications | |
DOCKER-10 |
8 | Recommended | Scan images for known vulnerabilities in CI, fail the build above an agreed severity, and keep scanning the images you have deployed. | OWASP, Rule #9: Integrate container scanning tools into your CI/CD pipeline | Docker Scout policy evaluation, Trivy |
DOCKER-11 |
6 | Recommended | Attach SBOM and provenance attestations to the images you publish, and sign them so that deployments can verify where an image came from. | Docker, Build attestations | Docker Scout policy evaluation |
DOCKER-12 |
9 | Strongly recommended | Never mount the Docker socket into a container, and never expose the daemon over unauthenticated TCP. | OWASP, Rule #1: Do not expose the Docker daemon socket | |
DOCKER-13 |
7 | Recommended | Run containers with least privilege: never use --privileged, drop all capabilities and add back only those needed, set no-new-privileges, and use a read-only root file system where possible. |
OWASP, Rule #3: Limit capabilities | |
DOCKER-14 |
7 | Recommended | Give containers runtime secrets as Compose or orchestrator secrets, mounted as files, rather than as environment variables. | Docker, Manage secrets securely in Docker Compose | |
DOCKER-15 |
6 | Recommended | Make services wait for their dependencies to be ready, not only started: give the dependency a healthcheck and use depends_on with condition: service_healthy. |
Docker, Control startup and shutdown order in Compose | |
DOCKER-16 |
6 | Recommended | Keep one base compose.yaml and put environment-specific changes in extra files, such as compose.override.yaml for development and compose.production.yaml for production. In production, don't bind-mount application code. |
Docker, Use Compose in production |
specific/dotnet¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
DOTNET-1 |
9 | Strongly recommended | Load secrets through configuration providers: user secrets (the Secret Manager) in development, and Azure Key Vault or another vault in production, never appsettings.json or source code. |
Microsoft, Safe storage of app secrets | GitHub secret scanning push protection |
DOTNET-2 |
9 | Strongly recommended | Go async all the way and never block on async code with .Result or .Wait(). |
Microsoft, ASP.NET Core best practices | CA1849, Microsoft.VisualStudio.Threading.Analyzers, VSTHRD002 |
DOTNET-3 |
8 | Recommended | Use the built-in DI container and follow its lifetime guidelines. | Microsoft, Dependency injection in ASP.NET Core | Built-in DI scope validation |
DOTNET-4 |
8 | Recommended | Add AddStandardResilienceHandler from Microsoft.Extensions.Http.Resilience to outgoing HttpClients. |
Microsoft, Build resilient HTTP apps | |
DOTNET-5 |
7 | Recommended | When the domain has real business logic, structure the solution with Clean Architecture: an application core that defines interfaces, and infrastructure projects that implement them and that the core never references. | Microsoft, Common web application architectures | ArchUnitNET |
DOTNET-6 |
7 | Recommended | Register AddProblemDetails and UseExceptionHandler, so that errors are returned as ProblemDetails and exceptions are handled in one place. |
Microsoft, Handle errors in ASP.NET Core | |
DOTNET-7 |
7 | Recommended | Map separate liveness and readiness endpoints with MapHealthChecks, selecting the checks for each by tag. |
Microsoft, Health checks | |
DOTNET-8 |
7 | Recommended | Instrument with the OpenTelemetry .NET SDK, or with the .NET Aspire service defaults, which configure it for you. | Microsoft, .NET observability with OpenTelemetry | |
DOTNET-9 |
7 | Recommended | Enable nullable reference types in all projects. | Microsoft, Nullable reference types | Nullable warnings as errors |
DOTNET-10 |
7 | Recommended | Test the HTTP pipeline with in-memory integration tests (WebApplicationFactory), and enforce layering with architecture tests. |
Microsoft, Integration tests | ArchUnitNET |
DOTNET-11 |
6 | Recommended | Bind configuration to strongly typed classes with the options pattern. | Microsoft, Options pattern | |
DOTNET-12 |
6 | Recommended | Follow the EF Core performance guidance for queries and change tracking. | Microsoft, EF Core performance |
specific/firebase¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
FIREBASE-1 |
10 | Strongly recommended | Start every Firestore database, Realtime Database and Storage bucket with rules that deny all access, and never deploy test-mode rules, allow read, write: if true, or rules that let any signed-in user (request.auth != null) reach all data. |
Firebase security checklist, Initialize rules in production or locked mode | @firebase/eslint-plugin-security-rules, Security Rules unit tests |
FIREBASE-2 |
8 | Recommended | Write the rules for each new collection or path together with the code that uses it, keep the rules and index definitions (firestore.rules, storage.rules and firestore.indexes.json) in the repository, and deploy them with the Firebase CLI instead of editing them in the console. |
Firebase security checklist, Security rules are a schema | |
FIREBASE-4 |
8 | Recommended | Validate every client write in the rules: allow only known fields with request.resource.data.keys().hasOnly(), check their types, and use diff().affectedKeys() to stop clients from changing fields such as an owner ID, a role or a balance. |
Firestore, Control access to specific fields | Security Rules unit tests |
FIREBASE-3 |
7 | Recommended | Unit-test the rules with @firebase/rules-unit-testing against the emulators, asserting with assertSucceeds and assertFails that allowed requests succeed and forbidden ones fail, and run the tests in CI with firebase emulators:exec. |
Firebase security checklist, Unit test security rules with the Local Emulator Suite | Security Rules unit tests |
FIREBASE-5 |
7 | Recommended | Keep fields that not every reader may see in a separate document, such as a private subcollection with its own rules, because rules allow or deny reads of whole documents. | Firestore, Allowing read access only for specific fields | Security Rules unit tests |
FIREBASE-6 |
7 | Recommended | If you use anonymous authentication, protect all non-public data with rules that require a permanent sign-in provider or a verified email address, because anyone can create an anonymous account. | Firebase security checklist, Anonymous authentication | Security Rules unit tests |
FIREBASE-8 |
8 | Recommended | Treat Firebase API keys and Remote Config values as public: restrict each API key to the APIs it needs, use a separate restricted key for any API that isn't a Firebase service, and never put a Gemini Developer API key, a service account key or another server credential in a client. | Learn about and manage API keys for Firebase | GitHub secret scanning push protection |
FIREBASE-7 |
7 | Recommended | Enforce App Check for every product that supports it, such as Firestore, Realtime Database, Cloud Storage, Authentication and callable functions, once its request metrics show that your current app versions send valid tokens. | Firebase launch checklist, App Check | |
FIREBASE-9 |
7 | Recommended | Harden Firebase Authentication before launch: disable the sign-in providers you don't use, enable email enumeration protection, tighten the quota of the sign-in endpoints, and allow only your own domains. | Firebase security checklist, Authentication | |
FIREBASE-10 |
8 | Recommended | Use a separate Firebase project for each environment, such as development, staging and production, register debug and release builds in different projects, and don't put unrelated apps in one project. | Firebase security checklist, Set up development and staging projects | |
FIREBASE-11 |
7 | Recommended | Model Firestore data around the queries your screens run and what they cost: each document a query returns, each document a listener receives when it's added or changed, and each document a rule reads with get() or exists() is billed as a read. |
Understand Cloud Firestore billing: listening to query results | |
FIREBASE-12 |
7 | Recommended | Turn on point-in-time recovery and scheduled backups for production Firestore databases. | Firestore, Point-in-time recovery: PITR window | |
FIREBASE-13 |
7 | Recommended | Give Cloud Functions their credentials through Secret Manager, with defineSecret() bound only to the functions that need each secret, not through .env files or functions.config(). |
Configure your environment: store and access sensitive configuration | |
FIREBASE-14 |
7 | Recommended | Make event-triggered functions idempotent, for example by using the event ID as an idempotency key, turn on retries only for transient errors, and test on the emulators that a function's writes can't trigger it again in a loop. | Retry asynchronous functions: best practices | |
FIREBASE-15 |
7 | Recommended | Set budget alerts on every project on the pay-as-you-go Blaze plan, add spend caps for the services that support them, such as Cloud Functions, and limit each function's maximum number of instances to what normal traffic needs. | Firebase launch checklist, Know your pricing plan limits and set budget alerts | |
FIREBASE-16 |
7 | Recommended | Where users must consent to analytics or crash reporting, set the Google Analytics consent defaults in the app's configuration, update them with setConsent() when the user decides, and turn on Crashlytics opt-in reporting. |
Google, Set up consent mode for apps |
specific/flutter¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
FLUTTER-1 |
9 | Strongly recommended | Separate the UI layer (views and view models) from the data layer (repositories and services), and add a domain layer of use cases only when needed. | Flutter, Guide to app architecture | bloc_lint, avoid_flutter_imports, DCM, avoid-banned-imports |
FLUTTER-2 |
8 | Recommended | Make repositories the source of truth for app data, with services that wrap external APIs. | Flutter, Guide to app architecture | |
FLUTTER-3 |
8 | Recommended | Use unidirectional data flow and immutable data models. | Flutter, Architecture recommendations | bloc_lint, avoid_flutter_imports, Dart analyzer |
FLUTTER-4 |
7 | Recommended | Cover logic with unit tests, widgets with widget tests, and critical flows with integration tests. | Flutter, Testing overview | |
FLUTTER-5 |
6 | Recommended | Choose a state management approach that fits the app and the team, and use it consistently for app state. setState is fine for widget-local state. |
Flutter, State management options | |
FLUTTER-6 |
5 | Conditional | Model user actions as commands, and model operation outcomes as Result values instead of throwing across layers. |
Flutter, Command pattern | |
FLUTTER-7 |
7 | Recommended | Describe custom widgets to screen readers with the Semantics widget, setting a label and properties such as button or header, and make every tap target at least 48 by 48 dp on Android and 44 by 44 pt on iOS. |
Flutter, Accessibility technologies | Flutter accessibility guideline matchers, meetsGuideline |
FLUTTER-8 |
6 | Recommended | Let text follow the font size set in the operating system, which Flutter's text widgets do by default, and make every layout leave room for text at the largest setting, testing on a small screen. | Flutter, UI design and styling: large fonts |
specific/game-servers¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GAMESERVER-1 |
7 | Recommended | Drive each game server through the hosting platform's lifecycle with its server SDK: report ready only when it can accept players, keep its health checks passing, mark it allocated when a match starts, and end the process when the match is over. | Agones, Client SDKs: lifecycle management | |
GAMESERVER-2 |
7 | Recommended | Ship the server as its own headless build without rendering, audio or client-only assets: Unity's Dedicated Server build target, an Unreal Server target, or a Godot export preset in Export as dedicated server mode. |
Unity, Dedicated Server optimizations | |
GAMESERVER-3 |
7 | Recommended | Choose the lowest tick rate that gives an acceptable player experience, and keep each tick within its time budget, with no database or HTTP calls inside it. | Nakama, Authoritative multiplayer: tick rate | |
GAMESERVER-4 |
9 | Strongly recommended | Don't let a scale-down or node maintenance end a running match. | Amazon GameLift Servers, Prepare for launch | |
GAMESERVER-5 |
7 | Recommended | Scale each fleet with a buffer of ready servers: start with a generous buffer and a maximum well above the expected peak, and lower the buffer later from real usage. | Agones, Fleet Autoscaler: ready buffer autoscaling | |
GAMESERVER-6 |
7 | Recommended | Handle the shutdowns you can't prevent: when the platform signals termination, stop accepting players, save the match state, disconnect players cleanly and exit before the deadline. | Amazon GameLift Servers, Respond to a server process shutdown notification | |
GAMESERVER-7 |
7 | Recommended | Run game servers in more than one region, and in more than one cluster or fleet per region, and allocate across them, so that one failed cluster doesn't stop matches from starting. | Agones, Best practices: redundant clusters | |
GAMESERVER-8 |
8 | Recommended | Let a backend service that authenticates players request matches and game servers for them, and take skill ratings and other matching attributes from server-side data, not from the client. | Amazon GameLift Servers, Build a backend service | |
GAMESERVER-9 |
7 | Recommended | Place each match in the region with the lowest measured latency for its players: have clients time UDP round trips to each region, send the results with the matchmaking request, cap the latency you accept, and relax the limits step by step while players wait. | Amazon GameLift Servers, UDP ping beacons | |
GAMESERVER-10 |
8 | Recommended | Roll out new server builds without ending running matches: start the new version next to the old one, send new matches to it, and let the old servers exit when their matches end. | Agones, Fleet updates | |
GAMESERVER-11 |
7 | Recommended | Version the network protocol, check the version when a client connects, and reject clients that don't match; send players only to servers running a build compatible with their client. | Unreal Engine 5.7 API, FNetworkVersion::GetLocalNetworkVersion | |
GAMESERVER-12 |
9 | Strongly recommended | Before launch, replace every default credential and close every administration port: change Nakama's socket.server_key, session.encryption_key, runtime.http_key and console password, and close RDP (3389) and SSH (22) on live fleets. |
Nakama, Configuration: common properties | |
GAMESERVER-13 |
8 | Recommended | Admit to a match only the players the matchmaker placed in it: the client presents its player session or ticket, and the server validates it before accepting the connection. | Amazon GameLift Servers, Validate a new player | |
GAMESERVER-14 |
8 | Recommended | Keep player inventories, currencies, progression and scores in data that only server code can write. | Nakama, Access controls: object permissions | |
GAMESERVER-15 |
7 | Recommended | Rate-limit each player's actions and traffic, and protect game servers from DDoS attacks, for example with a relay that hides their IP addresses. | Godot, High-level multiplayer: secure multiplayer design | |
GAMESERVER-16 |
7 | Recommended | Record tick time and achieved tick rate for every game server, along with players, active sessions and crashed or abnormally terminated sessions, and alert on severe problems such as ticks that overrun their budget. | Amazon GameLift Servers, Telemetry metrics: available metrics |
specific/gamedev¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GAMEDEV-1 |
8 | Recommended | Advance the simulation in fixed time steps, decoupled from the render rate, and interpolate between the last two simulated states when rendering. | Gaffer On Games, Fix Your Timestep! | |
GAMEDEV-2 |
7 | Recommended | Build game entities by composing components, not through deep inheritance hierarchies. | Nystrom, Component | |
GAMEDEV-3 |
7 | Recommended | Define entity types and tuning values as data that designers can change without recompiling, not as one subclass per type. | Nystrom, Type Object | |
GAMEDEV-21 |
5 | Conditional | Model an entity whose behaviour depends on its current mode, such as a character, an enemy or a menu, as a finite state machine: one current state out of a fixed set, with explicit transitions, instead of boolean flags and nested conditionals. | Nystrom, State | |
GAMEDEV-4 |
4 | Conditional | Adopt an entity component system (ECS) deliberately, when you need very large numbers of entities, and prefer an established framework to writing your own. | Mertens, ECS FAQ | |
GAMEDEV-5 |
8 | Recommended | In competitive multiplayer games, make the server authoritative: clients send inputs, and the server runs the simulation and sends back the results. | Gambetta, Client-Server Game Architecture | |
GAMEDEV-6 |
7 | Recommended | Hide latency with client-side prediction and server reconciliation. | Gambetta, Client-Side Prediction and Server Reconciliation | |
GAMEDEV-7 |
6 | Recommended | Render other players slightly in the past, interpolating between buffered server updates, instead of snapping to each update as it arrives. | Gambetta, Entity Interpolation | |
GAMEDEV-8 |
5 | Conditional | For hit detection in fast-paced shooters, use lag compensation: the server rewinds the world to the moment the shooter saw it and checks the hit there. | Gambetta, Lag Compensation | |
GAMEDEV-9 |
5 | Conditional | Choose deterministic lockstep, which sends only inputs, only if the simulation is bit-for-bit deterministic on every platform you ship to. Otherwise, synchronise state. | Gaffer On Games, Deterministic Lockstep | |
GAMEDEV-10 |
8 | Recommended | Version the save-data schema from the first release, and migrate older saves to the current version when loading them. | Meta, Save Game Best Practices | |
GAMEDEV-11 |
7 | Recommended | Keep the last good save until the new one is completely written, and store an integrity check so that a corrupt or partial save falls back to the previous one. | Meta, Save Game Best Practices | |
GAMEDEV-12 |
8 | Recommended | Set a frame-time budget for each target platform (33.3 ms at 30 fps, 16.7 ms at 60 fps), and measure against it with a profiler on the target hardware, before and after each optimisation. | Unreal Engine, Introduction to performance profiling and configuration | |
GAMEDEV-13 |
5 | Conditional | Pool objects that are created and destroyed often, such as projectiles and particles, instead of allocating and freeing each one. | Nystrom, Object Pool | |
GAMEDEV-14 |
4 | Conditional | Rearrange data for cache locality only where profiling shows that cache misses cost time. | Nystrom, Data Locality | |
GAMEDEV-22 |
8 | Recommended | Commit the project and metadata files that the engine needs to open the project, and keep the folders it regenerates, such as caches and build output, out of version control, starting from the ignore file that the engine generates or the engine's template in GitHub's gitignore collection. |
GitHub Docs, Ignoring files | |
GAMEDEV-15 |
8 | Recommended | Pick version control that handles large binary assets before the project grows: Git with Git LFS, or a system built for binaries such as Perforce. | GitHub, About large files on GitHub | |
GAMEDEV-16 |
7 | Recommended | Lock binary assets that can't be merged, such as levels, textures, models and audio, before editing them: mark their types lockable in .gitattributes with Git LFS, or check them out exclusively in Perforce. |
Git LFS, File Locking | |
GAMEDEV-17 |
7 | Recommended | Plan accessibility at the design stage: review the Game Accessibility Guidelines before work starts, choose the ones that apply, and schedule early the ones that are costly to add later. | Game Accessibility Guidelines, Why and how | |
GAMEDEV-18 |
7 | Recommended | Address the four most common complaints first: control remapping, text size, colour blindness and subtitle presentation. | Game Accessibility Guidelines, Basic | |
GAMEDEV-19 |
6 | Recommended | Give sound effects, speech and music separate volume controls or mutes. | Game Accessibility Guidelines, Basic | |
GAMEDEV-20 |
5 | Conditional | Use the Xbox Accessibility Guidelines as a test checklist for your game's accessibility features. | Xbox Accessibility Guidelines |
specific/gamemaker/code-architecture¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GAMEMAKER-CODE-1 |
8 | Recommended | Don't rely on the order in which instances run the same event, or on the order in which a room creates its instances. | GameMaker Manual, Event Order | |
GAMEMAKER-CODE-2 |
7 | Recommended | Declare every instance variable in the Create event, or as an Object Variable, and use var for values that only one event needs. |
GameMaker Manual, Feather Messages: GM2016 | Feather messages |
GAMEMAKER-CODE-5 |
7 | Recommended | Keep game-wide state in a few known places: declare every global variable in one script function or one controller object at the start of the game, always with the global. prefix, and define all macros in a dedicated script asset. |
GameMaker Manual, Global Variables | |
GAMEMAKER-CODE-3 |
6 | Recommended | Refer to a particular instance through its instance ID, and use the object name only in code meant for all its instances. | GameMaker Manual, Objects vs. Instances | |
GAMEMAKER-CODE-4 |
6 | Recommended | Put behaviour that a family of objects shares in a parent object that is never placed in a room itself, and call event_inherited() in a child's event when the parent's code for that event should also run. |
GameMaker Manual, Parent Objects | Feather messages |
GAMEMAKER-CODE-6 |
6 | Recommended | Make an object persistent only if its instance must outlive the room, such as a game manager or the player, and create that instance exactly once. | GameMaker Manual, The Object Editor: persistent | |
GAMEMAKER-CODE-7 |
7 | Recommended | Define global functions in script assets with function name() {}, and functions inside objects and constructors as method variables, name = function() {}, so that children can override them. |
GameMaker Manual, Script Functions vs. Methods | |
GAMEMAKER-CODE-8 |
7 | Recommended | Use constructors and structs, not object instances, for data and logic that need no events, drawing or collisions, such as stats, inventories or states, and declare their methods static so that all structs from a constructor share one copy. |
GameMaker Manual, Structs & Constructors compared with objects | |
GAMEMAKER-CODE-9 |
6 | Recommended | Don't depend on the order in which function arguments or parts of an expression are evaluated: call functions with side effects, such as buffer_read, in separate statements, and use brackets in expressions. |
GameMaker Manual, Evaluation Order | Feather messages |
GAMEMAKER-CODE-10 |
6 | Recommended | Document script functions and constructors with JSDoc comments that give the types of @param and @return, and let Feather check types. |
GameMaker Manual, JSDoc Comments | Feather type checking |
GAMEMAKER-CODE-11 |
7 | Recommended | Use the asynchronous versions of slow operations, such as HTTP requests, file loading and adding sprites, and in the Async event check that async_load[? "id"] matches the request ID you stored. |
GameMaker Manual, Async Events | |
GAMEMAKER-CODE-12 |
5 | Conditional | Model objects with distinct modes, such as enemies, the player or menu buttons, as finite state machines: one state variable, states named by an enum, and the state code that a family shares in its parent object. | GameMaker, Finite State Machines (GML) | |
GAMEMAKER-CODE-13 |
5 | Conditional | Build menus and the HUD in UI layers, with Flex Panels so that the layout adapts to the display, and place the objects that handle their input in those layers. | GameMaker Manual, UI Layers | |
GAMEMAKER-CODE-14 |
5 | Conditional | Choose the multiplayer approach before building gameplay: Rollback Multiplayer plays online only on the GX.games target and shares only input, so every client must run the same logic, and for other platforms use the Photon extension or your own server with the networking functions. | GameMaker Manual, Rollback Multiplayer |
specific/gamemaker/content-and-performance¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GAMEMAKER-PERF-1 |
7 | Recommended | Profile the game on every target device, during development and before and after each optimisation, with the Debugger's Profiler and the Debug Overlay. | GameMaker Manual, The Profiler | |
GAMEMAKER-PERF-2 |
6 | Recommended | Test and debug on the VM, but build the release of a CPU-heavy game with YYC on the platforms that offer it, measure its performance in that build, and clear the compiler cache before every final build. | GameMaker Manual, Compiling | |
GAMEMAKER-PERF-3 |
7 | Recommended | Destroy everything you create at run time that has a destroy function, such as data structures, surfaces and buffers, usually in the Clean Up event, and use arrays and structs rather than DS lists and maps. | GameMaker Manual, Garbage Collection | |
GAMEMAKER-PERF-4 |
7 | Recommended | Assign sprites, tile sets and fonts to texture groups by where they're used, such as one group per level and one for the menus, and keep groups that only some rooms need out of memory: make them dynamic, load them with texturegroup_load() before they're needed, and unload them afterwards. |
GameMaker Manual, Texture Groups | Dynamic texture groups, explicit mode |
GAMEMAKER-PERF-5 |
6 | Recommended | Choose each sound's compression by its length and use, and put sounds that only some rooms need in audio groups that you load with audio_group_load(). |
GameMaker, How To Optimise Your Games | |
GAMEMAKER-PERF-6 |
6 | Recommended | Build static scenery from tile layers rather than instances with sprites, and check collisions against the tile map where the level fits a grid. | GameMaker Manual, Animated Tiles | |
GAMEMAKER-PERF-7 |
5 | Conditional | If you deactivate instances outside the view, do it every few steps or when the camera moves, never every step or in a Draw event, and reactivate persistent instances at least one step before the room changes. | GameMaker Manual, Deactivating Instances | |
GAMEMAKER-PERF-8 |
7 | Recommended | Follow the manual's advice against losing saves: write each save to a new file, check it, then replace the old one, validate a save, for example with a checksum, before loading it, and keep files open only briefly. | GameMaker Manual (Beta), The File System: preventing data loss |
specific/gamemaker/project-structure¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GAMEMAKER-STRUCT-1 |
9 | Strongly recommended | Keep every project in source control from the first day, and keep the .gitignore and .gitattributes files that GameMaker adds to new and imported projects. |
GameMaker, Setting Up And Using Source Control | |
GAMEMAKER-STRUCT-2 |
7 | Recommended | Save and close the project in GameMaker before you pull, merge, switch branches or revert with an external Git client, and if GameMaker reports changed files while the project is open, choose Reload, not Save. | GameMaker, Setting Up And Using Source Control | |
GAMEMAKER-STRUCT-3 |
6 | Recommended | Name every asset with a prefix for its type, such as spr_, obj_, snd_ and ts_, agree on one way to group the Asset Browser, by asset type or by level, and set matching Feather naming rules. |
GameMaker Manual, Creating Sprites | Feather naming rules |
GAMEMAKER-STRUCT-4 |
7 | Recommended | Develop on the LTS release, use one IDE and runtime version across the team and the build machines, and upgrade everyone together, after committing, when you choose to. | GameMaker, What To Do If GameMaker Says Your Project Is Read-Only | |
GAMEMAKER-STRUCT-5 |
6 | Recommended | Compile every pull request in CI, with gm-cli compile or with Igor on your own build machine, and pin both the gm-cli version and the runtime version, which gm-options.json records in its toolchain field. |
YoYo Games, gm-cli README | gm-cli compile workflow |
GAMEMAKER-STRUCT-6 |
5 | Conditional | Use configurations for what differs between builds of the same game, such as platforms, stores or a demo, and select the configuration in every build. | GameMaker Manual, Configurations | |
GAMEMAKER-STRUCT-7 |
4 | Conditional | Share scripts and assets that several projects use as a Local Asset Package (.yymps) with a Package ID and version number, and update a project by importing the new version. |
GameMaker Manual, Local Asset Packages |
specific/gamemaker/rendering¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GAMEMAKER-GFX-1 |
7 | Recommended | Keep texture swaps and vertex batches low: draw instances that need the same blend mode or shader together, from one controller object or through layer begin and end scripts, instead of letting each instance set and reset the state. | GameMaker Manual, Best Practices When Programming | |
GAMEMAKER-GFX-2 |
7 | Recommended | Undo every GPU state change on every code path before the code that made it ends: shader_reset() after shader_set(), surface_reset_target() after surface_set_target(), and the blend mode and other gpu_set_* settings back to their defaults. |
GameMaker Manual, Feather Messages: GM2000 | Feather messages |
GAMEMAKER-GFX-3 |
7 | Recommended | Treat every surface except the application surface as volatile: check surface_exists() before each use and re-create the surface if it's gone, create and draw to surfaces in Draw events, keep them no larger than the view, and free them with surface_free(). |
GameMaker Manual, Surfaces | |
GAMEMAKER-GFX-4 |
6 | Recommended | Fit the game to each display with a camera and viewport, and resize the application surface to match, instead of relying on the Full Scale option, which stretches the image and ignores the aspect ratio. For pixel art, also turn off Interpolate colours between pixels, which is on by default, in each platform's Game Options. | GameMaker, The Basics Of Scaling - The Game Camera | |
GAMEMAKER-GFX-5 |
6 | Recommended | Make every image fit on the smallest texture page of any platform you ship to, check the pages with the Preview button in each platform's Game Options, and turn on mipmaps for texture groups that the camera zooms in and out on or that a 3D game uses. | GameMaker Manual, Texture Pages | |
GAMEMAKER-GFX-6 |
6 | Recommended | Write shaders in GLSL ES, the only shader language that works on every target, follow its specification strictly, and check shader_is_compiled() at start-up before you use any shader that isn't simple GLSL ES. |
GameMaker Manual, The Shader Editor |
specific/gamemaker/testing¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GAMEMAKER-TEST-1 |
6 | Recommended | Test the logic in script functions and constructors, and the behaviour of objects over several frames, with a GML testing library such as GMTL, and run the tests every time you run the game in development. | GameMaker, Guide to GameMaker Testing Library | |
GAMEMAKER-TEST-2 |
6 | Recommended | Smoke-test every target build automatically with Igor's test command. | GameMaker Manual, Building & Testing via Command Line | Igor test command |
GAMEMAKER-TEST-3 |
5 | Conditional | If you use Rollback Multiplayer, test every change in Sync Test, on Windows, macOS or GX.games, before you test online. | GameMaker Manual, Rollback System |
specific/gcp¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GCP-1 |
8 | Recommended | Use one organization resource, with folders for environments or other policy boundaries, and a separate project for each workload in each environment. | Decide a resource hierarchy for your landing zone | |
GCP-2 |
6 | Recommended | Label projects and resources consistently, for example with application, environment, cost center and owner, and set the labels from infrastructure as code. | Enterprise foundations blueprint, Organization structure | |
GCP-3 |
9 | Strongly recommended | Don't grant basic roles, such as Owner, Editor and Viewer, in production. Grant predefined or custom roles to groups, at the smallest scope that works. | Use IAM securely: least privilege | Checkov Terraform policies, IAM role recommendations, Security Command Center, Compliance Manager cloud controls |
GCP-4 |
8 | Recommended | Don't use service account keys: attach service accounts to workloads that run on Google Cloud, use Workload Identity Federation for CI pipelines and workloads elsewhere, and block key creation with an organization policy. | Best practices for service accounts: use keys only when there is no alternative | Checkov Terraform policies, Organization Policy constraints, Security Command Center, Compliance Manager cloud controls |
GCP-5 |
8 | Recommended | Give each application its own single-purpose service account instead of a default service account, and grant users the Service Account User and Token Creator roles on individual service accounts, not on projects or folders. | Best practices for service accounts: single-purpose service accounts | Checkov Terraform policies, Security Command Center, Compliance Manager cloud controls |
GCP-6 |
8 | Recommended | Enforce the Google Cloud security baseline constraints in every organization, including organizations created before 3 May 2024, which may not have them. | Manage Google Cloud security baseline constraints | Organization Policy constraints, Security Command Center, Compliance Manager cloud controls |
GCP-7 |
6 | Recommended | Add further Organization Policy constraints at the organization or folder level, starting from the enterprise foundations blueprint's set, and test each new policy in dry-run mode before you enforce it. | Organization Policy overview | |
GCP-8 |
7 | Recommended | Keep secrets in Secret Manager, grant access per secret when one project holds secrets for many services, and reference secret versions by number instead of latest. |
Secret Manager best practices | |
GCP-9 |
5 | Conditional | Put projects that hold sensitive data, for example in Cloud Storage or BigQuery, inside VPC Service Controls perimeters in addition to IAM, and run each new perimeter in dry-run mode first. | Overview of VPC Service Controls | Security Command Center, Compliance Manager cloud controls |
GCP-10 |
8 | Recommended | Deploy production workloads across multiple zones, and across regions where your availability or recovery targets require it. | Compute Engine, Regions and zones | |
GCP-11 |
8 | Recommended | Manage the organization's foundation and all workloads as code with Terraform, applied from a pipeline that validates changes against your policies, as the enterprise foundations blueprint does. | Well-Architected Framework, Automate and manage change | |
GCP-12 |
7 | Recommended | Route audit logs from the whole organization to a central project with an aggregated sink, and turn on Data Access audit logs for services that handle sensitive data. | Cloud Logging, Aggregated sinks | Checkov Terraform policies, Security Command Center, Compliance Manager cloud controls |
GCP-13 |
7 | Recommended | Create Cloud Billing budgets with alert thresholds for each billing account or project, and send the alerts to the owners or to Pub/Sub for automated responses. | Cloud Billing, Create, edit, or delete budgets and budget alerts |
specific/github-actions¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GHA-1 |
9 | Strongly recommended | Set the GITHUB_TOKEN to read-only at the top of each workflow, and grant write permissions only to the jobs that need them. |
GitHub, Secure use reference | CodeQL queries for GitHub Actions, GitHub Actions repository settings, OpenSSF Scorecard checks, zizmor audit rules |
GHA-2 |
9 | Strongly recommended | Pin third-party actions and reusable workflows to a full-length commit SHA, or lock them with a workflow dependency lockfile. | GitHub, Using third-party actions | CodeQL queries for GitHub Actions, GitHub Actions repository settings, OpenSSF Scorecard checks, zizmor audit rules |
GHA-3 |
9 | Strongly recommended | Never expand untrusted input, such as ${{ github.event.pull_request.title }}, directly in a run: script. Pass it through an intermediate environment variable. |
GitHub, Script injections | actionlint checks, CodeQL queries for GitHub Actions, OpenSSF Scorecard checks, zizmor audit rules |
GHA-4 |
8 | Recommended | Use pull_request rather than pull_request_target unless fork pull requests need secrets or write access, and never execute pull request code in a pull_request_target or workflow_run workflow. |
GitHub, Securely using pull_request_target | CodeQL queries for GitHub Actions, OpenSSF Scorecard checks, zizmor audit rules |
GHA-5 |
8 | Recommended | Authenticate to cloud providers with OpenID Connect instead of long-lived cloud secrets, and restrict the trust policy to specific repositories, branches or environments. | GitHub, OpenID Connect | |
GHA-6 |
7 | Recommended | Avoid self-hosted runners in public repositories. Where you use them, prefer ephemeral just-in-time runners. | GitHub, Hardening for self-hosted runners | zizmor audit rules |
GHA-7 |
7 | Recommended | Enable Dependabot version updates for the github-actions ecosystem. |
GitHub, Keeping your actions up to date with Dependabot | Dependabot alerts for actions, OpenSSF Scorecard checks |
GHA-8 |
6 | Recommended | Treat restored caches as untrusted input: never cache secrets, and write caches only from workflows with trusted triggers. | GitHub, Dependency caching: cache security | CodeQL queries for GitHub Actions, zizmor audit rules |
GHA-9 |
6 | Recommended | Require approval from designated code owners for changes to .github/workflows. |
GitHub, Using CODEOWNERS to monitor changes | |
GHA-10 |
5 | Conditional | Pass secrets to reusable workflows by name instead of with secrets: inherit. |
zizmor, secrets-inherit | zizmor audit rules |
GHA-11 |
7 | Recommended | Deploy through environments with protection rules: required reviewers, allowed deployment branches, and secrets scoped to the environment. | GitHub, Deployment environments | |
GHA-12 |
6 | Recommended | Share CI logic through reusable workflows (whole jobs) and composite actions (steps) instead of copying YAML between workflows and repositories. | GitHub, Reusing workflow configurations | |
GHA-13 |
6 | Recommended | Use concurrency groups to cancel superseded runs on the same branch and to stop deployments to the same environment from running at once. | GitHub, Concurrency | zizmor audit rules |
specific/gitlab-ci¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GITLAB-1 |
9 | Strongly recommended | Pin every include and CI/CD component to a commit SHA or to a protected tag, pin job images by digest, and let a bot such as Renovate propose updates. |
GitLab, Pipeline security: included configurations | Plumber |
GITLAB-2 |
9 | Strongly recommended | Keep secrets in an external secrets manager. If a secret must be a CI/CD variable, make it masked and hidden, and protected so that only pipelines for protected branches and tags receive it. | GitLab, Pipeline security: secrets storage | Plumber |
GITLAB-3 |
8 | Recommended | Authenticate to cloud providers and secret managers with ID tokens (id_tokens) instead of stored credentials, and restrict the trust policy to specific projects and protected branches or tags. |
GitLab, Use ID token claims in cloud trust policies | |
GITLAB-4 |
8 | Recommended | Run a pipeline in the parent project for a merge request from a fork only after reviewing its changes, including changes to .gitlab-ci.yml. |
GitLab, Run pipelines in the parent project | |
GITLAB-5 |
8 | Recommended | Don't use the shell executor or privileged Docker containers on runners that run jobs from several projects or untrusted users. Run privileged jobs only on isolated, ephemeral machines, and let runners that hold secrets or run privileged jobs take jobs from protected branches only. | GitLab, Security risks for different executors | |
GITLAB-6 |
7 | Recommended | Keep the CI/CD job token allowlist enabled, and add only the groups and projects that need cross-project access. | GitLab, Control job token access to your project | GitLab CI/CD settings |
GITLAB-7 |
7 | Recommended | Pass parameters to pipelines as typed CI/CD inputs, and set the minimum role to use pipeline variables to no_one_allowed or Maintainer. |
GitLab, Pipeline security: pass parameters | GitLab CI/CD settings, poutine |
GITLAB-8 |
6 | Recommended | Never commit CI_DEBUG_TRACE to CI configuration, and turn on debug logging only temporarily, while only team members can view job logs. |
GitLab, Enable debug logging | Plumber, poutine |
GITLAB-9 |
6 | Recommended | Keep separate caches for protected and unprotected branches, which is the default, and don't set cache:unprotect. Pass build outputs between jobs as artifacts, and use the cache only for dependencies such as downloaded packages. |
GitLab, Use the same cache for all branches | GitLab CI/CD settings |
GITLAB-10 |
6 | Recommended | Require Code Owner approval for changes to .gitlab-ci.yml and other CI configuration on protected branches. |
GitLab, Require Code Owner approval | |
GITLAB-11 |
7 | Recommended | Use rules instead of the deprecated only and except, and don't mix them in one pipeline. Add workflow:rules that choose between branch and merge request pipelines, so that a push to a branch with an open merge request doesn't start two pipelines. |
GitLab, Deprecated keywords: only and except | Checkov GitLab CI checks, CI Lint |
GITLAB-12 |
6 | Recommended | Run merge request pipelines, and enable merged results pipelines so that each merge request is tested combined with the latest target branch. Add merge trains when many merge requests are ready to merge at the same time. | GitLab, Merge request pipelines | |
GITLAB-13 |
6 | Recommended | Declare job dependencies with needs, so that each job starts as soon as the jobs it depends on finish, and give jobs that depend on nothing, such as linters, needs: []. |
GitLab, Make jobs start earlier with needs | |
GITLAB-14 |
6 | Recommended | Share CI configuration as versioned CI/CD components with inputs instead of copying YAML between projects. | GitLab, CI/CD components | |
GITLAB-15 |
7 | Recommended | Deploy to production only through a protected environment: limit who can deploy, require deployment approvals, and scope production variables to that environment. | GitLab, Deployment safety: protect production secrets | |
GITLAB-16 |
7 | Recommended | Give each deployment job a resource_group, so that only one deployment to an environment runs at a time, and turn on "Prevent outdated deployment jobs". |
GitLab, Ensure only one deployment job runs at a time | GitLab CI/CD settings |
specific/go¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GO-1 |
6 | Recommended | Lay out a service as "Organizing a Go module" describes for a server project: each command in cmd/<name>/, the packages that implement them under internal/, and each package named for what it provides, not util, common or helper. |
Go, Organizing a Go module: Server project | |
GO-2 |
6 | Recommended | Define interfaces in the package that uses them, keep them small, and return concrete types; don't add an interface before a consumer needs it, and don't export one from the implementing package only so that it can be mocked. | Go Code Review Comments, Interfaces | |
GO-3 |
7 | Recommended | Check every error, then either handle it or return it with added context, not both: don't discard errors with _, and don't log an error that you return. |
Go Code Review Comments, Handle errors | go vet, golangci-lint |
GO-4 |
7 | Recommended | Return an error for every failure a caller can expect, such as invalid input, failed I/O or bad configuration, and panic only for bugs that tests and reviews should catch, such as API misuse or a broken invariant. In a server, recover at the top of each goroutine that serves one connection, job or match. |
Go Code Review Comments, Don't panic | |
GO-5 |
8 | Recommended | Pass the request's context.Context along the whole call chain, from the incoming request to every outgoing call, as the first parameter, named ctx; never store it in a struct, and use the context-aware APIs, such as QueryContext and http.NewRequestWithContext. |
Go, context package | go vet, golangci-lint, gosec, Staticcheck checks |
GO-7 |
8 | Recommended | Never share a variable between goroutines without synchronization: hand data over on channels, or guard shared state, such as a cache, with a sync.Mutex, and run the tests with the race detector (go test -race) in CI. |
Effective Go, Share by communicating | Data Race Detector |
GO-6 |
7 | Recommended | Give each goroutine you start a context to stop on, and wait for it with a sync.WaitGroup or an errgroup.Group from golang.org/x/sync before the code that started it returns or shuts down. |
Go Code Review Comments, Goroutine lifetimes | gosec |
GO-8 |
7 | Recommended | Create every http.Server yourself and set its timeouts: always ReadHeaderTimeout and IdleTimeout, and ReadTimeout and WriteTimeout too unless handlers set their own deadlines. Don't serve with http.ListenAndServe or http.Serve, which can't set timeouts. |
net/http, Server | gosec |
GO-9 |
7 | Recommended | Shut down on SIGTERM: derive the root context from signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM), and when it's done, call Server.Shutdown with a deadline shorter than the platform's grace period. |
os/signal, Default behavior of signals | |
GO-10 |
6 | Recommended | Log with log/slog: in a service, set a JSON handler on stdout as the default logger, with slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stdout, nil))), call the ...Context logging methods so that handlers can add trace context, and give types that hold secrets a LogValue method that redacts them. |
Go blog, Structured Logging with slog | golangci-lint |
GO-12 |
8 | Recommended | Build with a supported Go release, one of the two newest major versions, at its latest minor version, and run govulncheck on every change in CI and regularly on the code or binaries you have deployed. |
Go, Release policy | govulncheck exit codes |
GO-11 |
7 | Recommended | Commit go.mod and go.sum, change dependencies only with go get or go mod tidy in a reviewed change, and fail CI when go mod tidy -diff reports a difference. |
Go blog, How Go Mitigates Supply Chain Attacks | go mod tidy -diff |
GO-13 |
9 | Strongly recommended | Never build SQL statements or HTML by formatting or concatenating strings with values: pass values to SQL as arguments for placeholders (? or $1), and render HTML with html/template, not text/template. |
Go, Avoiding SQL injection risk | gosec |
GO-14 |
7 | Recommended | Open one sql.DB for each database when the program starts and share it, because it is a connection pool that is safe for concurrent use, and close every sql.Rows with defer rows.Close() and check rows.Err(). |
Go, database/sql Open | |
GO-15 |
7 | Recommended | In CI, fail the build on unformatted code (gofmt -l), on any go vet ./... finding and on linter findings, for example from Staticcheck or golangci-lint. |
Go Code Review Comments, Gofmt | go vet, gofmt, golangci-lint, Staticcheck checks |
GO-16 |
6 | Recommended | Fuzz the code that parses untrusted input, such as request decoders and network protocol handlers, with go test -fuzz, and test code with timers, timeouts or background goroutines inside synctest.Test instead of waiting in real time. |
Go Security Best Practices, Fuzzing |
specific/godot/code-architecture¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GODOT-3 |
8 | Recommended | Design scenes to work on their own: keep what a scene needs inside it, and let the parent supply any outside dependency. | Godot, Scene organization | |
GODOT-4 |
7 | Recommended | Let parents call methods on and set properties of their children, and let children report what happened through signals. | Godot, Scene organization | |
GODOT-5 |
7 | Recommended | Use autoloads only for broad-scoped systems that manage their own data, such as a quest or dialogue system. | Godot, Autoloads versus regular nodes | |
GODOT-6 |
6 | Recommended | Reference other nodes through @export properties or scene-unique names (%Name), not long hard-coded node paths. |
Godot interfaces | |
GODOT-7 |
5 | Conditional | Make game-specific concepts scenes, and use named script classes for reusable tools shared across projects. | Godot, When to use scenes versus scripts | |
GODOT-8 |
5 | Conditional | Use RefCounted or Resource classes instead of nodes for data and logic that don't need to be in the scene tree. |
Godot, When and how to avoid using nodes for everything | |
GODOT-21 |
7 | Recommended | Choose the scripting languages early: GDScript suits most game code, C# suits teams that already know it, as long as you don't ship to the web, and C++ through GDExtension suits performance-critical algorithms. | Godot, Scripting languages | |
GODOT-9 |
7 | Recommended | Use static typing throughout, and set the untyped_declaration warning to Error so that untyped declarations stop a script from compiling. |
Godot, Static typing in GDScript | GDScript warning system |
GODOT-11 |
7 | Recommended | Move objects and run game logic in _physics_process, and turn on physics interpolation so that motion stays smooth at any frame rate. |
Godot, Using physics interpolation | |
GODOT-10 |
6 | Recommended | Follow the GDScript style guide, including its code order. | Godot, GDScript style guide | gdlint |
GODOT-22 |
7 | Recommended | Read player input through actions defined in the Input Map, not specific keys or buttons, and handle gameplay input events in _unhandled_input() rather than _input(), so that UI controls receive them first. |
Godot, Using InputEvent | |
GODOT-23 |
6 | Recommended | Set the base window size, stretch mode and stretch aspect at the start, following the docs' recommended settings for your kind of game, and lay out UI with anchors and Container nodes so that it adapts to every resolution and aspect ratio. | Godot, Multiple resolutions: common use case scenarios | |
GODOT-40 |
5 | Conditional | Give each Control that a screen reader should announce a human-readable accessibility_name, and an accessibility_description where the name isn't enough, keep the Accessibility Support project setting at its default, Auto, and test with a screen reader on each desktop platform you ship. |
Godot 4.5 release notes, Screen reader support | |
GODOT-24 |
7 | Recommended | In multiplayer games, replicate spawned scenes with MultiplayerSpawner and properties with MultiplayerSynchronizer, keep the server the multiplayer authority over gameplay state, and give each player authority only over a child node that sends their input. |
Godot, High-level multiplayer: secure multiplayer design | |
GODOT-25 |
6 | Recommended | Don't change the active scene tree from another thread: build or load nodes outside the tree in the worker thread and add them on the main thread with call_deferred(), don't load the same resource from several threads at once, and protect data that threads share with a Mutex. |
Godot, Thread-safe APIs |
specific/godot/content-and-performance¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GODOT-26 |
7 | Recommended | Profile on every target platform during development, not only in the editor: run a debug export with Deploy with Remote Debug, and use the debugger's Profiler for script time, the Visual Profiler for CPU and GPU rendering time, and the Monitors for memory and object counts. | Godot, Debugger panel | |
GODOT-27 |
7 | Recommended | Preload only what a script always needs, and load levels and other large or optional content in the background with ResourceLoader.load_threaded_request(), behind a loading screen, because load() blocks the thread until the resource has loaded. |
Godot, Logic preferences: loading vs. preloading | |
GODOT-28 |
7 | Recommended | Free nodes you no longer need with queue_free(): unlike RefCounted objects such as Resources, nodes aren't freed automatically, and remove_child() only takes a node out of the tree. |
Godot, Object | gdUnit4, Orphan nodes, GUT, Memory Management |
GODOT-29 |
6 | Recommended | Import 3D textures as VRAM Compressed with mipmaps, which Detect 3D sets automatically, and 2D textures, especially pixel art, as Lossless; if the project needs other settings, change the defaults project-wide in Project Settings > Import Defaults. | Godot, Importing images: compress mode | |
GODOT-30 |
6 | Recommended | Change imported 3D models in the modelling tool where you can, then in the import settings, and make any other change in an inherited scene, because Godot re-imports the whole scene whenever the source file changes. | Godot, Import configuration | |
GODOT-12 |
7 | Recommended | Model designer-edited game data as custom Resource classes saved as .tres files. |
Godot, Resources | |
GODOT-13 |
7 | Recommended | Write saves and settings to user://, and don't decode objects (allow_objects) from files that players can edit or share. |
Godot, File paths in Godot projects | |
GODOT-15 |
7 | Recommended | Localize with Godot's translation system: add CSV or gettext PO translations under Project Settings > Localization, look up text with tr() and tr_n() or a Control's automatic translation, fill named placeholders with String.format(), and switch languages with TranslationServer.set_locale(). |
Godot, Internationalizing games |
specific/godot/project-structure¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GODOT-1 |
9 | Strongly recommended | Commit the .import files next to your assets and the .uid files next to your scripts and shaders, and ignore the .godot/ folder. |
Godot, Version control systems | |
GODOT-31 |
7 | Recommended | Save scenes and resources in the text formats, .tscn and .tres, rather than the binary .scn and .res, so that they stay readable and easy to manage in version control. |
Godot, TSCN file format | |
GODOT-32 |
6 | Recommended | If you store large assets in Git LFS (GAMEDEV-15), set it up before the first commit, starting from the example .gitattributes in Godot's version control documentation, which also tracks Godot's binary formats such as .scn, .res, .mesh and .lmbake. |
Godot, Version control systems: Git LFS | |
GODOT-2 |
6 | Recommended | Use snake_case for file and folder names (C# scripts excepted), and keep third-party code in addons/. |
Godot, Project organization | |
GODOT-33 |
6 | Recommended | Keep scripts and assets close to the scenes that use them, and move, rename or delete files only in Godot's FileSystem dock, so that references to them don't break. | Godot, Project organization | |
GODOT-34 |
5 | Conditional | Install third-party addons from the Asset Library or a tagged stable release, not from a repository's latest commit, and keep each one in its own addons/<name>/ folder. |
Godot, Installing plugins | |
GODOT-35 |
7 | Recommended | Commit export_presets.cfg, keep signing keys, passwords and encryption keys out of the repository, and automate release builds with --export-release. |
Godot, Exporting projects: configuration files | |
GODOT-36 |
5 | Conditional | Put platform- and build-specific project settings in feature-tag overrides, such as .mobile, .web, .debug or a custom tag set in an export preset, and read those settings with ProjectSettings.get_setting_with_override(). |
Godot, Feature tags |
specific/godot/rendering¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GODOT-16 |
7 | Recommended | Choose the renderer for the platforms and oldest hardware you ship to: Forward+ for desktop games that need advanced rendering features, Mobile for mobile devices and standalone XR, and Compatibility for the web, older devices or the widest hardware support. | Godot, Overview of renderers | |
GODOT-17 |
7 | Recommended | In Forward+ and Mobile, let pipeline precompilation see everything during loading: show a simple scene that uses every rendering feature the game needs, such as MSAA, reflection probes or VoxelGI, before loading most assets, and instance effects that scripts add during play once as hidden nodes. | Godot, Reducing stutter from shader (pipeline) compilations | |
GODOT-18 |
7 | Recommended | Reuse materials, and where you can't, reuse shaders: share one material across objects and give each object its own values through per-instance uniforms (instance uniform), not a unique material. |
Godot, GPU optimization: reuse shaders and materials | |
GODOT-19 |
6 | Recommended | Draw thousands of identical objects, such as grass, flocks or particles, with a MultiMesh, and split it into several MultiMeshes by area, because Godot culls a MultiMesh only as a whole. | Godot, Optimizing 3D performance: instancing | |
GODOT-20 |
6 | Recommended | Keep the mesh LODs that Godot generates on import, and add visibility ranges (HLOD) where a group of objects should turn into one simpler mesh or an impostor in the distance, or where distant effects should disappear. | Godot, Mesh level of detail (LOD) |
specific/godot/testing¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GODOT-14 |
7 | Recommended | Write automated tests with GUT or gdUnit4, and run them headless in CI on every change. | GUT, Command line | gdUnit4 command line tool, GUT command line |
GODOT-37 |
7 | Recommended | Unit-test game logic in isolation, in RefCounted classes and other scripts that you can create with new(), and test whole scenes in integration tests with gdUnit4's Scene Runner or GUT's simulate() and input sender, for behaviour that spans frames or depends on input. |
gdUnit4, Unit testing | |
GODOT-38 |
6 | Recommended | Let the code under test receive its dependencies, as GODOT-3 describes for scenes, so that tests can replace them with GUT doubles and stubs or gdUnit4 mocks and spies. |
Godot, Scene organization | |
GODOT-39 |
6 | Recommended | Keep tests and the test framework out of release exports: put tests in their own folder, such as res://test/, and add it and the framework's addon folder (addons/gut/* or addons/gdunit4/*) to the exclude filter of every export preset. |
gdUnit4, Export failures with the plugin installed |
specific/graphics¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GFX-1 |
8 | Recommended | Choose the graphics API or engine render pipeline, and the oldest hardware you will support, at the start of the project, and record the choice and the options you rejected in an ADR. | Unity, Choose a render pipeline | |
GFX-2 |
7 | Recommended | Break each platform's frame-time budget (GAMEDEV-12) down into GPU budgets for each device tier: GPU time per frame, shader cycles, triangle counts, and memory for textures, meshes and render targets. |
Arm GPU Best Practices, 2.1 Optimization process | Mali Offline Compiler |
GFX-3 |
7 | Recommended | Before optimising, find out whether the frame is CPU-bound or GPU-bound, and which GPU stage limits it. Measure frame times in milliseconds with vsync off, not frames per second, and measure again after each change, because the bottleneck moves. | Android, Identify CPU or GPU bottlenecks | |
GFX-4 |
6 | Recommended | Inspect GPU frames with a frame debugger and GPU profiler for each target API: RenderDoc for Vulkan, Direct3D and OpenGL ES, PIX for Direct3D 12, the Metal debugger in Xcode for Apple GPUs, and Android GPU Inspector or the GPU vendor's profiler on Android. | RenderDoc, FAQ | |
GFX-5 |
8 | Recommended | Don't compile shaders or create pipeline state objects during gameplay. Create them while loading or on background threads, and keep them between runs in a pipeline cache (VkPipelineCache, a Direct3D 12 pipeline library) or as precompiled binaries where the platform allows, such as Metal binary archives. |
Arm GPU Best Practices, 4.1 and 4.2 | Vulkan Best Practices validation |
GFX-6 |
7 | Recommended | Keep the number of shader variants small and known: count them in every build, strip those no material uses, and use dynamic branching, specialization constants or an ubershader for features that don't need a variant of their own. | Unity, Introduction to shader variants | |
GFX-7 |
7 | Recommended | Compile every shader for every target API offline, in CI, and validate the output, so that a shader that fails on one platform breaks the build rather than the game. | Arm GPU Best Practices, 2.2 Basic optimization checklist | DirectX Shader Compiler, glslang, naga |
GFX-8 |
7 | Recommended | Run development and automated test builds with the graphics API's validation turned on, such as the Vulkan validation layers with Best Practices, the Direct3D 12 debug layer or Metal API Validation, and fix what they report. | Microsoft, GPU-based validation and the Direct3D 12 debug layer | |
GFX-9 |
6 | Recommended | Use 16-bit precision (mediump or explicit 16-bit types) wherever it is accurate enough, especially in fragment shaders on mobile GPUs, and check the results on a mobile GPU, because desktop GPUs usually ignore mediump. |
Arm GPU Best Practices, 10.1 Minimize precision | Mali Offline Compiler |
GFX-10 |
7 | Recommended | Cut draw calls and state changes: cull objects outside the view on the CPU, batch or instance objects that share a material, and sort draws by pipeline state. | Arm GPU Best Practices, 3.2 and 3.3 | Vulkan Best Practices validation |
GFX-11 |
6 | Recommended | Draw opaque geometry front to back and transparent geometry back to front, and avoid discard and depth writes in fragment shaders where you can, so that early depth testing removes hidden fragments before they are shaded. |
Arm GPU Best Practices, 3.4 Optimizing the draw call render order | |
GFX-12 |
7 | Recommended | On tile-based GPUs, which include most mobile GPUs and Apple silicon, choose every attachment's load and store action deliberately: clear or don't-care on load unless you need the previous contents, and don't-care on store for attachments you don't read later, such as depth and multisampled color, which can then be transient or memoryless. | Khronos, Vulkan Guide: Tile Based Rendering best practices | Vulkan Best Practices validation |
GFX-13 |
7 | Recommended | Ship textures in GPU-compressed formats, with mipmaps for anything seen in 3D: ASTC, with ETC2 as the fallback, on mobile, BC formats on desktop, and on the web a format each device supports, for example by transcoding Basis Universal at load time. | Arm GPU Best Practices, 8.4 Texture sampling performance | |
GFX-14 |
6 | Recommended | Give meshes that move towards and away from the camera levels of detail, with about half the triangles at each level, so that distant objects don't cost more than they show. | Android, Geometry: level of detail | |
GFX-15 |
6 | Recommended | Feature-detect WebGPU and keep a WebGL 2 fallback, or use an engine that has one. | web.dev, WebGPU is now supported in major browsers | |
GFX-16 |
6 | Recommended | Handle a lost GPU context: listen for webglcontextlost and webglcontextrestored in WebGL, and watch GPUDevice.lost in WebGPU, and be able to recreate every GPU resource. |
MDN, isContextLost(): usage notes |
specific/graphql¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
GQL-1 |
8 | Recommended | Evolve the schema without versions: add fields and types, mark what you plan to remove with @deprecated(reason: โฆ) naming the replacement, and remove it only after usage tracking shows that clients have migrated, or the announced deadline has passed. |
GraphQL, Schema change management | GraphQL ESLint, GraphQL Inspector diff |
GQL-2 |
8 | Recommended | Change data only in mutations: keep query fields free of side effects, and don't execute a mutation sent with GET. |
GraphQL spec, Normal and serial execution | |
GQL-3 |
7 | Recommended | Design the schema around the business domain and the way clients use the data, not around the database tables behind it. | GraphQL, Thinking in graphs | |
GQL-4 |
7 | Recommended | Paginate every list field that can grow, with cursor-based connections that follow the Relay connection specification, and cap the page size. | GraphQL, Pagination | GraphQL ESLint |
GQL-5 |
6 | Recommended | Choose nullability field by field: keep a field nullable if it can fail or be denied on its own, make it non-null only where clients need the guarantee, and return lists as [Item!]!. |
GraphQL, Schema design: Nullability | |
GQL-6 |
6 | Recommended | Return expected business errors, such as failed validation or a broken business rule, as typed results in the mutation's payload type, and keep the top-level errors array for unexpected failures. |
GraphQL, Error handling | |
GQL-7 |
9 | Strongly recommended | Check authorization in the business logic layer that resolvers call, for every object and field a request reaches, including lookups by ID such as node(id:) and connection edges. |
GraphQL, Authorization | |
GQL-8 |
8 | Recommended | Limit what one request can cost: reject operations above a maximum depth, number of aliases and root fields, and number of operations in a batch, and stop execution after a timeout. For public APIs, also consider query cost analysis and rate limits based on cost. | GraphQL, Security: demand control | |
GQL-9 |
7 | Recommended | If only your own clients call the API, execute only trusted documents in production: operations registered at build time and sent by ID. | GraphQL, Security: trusted documents | |
GQL-10 |
7 | Recommended | Mask unexpected errors in production, and turn off stack traces and debug output. | GraphQL, Security: error messages | |
GQL-11 |
6 | Recommended | Refuse requests that a browser can send cross-site without a CORS preflight, such as form-encoded or multipart bodies and GET requests without a custom header, to prevent cross-site request forgery. |
GraphQL over HTTP, Exercise caution | |
GQL-12 |
5 | Conditional | Turn off introspection and GraphiQL in production for APIs that only your own clients use, and don't count on it as protection. | GraphQL, Introspection in production | |
GQL-13 |
7 | Recommended | Load data in resolvers through DataLoader or an equivalent, which batches and caches the loads within each request. | GraphQL, Performance: the N+1 problem | |
GQL-14 |
5 | Conditional | Start with one GraphQL service, and adopt federation only when several teams need to own and deploy parts of the graph independently. | GraphQL, Is GraphQL federation right for you? |
specific/ios¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
IOS-1 |
7 | Recommended | Make each shared model an @Observable class, create it with @State private var in the view or App that owns it, and pass it down as a plain property, with @Bindable where a subview needs bindings, or through .environment(_:). |
Apple, Managing model data in your app | |
IOS-2 |
7 | Recommended | Keep data and the logic that changes it in model types, not in views, and use @State only for state that a view owns: declare it private in the highest view that needs it, and pass the value or a binding to subviews. |
Apple, Managing model data in your app | SwiftLint |
IOS-3 |
7 | Recommended | Build every target in the Swift 6 language mode, which prevents data races at compile time. Migrate older modules one at a time, for example by setting Strict Concurrency Checking to Complete in the Swift 5 mode first and fixing the warnings. | Swift.org, Data race safety | Swift 6 language mode, Thread Sanitizer and Main Thread Checker |
IOS-4 |
7 | Recommended | Keep UI code and UI state on the main actor, and add concurrency only where you need it: set Default Actor Isolation to MainActor for app targets, run heavy work off the main actor with @concurrent functions, and keep other mutable state that tasks share in actors. |
The Swift Programming Language, Concurrency | Thread Sanitizer and Main Thread Checker |
IOS-5 |
6 | Recommended | Use async let, task groups and SwiftUI's .task modifier rather than unstructured Task { }, and when you do create a Task, keep its handle and cancel it when its work is no longer needed. |
The Swift Programming Language, Concurrency | |
IOS-6 |
9 | Strongly recommended | Store tokens, passwords and keys in the Keychain with the most restrictive accessibility that works for the app, such as kSecAttrAccessibleWhenUnlockedThisDeviceOnly, not in UserDefaults, which stores data on disk unencrypted. |
Apple, UserDefaults | |
IOS-7 |
9 | Strongly recommended | Sign users in through ASWebAuthenticationSession, with the authorization code flow and PKCE (AUTH-2), never in a WKWebView. |
IETF, RFC 8252, 8.12 Embedded user agents | |
IOS-8 |
8 | Recommended | Keep App Transport Security on: don't set NSAllowsArbitraryLoads, fix a server that fails the ATS checks instead of adding an exception, and limit any exception you can't avoid to the domains that need it. |
Apple, Preventing insecure network connections | |
IOS-9 |
9 | Strongly recommended | Add a privacy manifest (PrivacyInfo.xcprivacy) to the app that declares the data it collects and an approved reason for each required reason API it uses, use the SDKs on Apple's list only in versions that include their privacy manifest (and their signature, if you add them as binaries), and compare the privacy report that Xcode generates from all the manifests with the App Store privacy details before each release. |
Apple, Privacy manifest files | App Store Connect upload checks, Verifying the origin of your XCFrameworks |
IOS-10 |
7 | Recommended | Save the user's work when the scene phase changes to .background, because the app may be terminated soon after, and restore lightweight UI state, such as the selected tab, with @SceneStorage. Keep model data and sensitive data out of @SceneStorage. |
Apple, ScenePhase | |
IOS-11 |
6 | Recommended | Do background work only through the system's mechanisms: finish a task the user started with beginBackgroundTask(withName:expirationHandler:), transfer large files with a background URLSession, and schedule refreshes and maintenance as BGAppRefreshTask and BGProcessingTask requests. |
Apple, Choosing background strategies for your app | |
IOS-12 |
7 | Recommended | Persist structured app data with SwiftData, or Core Data, and version the schema from the first release: describe each released schema with a VersionedSchema, and the migrations between them with a SchemaMigrationPlan. |
Apple, SwiftData | |
IOS-13 |
6 | Recommended | Make HTTP requests with URLSession and its async methods, set waitsForConnectivity so that a request waits for a network instead of failing at once, and keep the data the user needs offline in local storage. |
Apple, TN3151: Choosing the right networking API | |
IOS-14 |
7 | Recommended | Use the built-in text styles, and make any custom font scale the same way, so that text follows Dynamic Type, give every meaningful image and custom control a VoiceOver label, and hide decorative images from VoiceOver. | Apple, HIG: Typography | Accessibility audits in UI tests, SwiftLint |
IOS-15 |
7 | Recommended | Write unit tests with Swift Testing and UI tests with XCTest and XCUIAutomation, in a test pyramid (TEST-1), and run them on every pull request with xcodebuild test or Xcode Cloud. |
Apple, Testing | |
IOS-16 |
7 | Recommended | Sign release builds with cloud-managed certificates, through automatic signing in Xcode or in Xcode Cloud, and never commit exported signing identities or their passwords. | Apple, Distributing your app for beta testing and releases |
specific/kafka¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
KAFKA-1 |
8 | Recommended | Choose each record's key by the ordering you need: records with the same key go to the same partition, and Kafka keeps order only within a partition. | Apache Kafka, Introduction | |
KAFKA-2 |
7 | Recommended | Choose a topic's partition count when you create it, from the throughput and consumer parallelism you need, with room for growth. | Apache Kafka, Modifying topics | |
KAFKA-3 |
7 | Recommended | Create topics explicitly with their partition count, replication factor and retention, and turn off automatic topic creation on the brokers. | Apache Kafka, Adding and removing topics | CreateTopicPolicy |
KAFKA-4 |
6 | Recommended | Set each topic's cleanup policy and retention on purpose: keep records at least as long as consumers may lag behind or need to replay them, and use compaction (cleanup.policy=compact) for topics where only the latest value per key matters. |
Topic configs: retention.ms | CreateTopicPolicy |
KAFKA-5 |
8 | Recommended | For data you can't afford to lose, use a replication factor of 3, min.insync.replicas=2 and producer acks=all, and leave unclean leader election off. |
Topic configs: min.insync.replicas | CreateTopicPolicy |
KAFKA-6 |
7 | Recommended | Keep producer idempotence on, and set enable.idempotence=true explicitly, so that conflicting settings fail when the producer is created instead of silently turning it off. |
Producer configs: enable.idempotence | |
KAFKA-7 |
8 | Recommended | Commit offsets only after the records are processed, and make processing idempotent, because after a failure Kafka redelivers the records since the last commit. | Design: message delivery semantics | |
KAFKA-8 |
7 | Recommended | Don't let a record that can't be processed block its partition: after a bounded number of retries, write it with the error details to a dead-letter topic and move on. | Confluent, Error Handling Patterns in Kafka | |
KAFKA-9 |
6 | Recommended | Keep the work for each poll well within max.poll.interval.ms, and lower max.poll.records when processing is slow. |
KafkaConsumer API: detecting consumer failures | |
KAFKA-10 |
5 | Conditional | For consume-transform-produce flows between Kafka topics, get exactly-once processing from Kafka Streams or a transactional producer, and read the results with isolation.level=read_committed. |
Design: using transactions | |
KAFKA-11 |
5 | Conditional | For queue-style work whose records are independent and need no ordering, consider a share group (production-ready since Kafka 4.2) instead of a consumer group. | Design: the share consumer | |
KAFKA-12 |
8 | Recommended | Give every topic a schema (Avro, Protobuf or JSON Schema) in a schema registry, and enforce a compatibility type for each subject. | Confluent, Schema Evolution and Compatibility | buf breaking, Schema Registry Maven plugin |
KAFKA-13 |
7 | Recommended | Register schemas from CI after a compatibility check, and set auto.register.schemas=false on producers in production. |
Confluent, Schema Registry Best Practices | Schema Registry Maven plugin |
KAFKA-14 |
8 | Recommended | Authenticate every connection to the brokers with TLS client certificates or SASL over TLS, turn on the StandardAuthorizer, and give each application its own principal with only the ACLs it needs. |
Apache Kafka, Security overview | |
KAFKA-15 |
7 | Recommended | Run production clusters with dedicated KRaft controller nodes, usually three or five, rather than nodes that are both broker and controller. | Apache Kafka, KRaft: deploying considerations | |
KAFKA-16 |
7 | Recommended | Monitor consumer lag for every consumer group, and the brokers' under-replicated and under-min-ISR partition counts, and alert when lag keeps growing or those counts aren't 0. | Apache Kafka, Monitoring |
specific/kubernetes¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
K8S-1 |
9 | Strongly recommended | Give every container CPU and memory requests and a memory limit. Set CPU limits only where needed, for example on sensitive workloads. | Kubernetes, Resource management for pods and containers | kube-linter checks, Kyverno policy library, OPA Gatekeeper library, Polaris checks |
K8S-2 |
9 | Strongly recommended | Configure readiness, liveness and startup probes for their distinct purposes. | Kubernetes, Liveness, readiness and startup probes | kube-linter checks, Kyverno policy library, OPA Gatekeeper library, Polaris checks |
K8S-4 |
8 | Recommended | Run multiple replicas, spread them across nodes and zones, and protect them with PodDisruptionBudgets. | Kubernetes, Topology spread constraints | kube-linter checks, Kyverno policy library, Polaris checks |
K8S-5 |
8 | Recommended | Deploy images by digest, never by a mutable tag such as :latest. |
Kubernetes, Images | kube-linter checks, OPA Gatekeeper library, Polaris checks |
K8S-3 |
7 | Recommended | Fit graceful shutdown into the Pod's termination grace period: set terminationGracePeriodSeconds to cover your slowest shutdown, and use a preStop hook if the app needs time before it receives SIGTERM. |
Kubernetes, Pod lifecycle: termination | |
K8S-6 |
5 | Conditional | Scale stateless workloads horizontally with the HorizontalPodAutoscaler. | Kubernetes, Autoscaling workloads | |
K8S-7 |
4 | Conditional | Apply the recommended app.kubernetes.io/* labels. |
Kubernetes, Recommended labels | Kyverno policy library |
K8S-8 |
9 | Strongly recommended | Grant least-privilege RBAC, and give each workload its own service account. | Kubernetes, RBAC good practices | kube-linter checks, Polaris checks |
K8S-9 |
8 | Recommended | Enforce the Restricted Pod Security Standard for application namespaces. | Kubernetes, Pod Security Standards | Pod Security Admission |
K8S-10 |
8 | Recommended | Start each namespace from a default-deny NetworkPolicy and allow only the traffic you need. | Kubernetes, Security checklist | kube-linter checks, Kyverno policy library |
K8S-11 |
8 | Recommended | Encrypt Secrets at rest, restrict who can read them, and consider an external secret store. | Kubernetes, Good practices for Secrets | kube-linter checks |
K8S-12 |
5 | Conditional | Decide your tenancy model (namespaces, clusters) explicitly. | Kubernetes, Multi-tenancy | |
K8S-13 |
6 | Recommended | Let an agent pull the declared state from Git and continuously reconcile the cluster to it (GitOps). | OpenGitOps principles |
specific/laravel¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
LARAVEL-1 |
9 | Strongly recommended | Never commit the .env file: commit .env.example with placeholder values, and supply the real values as environment variables on the server or in an encrypted environment file (php artisan env:encrypt). |
Laravel, Environment file security | GitHub secret scanning push protection |
LARAVEL-2 |
9 | Strongly recommended | In production, set APP_DEBUG to false and point the web server's document root at the public directory. |
Laravel, Deployment: debug mode | Semgrep Laravel rules |
LARAVEL-3 |
7 | Recommended | Run php artisan optimize in every deployment, to cache the configuration, events, routes and views; call env() only in the files in config/; and restart queue workers and other long-running processes after deploying, for example with php artisan reload. |
Laravel, Deployment: optimization | Larastan rules |
LARAVEL-4 |
9 | Strongly recommended | Authorize every action: write the rules for each model in a policy and the other rules in gates, and check them in each controller action, in the Form Request's authorize() method, or with the can middleware. |
Laravel, Authorization | |
LARAVEL-5 |
9 | Strongly recommended | Output data with Blade's escaped {{ }} syntax, use {!! !!} only for HTML you trust, never for content that users supplied, and pass data to JavaScript with Js::from(). |
Laravel, Blade: displaying unescaped data | Psalm Laravel plugin, security analysis |
LARAVEL-6 |
9 | Strongly recommended | Pass values to raw SQL only as bindings, with ? or named placeholders, in DB::select(), whereRaw(), orderByRaw() and the other raw methods, and never let user input choose column names, including orderBy columns. |
Laravel, Query builder | Psalm Laravel plugin, security analysis |
LARAVEL-7 |
8 | Recommended | Validate every request with a Form Request or the validator, pass only the validated data ($request->validated() or safe()) to create(), fill() and update(), and declare each model's mass-assignable attributes with the Fillable attribute (the $fillable property before Laravel 13) instead of unguarding the model. |
Laravel, Form request validation | Semgrep Laravel rules |
LARAVEL-8 |
7 | Recommended | Validate the type and size of every upload with the File rule, for example File::types([...])->max('10mb') or File::image(), and store it under a generated name with store() or hashName(), never a name built from getClientOriginalName(), getClientOriginalExtension() or other user input. |
Laravel, Validating files | Psalm Laravel plugin, security analysis |
LARAVEL-9 |
7 | Recommended | Keep browser routes in the web middleware group, where the PreventRequestForgery middleware checks them, add @csrf to every POST, PUT, PATCH and DELETE form, and exclude only routes that can't send a token, such as third-party webhooks, from CSRF protection. |
Laravel, Preventing CSRF requests | Semgrep Laravel rules |
LARAVEL-10 |
8 | Recommended | Change the schema only through migrations in database/migrations, run them in each deployment with php artisan migrate --force, and add --isolated when several servers deploy at once. |
Laravel, Migrations | |
LARAVEL-11 |
7 | Recommended | Eager load the relationships that each query's results use with with() or load(), and call Model::preventLazyLoading(! $this->app->isProduction()) in AppServiceProvider, so that lazy loading throws an exception in development and tests. |
Laravel, Eager loading | |
LARAVEL-12 |
7 | Recommended | Wrap writes that must succeed or fail together in DB::transaction(), pass attempts to retry on deadlocks, and dispatch queued jobs from inside a transaction only after it commits, with the queue connection's after_commit option or ->afterCommit(). |
Laravel, Database transactions | Larastan rules |
LARAVEL-13 |
7 | Recommended | Run slow work, such as processing uploaded files, in queued jobs; make each job safe to run more than once, keep each worker's --timeout several seconds shorter than the connection's retry_after, limit the attempts, and keep failed jobs in the failed_jobs table to inspect and retry them. |
Laravel, Queues | |
LARAVEL-14 |
6 | Recommended | Write most tests as feature tests that send HTTP requests to the application and assert on the response and the database, reset the database for each test with RefreshDatabase, and create test data with model factories. |
Laravel, Testing | |
LARAVEL-15 |
6 | Recommended | Check the code style with Laravel Pint, and analyse the code with Larastan, the PHPStan extension for Laravel, in CI. | Laravel, Pint | Larastan rules, Laravel Pint --test |
LARAVEL-16 |
8 | Recommended | Run a Laravel release that still receives security fixes, on a PHP branch that is still supported, and plan each upgrade before the support ends. | Laravel, Support policy | composer audit |
specific/mobile-games¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
MOBGAME-1 |
9 | Strongly recommended | Verify every purchase on your own server before granting it, and keep entitlements and currency balances there, not on the device. | Google, Move sensitive logic to your backend | |
MOBGAME-2 |
8 | Recommended | Complete a purchase only after granting it: acknowledge or consume Google Play purchases from your backend, and finish App Store transactions after the content is delivered. | Google, Verify purchases before granting entitlements | |
MOBGAME-3 |
8 | Recommended | Process the stores' server notifications on your backend, Real-time developer notifications from Google Play and App Store Server Notifications V2, to keep subscriptions current and to claw back refunded or voided purchases. | Google, Purchase lifecycle management | |
MOBGAME-4 |
7 | Recommended | Show the odds of each item type before a player buys randomised items such as loot boxes. | Apple, App Review Guidelines 3.1.1 | |
MOBGAME-5 |
9 | Strongly recommended | Treat each store's build requirements as release blockers with deadlines: Google Play's target API level and Play Billing Library version, and the App Store's minimum Xcode and SDK version. | Google, Target API level requirement | Android Lint target SDK checks, App Store Connect upload checks |
MOBGAME-6 |
9 | Strongly recommended | Declare what the game and every SDK in it collect: keep the App Store privacy details and privacy manifests (IOS-9), and Google Play's Data safety form, accurate, and ask for permission through App Tracking Transparency before tracking players on iOS. |
Apple, App privacy details | App Store Connect upload checks |
MOBGAME-7 |
8 | Recommended | Decide the target audience before choosing ad, analytics and social SDKs, and answer both stores' age-rating questionnaires accurately. If children are part of the audience, follow Google Play's Families policies and the App Store's rules for kids' apps. | Google Play, Families policies | |
MOBGAME-8 |
8 | Recommended | Run live operations, such as events, offers and balance changes, from remote configuration and downloadable data with safe in-app defaults, not from downloaded code. | Apple, App Review Guidelines 2.5.2 | |
MOBGAME-9 |
8 | Recommended | Track user-perceived crash and ANR rates for every release, and keep them under Android vitals' bad-behavior thresholds: 1.09% and 0.47% overall, and 8% on any phone model. | Android vitals: bad behavior thresholds | Play Console pre-launch report |
MOBGAME-10 |
7 | Recommended | Keep the first download small: ship what the first session needs in the base app, and deliver the rest as asset packs with Play Asset Delivery and Background Assets. | Google, Play Asset Delivery: delivery modes | |
MOBGAME-11 |
7 | Recommended | Protect ranked play, trading, rewards and other economic features by checking app and device integrity on your server, with the Play Integrity API and App Attest. | Google, Play Integrity security considerations | |
MOBGAME-12 |
7 | Recommended | Release updates gradually, with staged rollouts on Google Play and phased release on the App Store, and halt or pause the rollout when crash or ANR rates rise. | Google Play, Release app updates with staged rollouts | |
MOBGAME-13 |
7 | Recommended | Cap the frame rate at what the game needs, and lower it and the rendering load when the device heats up, before the system throttles the game. | Apple, ProcessInfo.ThermalState.serious |
specific/mongodb¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
MONGO-1 |
8 | Recommended | Design each collection from the application's read and write patterns: embed data that is read or updated together, and reference data that grows without bound, has many items on the child side, is written at different times or exists on its own. | MongoDB, Data Modeling | |
MONGO-2 |
8 | Recommended | Keep documents bounded: cap arrays with the subset pattern or move their items to a separate collection, and move fields that aren't read together into separate documents. | MongoDB, Avoid Unbounded Arrays | |
MONGO-3 |
7 | Recommended | When the shape of a document changes, add a schemaVersion field, and make the code's queries and updates handle every version that can still be in the collection. |
MongoDB, Maintain Different Schema Versions | |
MONGO-4 |
7 | Recommended | Once a collection's schema is established, add a $jsonSchema validator and keep the default behavior, which rejects invalid inserts and updates. |
MongoDB, Schema Validation | |
MONGO-5 |
7 | Recommended | Create an index for every frequent query, order compound index keys by the ESR guideline (equality, then sort, then range), and check each query with explain("executionStats"): it should use an index scan (IXSCAN) and examine about as many documents as it returns. |
MongoDB, Development Checklist: schema design | notablescan server parameter |
MONGO-6 |
5 | Conditional | If you shard a collection, choose a shard key with high cardinality, evenly spread and non-monotonic values, that most queries include, so that they go to one shard. | MongoDB, Choose a Shard Key | |
MONGO-7 |
8 | Recommended | Write data you can't lose with w: "majority", the default, on replica sets with at least three data-bearing voting members, and read from the primary with "majority" read concern where a client must read its own writes. |
MongoDB, Rollbacks: avoid replica set rollbacks | |
MONGO-8 |
7 | Recommended | Use multi-document transactions only where several documents must change atomically, run them with the driver's callback API, which retries transient errors, and keep each one well under the 60-second default limit. | MongoDB, Transactions | |
MONGO-9 |
7 | Recommended | Leave retryable writes on, the driver default, and handle what they don't cover: retry failed operations with exponential backoff where that is safe (OPS-3), and make multi-document updates and deletes idempotent. |
MongoDB, Retryable Writes | |
MONGO-10 |
7 | Recommended | Create one MongoClient per process when it starts, outside request and serverless handlers, and reuse it for every operation; size maxPoolSize from the number of concurrent requests, starting at 110โ115% of the typical number. |
MongoDB, Connection Pool Overview | |
MONGO-11 |
9 | Strongly recommended | Self-managed: bind MongoDB to private interfaces, firewall its port so that only application hosts can reach it, and turn on access control, which is off by default. Atlas: never add 0.0.0.0/0 to the IP access list, and connect staging and production projects through private endpoints. |
MongoDB, Production Notes: use trusted networking environments | Atlas Resource Policies |
MONGO-12 |
9 | Strongly recommended | Never pass request data into a query filter or update document as an object: check that each value is a scalar of the expected type, or wrap it in $eq, so that a client can't send query operators such as {"$ne": null}. |
CodeQL, Database query built from user-controlled sources | CodeQL, Database query built from user-controlled sources |
MONGO-13 |
8 | Recommended | Give each application its own database user with roles scoped to the databases and actions it needs, never a cluster-wide or administrator role, and require TLS on every connection (SEC-5, SEC-13). On Atlas, authenticate production workloads with Workload Identity Federation, AWS IAM or X.509 certificates; Atlas recommends password (SCRAM) users only for development and test. |
MongoDB, Security Checklist: configure role-based access control | Atlas Resource Policies |
MONGO-14 |
7 | Recommended | Never build $where, $function or $accumulator expressions from user input, and turn server-side JavaScript off when the application doesn't use it: --noscripting or security.javascriptEnabled: false on self-managed servers, and the Allow Server-Side JavaScript setting on Atlas. |
MongoDB, FAQ: how does MongoDB address query injection | Semgrep mongodb-nosqli rule |
MONGO-15 |
8 | Recommended | Back up production clusters with point-in-time recovery, keep a copy in a second region, and test restores regularly (DATA-8). On Atlas, turn on Cloud Backup with Continuous Cloud Backup, multi-region snapshot distribution and a Backup Compliance Policy. |
Atlas Architecture Center, backup recommendations | |
MONGO-16 |
7 | Recommended | Choose the upgrade path on purpose. On Atlas clusters that upgrade automatically, declare the Stable API version in a strict client; elsewhere, test each new major version on a staging deployment first, upgrade before the current one reaches end of life, and raise the feature compatibility version only after testing, because after that you can't downgrade. | MongoDB, Stable API: create a strict client |
specific/nextjs¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
NEXTJS-1 |
9 | Strongly recommended | Treat every Server Action as a public endpoint: authenticate, authorize and validate its input inside the action. | Next.js, Server Actions: Security | |
NEXTJS-2 |
9 | Strongly recommended | Give an environment variable the NEXT_PUBLIC_ prefix only if its value may be public. |
Next.js, Environment variables | |
NEXTJS-3 |
8 | Recommended | Put data access in a server-only Data Access Layer that checks authorization and returns minimal data transfer objects (DTOs). | Next.js, Data security | server-only import guard |
NEXTJS-4 |
8 | Recommended | Pass Client Components, and return from Server Actions, only the fields the UI renders. | Next.js, The Server and Client Boundary | |
NEXTJS-5 |
7 | Recommended | Add import 'server-only' to modules that use secrets or the database. |
Next.js, Preventing environment poisoning | server-only import guard |
NEXTJS-6 |
7 | Recommended | Keep "use client" boundaries small: mark the interactive components, not whole layouts or pages, and pass server-rendered content to them as children or props. |
Next.js, Reducing JS bundle size | Lighthouse CI |
NEXTJS-7 |
7 | Recommended | Decide caching per data source, and invalidate the cache in every mutation that changes the data. | Next.js, Caching | |
NEXTJS-8 |
6 | Recommended | Read data in Server Components and change it with Server Actions. | Next.js, Production checklist | |
NEXTJS-9 |
6 | Recommended | Avoid request waterfalls: start independent requests in parallel, and stream slow parts behind <Suspense> or loading.js. |
Next.js, Parallel data fetching | |
NEXTJS-10 |
6 | Recommended | Return expected errors, such as failed validation, from Server Actions as values, and let error.js and global-error.js boundaries catch uncaught exceptions. |
Next.js, Error handling | |
NEXTJS-11 |
6 | Recommended | Use next/image, next/font and next/script instead of plain <img> tags, font links and script tags. |
Next.js, Image optimization | eslint-config-next, Lighthouse CI |
specific/nodejs¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
NODE-1 |
9 | Strongly recommended | Don't block the event loop. | Node.js, Don't Block the Event Loop | eslint-plugin-n no-sync, eslint-plugin-regexp no-super-linear-backtracking |
NODE-2 |
8 | Recommended | Await or return every promise, and don't pass async functions where the caller ignores the returned promise. | typescript-eslint, no-floating-promises | typescript-eslint no-floating-promises |
NODE-3 |
8 | Recommended | Validate all external input, such as request bodies, query strings and messages, at runtime with a schema library. | Node.js Best Practices 6.10 | |
NODE-4 |
8 | Recommended | Commit the lockfile, install with npm ci, and check dependencies for known vulnerabilities in CI. |
Node.js, Supply chain attacks | npm ci |
NODE-5 |
8 | Recommended | Run only Active LTS or Maintenance LTS releases of Node.js in production. | Node.js, Releases | |
NODE-6 |
7 | Recommended | Treat unknown errors as fatal: log them, shut down gracefully and let the platform restart the process. | Node.js, Using 'uncaughtException' correctly | |
NODE-7 |
7 | Recommended | Structure the service by business components, each with its own entry points, domain logic and data access, and keep web-framework objects out of the domain logic. | Node.js Best Practices 1.1 | dependency-cruiser |
NODE-8 |
7 | Recommended | Type-check Node.js services in CI with tsc, and set module to nodenext. |
TypeScript, strict | TypeScript strict |
NODE-9 |
7 | Recommended | Shut down gracefully on SIGTERM: fail the readiness check, stop accepting connections, finish in-flight requests, close resources, then exit. |
Node.js Best Practices 8.6 | |
NODE-10 |
7 | Recommended | Log structured JSON to stdout with a mature logger such as Pino, add request context with child loggers, and redact secrets. | Node.js Best Practices 2.7 | |
NODE-11 |
6 | Recommended | Handle errors in one central handler that every entry point (HTTP routes, jobs, message consumers) calls, and throw only Error objects or subclasses of it. |
Node.js Best Practices 2.4 | |
NODE-12 |
6 | Recommended | Set HTTP server timeouts and connection limits, and put a reverse proxy in front of the service. | Node.js, Denial of service of HTTP server |
specific/opentelemetry¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
OTEL-1 |
8 | Recommended | Set service.name explicitly in every service, with the same value for all instances of the service, and add service.version and deployment.environment.name as resource attributes. |
OpenTelemetry, Resources | |
OTEL-2 |
6 | Recommended | Before you name a custom attribute or metric, look for it in the semantic conventions; when none fits, prefix the new name with your company's reverse domain name, such as com.acme., or with your application's name. |
Semantic conventions, Naming: recommendations for application developers | Weaver live check |
OTEL-3 |
8 | Recommended | Propagate trace context across every process boundary, including queues: keep the default W3C Trace Context propagator for HTTP and gRPC, and have producers attach the context to each message. | OpenTelemetry, Context propagation | |
OTEL-4 |
7 | Recommended | Start with zero-code instrumentation or instrumentation libraries for your frameworks and clients, then add code-based spans, attributes and metrics for the business operations that matter. | OpenTelemetry, Instrumentation | |
OTEL-5 |
7 | Recommended | Correlate logs with traces: keep your logging library, connect it to OpenTelemetry with a log appender (bridge) so that each record carries the active trace and span IDs, and prefer structured logs. | OpenTelemetry, Logs: log appender / bridge | |
OTEL-6 |
7 | Recommended | Keep span names and metric attributes low-cardinality: use route templates such as /users/{id} instead of raw paths, and keep user IDs, request IDs and other unbounded values off metric attributes. |
OpenTelemetry, Metrics: cardinality limits | |
OTEL-7 |
6 | Recommended | Treat trace context from outside as untrusted: ignore or sanitize incoming trace headers from callers you don't trust, don't send internal context to external services, and never put credentials or personal data in baggage. | OpenTelemetry, Context propagation: security best practices | |
OTEL-8 |
6 | Recommended | Choose sampling deliberately: don't sample when you produce little data, use consistent probability (head) sampling to cut volume cheaply, and add tail sampling in a Collector tier when you must keep every error or slow trace. | OpenTelemetry, Sampling | |
OTEL-9 |
8 | Recommended | Make memory_limiter the first processor in every Collector pipeline, set GOMEMLIMIT to about 80% of the Collector's hard memory limit, and batch data after sampling and filtering, preferably with the exporter's sending_queue batching. |
OpenTelemetry Collector, Recommended processors | Collector validate command |
OTEL-10 |
8 | Recommended | Secure every Collector: bind receivers to localhost or a specific interface instead of 0.0.0.0, require TLS and authentication on receivers that other hosts send to, keep credentials out of the configuration file, in a secret store or, where nothing else is available, in environment variables, and include only the components you use. |
OpenTelemetry, Collector configuration best practices | |
OTEL-11 |
7 | Recommended | Send telemetry over OTLP to an OpenTelemetry Collector, running as an agent next to the service or as a gateway, rather than from each service straight to a vendor. | OpenTelemetry, Collector: when to use a collector | |
OTEL-12 |
8 | Recommended | Keep secrets and personal data out of telemetry: don't record what you don't need, and remove, hash or truncate what instrumentation captures anyway, for example with the Collector's redaction, attributes, transform or filter processors. |
OpenTelemetry, Handling sensitive data |
specific/postgres¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
PG-1 |
8 | Recommended | Declare integrity rules as constraints in the database: a primary key on every table, NOT NULL on most columns, and foreign key, unique and check constraints where the data needs them. |
PostgreSQL, Constraints | |
PG-2 |
7 | Recommended | Store points in time as timestamptz, not timestamp. |
PostgreSQL wiki, Don't use timestamp (without time zone) | Squawk |
PG-3 |
6 | Recommended | Generate keys with identity columns, such as id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, instead of serial. |
PostgreSQL wiki, Don't use serial | Squawk |
PG-4 |
6 | Recommended | Use text for strings, rather than char(n) or a varchar(n) with an arbitrary limit. |
PostgreSQL, Character Types | Squawk |
PG-5 |
7 | Recommended | Add indexes for the queries the application actually runs: find the costly ones with pg_stat_statements, check their plans with EXPLAIN ANALYZE on realistic data, and drop indexes that are never used. |
PostgreSQL, Examining Index Usage | |
PG-6 |
8 | Recommended | Create and drop indexes on tables in use with CREATE INDEX CONCURRENTLY and DROP INDEX CONCURRENTLY. |
PostgreSQL, CREATE INDEX: Building Indexes Concurrently | Squawk |
PG-7 |
7 | Recommended | Set a short lock_timeout at the start of each migration, and retry the migration when it times out. |
PostgreSQL, lock_timeout | Squawk |
PG-8 |
7 | Recommended | Add foreign key and check constraints to existing tables as NOT VALID, then run VALIDATE CONSTRAINT in a separate transaction. |
PostgreSQL, ALTER TABLE: Notes | Squawk |
PG-9 |
7 | Recommended | Put a connection pooler such as PgBouncer between the database and large numbers of clients, such as many app instances or serverless functions, instead of raising max_connections. |
PostgreSQL wiki, Number Of Database Connections | |
PG-10 |
7 | Recommended | Keep transactions short, set idle_in_transaction_session_timeout to end abandoned ones, and leave autovacuum on. |
PostgreSQL, idle_in_transaction_session_timeout | |
PG-11 |
9 | Strongly recommended | Test restores regularly, and check that the restored database works and contains the correct data. | PostgreSQL, pg_verifybackup | pg_verifybackup, pgBackRest check |
PG-12 |
8 | Recommended | Back up production databases with continuous archiving, base backups plus archived WAL, so that you can restore to any point in time, not only to the last dump. | PostgreSQL, Continuous Archiving and Point-in-Time Recovery | pgBackRest check |
PG-13 |
8 | Recommended | Connect the application as a role that isn't a superuser and doesn't own the tables, and grant it only the privileges it needs; run migrations as a separate owner role. | PostgreSQL, Role Attributes | |
PG-14 |
7 | Recommended | Use scram-sha-256 password authentication over TLS, and have clients verify the server with sslmode=verify-full. |
PostgreSQL, Password Authentication | |
PG-15 |
5 | Conditional | When tenants share tables, isolate their rows with row security policies, and make sure the application role isn't the table owner or use FORCE ROW LEVEL SECURITY. |
PostgreSQL, Row Security Policies | |
PG-16 |
9 | Strongly recommended | Run a supported major version, apply each minor release soon after it ships, and upgrade to a newer major version before the current one reaches end of life. | PostgreSQL, Versioning Policy |
specific/python¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
PY-1 |
8 | Recommended | Run a Python version that still receives fixes, and upgrade before its end-of-life date. | Python Developer's Guide, Status of Python versions | |
PY-2 |
8 | Recommended | Commit a lock file that pins every direct and transitive dependency, install exactly what it lists in CI and deployments, and audit it for known vulnerabilities in CI. | uv, The lockfile | pip hash-checking mode, pip-audit |
PY-3 |
6 | Recommended | Install each application's dependencies into its own virtual environment, not into the Python that the operating system manages, and treat the environment as disposable. | Python, venv | |
PY-4 |
6 | Recommended | Describe the project in pyproject.toml, use the src layout, and keep tests in a separate tests/ directory. |
Packaging User Guide, Writing your pyproject.toml | |
PY-5 |
6 | Recommended | When the domain has real business logic, keep it in plain Python modules that import neither the web framework nor the ORM, and let views, routers, tasks and commands call it through a service layer. | Architecture Patterns with Python, Repository pattern | Import Linter forbidden contracts |
PY-6 |
6 | Recommended | In FastAPI, split path operations into APIRouter modules by area, and provide shared resources such as database sessions, settings and the current user through dependencies (Depends). |
FastAPI, Bigger Applications | |
PY-7 |
8 | Recommended | Validate all external input at runtime where it enters the application, with Pydantic models (as FastAPI does for request bodies) or with Django forms or Django REST framework serializers, and use only the validated data. | Python, typing | |
PY-8 |
7 | Recommended | Annotate the code with type hints and run a type checker, such as mypy or Pyright, in CI, pinned with the other development dependencies. | mypy, Using mypy with an existing codebase | mypy --strict |
PY-9 |
8 | Recommended | In async code, don't call blocking I/O or CPU-heavy functions directly: use async libraries, run blocking calls in a thread with asyncio.to_thread() (in Django, sync_to_async()), and run CPU-heavy work in an executor such as a process pool. |
Python, Running blocking code | Ruff flake8-async (ASYNC) rules |
PY-10 |
7 | Recommended | Run concurrent tasks in an asyncio.TaskGroup, or keep a reference to every task you start with asyncio.create_task() until it finishes. |
Python, Task groups | Ruff flake8-async (ASYNC) rules |
PY-11 |
5 | Conditional | Write async code only where a service waits on many I/O operations at once, such as long-lived connections or calls fanned out to other services. Otherwise keep it synchronous. | Python, asyncio | |
PY-12 |
9 | Strongly recommended | In Django, never enable DEBUG in production, load SECRET_KEY and other secrets from the environment or a file, and run manage.py check --deploy against the production settings. |
Django, Deployment checklist | manage.py check --deploy |
PY-13 |
6 | Recommended | Load configuration into one typed settings object, such as a pydantic-settings BaseSettings class, so that missing or malformed values raise a validation error when the settings load. |
FastAPI, Settings and Environment Variables | |
PY-14 |
9 | Strongly recommended | Never pass untrusted data to pickle, eval(), exec() or yaml.load(), or into a shell command with shell=True. |
Python, pickle | Ruff flake8-bandit (S) rules |
PY-15 |
6 | Recommended | Lint and format with Ruff, and run ruff check and ruff format --check in CI and in a pre-commit hook. |
Ruff | Ruff linter exit codes |
specific/rabbitmq¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
RABBITMQ-2 |
9 | Strongly recommended | Publish with publisher confirms, and consume with manual acknowledgements, acknowledging each message only after it has been processed. | RabbitMQ, Acknowledgement modes | |
RABBITMQ-1 |
8 | Recommended | Declare queues whose messages must survive the loss of a node as quorum queues, and make quorum the default queue type of the virtual host. |
RabbitMQ, Quorum Queues: use cases | |
RABBITMQ-3 |
8 | Recommended | Make consumers idempotent: the same message can arrive twice, after a redelivery or when a publisher resends a message whose confirm it didn't receive. | RabbitMQ, Reliability Guide: consumer side | |
RABBITMQ-4 |
7 | Recommended | Don't let unroutable messages disappear: publish with the mandatory flag and handle returned messages, or give the exchange an alternate exchange. |
RabbitMQ, Publishers: unroutable message handling | RabbitMQ Prometheus alerting rules |
RABBITMQ-5 |
8 | Recommended | Handle poison messages with the quorum queue delivery limit and a dead-letter exchange: keep the limit on (20 by default since RabbitMQ 4.0), and dead-letter messages that exceed it to a queue that someone monitors. | RabbitMQ, Quorum Queues: poison message handling | Operator policies |
RABBITMQ-6 |
7 | Recommended | Give every consumer a bounded prefetch, starting between 100 and 300, and tune it by measurement. | RabbitMQ, Prefetch and throughput | |
RABBITMQ-7 |
6 | Recommended | Retry transient failures with the quorum queue's delayed retry (RabbitMQ 4.3 and later) instead of requeueing at once or building dead-letter cycles with TTLs. | RabbitMQ, Quorum Queues: delayed retry | |
RABBITMQ-8 |
7 | Recommended | Keep connections long-lived, use separate connections for publishing and consuming, and give each thread its own channel. | RabbitMQ, Connections: high connection churn | RabbitMQ Prometheus alerting rules |
RABBITMQ-9 |
7 | Recommended | Keep queues short: run enough consumers to keep up, cap queue length with a policy, and use a stream instead of a queue for large backlogs, replay or large fan-outs. | RabbitMQ, Streams: use cases | Operator policies |
RABBITMQ-10 |
7 | Recommended | Configure dead-lettering, TTLs, length limits and delivery limits through policies, not through x- arguments hard-coded in applications. |
RabbitMQ, Dead Letter Exchanges: configuration | |
RABBITMQ-11 |
9 | Strongly recommended | Delete the default guest user, disable anonymous logins, and give each application its own user with only the permissions it needs. |
RabbitMQ, Production checklist: users | |
RABBITMQ-12 |
8 | Recommended | Use TLS for client connections with peer verification, and secure inter-node and CLI traffic too. | RabbitMQ, Production checklist: TLS | rabbitmq-diagnostics check_certificate_expiration |
RABBITMQ-14 |
8 | Recommended | Stay on a release series that still has community support, and upgrade along the supported rolling upgrade paths, with all stable feature flags enabled first. | RabbitMQ, Release information | |
RABBITMQ-13 |
7 | Recommended | Monitor with the built-in Prometheus plugin, and alert on queue depth, unacknowledged messages, consumer counts, connection churn and resource alarms. | RabbitMQ, Monitoring with Prometheus-compatible tools | RabbitMQ Prometheus alerting rules |
specific/react¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
REACT-1 |
9 | Strongly recommended | Keep components and hooks pure. Side effects belong in event handlers or Effects. | react.dev, Keeping components pure | eslint-plugin-react-hooks |
REACT-2 |
7 | Recommended | Keep state minimal. | react.dev, Choosing the state structure | eslint-plugin-react-hooks |
REACT-3 |
7 | Recommended | Don't use Effects to transform data or handle user events. | react.dev, You might not need an Effect | eslint-plugin-react-hooks |
REACT-4 |
7 | Recommended | Put state where it's used, and lift it only as far as the closest common parent. | react.dev, Sharing state between components | |
REACT-5 |
7 | Recommended | Treat server state (fetched and cached data) separately from UI state, for example with TanStack Query. | TanStack Query overview | |
REACT-6 |
7 | Recommended | Test components with React Testing Library, which renders them into the DOM and queries them the way users find things. | Testing Library, Guiding principles | eslint-plugin-testing-library |
REACT-7 |
6 | Recommended | Start new apps with a framework, or with a build tool such as Vite when you have specific constraints. | react.dev, Creating a React App | |
REACT-8 |
6 | Recommended | Try props and composition before reaching for context. | react.dev, Passing data deeply with context | |
REACT-9 |
6 | Recommended | Extract reusable stateful logic into custom hooks. | react.dev, Reusing logic with custom hooks | |
REACT-10 |
6 | Recommended | Organise larger apps by feature, not by file type. | Bulletproof React, project structure | eslint-plugin-boundaries |
REACT-11 |
6 | Recommended | Move non-view logic (domain, data access) out of components as the app grows. | Modularizing React Applications with Established UI Patterns | eslint-plugin-boundaries |
specific/react-native¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
RN-1 |
7 | Recommended | Start new apps with Expo and Expo Router, and develop in development builds rather than in Expo Go. | React Native, Get started | |
RN-2 |
7 | Recommended | Generate the ios and android directories with Prebuild (Continuous Native Generation): keep native configuration in the app config and config plugins, keep the generated directories out of Git, and don't edit them by hand. |
Expo, Continuous Native Generation | Expo Doctor |
RN-3 |
6 | Recommended | Write the app in TypeScript with strict on (TS-1), and turn on Expo Router's typed routes, so that the type checker reports links to routes that don't exist. |
Expo, Using TypeScript | TypeScript type checking |
RN-4 |
9 | Strongly recommended | Treat the JavaScript bundle and the app config as public: never put secrets in EXPO_PUBLIC_ variables, the app config or the code, and call services that need a secret through your own server. |
Expo, Environment variables | |
RN-5 |
9 | Strongly recommended | Store tokens and other secrets with expo-secure-store, which uses the iOS Keychain and the Android Keystore, not in AsyncStorage, which is unencrypted, or in a persisted state store, and keep them out of crash reports and analytics. |
React Native, Async Storage | |
RN-6 |
9 | Strongly recommended | Sign users in through the system browser with expo-auth-session or react-native-app-auth, using the authorization code flow with PKCE (AUTH-2), never in a WebView, and exchange the code on your server when the provider requires a client secret. |
React Native, OAuth2 and redirects | |
RN-7 |
8 | Recommended | Treat every incoming link as untrusted input: validate its route and query parameters before using them (SEC-10), never put tokens or personal data in a link, and use universal links and Android App Links for links that must open only your app. |
React Native, Authentication and deep linking | |
RN-8 |
7 | Recommended | Declare the required reason APIs that the app and its libraries use in ios.privacyManifests in the app config, copying the reasons from each library's PrivacyInfo.xcprivacy. |
Expo, Privacy manifests | |
RN-11 |
7 | Recommended | Build and submit releases with EAS Build and EAS Submit from CI, and let EAS manage the signing credentials. If you use local credentials, add credentials.json and the keystore and certificate files to .gitignore (SEC-2). |
Expo, Using automatically managed credentials | |
RN-9 |
6 | Recommended | Give every build a runtime version that changes whenever its native code changes, preferably with the fingerprint policy, test each update on a preview build of the same runtime version through its own channel, and release it to production as a rollout to a small share of users first. Cancel the rollout, or roll back, if the error rate rises. |
Expo, Runtime versions and updates | |
RN-10 |
6 | Recommended | Use over-the-air updates for bug fixes and other changes that the stores allow without review, and ship new features and changes to the app's purpose in a store build. | Apple, App Review Guidelines 2.5.2 | |
RN-12 |
5 | Conditional | If your EAS plan includes it, sign updates end to end with expo-updates code signing, and keep the private key out of source control. |
Expo, End-to-end code signing with Expo Update | |
RN-13 |
7 | Recommended | Render long or growing lists with a virtualized list, FlatList, SectionList or FlashList, not with .map() inside a ScrollView, and measure performance in release builds. |
React Native, ScrollView | |
RN-14 |
6 | Recommended | Turn on the React Compiler after checking the project with react-compiler-healthcheck, and in new code rely on it for memoization, with useMemo and useCallback only where you need precise control. |
Expo, React Compiler | eslint-config-expo |
RN-15 |
8 | Recommended | Stay on a React Native release that still gets fixes, one of the latest three minor versions, by upgrading one Expo SDK at a time: run npx expo install --fix and npx expo-doctor, and apply native changes with the Upgrade Helper if you don't use Prebuild. |
React Native, Releases overview | Expo Doctor |
RN-16 |
7 | Recommended | Test components with Jest, the jest-expo preset and React Native Testing Library, finding elements as users do (WEB-14), and cover the few critical journeys with Maestro end-to-end flows that run in CI, for example on EAS Workflows. |
Expo, Unit testing with Jest |
specific/redis¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
REDIS-1 |
8 | Recommended | Keep the authoritative copy of cached data in a durable data store, and keep data only in Redis when you have configured persistence and replication for it on purpose. | Azure, Caching guidance: high availability and scalability | |
REDIS-2 |
8 | Recommended | Give cache entries a TTL, even a long one, unless write-through keeps them current, and set maxmemory with an eviction policy that fits the workload, such as allkeys-lru for a pure cache. |
AWS, Caching best practices | |
REDIS-3 |
7 | Recommended | Choose the write strategy per data set: cache-aside (load on a miss, invalidate on write) as the default, and write-through where readers must see a change right after the write. | Azure, Cache-Aside pattern | |
REDIS-4 |
7 | Recommended | Plan for a cold or unavailable cache: put a timeout on cache calls (OPS-3), make sure the data store can take the load of all misses or cap and shed that load, and load-test with the cache disabled. |
AWS Builders' Library, Caching challenges and strategies | |
REDIS-5 |
6 | Recommended | Protect expensive entries from cache stampedes: add random jitter to TTLs, let only one caller recompute a missing entry (request coalescing), or refresh hot entries before they expire. | AWS, Caching best practices | |
REDIS-6 |
8 | Recommended | Never call KEYS from application code, and avoid other O(N) commands on big keys: iterate with SCAN, SSCAN, HSCAN or ZSCAN, keep collections and values small, and watch the slow log. |
Redis, Keys and values: KEYS | Redis ACL command categories |
REDIS-7 |
6 | Recommended | Name keys with one schema, such as app:object-type:id[:field], with a prefix per application or tenant, and hash long natural keys instead of using them as key names. |
Redis, Keys and values: content of keys | Redis ACL command categories |
REDIS-9 |
6 | Recommended | Use Streams with consumer groups, not Pub/Sub, for messages that must not be lost. | Redis, Pub/sub: delivery semantics | |
REDIS-8 |
5 | Conditional | On Redis Cluster, put keys that one multi-key command, transaction or script uses into the same hash slot with a hash tag, such as {user:1000}:cart, and use hash tags only where you need them. |
Redis, Keys and values: hashtags | |
REDIS-10 |
9 | Strongly recommended | Set the bind directive in redis.conf to private interfaces, firewall the Redis port so that only the application hosts can reach it, and leave protected mode on. |
Redis, Security: network security | Checkov Terraform policies |
REDIS-11 |
8 | Recommended | Authenticate every client as a named ACL user with only the commands and key patterns it needs, turn off the passwordless default user, and use TLS for every connection that leaves the host. |
Redis, ACL | Checkov Terraform policies |
REDIS-12 |
7 | Recommended | Choose persistence by what losing the data would cost: none for a cache you can rebuild, RDB snapshots when losing the last minutes of writes is acceptable, and AOF plus RDB for safety close to PostgreSQL's. Copy RDB snapshots off the machine at least daily. | Redis, Persistence: what should I use | Checkov Terraform policies |
REDIS-13 |
6 | Recommended | With replication, turn on persistence on the primary and the replicas, or stop a primary without persistence from restarting automatically. | Redis, Replication: safety when the master has persistence turned off | |
REDIS-14 |
6 | Recommended | For automatic failover, run Sentinel, with at least three instances on machines that fail independently, or Redis Cluster, and design for lost writes. | Redis, Sentinel: fundamental things to know | Checkov Terraform policies |
specific/spring-boot¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
SPRING-1 |
7 | Recommended | Inject dependencies through constructors, not into fields. | Spring Boot, Spring Beans and Dependency Injection | ArchUnit GeneralCodingRules |
SPRING-2 |
6 | Recommended | Package by feature: put the main application class in a root package, give each business capability its own subpackage, and once there are several, enforce the boundaries with Spring Modulith. | Spring Boot, Structuring Your Code | Spring Modulith verification |
SPRING-3 |
9 | Strongly recommended | Keep secrets out of application.properties, application.yaml and every other file in the repository: mount them as files and import them with spring.config.import=configtree:, or load them from a secrets manager, for example with Spring Cloud Vault. |
Spring Boot, Using Configuration Trees | GitHub secret scanning push protection |
SPRING-4 |
6 | Recommended | Bind your own settings to @ConfigurationProperties classes instead of scattering @Value annotations, and annotate them with @Validated and Jakarta Bean Validation constraints, so that Spring Boot validates the values when it binds them. |
Spring Boot, @ConfigurationProperties vs. @Value | |
SPRING-5 |
9 | Strongly recommended | Declare the authorization of every request in each SecurityFilterChain: permit the public paths explicitly, require roles or authorities for the rest, and end with anyRequest().authenticated() or anyRequest().denyAll(). |
Spring Security, Authorize HttpServletRequests: matching by HTTP method | |
SPRING-6 |
9 | Strongly recommended | Expose only the Actuator endpoints you need over HTTP, and secure every exposed endpoint other than health, with Spring Security rules built on EndpointRequest or by keeping the endpoints behind a firewall. |
Spring Boot, Exposing Endpoints | CodeQL, Disabled Spring CSRF protection |
SPRING-7 |
8 | Recommended | Keep Spring Security's CSRF protection, which is on by default, for every endpoint that browsers call with cookies or HTTP Basic credentials, and exempt only paths that only non-browser clients call, such as APIs authenticated with bearer tokens, with csrf.ignoringRequestMatchers() instead of turning the protection off with csrf.disable(). |
Spring Security, When to use CSRF protection | CodeQL, Disabled Spring CSRF protection |
SPRING-8 |
7 | Recommended | Use method security (@EnableMethodSecurity with @PreAuthorize and @PostAuthorize) for checks that depend on a method's arguments or return value, such as ownership of a record, and keep a catch-all rule in the SecurityFilterChain. |
Spring Security, Method Security | |
SPRING-9 |
8 | Recommended | Manage the schema with Flyway or Liquibase migrations, which Spring Boot runs at startup, and leave spring.jpa.hibernate.ddl-auto at none or set it to validate. |
Spring Boot, Use a Higher-level Database Migration Tool | |
SPRING-10 |
7 | Recommended | Map every association with fetch = LAZY, fetch the data each use case needs up front with join fetch or an entity graph (@EntityGraph in Spring Data JPA), and set spring.jpa.open-in-view=false. |
Hibernate, Many-to-one | |
SPRING-11 |
7 | Recommended | Define transaction boundaries with @Transactional on the methods of service classes that carry out one use case across several repository calls, and call those methods from other beans. |
Spring Data JPA, Transactionality | ArchUnit GeneralCodingRules |
SPRING-12 |
7 | Recommended | On Kubernetes, point the liveness and readiness probes at /actuator/health/liveness and /actuator/health/readiness, keep checks of external systems out of the liveness group, and give the pod a preStop sleep and a termination grace period long enough for the sleep and spring.lifecycle.timeout-per-shutdown-phase. |
Spring Boot, Kubernetes Probes | |
SPRING-13 |
7 | Recommended | Instrument through Micrometer Observation, which Spring Boot uses for metrics and traces, export both over OTLP to an OpenTelemetry Collector, and set the service name with OTEL_SERVICE_NAME or management.opentelemetry.resource-attributes. |
Spring Boot, Observability: OpenTelemetry Support | |
SPRING-14 |
8 | Recommended | Run a Spring Boot generation that still has open-source support, and upgrade to the next minor release before its support ends; run it on a Java LTS release that your JDK distribution still updates. | Spring, Spring Boot support timeline | OWASP Dependency-Check |
SPRING-15 |
5 | Conditional | Enable virtual threads with spring.threads.virtual.enabled=true only on Java 21 or later, preferably Java 24 or later, and when you do, set spring.main.keep-alive=true and limit concurrency with semaphores or connection pools rather than pools of threads. |
Spring Boot, Virtual threads | |
SPRING-16 |
7 | Recommended | Test controllers with @WebMvcTest and repositories with @DataJpaTest, and run at least the repository and integration tests against the database engine you use in production, started by Testcontainers and connected with @ServiceConnection. |
Spring Boot, Auto-configured Tests |
specific/sqlite¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
SQLITE-1 |
8 | Recommended | Use SQLite where the data is on the same machine as the code that queries it and writers can take turns; choose a client/server database, such as PostgreSQL, when the data is on another machine, many processes must write at the same instant, or the data is heading for terabytes. | SQLite, Appropriate Uses: checklist for choosing the right database engine | |
SQLITE-2 |
8 | Recommended | Never share a database between processes or machines through a network file system, such as NFS or SMB. | SQLite, How To Corrupt: file systems with broken or missing lock implementations | |
SQLITE-3 |
8 | Recommended | Configure every connection in one place as soon as it opens: PRAGMA foreign_keys=ON, a busy timeout, and PRAGMA trusted_schema=OFF. |
SQLite, Foreign Key Support: enabling foreign key support | PRAGMA foreign_key_check |
SQLITE-4 |
7 | Recommended | Use WAL mode (PRAGMA journal_mode=WAL) for databases that are read while they are written, set PRAGMA synchronous=NORMAL when each connection opens, and never set synchronous=OFF for data you need to keep. |
SQLite, Write-Ahead Logging | |
SQLITE-5 |
7 | Recommended | Send all writes through one connection or a serial queue, start transactions that will write with BEGIN IMMEDIATE, and keep write transactions short. |
SQLite, Transaction: read transactions versus write transactions | |
SQLITE-6 |
9 | Strongly recommended | Bind values with SQLite's placeholders, ? or :name, through the driver's parameter API, such as the second argument of Python's execute(). |
Python, sqlite3: how to use placeholders to bind values | CodeQL, SQL query built from user-controlled sources, Ruff hardcoded-sql-expression (S608) |
SQLITE-7 |
7 | Recommended | Record the schema version in PRAGMA user_version, and when the app opens a database, apply the missing migrations in order, each in a transaction. For changes that ALTER TABLE can't make, follow SQLite's 12-step procedure for rebuilding a table and finish with PRAGMA foreign_key_check. |
SQLite, PRAGMA user_version | PRAGMA foreign_key_check |
SQLITE-8 |
6 | Recommended | Create new tables as STRICT tables once every SQLite version that opens the file is 3.37.0 or later. |
SQLite, STRICT Tables | |
SQLITE-9 |
6 | Recommended | Group related writes into one explicit transaction instead of letting each statement commit on its own. | SQLite, FAQ (19) | |
SQLITE-10 |
5 | Conditional | Index the columns that frequent queries filter, sort or join on, including the child columns of foreign keys, check plans with EXPLAIN QUERY PLAN, and run PRAGMA optimize as SQLite recommends: before closing short-lived connections, periodically on long-lived ones, and after schema changes. |
SQLite, Query Planning | |
SQLITE-11 |
8 | Recommended | Copy a live database only with the online backup API, VACUUM INTO or sqlite3_rsync, never copy the database file while a connection may be writing to it, and never delete, rename or separate it from its -wal or -journal file. |
SQLite, How To Corrupt: backup or restore while a transaction is active | |
SQLITE-12 |
6 | Recommended | Check backups and saves with PRAGMA integrity_check, or the faster quick_check, before you rely on them, and keep the previous good copy until the new one passes. |
SQLite, PRAGMA integrity_check | |
SQLITE-13 |
6 | Recommended | Treat a database file that someone else could have written, such as a shared save, a mod or a downloaded file, as untrusted input (SEC-10): keep trusted_schema off, and in security-sensitive apps run PRAGMA quick_check before any other statement, reject files that fail, and set PRAGMA cell_size_check=ON and PRAGMA mmap_size=0. |
SQLite, Defense Against The Dark Arts: untrusted SQLite database files | |
SQLITE-14 |
5 | Conditional | If the app runs SQL written by users or mods, turn on SQLITE_DBCONFIG_DEFENSIVE, lower the limits with sqlite3_limit(), and restrict what statements may do with an authorizer callback. |
SQLite, Defense Against The Dark Arts: untrusted SQL inputs |
specific/steam¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
STEAM-1 |
7 | Recommended | Upload builds from CI with steamcmd under a dedicated Steam build account that has only the Edit App Metadata and Publish App Changes To Steam permissions, and keep its login token in the CI secret store. |
Steamworks, Steam build account | |
STEAM-2 |
7 | Recommended | Let CI set builds live only on a beta branch with a password, test each build there, and set it live on the default branch by hand in Steamworks. To roll back, set the previous build live again. | Steamworks, Updating your game: uploading your update | |
STEAM-3 |
7 | Recommended | Ship updates and extra content through SteamPipe depots or DLC, not as downloads inside the game, and lay out pack files so that patches stay small: no more than about one or two GB each, grouped by level or feature, with new content in new pack files, no reordered assets or build timestamps, and compression only per asset. | Steamworks, Updating your game: best practices | |
STEAM-4 |
9 | Strongly recommended | Keep the publisher Web API key and the Encrypted App Ticket key on your servers only, never in the game or its repository, and limit each publisher key to the permissions and calling IP addresses it needs. | Steamworks, Publisher keys | |
STEAM-5 |
7 | Recommended | Identify players on your game servers and backends by verifying a Steam session ticket, not by a Steam ID that the client reports: a game server or peer passes the ticket to BeginAuthSession, and a backend sends a ticket from GetAuthTicketForWebApi to the ISteamUserAuth/AuthenticateUserTicket Web API. |
Steamworks, Authentication between clients and game servers | |
STEAM-6 |
7 | Recommended | Run in-game purchases from your server: start each one with ISteamMicroTxn/InitTxn, grant the items only after your server's FinalizeTxn call succeeds, and call GetReport at least once a day to take back the items of refunded and charged-back orders. |
Steamworks, Microtransactions: in-game purchasing | |
STEAM-7 |
7 | Recommended | Grant Steamworks permissions through groups that contain only the apps each person works on, give each person only the permissions they need, keep Administrator, Manage Users, Manage Signing and Actual Authority to a few people, and review who has them regularly. | Steamworks, Managing groups | |
STEAM-8 |
7 | Recommended | Let only servers you host set the stats, achievements and leaderboard scores that competition or rewards depend on: set the stat's Set By to Official GS and register your servers' IP ranges, and set competitive leaderboards' Writes to Trusted, so that only your server can submit scores, with the SetLeaderboardScore Web API. |
Steamworks, Define your game's stats | |
STEAM-9 |
7 | Recommended | Write Steam Cloud saves to a folder for each Steam user, such as {64BitSteamID} in an Auto-Cloud path, keep Auto-Cloud root paths Cross-Platform, split saves into small files by how often they change, and never sync machine-specific settings such as resolution or graphics quality. |
Steamworks, Steam Cloud: notes and best practices | |
STEAM-10 |
6 | Recommended | Let Steam keep stats and achievements: call SetStat whenever a stat changes and StoreStats at checkpoints and right after unlocking achievements, and don't keep a copy of them in your own files. |
Steamworks, How to use stats and achievements | |
STEAM-11 |
7 | Recommended | Make the whole game playable with a controller in its default configuration: read input as actions grouped into action sets, through the Steam Input API or your engine's action-based input (UNREAL-29, GODOT-22), show glyphs for the device in use, accept mouse and controller input at the same time, and open the on-screen keyboard with ShowGamepadTextInput or ShowFloatingGamepadTextInput when the game needs text. |
Steamworks, Compatibility checklist | |
STEAM-12 |
7 | Recommended | Save graphics settings for each device and keep them out of Steam Cloud, choose defaults for the detected hardware without hiding any setting, support aspect ratios other than 16:9 and 16:10, and match the display's resolution on first launch. | Steamworks, Getting your game ready for Steam Deck: game features | |
STEAM-13 |
7 | Recommended | Make all single-player content playable without an Internet connection, and test it offline, including the first launch on a new Steam account. | Steamworks, Getting your game ready for Steam Deck: game features | |
STEAM-14 |
6 | Recommended | Build everything the player needs into the game instead of a separate launcher, choose middleware that runs under Proton, and test the Windows build under Proton, on Linux or a Steam Deck. | Steamworks, Proton anti-cheat support | |
STEAM-15 |
7 | Recommended | Collect crash reports from players' release builds through your engine's crash reporter or a crash-reporting service, and archive the debug symbols of every build you upload, outside the depots. | Steamworks, Steam Error Reporting | |
STEAM-16 |
5 | Conditional | Sign the Windows executables, libraries and installers you ship, in the release pipeline, with one consistent signing identity, such as Azure Artifact Signing or an OV certificate, and sign after every step that changes the files, such as the Steam DRM wrapper. | Microsoft, Code signing options for Windows app developers | SignTool verify |
specific/supabase¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
SUPABASE-1 |
10 | Strongly recommended | Enable Row Level Security on every table in an exposed schema, such as public, and grant the anon and authenticated roles only the operations your app needs. |
Row Level Security | supabase test db, Supabase Advisors |
SUPABASE-2 |
9 | Strongly recommended | Never create security definer functions in an exposed schema, set search_path = '' on every one, and create views with security_invoker = true or keep them out of exposed schemas. |
Row Level Security: use security definer functions | Supabase Advisors |
SUPABASE-3 |
8 | Recommended | Write a separate policy for each operation, name its role with to authenticated or to anon, compare owner columns with (select auth.uid()), add with check to insert and update policies, and base authorisation on app_metadata, never on user_metadata, which users can change themselves. |
Row Level Security: write a policy for each operation | supabase test db, Supabase Advisors |
SUPABASE-4 |
7 | Recommended | Test the policies of every table with pgTAP: a test file per table under supabase/tests that asserts which operations each role may and may not perform, run with supabase test db on every pull request. |
Row Level Security: secure a table with RLS | supabase test db |
SUPABASE-5 |
7 | Recommended | Index every column that policies filter on, and wrap auth.uid() and auth.jwt() in a select so that Postgres evaluates them once per statement instead of once per row. |
Row Level Security: add indexes | Supabase Advisors |
SUPABASE-6 |
7 | Recommended | If you enable anonymous sign-ins, check the is_anonymous claim in restrictive policies on data that only permanent users may reach, and protect the sign-in endpoint with CAPTCHA. |
Anonymous Sign-Ins: access control | supabase test db, Supabase Advisors |
SUPABASE-7 |
7 | Recommended | Keep Storage buckets private unless every file in them may be public, control access with policies on storage.objects, for example per user folder, and give temporary access to private files with signed URLs. |
Storage Buckets: access model | supabase test db, Supabase Advisors |
SUPABASE-8 |
9 | Strongly recommended | Put only the publishable key, or the legacy anon key, in clients, and keep secret keys and the service_role key in servers and Edge Functions, out of source control. |
API keys: which key do you use? | GitHub secret scanning push protection |
SUPABASE-9 |
7 | Recommended | Check every caller of an Edge Function: keep verify_jwt on for functions that users call, and query with the client that applies their RLS policies; use the admin client, which bypasses RLS, only for work that must cross policies, and verify the signature of external webhooks. |
Securing Edge Functions: authenticated user calls | |
SUPABASE-10 |
8 | Recommended | Make every schema change, including RLS policies, grants and functions, a migration file in supabase/migrations under version control, and never change the production database directly in the dashboard. |
Deploy database migrations: working with a team | |
SUPABASE-11 |
8 | Recommended | Plan backups for your recovery point objective: Supabase backs up only paid-plan projects daily, so on the Free plan export the database regularly with supabase db dump --remote (CLI 3 dumps the local stack without --remote) and keep the copies off-site, and on paid plans enable point-in-time recovery when losing up to a day of data is too much. |
Database Backups | |
SUPABASE-12 |
7 | Recommended | Connect each runtime the way Supabase recommends: clients through the Data API, serverless and edge functions through the shared pooler in transaction mode, with prepared statements off and a pool of one connection per instance, and migrations, pg_dump and long-running backends through a direct connection or the pooler's session mode. |
Connect to your database: which connection method do you use? | |
SUPABASE-13 |
7 | Recommended | Turn on SSL enforcement and network restrictions for the database. | Production security checklist: database | |
SUPABASE-14 |
6 | Recommended | Leave the Spend Cap on, or watch the organization's usage page when it's off, so that an attack or a bug can't run up unlimited charges. | Control your costs: Spend Cap | |
SUPABASE-15 |
7 | Recommended | Configure Supabase Auth for production: turn on email confirmations, send auth email through your own SMTP server, enable CAPTCHA on sign-up, sign-in and password reset, let one-time passwords expire within an hour, and review the rate limits. | Production security checklist: Auth |
specific/svelte¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
SVELTE-1 |
7 | Recommended | Write new components in runes mode, and don't use legacy features that have modern replacements, such as $: statements, export let, on: directives, slots, and stores for shared state. |
Svelte, Best practices: avoid legacy features | Svelte compiler runes option |
SVELTE-2 |
7 | Recommended | Compute values from state and props with $derived, not by assigning state in an $effect, and keep $effect as an escape hatch for things such as analytics and direct DOM manipulation. |
Svelte, When not to use $effect | eslint-plugin-svelte |
SVELTE-3 |
7 | Recommended | Type-check .svelte files in CI with sv check (svelte-check). |
Svelte, TypeScript | sv check |
SVELTE-4 |
6 | Recommended | Share reactive state between components with $state objects or classes with $state fields, defined in .svelte.js or .svelte.ts modules, and keep stores for complex asynchronous streams or for when you need manual control over updates. |
Svelte, When to use stores | |
SVELTE-5 |
9 | Strongly recommended | Never keep user or request data in module-level variables or other shared state on the server: return it from load, pass it down as props or through context, and persist it in a database. Keep load functions free of side effects for the same reason. |
SvelteKit, Avoid shared state on the server | |
SVELTE-6 |
7 | Recommended | Load data that needs the database, the filesystem or private credentials in server load functions (+page.server.js), and use universal load functions (+page.js) only for public APIs or for values that can't be serialized. |
SvelteKit, Universal vs server: when to use which | |
SVELTE-7 |
6 | Recommended | Avoid request waterfalls: make dependent backend calls in server load functions, use the fetch that load receives, and call await parent() only after the requests that don't depend on it. |
SvelteKit, Preventing waterfalls | |
SVELTE-8 |
6 | Recommended | Implement mutations as form actions that work without JavaScript, return validation errors with fail(), and progressively enhance the form with use:enhance. |
SvelteKit, Form actions | |
SVELTE-9 |
7 | Recommended | Choose rendering per route with page options: prerender pages that every user sees the same, server-render dynamic pages, and turn off ssr only for pages that can't run on the server. |
SvelteKit, Page options | |
SVELTE-10 |
5 | Conditional | Replace adapter-auto with the adapter for your platform once you've chosen where to deploy, and host the app in the same data center as its backend. |
SvelteKit, Zero-config deployments | |
SVELTE-11 |
9 | Strongly recommended | Treat every form action, +server.js handler and remote function as a public HTTP endpoint: make sure an authorization check covers it, and validate its input on the server. |
SvelteKit, Remote functions: query arguments | |
SVELTE-12 |
9 | Strongly recommended | Declare environment variables in src/env.ts, mark one public: true only if its value may be public, and import secrets only from $app/env/private. |
SvelteKit, Environment variables | Server-only module check |
SVELTE-13 |
8 | Recommended | Check authentication in the handle hook or in each +page.server.js load function, not only in a +layout.server.js load function. |
SvelteKit, Implications for authentication | |
SVELTE-14 |
7 | Recommended | Put code that uses secrets, the database or other server-only APIs in server-only modules: files with a server segment in their name, such as db.server.ts, or files in a server directory. |
SvelteKit, Server-only modules: your modules | Server-only module check |
SVELTE-15 |
6 | Recommended | Set each page's <title> in <svelte:head>, and the lang attribute in src/app.html. |
SvelteKit, Route announcements | |
SVELTE-16 |
6 | Recommended | Fix the compiler's accessibility warnings, and silence one with <!-- svelte-ignore --> only for a false positive, with a note saying why. |
Svelte, Compiler warnings | eslint-plugin-svelte, sv check |
specific/terraform¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
TF-1 |
9 | Strongly recommended | Store state in a remote backend with locking and encryption at rest, restrict who can read it, and never commit state files. | HashiCorp, Remote state | |
TF-2 |
8 | Recommended | Give Terraform short-lived credentials, such as OIDC from the CI platform or HCP Terraform dynamic provider credentials, instead of static keys. Never put credentials in provider blocks or variables. | HashiCorp, Dynamic provider credentials | Checkov Terraform policies, Trivy Terraform scanning |
TF-3 |
7 | Recommended | Keep secrets out of state where the provider allows it, with ephemeral values and write-only arguments (Terraform 1.10 and 1.11 or later), and protect saved plan files like state. | HashiCorp, Manage sensitive data | |
TF-4 |
8 | Recommended | Split infrastructure into separate root modules, each with its own state, by environment, blast radius, rate of change and team ownership. | HashiCorp, Workspace best practices | |
TF-5 |
7 | Recommended | Give each environment its own directory, with its own backend, that calls shared modules. Don't use CLI workspaces for environments that need separate credentials or access controls. | Terraform style guide | |
TF-6 |
7 | Recommended | Rename and move resources with moved blocks, and keep old moved blocks in shared modules. |
HashiCorp, Refactor modules | |
TF-7 |
6 | Recommended | Keep the module tree flat: compose child modules in the root module and pass their dependencies in as variables. | HashiCorp, Module composition | |
TF-8 |
6 | Recommended | Write modules that do one thing well at a higher level of abstraction, not thin wrappers around a single resource. | HashiCorp, Module creation: recommended pattern | |
TF-9 |
5 | Conditional | Protect costly stateful resources, such as databases and storage, with prevent_destroy, sparingly. |
HashiCorp, lifecycle meta-argument | |
TF-10 |
8 | Recommended | Pin versions: set required_version, constrain providers with ~> in root modules but only by minimum in reusable modules, pin module versions, and commit .terraform.lock.hcl. |
HashiCorp, Version constraints: best practices | Checkov Terraform policies, Dependabot for Terraform, TFLint Terraform ruleset |
TF-11 |
8 | Recommended | Run Terraform from a pipeline: plan every change, save the plan with -out, and apply exactly that plan after review. |
HashiCorp, Running Terraform in automation | |
TF-12 |
6 | Recommended | Run terraform fmt -check, terraform validate and TFLint on every change, and test reusable modules with terraform test. |
Terraform style guide | terraform fmt -check |
TF-13 |
6 | Recommended | Check plans against security and organisation policies as code before applying them. | Terraform style guide | Checkov Terraform policies, HCP Terraform policy enforcement, Trivy Terraform scanning |
TF-14 |
5 | Conditional | Detect drift on a schedule, for example with terraform plan -detailed-exitcode or HCP Terraform health assessments. |
HashiCorp, terraform plan | HCP Terraform policy enforcement |
specific/typescript¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
TS-1 |
8 | Recommended | Keep strict on in every project, and don't turn off the checks it includes. |
TSConfig, strict | tsc |
TS-2 |
7 | Recommended | When another tool compiles your TypeScript, turn on isolatedModules, add erasableSyntaxOnly if that tool only strips types, and type-check with tsc --noEmit in CI. |
TSConfig, isolatedModules | tsc |
TS-3 |
6 | Recommended | In new projects, also turn on noUncheckedIndexedAccess and exactOptionalPropertyTypes. |
TSConfig, noUncheckedIndexedAccess | tsc |
TS-4 |
6 | Recommended | Remove the options that TypeScript 6.0 deprecated, such as baseUrl, moduleResolution: node10, target: es5 and AMD or UMD output, instead of silencing the warnings with ignoreDeprecations. |
TypeScript 6.0, Breaking changes and deprecations | tsc |
TS-5 |
7 | Recommended | Set module for the host that loads your code: nodenext when Node.js runs it, and esnext or preserve with moduleResolution: bundler when a bundler does. |
TypeScript, Modules: Theory | |
TS-6 |
7 | Recommended | Turn on verbatimModuleSyntax, and import and export types with import type and export type. |
TSConfig, verbatimModuleSyntax | tsc |
TS-7 |
7 | Recommended | Don't use any. Use unknown for values whose type you don't know, and narrow them with type guards before you use them. |
TypeScript, Do's and Don'ts: any | typescript-eslint no-explicit-any |
TS-8 |
7 | Recommended | Type data from outside the program, such as JSON.parse results, fetch responses, storage and messages, as unknown, and check it at runtime before you narrow it to your own types. Don't claim its shape with an as assertion. |
TypeScript, Erased types | typescript-eslint no-explicit-any |
TS-9 |
6 | Recommended | Model a value that can be in one of several states as a discriminated union, and make switch statements over it exhaustive with a never check. |
TypeScript, Discriminated unions | typescript-eslint switch-exhaustiveness-check |
TS-10 |
6 | Recommended | Check a library with the settings its consumers might use: module set to node18 or nodenext rather than moduleResolution: bundler, declaration on, and the lowest target you support. |
Choosing compiler options: I'm writing a library | arethetypeswrong CLI |
TS-11 |
6 | Recommended | Publish declaration files with the package and point to them from exports: put the types condition first in each entry, and give the ES module and CommonJS entry points separate declaration files. |
TypeScript, Publishing | arethetypeswrong CLI, publint rules |
TS-12 |
6 | Recommended | Give each environment, such as browser, server, worker and tests, its own tsconfig.json, and connect them, and the packages of a monorepo, with project references built by tsc --build. |
Choosing compiler options: I'm writing an app | |
TS-13 |
4 | Conditional | Turn on isolatedDeclarations only when declaration emit limits your build, as in large monorepos, or when another tool generates your declaration files. |
TypeScript 5.5, Isolated declarations |
specific/unity/code-architecture¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNITY-CODE-1 |
8 | Recommended | Keep logic that doesn't need the engine in plain C# classes, with MonoBehaviours as thin adapters. | Unity, How to architect code as your project scales | |
UNITY-CODE-2 |
7 | Recommended | Separate UI from game logic with Model-View-Presenter (or MVC). | Unity e-book, Level up your code with design patterns and SOLID | |
UNITY-CODE-4 |
4 | Conditional | Wrap player and AI actions in commands when you need undo, replay, rebinding or queuing. | Unity e-book, Level up your code with design patterns and SOLID | |
UNITY-CODE-6 |
8 | Recommended | Don't use ScriptableObjects as save-game storage. | Unity Manual, Save changes to ScriptableObject data | |
UNITY-CODE-5 |
7 | Recommended | Put designer-tunable, shared data in ScriptableObject assets, not hard-coded values or copies on every prefab. | Unity, Separate game data and logic with ScriptableObjects | |
UNITY-CODE-7 |
4 | Conditional | Use ScriptableObject-based enums when designers need to add values without code changes. | Unity, ScriptableObject-based enums | |
UNITY-CODE-8 |
8 | Recommended | Make dependencies explicit through serialized references, constructor or method injection, or a DI container (for example VContainer), rather than singletons and scene-wide Find lookups everywhere. |
Unity, Architect your code with ScriptableObjects | |
UNITY-CODE-9 |
8 | Recommended | Don't rely on the order in which Unity calls the same event function (Awake, Start, โฆ) on different objects. |
Unity Manual, Order of execution for event functions | |
UNITY-CODE-10 |
7 | Recommended | Decouple systems with events. | Unity e-book, Level up your code with design patterns and SOLID | |
UNITY-CODE-11 |
6 | Recommended | For asynchronous code, use Awaitable with async/await (Unity 2023.1+) or coroutines, and know which thread each continuation runs on. |
Unity Manual, Asynchronous programming with Awaitable | |
UNITY-CODE-12 |
5 | Conditional | For multiplayer, choose the netcode stack with the Multiplayer Center and study Boss Room before designing your own architecture. | Multiplayer Center | |
UNITY-CODE-13 |
5 | Conditional | Choose the UI system (UI Toolkit or uGUI) per use case using Unity's comparison. | Unity Manual, Comparison of UI systems | |
UNITY-CODE-14 |
4 | Conditional | Choose the Entities package (DOTS/ECS) deliberately for large simulations. | Entities package manual | |
UNITY-CODE-15 |
6 | Recommended | For screen reader support, build an accessibility hierarchy with Unity's Accessibility module: an AccessibilityNode with a label, role and state for each element that players read or use, set as AssistiveSupport.activeHierarchy while that UI is shown, and kept in sync with the UI, including each node's screen position, in your own code. |
Unity Manual, Introduction to the Accessibility module |
specific/unity/content-and-performance¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNITY-PERF-1 |
8 | Recommended | Profile with the Unity Profiler connected to a build running on the target device, early and before and after every optimisation, not only in the Editor. | Unity, Ultimate guide to profiling | Unity Performance Testing package |
UNITY-PERF-2 |
8 | Recommended | Pair every Addressables load with a release. | Addressables, Release assets from memory | |
UNITY-PERF-3 |
8 | Recommended | Avoid managed allocations in per-frame code paths to prevent garbage-collector spikes. | Unity Manual, Optimizing managed memory | Microsoft.Unity.Analyzers, Unity Project Auditor, Code view |
UNITY-PERF-4 |
7 | Recommended | Keep the Resources folder for prototypes and small bootstrap data. Load game content through Addressables (or AssetBundles). |
Unity Manual, Load resources at runtime | |
UNITY-PERF-5 |
6 | Recommended | Pool objects that are created and destroyed often, such as projectiles, effects and UI list items, using UnityEngine.Pool. |
Unity Scripting API, ObjectPool | |
UNITY-PERF-6 |
7 | Recommended | Localize with the Unity Localization package: keep text in String Tables, make entries that insert values or counts Smart Strings, which take named placeholders and choose plural forms by the CLDR rules, and swap language-specific textures, audio and other assets through Asset Tables. | Unity, Localization package |
specific/unity/project-structure¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNITY-STRUCT-1 |
7 | Recommended | Agree on one folder structure and naming convention, write it down, and keep your own assets separate from third-party assets. | Unity, Best practices for organizing your Unity project | |
UNITY-STRUCT-2 |
6 | Recommended | Know Unity's reserved folder names (Editor, Resources, StreamingAssets, Plugins, โฆ) and use them only for their purpose. |
Unity Manual, Special folder names | |
UNITY-STRUCT-3 |
6 | Recommended | Agree on a team C# style guide, starting from Unity's example and adapting it. Apply it consistently, and enforce formatting with an EditorConfig file. | C# style guide e-book (Unity 6 edition) | dotnet format |
UNITY-STRUCT-4 |
7 | Recommended | Split code into assemblies with Assembly Definition files once the project grows. | Unity Manual, Introduction to assemblies | Unity compiler with assembly definitions |
UNITY-STRUCT-5 |
7 | Recommended | Mirror the architecture in assemblies, for example Game.Core (no engine-specific dependencies where practical), Game.Gameplay, Game.UI, Game.Editor and *.Tests, so that wrong-way references fail to compile. |
Unity Manual, Assembly definitions | Unity compiler with assembly definitions |
UNITY-STRUCT-6 |
4 | Conditional | Move systems that several projects share into custom UPM packages that follow the standard package layout. | Unity Manual, Creating custom packages | |
UNITY-STRUCT-7 |
10 | Strongly recommended | Keep .meta files visible and committed, and keep asset serialization on Force Text, so that assets diff and merge. |
Unity Manual, Version control settings | |
UNITY-STRUCT-8 |
9 | Strongly recommended | Start from the Unity.gitignore template in github/gitignore, which ignores generated folders such as Library/ and Temp/. |
github/gitignore, Unity.gitignore | |
UNITY-STRUCT-9 |
6 | Recommended | Configure UnityYAMLMerge (Smart Merge) as the merge tool for scenes and prefabs. | Unity Manual, Smart Merge | |
UNITY-STRUCT-10 |
5 | Conditional | Enter Play mode without domain reload for faster iteration. | Unity Manual, Domain reloading | Unity Project Auditor, domain reloading issues |
specific/unity/rendering¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNITY-GFX-1 |
9 | Strongly recommended | Start new projects on the Universal Render Pipeline (URP), and choose HDRP only for a PC or console project that needs its high-end features. Don't start a new title on the Built-in Render Pipeline. | Unity, Render pipelines strategy for 2026 | |
UNITY-GFX-2 |
7 | Recommended | In URP and HDRP, follow Unity's draw-call recommendations: enable the SRP Batcher and the GPU Resident Drawer, turn off static batching and the materials' Enable GPU Instancing checkbox, share materials, and use Material Variants rather than MaterialPropertyBlock for objects that differ only in property values. |
Unity Manual, Choose a method for optimizing draw calls | |
UNITY-GFX-3 |
7 | Recommended | Write custom shaders in Shader Graph by default, bring in hand-written HLSL through Custom Function nodes, and keep any fully hand-written URP or HDRP shader compatible with the SRP Batcher. | Unity, Introduction to URP for advanced creators | Unity Project Auditor, Shaders view |
UNITY-GFX-4 |
7 | Recommended | Declare keywords that only materials set with shader_feature_local (in Shader Graph, keep the keyword's default Shader Feature definition), keep multi_compile for branches that C# switches at run time, and use dynamic_branch for simple, balanced branches on fast GPUs. |
Unity Manual, How Unity compiles branching shaders | Unity Project Auditor, Shaders view |
UNITY-GFX-5 |
7 | Recommended | Strip the shader variants the build doesn't need, and check the count after every build: turn on Strip Unused Variants and Strip Unused Post Processing Variants in the URP Graphics settings, turn off unused features in every URP asset the build includes, remove keywords in Shader Build Settings (Unity 6.3 LTS and later), and strip the rest with IPreprocessShaders. |
Unity Manual, Reduce shader variants | Unity build log, shader variant counts, Unity Project Auditor, Shaders view |
UNITY-GFX-6 |
7 | Recommended | On DirectX 12, Vulkan and Metal, record the pipeline state objects (PSOs) the game uses into a GraphicsStateCollection from a development build, one collection per graphics API and platform, ship the collections, and warm them up during loading screens with WarmUp or WarmUpProgressively. |
Unity Manual, Introduction to PSO tracing and warming | |
UNITY-GFX-7 |
7 | Recommended | Set texture import settings for each platform in the platform overrides: ASTC on mobile, XR and the web, BC7, DXT or BC6H on desktop, the lowest Max Size that looks acceptable, and Read/Write off. Apply them through presets, so that new imports get them automatically. | Unity e-book, Optimize performance for mobile, XR and web games | |
UNITY-GFX-8 |
6 | Recommended | Give meshes that are seen at varying distances levels of detail: generate Mesh LODs on import (Unity 6.2 and later) to cut triangles at little memory cost, and use LOD Groups where a lower level must also cut materials or draw calls, or needs explicit transition sizes. | Unity Manual, Introduction to level of detail | |
UNITY-GFX-9 |
6 | Recommended | Inspect batching in the Frame Debugger and GPU cost in the Rendering Debugger, both of which can also inspect a built player. | Unity Manual, Troubleshoot the SRP Batcher |
specific/unity/testing¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNITY-TEST-1 |
8 | Recommended | Inject dependencies into the plain C# classes that hold the logic, so that Edit Mode tests can substitute fakes. | Unity, How to architect code as your project scales | |
UNITY-TEST-2 |
7 | Recommended | Run the tests from the command line in batch mode as part of the build, so CI runs them on every change. | Unity Test Framework, Run tests from the command line | GameCI Unity Test Runner |
UNITY-TEST-3 |
7 | Recommended | Write plain NUnit [Test] tests in Edit Mode for logic that doesn't need Play mode, and use [UnityTest] Play Mode tests for runtime behaviour that spans frames or needs a scene. |
Unity Test Framework, Edit Mode vs. Play Mode tests | |
UNITY-TEST-4 |
7 | Recommended | Put tests in their own test assemblies that reference the assemblies under test. | Unity Test Framework, Edit Mode vs. Play Mode tests |
specific/unreal/code-architecture¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNREAL-1 |
9 | Strongly recommended | Hold UObject references that must keep their target alive in UPROPERTY members, preferably TObjectPtr, and use TWeakObjectPtr for references that must not. |
Unreal Object Handling | PVS-Studio V1100 |
UNREAL-2 |
8 | Recommended | Put match rules in the game mode, which exists only on the server, state that all players need in the game state, per-player state in the player state, and anything that must survive a level change in the game instance or its subsystems. | Gameplay Framework | |
UNREAL-3 |
7 | Recommended | Write core systems, high-frequency logic and data-heavy work in C++ base classes, and expose a small API that designers extend in Blueprint subclasses. | Exposing C++ to Blueprints | |
UNREAL-4 |
7 | Recommended | Put game-wide services in subsystems (UGameInstanceSubsystem, ULocalPlayerSubsystem, UEngineSubsystem or UEditorSubsystem) instead of adding them to a custom game instance or overriding engine classes. |
Programming Subsystems | |
UNREAL-23 |
7 | Recommended | Don't poll for changes on Tick: run occasional logic from events, delegates or timers, give logic that must repeat but not every frame a tick interval, and turn ticking off on Actors and components that don't need it. | Unreal Engine, Common Memory and CPU Performance Considerations | |
UNREAL-24 |
5 | Conditional | Represent statuses, object types and gameplay events as hierarchical Gameplay Tags of the form Movement.Mode.Swimming, registered in .ini tag lists or as native tags in C++. |
Unreal Engine, Using Gameplay Tags | |
UNREAL-6 |
5 | Conditional | Use the Gameplay Ability System for games built around many abilities, attributes and status effects, especially multiplayer ones. | Understanding the Gameplay Ability System | |
UNREAL-25 |
5 | Conditional | Model AI and other state-driven logic, such as game flow, in StateTree, Epic's general-purpose hierarchical state machine, or, for AI, in Behavior Trees with a Blackboard. | Unreal Engine, StateTree Overview | |
UNREAL-26 |
7 | Recommended | Put designer-tunable data in Data Tables, whose rows are C++ structs and which designers can import from CSV or JSON files, or in Data Assets, and make content that the Asset Manager loads on demand a Primary Data Asset. | Unreal Engine, Data Driven Gameplay Elements | |
UNREAL-27 |
7 | Recommended | Save games through your own USaveGame subclasses, with separate classes for globally unlocked features and for each playthrough's data, and save with AsyncSaveGameToSlot during play. |
Unreal Engine, Saving and Loading Your Game | |
UNREAL-28 |
6 | Recommended | Choose how Blueprints communicate by the relationship between them: a direct reference for one Actor talking to one specific other, an event dispatcher to tell any number of listeners that something happened, and a Blueprint Interface to call the same function on unrelated classes that each respond in their own way. | Unreal Engine, Blueprint Communication Usage | |
UNREAL-29 |
6 | Recommended | Handle player input with Enhanced Input: an Input Action for each thing the player can do, Input Mapping Contexts that you add, remove and prioritize as the player's situation changes, and Player Mappable Input Configs for control presets. | Unreal Engine, Enhanced Input | |
UNREAL-30 |
5 | Conditional | Keep game logic out of UMG widgets: give widgets their data through viewmodels and View Bindings (the UMG Viewmodel plugin, in Beta), which update a widget only when a value changes, and set the Property Binding Rule to Prevent so that nobody adds legacy property bindings. | Unreal Engine, UMG Viewmodel | UMG Viewmodel, Property Binding Rule |
UNREAL-45 |
5 | Conditional | If players need a screen reader, turn on Unreal's accessibility support with Accessibility.Enable=1, set the Accessibility options of each UMG widget, such as Accessible Behavior, and choose how it's read: by third-party screen readers on Windows and VoiceOver on iOS, or by the Slate Screen Reader plugin, which reads focused Slate and UMG widgets aloud with the engine's text-to-speech. |
Unreal Engine, Supporting Screen Readers | |
UNREAL-8 |
8 | Recommended | Keep the server authoritative: clients request actions through Server RPCs, and the server validates them before it changes any state. | Networking Overview | |
UNREAL-9 |
7 | Recommended | Prefer replicated properties with RepNotify to RPCs, use multicast RPCs sparingly, and make frequently called RPCs unreliable. | Networking Overview, networking tips | |
UNREAL-31 |
4 | Conditional | In games with many players and many replicated Actors, decide what each client receives with the Replication Graph, and evaluate Iris, which is still Experimental, before relying on it. | Unreal Engine, Replication Graph |
specific/unreal/content-and-performance¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNREAL-10 |
8 | Recommended | Reference assets that aren't always needed with soft references (TSoftObjectPtr, TSoftClassPtr), and load them asynchronously. |
Referencing Assets | |
UNREAL-11 |
8 | Recommended | Profile early and often on the target hardware, with Unreal Insights. | Introduction to Performance Profiling and Configuration | |
UNREAL-12 |
6 | Recommended | Register the content you load on demand, such as levels and data assets, as primary assets with the Asset Manager, and use asset bundles to control which secondary assets load with them. | Asset Management | |
UNREAL-32 |
6 | Recommended | Keep garbage-collection hitches out of gameplay: pool Actors that are spawned and destroyed often when the CPU budget is tight, and collect garbage manually where a spike is tolerable, such as behind a loading screen. | Unreal Engine, Common Memory and CPU Performance Considerations | |
UNREAL-33 |
6 | Recommended | Find out what an asset pulls into memory with the Reference Viewer and its Size Map, and track memory at run time on each target platform with the Low-Level Memory Tracker and Memory Insights. | Unreal Engine, Reference Viewer | |
UNREAL-34 |
5 | Conditional | Build large open worlds with World Partition, which stores the world in one level divided into grid cells and streams the cells by distance, instead of dividing the map into sublevels and streaming them by hand. | Unreal Engine, World Partition | |
UNREAL-13 |
6 | Recommended | Turn content rules, such as naming conventions and size or performance budgets, into Data Validation rules, and run the DataValidation commandlet in CI. |
Data Validation | Data Validation commandlet |
UNREAL-16 |
7 | Recommended | Keep all user-facing text in FText, created from text properties in assets, LOCTEXT macros in C++ or String Tables, and build messages with FText::Format and its plural, ordinal and gender argument modifiers. |
Unreal Engine, Text Localization |
specific/unreal/project-structure¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNREAL-5 |
7 | Recommended | Split code into modules with explicit dependencies in their Build.cs files: keep editor-only code in Editor modules, and prefer private dependencies to public ones. |
Unreal Engine Modules | Unreal Build Tool, module dependencies |
UNREAL-7 |
5 | Conditional | Build optional or frequently changing features as Game Feature plugins, so that unrelated features can't depend on each other by accident. | Game Features and Modular Gameplay | |
UNREAL-35 |
6 | Recommended | Agree on an asset naming convention early in development, starting from Epic's [AssetTypePrefix]_[AssetName]_[Descriptor]_[OptionalVariantLetterOrNumber] scheme, and keep each person's experiments in their own Developers folder, which no asset outside it may reference. |
Unreal Engine, Recommended Asset Naming Conventions | |
UNREAL-36 |
5 | Conditional | After moving or renaming assets, fix up the redirectors they leave behind, in the Content Browser or with the ResavePackages commandlet and -fixupredirects, and submit the resaved packages. |
Unreal Engine, Asset Redirectors | |
UNREAL-37 |
7 | Recommended | Start from the UnrealEngine.gitignore template in github/gitignore, which ignores Binaries/, Intermediate/, Saved/ and DerivedDataCache/, or, with Perforce, from Epic's example .p4ignore. |
github/gitignore, UnrealEngine.gitignore | |
UNREAL-38 |
7 | Recommended | Connect the editor to revision control, and turn on its automatic checkout or checkout prompt on modification, so that assets are checked out, and with that locked, before anyone changes them. | Unreal Engine, Source Control | |
UNREAL-15 |
7 | Recommended | Keep One File Per Actor on (the default with World Partition), so that several people can change actors in the same level at once. | Unreal Engine, One File Per Actor | |
UNREAL-39 |
5 | Conditional | Script CI builds, cooks and tests with BuildGraph, and give artists and designers the editor binaries that CI builds, for example through Unreal Game Sync with Perforce, so that they don't have to compile. | Unreal Engine, BuildGraph | |
UNREAL-40 |
5 | Conditional | Iterate on C++ with Live Coding, which is on by default and is significantly faster and more flexible than Hot Reload, and keep Object Reinstancing on so that structural changes reach existing objects. | Unreal Engine, Live Coding |
specific/unreal/rendering¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNREAL-17 |
8 | Recommended | Keep PSO precaching on, hold the first loading screen until FShaderPipelineCache::NumPrecompilesRemaining() reaches zero, and test first-run smoothness with -clearPSODriverCache. |
Unreal Engine, PSO Precaching | PSO precache validation |
UNREAL-19 |
7 | Recommended | Build materials as a few parameterized parent materials, create the variations as Material Instances, and use Material Instance Dynamic only for values that change at run time. | Unreal Engine, Material Instances | |
UNREAL-20 |
7 | Recommended | Keep material permutations down: use few static switch parameters and few combinations of them across instances, and keep usage flags to the kinds of mesh a material is really used on, because each combination and each flag compiles more shaders. | Unreal Engine, Material Instances: static parameters | |
UNREAL-21 |
7 | Recommended | Decide for each target platform, before content production starts, whether to use Nanite and Lumen. | Unreal Engine, Nanite Virtualized Geometry | |
UNREAL-22 |
7 | Recommended | Set rendering quality for each platform and device in Config/DefaultDeviceProfiles.ini, through the scalability groups (sg.*) and console variables, and test every quality level on low-, mid- and high-spec hardware. |
Unreal Engine, Setting Up Device Profiles | |
UNREAL-18 |
6 | Recommended | Give the team a shared Derived Data Cache, so that each shader and other derived asset is built once for everyone: a Zen Storage Server or a network drive for people in one office, and Unreal Cloud DDC for a distributed team. | Unreal Engine, Using Derived Data Cache: Shared DDC |
specific/unreal/testing¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
UNREAL-14 |
7 | Recommended | Write automated tests with the Automation Test Framework, use Low-Level Tests for pure unit tests, and run both from the command line in CI. | Automation Test Framework | Gauntlet RunUnreal |
UNREAL-42 |
6 | Recommended | Follow Epic's test design guidelines: don't assume the state of the game or the editor, because tests can run in any order or in parallel on several machines, leave files on disk as you found them, and mark a test as a Smoke test only if it finishes within a second. | Unreal Engine, Automation Test Framework: test design guidelines | |
UNREAL-43 |
6 | Recommended | Run boot tests and automation tests on packaged builds for each target platform with Gauntlet, not only in the editor. | Unreal Engine, Gauntlet Automation Framework | Gauntlet RunUnreal |
UNREAL-41 |
5 | Conditional | Write tests for code that needs engine systems as Automation Spec or CQTest tests rather than with the plain automation test macros, and test gameplay that spans frames or needs a level with Functional Tests, Actors placed in a test level. | Unreal Engine, Automation Test Framework | |
UNREAL-44 |
4 | Conditional | Catch rendering regressions with screenshot comparison tests: place Functional Screenshot Test Actors in test levels, turn off noisy rendering features, set a tolerance, and review differences in the Screenshot Comparison browser. | Unreal Engine, Screenshot Comparison Tool |
specific/vue¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
VUE-1 |
8 | Recommended | Never mutate props, including nested properties of object props: emit an event so that the parent changes its own state, or use defineModel() for two-way binding. |
Vue.js, One-way data flow | eslint-plugin-vue |
VUE-2 |
7 | Recommended | Write application components as Single-File Components with the Composition API and <script setup>. |
Vue.js, Which to choose? | eslint-plugin-vue |
VUE-3 |
7 | Recommended | Derive values with computed, keep computed getters free of side effects, and use watchers only for side effects in reaction to state changes. |
Vue.js, Computed properties: best practices | eslint-plugin-vue |
VUE-4 |
7 | Recommended | Declare props and emitted events with types, such as defineProps<Props>(), and type-check .vue files in CI with vue-tsc. |
Vue.js, Using Vue with TypeScript | eslint-plugin-vue, vue-tsc |
VUE-5 |
6 | Recommended | Extract reusable stateful logic into composables: name them useX, accept refs or getters and read them with toValue(), return a plain object of refs, and call them synchronously in <script setup> or setup(). |
Vue.js, Composables: conventions and best practices | |
VUE-6 |
9 | Strongly recommended | In server-rendered apps, never keep user or request data in module-level state: create the app, router and stores for each request, and in Nuxt keep shared state in useState or Pinia, not in refs exported from a module. |
Vue.js, Cross-request state pollution | |
VUE-7 |
7 | Recommended | Use Pinia for state that many components share, instead of hand-rolled global reactive() objects. |
Vue.js, State management: Pinia | |
VUE-8 |
7 | Recommended | In Nuxt, load the data a page renders with useFetch or useAsyncData, keep $fetch for requests that user events trigger, and use pick or transform to keep only the fields the page renders. |
Nuxt, The need for useFetch and useAsyncData | |
VUE-9 |
6 | Recommended | Render the same output on the server and in the browser: use SSR-safe composables, keep browser-only code in onMounted() or <ClientOnly>, and don't render values that differ between the two, such as the current time. |
Nuxt, Nuxt and hydration | |
VUE-10 |
7 | Recommended | Use server-side rendering or static generation, for example with Nuxt, when page load performance or SEO matters, and a client-side SPA only when they don't. In Nuxt, set the rendering mode per route with routeRules. |
Vue.js, Performance: choosing the right architecture | |
VUE-11 |
7 | Recommended | Lazy-load route components with dynamic imports. | Vue.js, Code splitting | |
VUE-12 |
6 | Recommended | Put an element with tabindex="-1" at the top of App.vue, just before a skip link to the main content, and focus it in a watcher on Vue Router's current route. |
Vue.js, Accessibility: skip link | |
VUE-13 |
9 | Strongly recommended | Never use untrusted content as a Vue template, and never mount Vue on server-rendered HTML that contains user-provided content. | Vue.js, Security: Rule No.1 | |
VUE-14 |
9 | Strongly recommended | Give an environment variable the VITE_ prefix, or put a value in Nuxt's runtimeConfig.public, only if it may be public. |
Vite, Env variables | |
VUE-15 |
6 | Recommended | Run unit and component tests with Vitest, give each component its own component test, and in those tests interact with the component as a user would instead of mocking its child components. | Vue.js, Testing: component testing |
specific/web¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
WEB-2 |
9 | Strongly recommended | Use native HTML elements, such as button, a, input and select, before ARIA. |
MDN, ARIA | axe-core rules |
WEB-3 |
7 | Recommended | Run automated accessibility checks, such as axe-core, in CI and in end-to-end tests. | axe-core | axe-core rules |
WEB-22 |
6 | Recommended | After each client-side navigation in a single-page app, change the document's <title> to describe the new view, and move focus to the new content, such as its main heading, or announce the new page to screen readers. |
W3C, Understanding WCAG 2.2 SC 2.4.2 Page Titled | |
WEB-4 |
7 | Recommended | Measure Core Web Vitals from real users at the 75th percentile, separately for mobile and desktop, and set priorities from that field data. | web.dev, Web Vitals | Lighthouse CI |
WEB-5 |
7 | Recommended | Ship less JavaScript: split off code that the first render doesn't need, remove unused code, and use Baseline platform features instead of JavaScript reimplementations. | web.dev, The most effective ways to improve Core Web Vitals | Lighthouse CI, Size Limit |
WEB-6 |
7 | Recommended | Give every image and embed explicit dimensions, offer sizes that fit the layout with srcset and sizes, and lazy-load only images outside the initial viewport. |
web.dev, The most effective ways to improve Core Web Vitals | Lighthouse CI |
WEB-7 |
7 | Recommended | Put a content hash or version in the URLs of static assets and cache them for a long time with immutable, and serve HTML with Cache-Control: no-cache (plus private when it's personalised) so that it's always revalidated. |
MDN, HTTP caching | |
WEB-8 |
9 | Strongly recommended | Render untrusted data through the framework's automatic escaping or textContent, and sanitize it with DOMPurify before it reaches an HTML sink such as innerHTML or React's dangerouslySetInnerHTML. |
OWASP, Cross Site Scripting Prevention | eslint-plugin-astro, eslint-plugin-no-unsanitized |
WEB-9 |
7 | Recommended | Send security headers with every response: Strict-Transport-Security, X-Content-Type-Options: nosniff, a Referrer-Policy, and the CSP frame-ancestors directive against framing. |
OWASP, HTTP Headers | HTTP Observatory CLI |
WEB-10 |
7 | Recommended | Add a strict, nonce- or hash-based Content Security Policy as a second layer of defence against XSS, and try it in Content-Security-Policy-Report-Only mode before enforcing it. |
OWASP, Content Security Policy | HTTP Observatory CLI |
WEB-11 |
6 | Recommended | Load third-party scripts with Subresource Integrity, or serve your own reviewed copies. | MDN, Subresource Integrity | HTTP Observatory CLI |
WEB-12 |
6 | Recommended | Choose a Baseline target, such as Baseline Widely available, from your users' browser data, and set it once in Browserslist so that build and lint tools share it. | web.dev, How to choose your Baseline target | @eslint/css use-baseline, eslint-plugin-compat |
WEB-13 |
5 | Conditional | Build core user journeys with progressive enhancement: HTML that works on its own first, then CSS and JavaScript that enhance it, so that a script that fails to load doesn't stop users. | GOV.UK Service Manual, Building a robust frontend using progressive enhancement | |
WEB-14 |
7 | Recommended | Find elements in tests the way users find them: by role and accessible name first, then by label or text, and by test ID only when nothing visible identifies the element. | Testing Library, About Queries: Priority | eslint-plugin-playwright no-wait-for-timeout, eslint-plugin-testing-library no-container |
WEB-15 |
7 | Recommended | Never wait for a fixed time in a test: use actions that wait automatically and assertions that retry until the page reaches the expected state, such as Playwright's await expect(locator).toBeVisible() or Testing Library's findBy queries. |
Playwright, page.waitForTimeout |
eslint-plugin-playwright no-wait-for-timeout |
WEB-16 |
7 | Recommended | Isolate every test: run it in a fresh browser context, let it build the state and data it needs instead of relying on earlier tests, and when tests change server-side state, give each parallel worker its own user account. | Playwright, Isolation | Vitest sequence.shuffle |
WEB-17 |
7 | Recommended | Run the end-to-end tests in CI on every pull request, in each browser engine you support, and keep a trace of every failure. | Playwright, Best Practices | |
WEB-18 |
7 | Recommended | Treat a flaky test as a bug: quarantine it outside the blocking pipeline, file a bug for it, and fix it within a set time. | Fowler, Eradicating Non-Determinism in Tests | Playwright failOnFlakyTests |
WEB-19 |
6 | Recommended | Test components in a real browser, for example with Vitest Browser Mode, and keep end-to-end tests to the few user journeys that carry the product's core value. | Vitest, Component Testing: Why Browser Mode? | |
WEB-20 |
6 | Recommended | Mock HTTP at the network level, for example with Mock Service Worker, instead of mocking fetch or your API client modules, and make requests without a handler fail the test. |
Vitest, Mocking Requests | Mock Service Worker onUnhandledFrame |
WEB-21 |
5 | Conditional | Keep visual comparison (screenshot) tests to a few stable pages and components, hide dynamic content such as dates, and create and compare the screenshots in the same environment, with the same operating system and browser versions. | Playwright, Visual comparisons |
specific/web-games¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
WEBGAME-1 |
8 | Recommended | Before you choose a scripting language, renderer or plugins, check what the engine's web export supports. | Godot, Exporting for the Web | |
WEBGAME-2 |
7 | Recommended | Serve the engine's precompressed build files over HTTPS with the matching Content-Encoding header, gzip for .gz and br for .br files, and serve .wasm files as application/wasm. |
Unity, Deploy a Web application | |
WEBGAME-3 |
7 | Recommended | Export without threads unless you control the headers of every page that hosts the game. | Godot, Exporting for the Web | |
WEBGAME-4 |
6 | Recommended | Ship GPU texture formats for both desktop and mobile browsers: in Unity, make two builds, one with DXT for desktop and one with ASTC for mobile browsers, and in Godot, turn on VRAM texture compression for both desktop and mobile in the web export preset. | Unity, Texture compression in Web | |
WEBGAME-5 |
8 | Recommended | Set a download budget for the first load and for the whole game, from the portals and devices you target, and check every build against it. | Poki, Choosing your web game engine | Lighthouse CI |
WEBGAME-6 |
7 | Recommended | Download only what the first scene needs before play starts, load the rest per scene in the background, and let the engine cache downloaded files on the player's device. | Unity, Reduce Web startup time with progressive asset loading | |
WEBGAME-7 |
7 | Recommended | When the page becomes hidden, pause the game, suspend the AudioContext and save progress. |
MDN, Page Visibility API: policies for background pages | |
WEBGAME-8 |
6 | Recommended | If you write your own game loop, drive it with requestAnimationFrame, request the next frame before doing the frame's work, and advance the fixed time step of GAMEDEV-1 from the callback's timestamp. |
MDN, Anatomy of a video game | |
WEBGAME-9 |
7 | Recommended | Start audio from the player's first click, tap or key press, for example on a "tap to play" screen, and resume the AudioContext from a later tap whenever it is suspended or interrupted. |
MDN, Web Audio API best practices: autoplay policy | |
WEBGAME-10 |
7 | Recommended | Handle mouse, touch and pen with Pointer Events on the game canvas, set touch-action: none on the canvas only, and if the game runs in mobile browsers, give it touch controls and a layout for each orientation it supports. |
MDN, Pointer events: touch-action | |
WEBGAME-11 |
6 | Recommended | Read gamepads by polling navigator.getGamepads() once per frame, ask the player to press a button before expecting a controller to appear, and let players remap buttons when a gamepad's mapping isn't "standard". |
MDN, Using the Gamepad API | |
WEBGAME-12 |
6 | Recommended | Request fullscreen and pointer lock only from a click or key-press handler, handle a refusal, and check that the page embedding the game allows them. | MDN, requestFullscreen(): security considerations | |
WEBGAME-13 |
8 | Recommended | Store saves in IndexedDB rather than localStorage, request persistent storage when the player first saves, and keep a copy of progress that matters on a server, such as a portal's cloud save or your own backend. |
web.dev, Storage for the web | ESLint no-restricted-globals |
WEBGAME-14 |
6 | Recommended | If you publish on web game portals, integrate each portal's SDK and meet its technical requirements from the start: report loading and gameplay events, show ads only through the portal's SDK, and bundle every asset into the build. | Poki, Requirements | |
WEBGAME-15 |
7 | Recommended | Free GPU resources explicitly when a level or scene ends: in three.js, call dispose() on geometries, materials, textures and render targets, and in Phaser, remove assets that only the finished scene used. |
three.js manual, How to dispose of objects | |
WEBGAME-16 |
6 | Recommended | Profile web builds in the browser on the slowest device you support, and move heavy work that doesn't draw, such as pathfinding or procedural generation, to Web Workers. | Chrome DevTools, Analyze runtime performance |
specific/web-hosting¶
| ID | Score | Level | Rule | Source | Checked by |
|---|---|---|---|---|---|
HOST-1 |
7 | Recommended | Run code that queries a regional database or API in the same region as that backend, and keep edge execution for work that doesn't need it, such as redirects, rewrites, headers and geolocation. | Vercel, Configuring regions for Vercel Functions | |
HOST-2 |
6 | Recommended | Start new projects on each platform's recommended compute: the Node.js runtime on Vercel, and Workers with static assets on Cloudflare. | Vercel, Edge Runtime | |
HOST-3 |
6 | Recommended | Keep each request well within the platform's duration, CPU, memory and payload limits, and move long or retryable work to background functions, queues or workflows. | Vercel, Functions limits | |
HOST-4 |
8 | Recommended | Keep request and user data out of module-level variables and the local file system, and keep durable state in managed storage, such as a database, key-value store or blob store. | Cloudflare, Do not store request-scoped state in global scope | |
HOST-5 |
7 | Recommended | Connect to relational databases through connection pooling built for the platform: Hyperdrive on Cloudflare Workers, and on Vercel a pool created once per instance and registered with attachDatabasePool. |
Cloudflare, Use Hyperdrive for external database connections | |
HOST-6 |
7 | Recommended | Set CDN caching deliberately on function responses: a shared-cache lifetime with s-maxage or CDN-Cache-Control, stale-while-revalidate where slightly stale content is acceptable, and private or no-store on per-user responses. |
Vercel, Cache-Control headers | |
HOST-7 |
6 | Recommended | Tag cached responses with cache tags, and purge or invalidate them by tag when the underlying content changes. | Vercel, Cache tags | |
HOST-8 |
8 | Recommended | Store credentials only as the platform's secret variables: Vercel Secret environment variables, Netlify variables marked as containing secret values, and Cloudflare secrets. Never put them in plain variables or in vercel.json, netlify.toml or Wrangler files. |
Vercel, Config and Secret environment variables | Netlify secret scanning |
HOST-9 |
8 | Recommended | Give production its own secrets and data stores, and don't let preview or development deployments use them. | Vercel, Environment variables: environments | Vercel Separate Production Secret Values |
HOST-10 |
7 | Recommended | Keep platform configuration in files in the repository, such as vercel.json, netlify.toml or the Wrangler configuration, and treat them as the source of truth instead of changing settings in the dashboard. |
Vercel, Project configuration | |
HOST-11 |
7 | Recommended | Keep preview deployments private: check that Vercel Deployment Protection or Netlify's private previews cover them, and put Cloudflare Access in front of Workers previews and Pages preview deployments, which are public by default. | Vercel, Deployment Protection | |
HOST-12 |
7 | Recommended | Recover from a bad release by rolling back to the previous production deployment, and keep data and schema changes backward compatible so that the previous version still works. | Vercel, Instant Rollback | |
HOST-13 |
7 | Recommended | Send logs and traces to an external observability service with a log drain or OpenTelemetry export, because the platforms keep runtime logs only for hours or days. | Vercel, Runtime Logs: limits |
Retired IDs¶
These IDs belonged to rules that were removed. They are not reused.
REACT-12: Track Core Web Vitals as the user-facing performance budget.UNITY-CODE-3: Model complex behaviour, such as characters, AI and game flow, with the State pattern instead of growingswitchstatements.WEB-1: Target WCAG 2.2 Level AA as the minimum for every page and component.