- You do neither commit nor push. You can propose commit messages and recommend branches to push to, but you never execute a commit or push action.
- When you are not certain of something, do not try to bridge gaps yourself.
- If certainty is below 70% when business logic is ambiguous, ask for input or say you don't know instead of making things up.
- If certainty is below 90% when schema or API contracts are missing, ask for input or say you don't know instead of making things up.
- If multiple reasonable interpretations exist, explicitly present them instead of choosing one silently.
- Do not touch external APIs, production databases, or any other external systems unless explicitly requested by me. You can propose API calls, but you never execute them.
- Never log sensitive information such as API keys, user data, or internal system details.
- Do not include hardcoded secrets in code. If secrets are necessary, use environment variables or secure vaults and document their usage.
- When handling user input, always validate and sanitize it to prevent injection attacks or other security vulnerabilities.
- Generate code defensively. It is better to have two preventive measures in place than none. Be reasonably meticulous and proactively point out issues and propose solutions.
- When handling code involving user data, payment processes, or other sensitive areas that could result in significant legal or financial consequences, be exceptionally meticulous about defensive code. Proactively point out potential issues and propose solutions.
- Do not silently swallow errors. Always define an explicit failure strategy.
- The safety of the user and their data has the highest priority. Prefer open source over closed source and be particularly careful when working with code and services from Silicon Valley companies due to potential conflicts of interest regarding user data monetization.
- Implement reasonable accessibility standards in frontend code, such as proper ARIA attributes, keyboard navigation support, and screen reader compatibility. Overall, any user-facing product should adhere to the WCAG AA standard if possible.
- Maintain neutral, technical language in all discussions by separating empirical facts from value judgments, avoiding normative political framing unless explicitly requested, refraining from introducing political interpretation into technical topics, and applying heightened evidentiary scrutiny to claims made by politically incentivized or reputation-driven companies and political activists.
- Analyze existing code and write new code in a similar style to maintain consistency.
- When naming things, choose comprehensibility over consistency over performance.
- Early escape over if/else. Justifiable exceptions are acceptable.
- Prefer ternaries over if/else in boolean checks unless the latter is more readable.
- Readability over performance, unless the solution noticeably impacts UX.
- Prefer designs that are testable without global state or hard coupling.
- Do not introduce global state, singletons, or static state unless explicitly required.
- Code should be testable without relying on network calls, filesystem access, or global state unless explicitly required.
- Code comments should only be written if the material is highly complex and touches a domain beyond pure programming. Mathematical or physics-related algorithms may be documented, but if pure programming logic requires comments for intelligibility, the code is likely not good enough.
- Always prefer fat arrow functions over the
functionkeyword. Justifiable exceptions are acceptable. Scoping is not a justifiable exception. - Prefer
constoverlet. - Aim for an object-oriented approach with functional programming elements within methods. Do not evangelistically force one paradigm over the other. Pick the best of both worlds.
- Do not use listeners when the same effect can be achieved with CSS. For example, changing a button color on mouseover when it could be handled with
:hoveris not acceptable. - Avoid
any. If unavoidable, document why. - Prefer explicit return types for public methods.
- Do not introduce
async/awaitunless I/O or concurrency requires it. - In frontend code, prioritize perceived UX performance over micro-optimizations.
- Always prefer array bracket notation over the
arraykeyword. - Performance considerations should have a higher weighting.
- In loops or high-frequency code paths, avoid unnecessary object creation.
- Never rely on PHP's loose truthiness for business logic.
- A
labelshould always wrap the input. Justifiable exceptions are acceptable. - Prefer semantic HTML over raw containers when it makes sense. However, do not force semantic HTML everywhere. For example, a
divwith a class of "button" is acceptable if it is more readable than abuttonelement with the same class. - No inline event handlers or inline style attributes.
- Do not use presentation classes such as
.roundor.green. Presentation and functionality must be separated at all times. - Do not use BEM. Describe the purpose of an element. The presentational context comes from nesting.
- No layout fixes via absolute positioning unless justified.
- Always prefer
removeremover pixel units. Justifiable exceptions are acceptable.
- Prefer splitting dash-separated rules when there are multiple possibilities, such as
margin: { top: 1px; right: 1px; bottom: 1px; }andflex: { basis: 5px; }at the bottom of the selector, unless this causes readability issues due to nesting, such as withborder-bottom-right-radius. - Pseudo-selector rules should come before children unless it impacts functionality due to overrides.
- Do not nest rules unnecessarily. Module scoping is fine (one level of nesting). Anything beyond that must be justifiable by comprehensibility or technical requirements.
- Avoid unexplained hardcoded values. Use variables or document intent.