1---
2name: developer
3description: Write clean, maintainable code with debugging, testing, and architectural best practices.
4metadata:
5 source: https://skillmd.com/skills/modbender/developer
6 clawdbot:
7 emoji: 💻
8 os:
9 - linux
10 - darwin
11 - win32
12---
13
14# Software Development Rules
15
16## Code Quality
17- Readable code beats clever code — you'll read it 10x more than write it
18- Functions do one thing — if you need "and" to describe it, split it
19- Name things by what they do, not how — implementation changes, purpose doesn't
20- Delete dead code — version control remembers, codebase shouldn't carry weight
21- Consistent style matters more than which style — match the project
22
23## Debugging
24- Read the error message completely — the answer is often in there
25- Reproduce before fixing — if you can't trigger it, you can't verify the fix
26- Binary search: comment out half the code to find the problem half
27- Check the obvious first — typos, wrong file, stale cache, wrong environment
28- Print/log liberally when stuck — assumptions are usually wrong
29
30## Testing
31- Test behavior, not implementation — tests shouldn't break when you refactor
32- One assertion per test when possible — failures point to exact problem
33- Name tests as sentences describing expected behavior — readable test names are documentation
34- Mock external dependencies, not internal logic — integration points are boundaries
35- Fast tests run often, slow tests get skipped — optimize for feedback speed
36
37## Error Handling
38- Fail fast and loud — silent failures create debugging nightmares
39- Catch specific exceptions, not generic — different errors need different handling
40- Log enough context to debug — error type alone isn't enough
41- User-facing errors should be helpful — "something went wrong" helps nobody
42- Don't catch exceptions you can't handle — let them bubble up
43
44## Architecture
45- Start simple, add complexity when needed — premature abstraction wastes time
46- Separate concerns — UI, business logic, data access are different responsibilities
47- Dependencies flow inward — core logic shouldn't know about frameworks
48- Configuration separate from code — environment-specific values externalized
49- Document decisions, not just code — why matters more than what
50
51## Code Review
52- Review for understanding, not just correctness — if you can't follow it, others won't
53- Ask questions instead of making demands — "what if..." opens discussion
54- Small PRs get better reviews — 500 lines gets skimmed, 50 lines gets read
55- Approve when good enough, not perfect — progress beats perfection
56- Catch bugs early, style issues are secondary — priorities matter
57
58## Performance
59- Measure before optimizing — intuition about bottlenecks is usually wrong
60- Optimize the hot path — 90% of time is spent in 10% of code
61- Database queries are usually the bottleneck — check there first
62- Caching solves many problems — but cache invalidation creates new ones
63- Premature optimization wastes time — make it work, then make it fast
64
65## Dependencies
66- Evaluate before adding — every dependency is code you don't control
67- Pin versions — "latest" breaks builds unpredictably
68- Check maintenance status — abandoned packages become security risks
69- Fewer dependencies is better — each one adds supply chain risk
70- Read changelogs before upgrading — breaking changes hide in minor versions
71
72## Working in Existing Codebases
73- Match existing patterns — consistency beats personal preference
74- Improve incrementally — boy scout rule, leave it better than you found it
75- Understand before changing — read the tests, check git history
76- Don't refactor while fixing bugs — separate commits, separate PRs
77- Legacy code works — respect the battle scars
78
79## Communication
80- Commit messages explain why, not what — diff shows what changed
81- Document surprising behavior — future developers need context
82- Ask before large refactors — alignment prevents wasted work
83- Estimate with ranges, not points — "2-4 days" is more honest than "3 days"
84- Say "I don't know" when you don't — guessing wastes everyone's time