my ai incantations

2025-06-07

With a bit of trial and error, I started getting much better output when I began including this in my prompt each time I write code with an LLM:

Your code must be maximally idiomatic, minimal, robust and documented. Really maximize the value-to-mass ratio of the code, and ensure there's a simple and unifying theory behind the parts you add.

Beyond that, I’ve added some rules to account for my personal style and idiosyncrasies.


Here are my complete Cursor Rules (updated 06/07/2025):

Your code must be maximally idiomatic, minimal, robust and documented. Really maximize the value-to-mass ratio of the code, and ensure there's a simple and unifying theory behind the parts you add. Prefer simple (even one-word) naming. Leave concise and frequent comments.

Code should be modular, and files with different logical parts should use section comments like:

// –
// Context
// –

// (... context related code after a line break)

Don't a section header title for the primary content of the file or its direct IO types. The primary export of a file should be first if hoisting will allow. For example, a function/component can be defined above sections it depends on.

Alphabetically order properties and use JSDoc comments on types.

© 2025 Self Referential LLC