implementer
npx machina-cli add skill karim-bhalwani/agent-skills-collection/implementer --openclawFiles (1)
SKILL.md
4.5 KB
Implementer Skill - High-Integrity Development
Overview
The Implementer skill turns architectural specifications into working, tested, and high-performance software. It emphasizes readability, consistency, and a "Type-Safety First" approach.
Core Principles
- Readability First: Optimize code for the reader, not the writer.
- Consistency: Adhere strictly to existing project patterns and coding standards.
- Simplicity: Straightforward solutions over clever ones. Refactor complexity into focused functions.
- Fail Fast & Explicitly: Validate boundaries and use custom exceptions.
- Test-Driven Reliability: Write tests alongside implementation. Target 80%+ coverage.
- Type Safety: Use complete type annotations (Python 3.11+) for documentation and bug prevention.
Coding Standards (Python)
- Imports: Grouped by Future, StdLib, Third-Party, and Local.
- Naming:
Upper_Casefor constants,CapWordsfor classes,snake_casefor functions/variables. - Paths: Use
pathlib.Pathexclusively. - Strings: Use f-strings for formatting (except logging).
- Docstrings: Google Style required for all public APIs.
- Exceptions: Define custom hierarchies (e.g.,
ApplicationError->ValidationError).
Workflow
- Read Spec: Never implement without an approved
spec.md. - Setup Tests: Write unit tests for expected behavior before implementation.
- Draft Code: Implement business logic according to architecture boundaries.
- Validate: Run lints, type checks, and tests.
- Refactor: Simplify and clean up code while maintaining test passes.
When to Use
- Implementing features from a design specification.
- Bug fixing and refactoring.
- Creating data access layers, service logic, or API handlers.
Outputs & Deliverables
- Primary Output: Production-ready code with tests
- Secondary Output: Updated test suite and documentation
- Success Criteria: All tests pass, code passes linting and type checking
- Quality Gate: Code passes guardian review before merge
Standards & Best Practices
Code Quality Standards
- Readability First: Optimize code for human readers, not machines
- Type Safety: Use complete type annotations (Python 3.11+)
- Fail Fast: Validate inputs and fail explicitly with custom exceptions
- Test-Driven: Write tests before implementation, target 80%+ coverage
Python Standards
- Imports: Group by Standard Library, Third-party, Local with blank lines
- Naming:
snake_casefor functions/variables,PascalCasefor classes - Docstrings: Google-style for all public APIs
- Error Handling: Custom exception hierarchies with meaningful messages
Constraints
- NO architectural changes. Follow the
architect's spec strictly. - NO deployment management.
- NO code without tests.
Common Pitfalls
- Skipping Tests: "I'll test it manually" leads to regressions. Write tests first, always.
- Ignoring Type Hints: Skipping annotations makes code fragile and self-documenting. Type safety prevents 40% of bugs.
- Over-Clever Code: Smart code is hard to maintain. Choose readability over cleverness every time.
- Deviating from Spec: "Just a small change" breaks the contract. If the spec is wrong, escalate to
architect, don't improvise. - Not Handling Errors: Silent failures or generic exceptions hide problems. Fail fast with specific, descriptive errors.
- Mixing Concerns: Business logic in controllers or data access in services. Respect module boundaries.
- No Regression Tests: Fixing one bug while introducing another. Red-Green testing prevents this.
Integration Points
| Phase | Input From | Output To | Context |
|---|---|---|---|
| Design | architect | Implementation | Receive approved spec.md |
| Testing | Test requirements | Local verification | Run all tests before commit |
| Review | Code ready | guardian | Request quality/security review |
| Documentation | Implementation details | ops-manager | API docs, deployment instructions |
| Verification | Completion claims | verification-before-completion | Confirm all tests pass, type checks clean |
Source
git clone https://github.com/karim-bhalwani/agent-skills-collection/blob/main/skills/implementer/SKILL.mdView on GitHub Overview
The Implementer skill turns architectural specifications into working, tested, and high-performance software. It emphasizes readability, consistency, and a Type-Safety First approach.
How This Skill Works
It requires an approved spec.md, then sets up unit tests for expected behavior before implementation. Draft code that adheres to architecture boundaries, prioritizes readability, and follows the project's coding standards. Finally, run linters, type checks, and tests, and refactor if needed.
When to Use It
- Implementing features from a design specification.
- Bug fixing and refactoring.
- Creating data access layers, service logic, or API handlers.
- Improving code quality with type safety and tests.
- Migrating to or upgrading with explicit type hints and documentation.
Quick Start
- Step 1: Get an approved spec.md and write or update unit tests describing expected behavior.
- Step 2: Draft code implementing the business logic within architecture boundaries.
- Step 3: Run linting, type checks, and the test suite; refactor if needed.
Best Practices
- Readability First: Optimize code for human readers.
- Adhere to existing patterns and coding standards.
- Write tests before implementation; target 80%+ coverage.
- Use complete type annotations (Python 3.11+).
- Fail fast with explicit validation and custom exceptions.
Example Use Cases
- Implement a feature from an approved spec.md in a Python service with tests.
- Fix a bug by adding unit tests before changing code to prevent regressions.
- Refactor a data access layer to align with repository patterns and boundaries.
- Implement an API handler following architecture boundaries and standards.
- Add Google-style docstrings, complete type hints, and a custom exception hierarchy.
Frequently Asked Questions
Add this skill to your agents