Repository inventory

yanko-belov/code-craft

Skills indexed from this repository, with install-style signals scoped to the repo.
28 skills168 GitHub stars0 weekly installsTypeScriptGitHubOwner profile

Overview

This skill captures the Single Responsibility Principle (SRP) guidance for TypeScript code. It helps you decide when to split classes, modules, or functions so each has exactly one reason to change. Use it to avoid god classes and keep code maintainable and testable.

How this skill works

It inspects design intent and common symptoms: whether a class does multiple things, how many public methods it has, file size, and whether descriptions require "AND". It recommends concrete refactors: extract focused services, avoid adding unrelated methods, and document technical debt when immediate refactoring is impossible. It also gives scripts for resisting pressure to violate SRP.

When to use it

  • Creating a new class, module, or service
  • Adding methods to an existing class
  • Reviewing code that seems to do multiple things
  • When you feel pressure to "just add it here"
  • When a class has multiple reasons to change

Best practices

  • Describe the class in one sentence; if it includes "AND", split it
  • Never add functionality that introduces a second reason to change
  • Extract on touch: when modifying, pull related behavior into a new class
  • Create focused classes even under time or authority pressure and document concerns
  • Use specific names (Avoid vague Manager/Handler/Processor/Service without domain)

Example use cases

  • Refactoring a 500-line OrderService into OrderService, PaymentService, InventoryService, NotificationService
  • Adding email delivery: create NotificationService instead of tacking sendEmail onto UserManager
  • Code review: flag classes with >200 lines or >5–7 public methods for extraction
  • Implementing a new feature: add a new service rather than expanding an unrelated class
  • Handling disputes over design: use the provided script to push back and record decisions

FAQ

Create a focused class for the change—this is usually not slower—and avoid adding unrelated responsibilities to existing classes. If impossible, document the debt and create a ticket to refactor.

How do I start refactoring a god class safely?

Don’t make it worse. When you touch part of the class, extract that part into a new class or service and update callers gradually. Add tests and document remaining work.

28 skills

single-responsibility
Code Review

This skill helps you apply the single-responsibility principle by guiding you to split classes and modules, reducing change coupling and maintenance.

PlanningRefactorTypescript
dependency-inversion
Api

This skill helps you apply the Dependency Inversion Principle in TypeScript by promoting interface-based design and injecting dependencies instead of

BackendCode ReviewDebuggingRefactor+2
interface-segregation
Code Review

This skill helps you design focused interfaces by applying the Interface Segregation Principle, avoiding throw and no-op methods and promoting cohesive,

DesignRefactorTypescript
yagni
Api

This skill helps you resist feature bloat by enforcing YAGNI principles, guiding minimal viable implementations until requirements actually demand change.

BackendDevopsPerformanceRefactor+2
liskov-substitution
Code Review

This skill helps you apply the Liskov Substitution Principle by avoiding broken inheritance and favoring interfaces and composition for reliable subclassing.

DesignRefactorTestingTypescript
open-closed
Backend

This skill helps you apply the Open/Closed Principle by guiding you to add new behavior via extensions rather than modifying existing code.

Code ReviewDesignRefactorTypescript
dry
Code Review

This skill helps you identify and extract duplicate logic to enforce a single source of truth across codebases, reducing bugs and maintenance.

DebuggingRefactorTestingTypescript
kiss
Code Review

This skill helps you replace overengineered solutions with simple, clear code that works and ships faster.

DebuggingPerformanceProductivityRefactor+1
encapsulation
Backend

This skill enforces encapsulation in TypeScript by guiding you to hide internal state and expose behavior through validated methods.

Code ReviewDesignFrontendObservability+4
skill-awareness
Analytics

This skill tracks every code-craft application to build a practice record and support analytics across sessions.

DataGitProductivityScripting+1
law-of-demeter
Code Review

This skill helps you write safer TypeScript code by avoiding deep property access and encouraging explicit data access patterns.

DebuggingDesignRefactorTypescript
error-boundaries
Backend

This skill helps you place error handling at architectural boundaries, enabling graceful degradation and preventing cascading failures.

DebuggingDesignFrontendRefactor+1
immutability
Code Review

This skill enforces immutable patterns by returning new objects for updates, preventing bugs and improving React state predictability.

DebuggingFrontendPerformanceRefactor+2
n-plus-one-prevention
Backend

This skill helps you prevent N+1 queries by enforcing eager loading and providing patterns to fetch related data in a single query.

DatabasePerformanceTypescript
test-isolation
Debugging

This skill helps you enforce test isolation by guiding you to create independent tests, avoid shared state, and run reliably.

Integration TestsRefactorTestingUnit Tests+1
rest-conventions
Api

This skill helps you design RESTful endpoints by enforcing correct HTTP methods, avoiding verbs in URLs, and promoting semantic, cache-friendly APIs.

BackendDataDatabaseDesign+4
composition-over-inheritance
Api

This skill helps you replace inheritance with composition by guiding you to assemble behaviors via interfaces and injectables for flexible class design.

BackendCode ReviewDebuggingDesign+4
lazy-loading
Data

This skill helps you implement lazy loading to load data on demand, improving initial load times and perceived performance.

DebuggingFrontendPerformanceUx+1
race-conditions
Backend

This skill helps you identify and remediate race conditions by applying atomic, transactional, and locking patterns across code paths.

DataDatabaseDebuggingPerformance+3
error-responses
Api

This skill helps you implement safe, structured API error responses that avoid leaks and improve client understanding.

BackendDebuggingPerformanceSecurity+1
aaa-pattern
Integration Tests

This skill enforces clear arrange-act-assert test structure by guiding you to separate phases for readability and maintainability.

TestingUnit TestsTypescript
exception-hierarchies
Api

This skill helps you design precise exception hierarchies in TypeScript, enabling targeted catch blocks and safer error handling across layers.

BackendCode ReviewDatabaseDebugging+4
fail-fast
Backend

This skill promotes fail-fast error handling in TypeScript by throwing at the source and surfacing clear errors to boundaries.

Code ReviewDebuggingTestingTypescript
idempotency
Api

This skill helps you implement idempotency for critical mutations using idempotency keys to prevent duplicates and ensure safe retries.

BackendDatabaseDevopsFullstack+2
secrets-handling
Api

This skill guides you to never hardcode secrets, enforcing environment variables and startup validation to prevent leaks and secure credentials.

BackendDatabaseDevopsSecurity+1
deadlock-prevention
Backend

This skill helps prevent deadlocks by enforcing consistent lock ordering and timeouts across services, ensuring operations complete reliably.

Ci CdDatabaseDebuggingMonitoring+2
caching
Backend

This skill helps you implement caching with robust invalidation strategies to boost performance while ensuring data freshness.

Code ReviewDataDebuggingMonitoring+2
api-versioning
Api

This skill helps you design and evolve APIs safely by enforcing versioning, deprecation, and non-breaking changes across clients.

BackendDocsMigrationPlanning+1
More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational