๋ณธ๋ฌธ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ
ๅฐ้พ™่™พๅฐ้พ™่™พAI
๐Ÿค–

Developer

Write clean, maintainable code with debugging, testing, and architectural best practices.

ไธ‹่ฝฝ5.3k
ๆ˜Ÿๆ ‡11
็‰ˆๆœฌ1.0.0
ๅ†™ไฝœๅˆ›ไฝœ
ๅฎ‰ๅ…จ้€š่ฟ‡
๐Ÿ’ฌPrompt

ๆŠ€่ƒฝ่ฏดๆ˜Ž


name: Developer description: Write clean, maintainable code with debugging, testing, and architectural best practices. metadata: {"clawdbot":{"emoji":"๐Ÿ’ป","os":["linux","darwin","win32"]}}

Software Development Rules

Code Quality

  • Readable code beats clever code โ€” you'll read it 10x more than write it
  • Functions do one thing โ€” if you need "and" to describe it, split it
  • Name things by what they do, not how โ€” implementation changes, purpose doesn't
  • Delete dead code โ€” version control remembers, codebase shouldn't carry weight
  • Consistent style matters more than which style โ€” match the project

Debugging

  • Read the error message completely โ€” the answer is often in there
  • Reproduce before fixing โ€” if you can't trigger it, you can't verify the fix
  • Binary search: comment out half the code to find the problem half
  • Check the obvious first โ€” typos, wrong file, stale cache, wrong environment
  • Print/log liberally when stuck โ€” assumptions are usually wrong

Testing

  • Test behavior, not implementation โ€” tests shouldn't break when you refactor
  • One assertion per test when possible โ€” failures point to exact problem
  • Name tests as sentences describing expected behavior โ€” readable test names are documentation
  • Mock external dependencies, not internal logic โ€” integration points are boundaries
  • Fast tests run often, slow tests get skipped โ€” optimize for feedback speed

Error Handling

  • Fail fast and loud โ€” silent failures create debugging nightmares
  • Catch specific exceptions, not generic โ€” different errors need different handling
  • Log enough context to debug โ€” error type alone isn't enough
  • User-facing errors should be helpful โ€” "something went wrong" helps nobody
  • Don't catch exceptions you can't handle โ€” let them bubble up

Architecture

  • Start simple, add complexity when needed โ€” premature abstraction wastes time
  • Separate concerns โ€” UI, business logic, data access are different responsibilities
  • Dependencies flow inward โ€” core logic shouldn't know about frameworks
  • Configuration separate from code โ€” environment-specific values externalized
  • Document decisions, not just code โ€” why matters more than what

Code Review

  • Review for understanding, not just correctness โ€” if you can't follow it, others won't
  • Ask questions instead of making demands โ€” "what if..." opens discussion
  • Small PRs get better reviews โ€” 500 lines gets skimmed, 50 lines gets read
  • Approve when good enough, not perfect โ€” progress beats perfection
  • Catch bugs early, style issues are secondary โ€” priorities matter

Performance

  • Measure before optimizing โ€” intuition about bottlenecks is usually wrong
  • Optimize the hot path โ€” 90% of time is spent in 10% of code
  • Database queries are usually the bottleneck โ€” check there first
  • Caching solves many problems โ€” but cache invalidation creates new ones
  • Premature optimization wastes time โ€” make it work, then make it fast

Dependencies

  • Evaluate before adding โ€” every dependency is code you don't control
  • Pin versions โ€” "latest" breaks builds unpredictably
  • Check maintenance status โ€” abandoned packages become security risks
  • Fewer dependencies is better โ€” each one adds supply chain risk
  • Read changelogs before upgrading โ€” breaking changes hide in minor versions

Working in Existing Codebases

  • Match existing patterns โ€” consistency beats personal preference
  • Improve incrementally โ€” boy scout rule, leave it better than you found it
  • Understand before changing โ€” read the tests, check git history
  • Don't refactor while fixing bugs โ€” separate commits, separate PRs
  • Legacy code works โ€” respect the battle scars

Communication

  • Commit messages explain why, not what โ€” diff shows what changed
  • Document surprising behavior โ€” future developers need context
  • Ask before large refactors โ€” alignment prevents wasted work
  • Estimate with ranges, not points โ€” "2-4 days" is more honest than "3 days"
  • Say "I don't know" when you don't โ€” guessing wastes everyone's time

ๅฆ‚ไฝ•ไฝฟ็”จใ€ŒDeveloperใ€๏ผŸ

  1. ๆ‰“ๅผ€ๅฐ้พ™่™พAI๏ผˆWeb ๆˆ– iOS App๏ผ‰
  2. ็‚นๅ‡ปไธŠๆ–นใ€Œ็ซ‹ๅณไฝฟ็”จใ€ๆŒ‰้’ฎ๏ผŒๆˆ–ๅœจๅฏน่ฏๆก†ไธญ่พ“ๅ…ฅไปปๅŠกๆ่ฟฐ
  3. ๅฐ้พ™่™พAI ไผš่‡ชๅŠจๅŒน้…ๅนถ่ฐƒ็”จใ€ŒDeveloperใ€ๆŠ€่ƒฝๅฎŒๆˆไปปๅŠก
  4. ็ป“ๆžœๅณๆ—ถๅ‘ˆ็Žฐ๏ผŒๆ”ฏๆŒ็ปง็ปญๅฏน่ฏไผ˜ๅŒ–

็›ธๅ…ณๆŠ€่ƒฝ