Skip to content

Instantly share code, notes, and snippets.

@nikeyes
Last active October 3, 2025 17:09
Show Gist options
  • Select an option

  • Save nikeyes/df5a882a116995e308f8b9db510b8044 to your computer and use it in GitHub Desktop.

Select an option

Save nikeyes/df5a882a116995e308f8b9db510b8044 to your computer and use it in GitHub Desktop.
Global CLAUDE.md for all projects

Claude Code Development Guidelines

Core Principles (Priority Order)

  1. Tests Pass - Code must work correctly
  2. Reveals Intention - Self-documenting, readable code with clear names
  3. No Business Logic Duplication - Eliminate redundant business logic (code repetition OK for clarity)
  4. Fewest Elements - Keep solutions simple

TDD Workflow

  • Red: Write failing test
  • Green: Minimal code to pass
  • Refactor: Improve while keeping tests green

Guidelines

Testing

  • Test behavior, not implementation
  • Avoid mocks when possible
  • Write simplest failing test first

Code Quality

  • Descriptive names for everything
  • One responsibility per component
  • English for all code

Duplication

  • Extract when: Same business logic, same purpose
  • Keep separate when: Different intent (create vs update), different contexts (frontend vs backend validation)

Anti-Patterns

  • Tests after implementation
  • Complex tests
  • "Just in case" features
  • Code requiring extensive comments

Decision Framework

  • What's the simplest test that could fail?
  • Does this make intent clearer?
  • Am I repeating business logic that should be unified?
  • Can I remove anything without losing value?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment