Agent skill
implementation-patterns
Use when the Developer is implementing features from task specifications, translating architecture into code, integrating with APIs, managing state, or choosing design patterns. Activates when building new functionality from requirements.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/implementation-patterns
SKILL.md
Implementation Patterns
When This Applies
Apply this guidance when:
- Translating a task specification into working code
- Choosing design patterns for a feature
- Integrating with external APIs or services
- Implementing business logic from requirements
Implementation Workflow
Before Writing Code
- Read the task — Understand requirements and acceptance criteria
- Read the architecture — Check ARCHITECTURE.md for design guidance
- Read existing code — Understand patterns already used in the project
- Plan the approach — Which files to create/modify, what order
While Writing Code
- Follow existing patterns — If the codebase uses MVC, don't introduce MVVM
- Build incrementally — Get the simplest version working, then add complexity
- Test as you go — Verify each piece before building the next
- Stay in scope — Only implement what the task asks for
Common Design Patterns
Repository Pattern
Use when: Abstracting data access from business logic
DataSource → Repository → Service → Controller
The repository provides a clean interface for data operations, hiding storage details.
Strategy Pattern
Use when: Multiple algorithms or behaviors that should be interchangeable
Context uses Strategy interface
→ ConcreteStrategyA
→ ConcreteStrategyB
Observer/Event Pattern
Use when: Multiple parts of the system need to react to changes
EventEmitter.emit("userCreated", user)
→ Logger.onUserCreated(user)
→ EmailService.onUserCreated(user)
Middleware/Pipeline Pattern
Use when: Processing requests through a chain of handlers
Request → Auth → Validate → RateLimit → Handler → Response
API Integration Guidelines
When integrating with external APIs:
- Wrap the client — Create a service layer, don't call APIs directly from business logic
- Handle errors — Network timeouts, rate limits, 4xx/5xx responses
- Validate responses — Don't trust external data; validate shape and types
- Add retries — For transient failures (network issues, 503s)
- Log requests — Log URL, method, status code (never log secrets or PII)
State Management
- Keep state as close to where it's used as possible
- Use immutable patterns where the language supports it
- Centralize shared state; avoid passing it through many layers
- Document state transitions (what triggers changes)
File Organization
When creating new files for a feature:
projects/<project>/src/
├── models/ # Data structures
├── services/ # Business logic
├── controllers/ # API handlers / entry points
├── utils/ # Shared utilities
└── config/ # Configuration
Follow whatever structure the project already uses. Don't introduce a new organization scheme within a task.
Scope Discipline
- If you discover something that needs fixing but is outside your task, don't fix it — send a message to the Manager or Architect via queue describing what you found
- If the task requirements are ambiguous, ask via queue before guessing
- If you need an architecture change, send to Architect — don't change ARCHITECTURE.md yourself
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?