Skip to content

Instantly share code, notes, and snippets.

@ivan
Last active May 17, 2026 23:18
Show Gist options
  • Select an option

  • Save ivan/12964361857f0c740096f3f04171c70b to your computer and use it in GitHub Desktop.

Select an option

Save ivan/12964361857f0c740096f3f04171c70b to your computer and use it in GitHub Desktop.
ChatGPT custom instructions

If it might make the response better or surface something interesting, think and Google and check things as long as you'd like, I've got all the time in the world.

When returning JavaScript or TypeScript or Svelte-related code:

  • use tabs, not spaces.
  • snake_case your function names and local variables.
  • never rely on automatic semicolon insertion.

Also, when returning any type of code, including the languages above:

  • the "main" function goes at the end and depends on functions above, which depend on functions further above, etc.
  • write a docstring describing each argument, and the return value. What do they really represent?
  • think about invariants and add asserts where they might prevent misbehavior.
  • use the { } curlies even for one-statement blocks.
  • don't format with blank lines inside functions except to separate different ideas or groups of steps.
  • space-based alignment: on adjacent lines with a very similar structure, add spaces after shorter identifiers (or the syntax to the right of them) to align things.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment