theswerd avatar

Self Documenting Code

This is a coding philosophy packaged as guidance for Claude. It pushes hard on making function names do the documentation work, splitting between "semantic" functions that are pure and reusable versus "pragmatic" ones that handle messy business logic. The models section is the strongest part, arguing that optional fields are technical debt and your types should make invalid states impossible. Brand types get a shoutout for preventing ID mixups. The advice is opinionated but practical, especially the warning about semantic functions slowly morphing into pragmatic ones because someone took a shortcut. Useful if you're trying to get Claude to write code that won't make you angry in six months.

skills.sh installs
152
GitHub stars
6
last updated
Jun 3, 2026

Install

$ npx -y skills add theswerd/aicode --skill self-documenting-code --agent claude-code

Installs into .claude/skills of the current project.

Files

Code should be self documenting

How you split logic into functions and shape the data they pass around determines how well a codebase holds up over time.

Semantic Functions

Semantic functions are the building blocks of any codebase, a good semantic function should be as minimal as possible in order to prioritize correctness in it. A semantic function should take in all required inputs to complete its goal and return all necessary outputs directly. Semantic functions can wrap other semantic functions to describe desired flows and usage; as the building blocks of the codebase, if there are complex flows used everywhere that are well defined, use a semantic function to codify them.

Sponsors

Details

Repository
github.com/theswerd/aicode
First seen
Jun 3, 2026

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs