bfollington

Writing good code

Read and apply the guidance from @../../lib/code-style.md

bfollington 51 6 Updated 7mo ago
GitHub

Install

npx skillscat add bfollington/terma/plugins-terma-skills-writing-code

Install via the SkillsCat registry.

About this skill

We need to produce a 2-3 sentence plain-text summary, objective, factual, no marketing, no superlatives, no calls to action, natural prose, no bullet points, no headings, no markdown. At most 60 words. Must explain what the skill does, what problem it solves, when to use it. The skill: "Read and apply the guidance from @../../lib/code-style.md". The excerpt shows guidelines for writing good code: prefer functions over classes, types first, flat code, etc. So skill is about applying code style guidelines.

SKILL.md

Writing good code

  • prefer functions over classes unless managing resources
  • let the types and signatures do the talking
  • prefer flat code, small focused routines
  • the program should read like the story of what it does
  • the structure and name of the modules is critical
  • write the types first, then the functions, then the tests, then the integrations
  • make the smallest change possible or leave the code cleaner than you found it
  • rigor and intentionality upfront is worth it

write code like Rich Hickey

Read and apply the guidance from @../../lib/code-style.md