Programming Assistant Skill
Overview
This skill enables OpenClaw to leverage Claude CLI for sophisticated programming tasks. It provides structured workflows for coding activities including project creation, code modification, debugging, and optimization.
When to Use This Skill
Use this skill when OpenClaw encounters tasks such as:
- Creating new programs or scripts
- Modifying existing code files
- Debugging code issues
- Refactoring code for better performance/readability
- Performing code reviews
- Setting up new projects or adding features
- Converting code between languages or formats
- Generating documentation for code
Prerequisites
- Claude CLI must be installed (
claudecommand available) - Claude desktop application should be accessible for IDE integration
- Sufficient permissions to read/write files in the target directory
Basic Usage Patterns
Pattern 1: Simple Code Generation
When tasked with creating new code:
- Identify the target directory for the project
- Use
claude --ideto initiate the coding session - Provide specific instructions about the desired functionality
- Review the generated code for correctness
Pattern 2: Code Modification
When modifying existing code:
- Determine the files that need to be changed
- Use
claude --ide --add-dir <project-path>to focus on the specific project - Request specific changes while preserving existing functionality
- Verify the changes meet requirements
Pattern 3: Project Setup
When setting up new projects:
- Create the necessary directory structure
- Generate initial configuration files
- Set up basic file templates
- Ensure dependencies are properly documented
Workflow Steps
1. Assessment
- Determine the scope of the programming task
- Identify the target directory and relevant files
- Assess complexity and potential challenges
2. Preparation
- Ensure Claude CLI is available and authenticated
- Prepare any necessary context about the codebase
- Gather requirements and constraints
3. Execution
- Use appropriate Claude CLI commands based on the task
- Monitor progress and intervene if needed
- Ensure code quality and adherence to requirements
4. Verification
- Review generated code for correctness
- Test functionality if possible
- Validate that requirements were met
Available Tools Integration
The skill integrates with Claude CLI tools:
- Bash: For running commands, tests, and system operations
- Edit: For modifying files directly
- Read: For reading files to understand context
- IDE Integration: For seamless code editing experience
Error Handling
- If Claude CLI is unavailable, suggest alternative approaches
- If authentication is required, guide through setup process
- For complex projects, break tasks into smaller manageable pieces
- When facing permission issues, suggest alternative approaches
Best Practices
- Always consider security implications when generating code
- Follow language-specific best practices and conventions
- Include appropriate error handling in generated code
- Add comments and documentation where appropriate
- Ensure generated code is maintainable and readable