code-generation
Scannednpx machina-cli add skill a5c-ai/babysitter/code-generation --openclawFiles (1)
SKILL.md
1.3 KB
Code Generation
Overview
Guides code output to be minimal and pattern-matching. Write the least amount of code that satisfies the requirements while following existing project conventions.
Principles
- Minimal: Write the least code that makes tests pass
- Pattern-matching: Follow existing project conventions (check patterns.md)
- Tool discipline: Use Write/Edit for files, Bash only for runners and linters
- No gold plating: Do not add features beyond what is required
- No premature optimization: Optimize only when performance tests demand it
Code Quality Checks
- Follow project naming conventions
- Match existing file structure and organization
- Use established error handling patterns
- Maintain consistent import ordering
- Follow TypeScript strictness (no
any, proper narrowing)
When to Use
- During TDD GREEN phase (minimal implementation)
- During TDD REFACTOR phase (pattern alignment)
- When implementing fixes in DEBUG workflow
Agents Used
component-builder(primary consumer)bug-investigator(fix implementation)
Source
git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/methodologies/cc10x/skills/code-generation/SKILL.mdView on GitHub Overview
Code-generation guides you to produce the least amount of code that satisfies requirements while matching existing project conventions. It emphasizes minimalism, pattern alignment, and disciplined use of Write/Edit tools to fit the codebase.
How This Skill Works
When given a task, this skill generates code using Write/Edit to create or modify files, and reserves Bash only for runners and linters. It enforces minimal implementations, strict typing, and established error handling patterns to maintain consistency with the project’s conventions.
When to Use It
- During TDD GREEN phase (minimal implementation)
- During TDD REFACTOR phase (pattern alignment)
- When implementing fixes in DEBUG workflow
- When aligning new code with existing project patterns
- For incremental fixes that must pass tests with minimal changes
Quick Start
- Step 1: Inspect the requirement and tests to determine the minimal scope
- Step 2: Create or modify files using Write/Edit, following existing conventions
- Step 3: Run tests with Bash runners and iterate until green
Best Practices
- Aim for the smallest change that satisfies tests
- Follow existing file structure and naming conventions
- Use Write/Edit for code artifacts; Bash only for runners/linters
- Avoid adding features beyond what is required (no gold plating)
- Maintain TypeScript strictness and proper error handling
Example Use Cases
- Add a missing utility with the minimal function signature and tests
- Refactor a module to align with patterns.md without altering behavior
- Replace a verbose implementation with a concise, pattern-based version
- Fix a bug by returning early and trimming unnecessary logic
- Convert a test stub into a minimal implementation that passes tests
Frequently Asked Questions
Add this skill to your agents