The Skript book · Intermezzo

Skript Style

Half the language core remains (the business actions, scoring), but you already know enough to write real programs — which means you know enough to write untidy ones. A short pause, then, for style. Skript has fewer degrees of freedom than most languages, so its style guide fits on two pages; the compound interest it pays does not.

Layout

  • Two spaces per indent level. The interpreter tolerates more; readers should not have to.
  • One blank line between rules and between function definitions. None inside them, usually — a rule that needs internal paragraph breaks is a rule that wants functions.
  • Rules first, functions after. The top of the file should read like a table of contents for what the automation does; the bottom, like a dictionary for how.
  • Comment the contract, not the code. The steps explain themselves — that is the language's whole trick. What steps cannot say is context: which event feeds this file, which teammate names are placeholders, which command lines were used to test it. Three # lines at the top of the file carrying those facts are worth more than a comment per line.

Naming

  • Variables are nouns, lowercase, underscore-separated when multiword: followup_delay, alerted. You can use spaces and apostrophes in names — the grammar allows lead's budget — but reserve that flourish for reading-critical moments; underscores survive editing better.
  • Functions are verb phrases — they are called as sentences, so name them as things one does: sound the alarm, route to sales, file the paperwork. If the name wants to contain "and", it is two functions.
  • Tags are kebab-case labels: "follow-up-today", "receipt-sent". Tags outlive the skript that set them; name them for the person filtering a list view next quarter.

Shape

  • Guard early, stop early. Disqualify at the top and keep the happy path flat, rather than nesting the whole rule inside an if.
  • One altitude per body. A rule reads either as raw steps or as function calls — mixing the two reads like a recipe that pauses to explain chemistry.
  • Chain with and only what forms one thought — two, maybe three short steps. set plan to "starter" and add tag "self-serve" is one thought; five chained actions is a paragraph pretending to be a sentence.
  • Narrate decisions. A log at each major branch ("hot path, assigning to Maya") costs one line and turns every production trace into its own incident report.

Restraint

The strongest style rule in Skript is the one the language enforces socially rather than syntactically: if the logic stops reading like something you would say, stop writing it in Skript. Deep arithmetic, elaborate data reshaping, cascades of nested conditions — these are signs the problem has outgrown sentences, and Skode has proper homes for them (Functions, connectors, the SDK). A skript at its best is the conductor's score, not the orchestra: short, legible, and unmistakably in charge.

None of this is enforced. All of it is what the marketplace's most-starred packages have in common — which is the only authority a style guide ever really has.