Skip to content
typescript-clean-code logo

typescript-clean-code

Clean Code principles, professional practices, and workflows for TypeScript developers. Based on Robert C. Martin's "Clean Code" and "The Clean Coder" books. Use this skill when: - Writing new TypeScript/JavaScript functions, classes, or modules - Reviewing code or pull requests - Refactoring ex...

NeverSight/skills_feed0installs214stars

SKILL.md

Full skill instructions

Clean Code

Principles, practices, and workflows for TypeScript developers.

Quick Start

  1. For a task: Check guidelines.md → find the right workflow
  2. For reference: Load only the files relevant to your work
  3. Follow the workflow: Step-by-step process for consistent results

Workflows

Step-by-step processes for common tasks:

WorkflowWhen to Use
workflows/​code-review.mdReviewing code for quality
workflows/​pr-review.mdReviewing pull requests
workflows/​tdd.mdTest-driven development cycle
workflows/​refactoring.mdSafe refactoring with tests
workflows/​new-feature.mdBuilding new functionality
workflows/​bug-fix.mdFixing bugs properly
workflows/​test-strategy.mdPlanning test coverage
workflows/​estimation.mdEstimating tasks (PERT)
workflows/​deadline-negotiation.mdHandling unrealistic deadlines

Reference Categories

Part 1: Code Quality (Clean Code book)

CategoryFilesPurpose
naming3Variable, function, class naming
functions4Function design and review
classes3Class/​module design
comments3Comment best practices
error-handling3Exception handling
unit-tests3Clean test principles
formatting3Code layout
smells3Code smell catalog (50+)

Part 2: Professional Practices (Clean Coder book)

CategoryFilesPurpose
professionalism3Professional ethics
saying-no3Declining requests
commitment3Making promises
coding-practices3Daily habits, flow, debugging
tdd3TDD workflow and benefits
practicing3Deliberate practice
acceptance-testing3Requirements as tests
testing-strategies3Test pyramid
time-management3Meetings, focus
estimation3PERT estimation
pressure3Working under pressure
collaboration3Working with teams

Key Principles

Code Quality

  1. Readability - Code is read far more than written
  2. Single Responsibility - Each unit does one thing well
  3. Small Units - Functions ~5-20 lines, focused classes
  4. Meaningful Names - Names reveal intent
  5. DRY - Don't Repeat Yourself
  6. Clean Tests - Tests are first-class citizens

Professional Practices

  1. Take Responsibility - Own your code and decisions
  2. Say No - Decline impossible commitments professionally
  3. Commit Clearly - Use "I will... by..." language
  4. Estimates != Commitments - Communicate uncertainty
  5. Stay Clean Under Pressure - Don't abandon practices in crisis

Guidelines

See guidelines.md for:

  • Task → workflow mapping
  • Situation → reference file mapping
  • Decision tree for common scenarios