Code assist

From mikeyobrien/rho · View interactive version

Code assist is an AI agent skill from the GitHub repository mikeyobrien/rho. Implement coding tasks with an explore-plan-code workflow and explicit verification gates.

How to use this skill

Skill file

Code Assist

Overview

This sop guides the implementation of code tasks using test-driven development principles, following a structured Explore, Plan, Code, Commit workflow. It balances automation with user collaboration while adhering to existing package patterns and prioritizing readability and extensibility. The agent acts as a Technical Implementation Partner and TDD Coach - providing guidance, generating test cases and implementation code that follows existing patterns, avoids over-engineering, and produces idiomatic, modern code in the target language.

Parameters

Constraints for parameter acquisition:

Mode Behavior

Apply these patterns throughout all steps based on the selected mode:

Interactive Mode:

Auto Mode:

Important Notes

Separation of Concerns:

This script maintains strict separation between documentation and code. All documentation about the implementation process is stored in the documentation directory, while all actual code (both tests and implementation) must be placed in the appropriate directories within the repository root. No code files should ever be placed in the documentation directory.

CODEASSIST.md Integration:

If CODEASSIST.md exists in repo_root, it contains additional constraints, pre/post SOP instructions, examples, and troubleshooting specific to this project. Apply any specified practices throughout the implementation process.

Steps

1. Setup

Initialize the project environment and create necessary directory structures.

Constraints:

Instruction File Discovery:

💬 See Mode Behavior for mode-specific interaction guidance

2. Explore Phase

2.1 Analyze Requirements and Context

Analyze the task description and existing documentation to identify core functionality, edge cases, and constraints.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

2.2 Research Existing Patterns

Search for similar implementations and identify interfaces, libraries, and components the implementation will interact with.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

2.3 Create Code Context Document

Compile all findings into a comprehensive code context document.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

3. Plan Phase

3.1 Design Test Strategy

Create a comprehensive list of test scenarios covering normal operation, edge cases, and error conditions.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

3.2 Implementation Planning & Tracking

Outline the high-level structure of the implementation and create an implementation plan.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

4. Code Phase

4.1 Implement Test Cases

Write test cases based on the approved outlines, following strict TDD principles.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

4.2 Develop Implementation Code

Write implementation code to pass the tests, focusing on simplicity and correctness first.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

4.3 Refactor and Optimize

If the implementation is complete, proceed with review of the implementation to identify opportunities for simplification, improvement, and coding convention alignment.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

4.4 Validate Implementation

If the implementation meets all requirements and follows established patterns, proceed with step 6. Otherwise, return to step 5.2 to fix any issues.

Constraints:

Build Validation:

💬 See Mode Behavior for mode-specific interaction guidance

5. Commit Phase

If all tests are passing, draft a conventional commit message and perform the actual git commit.

Constraints:

💬 See Mode Behavior for mode-specific interaction guidance

Desired Outcome

Examples

Example 1: Feature Implementation

Input:

task_description: "Create a utility function that validates email addresses"
mode: "interactive"

Expected Process:

  1. Check for CODEASSIST.md and discover instruction files
  2. Detect project type from existing files (pom.xml, package.json, etc.)
  3. Set up directory structure in .agents/scratchpad/{project_name}/email-validator/
  4. Explore requirements and create context documentation
  5. Plan test scenarios for valid/invalid email formats
  6. Implement tests first (TDD approach)
  7. Implement the validation function
  8. Commit with conventional commit message

With CODEASSIST.md: Apply additional constraints and instructions throughout the workflow.

Without CODEASSIST.md: Suggest creating it with template for project-specific SOP guidance.

Troubleshooting

Project Directory Issues

If the documentation directory doesn't exist or isn't accessible:

Project Structure Issues

If there are issues with the project structure or build system:

Build Issues

If builds fail during implementation:

Multi-Package Coordination Issues

If there are issues coordinating changes across multiple packages:

Repository Implementation Issues

If there are issues with implementing code in the repository root:

Implementation Challenges

If the implementation encounters unexpected challenges:

Best Practices

Project Detection and Configuration

Build Output Management

Documentation Organization

Artifacts

• {documentation_dir}/{task_name}/

• {documentation_dir}/{task_name}/context.md

• Workspace structure and package analysis

• Requirements, patterns, and dependencies

• Implementation paths and mappings

• {documentation_dir}/{task_name}/plan.md

• Test scenarios and test planning

• Implementation planning and strategy

• All planning-related documentation

• {documentation_dir}/{task_name}/progress.md

• Script execution tracking

• TDD cycle documentation

• Refactoring and simplification notes

• Commit status and final results

• Technical challenges encountered

• Setup and progress notes

• {documentation_dir}/{task_name}/logs/

• Build outputs (one log per package, replaced on each build)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.