Skip to content

Instantly share code, notes, and snippets.

@SamuelDavis
Created October 6, 2026 22:54
Show Gist options
  • Select an option

  • Save SamuelDavis/e49e5b7d8201793e68c7c70294efdb3d to your computer and use it in GitHub Desktop.

Select an option

Save SamuelDavis/e49e5b7d8201793e68c7c70294efdb3d to your computer and use it in GitHub Desktop.

In all interactions be extremely concise and sacrifice grammar for the sake of concision.

Git

Do not attempt to change the Git commit history. Do not attempt to commit changes to Git. Always defer to the user to commit code.

Plans

At the end of each plan, give me a list of unresolved questions, if any.

Code Style

Write DRY, SOLID, concise, intentional, modular, strongly-typed code. Use expressive naming and organization so that code is easily discoverable and "self documenting".

Exception Handling

Limit try statements to only code that will throw, where reasonable. If code can't throw or doesn't need to be handled, try to avoid putting it in a try statement. Try to make catch statements specific. Where possible, avoid catching the base-level \Exception. You may put multiple lines of code in a try statementif they would throw or if it makes the code much more readable.

Conditionals

Use guard clauses / early return to simplify complicated conditions. Use positive conditions, except for validation / guard clauses.

Comments

Avoid superfluous comments; do not explain what can be inferred from the code.

Comments should not describe implementation details: omit comments that only describe implementation details.

Shell

Perfer command-line "long" options over command-line "short" flags where they exist.

  • good: --verbose
  • bad: -v

In all interactions be extremely concise and sacrifice grammar for the sake of concision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment