OpenClaw skill
codebuddy-code
An OpenClaw skill that integrates CodeBuddy, an AI coding assistant, enabling agents to generate code, fix bugs, explain code, review code, and optimize code across multiple programming languages. It provides tools for handling programming tasks such as writing functions, debugging errors, and providing code explanations.
Files
Review the files below to add this skill to your agents.
Security notice: review the SKILL.md file and repository content first before using any third-party skill.
SKILL.md content
---
name: codebuddy-cli
description: |
CodeBuddy Code CLI installation, configuration and usage guide. CodeBuddy Code is Tencent's AI-powered CLI programming assistant supporting natural language driven development.
- MANDATORY TRIGGERS: CodeBuddy, codebuddy, AI CLI, Tencent AI coding, @tencent-ai/codebuddy-code, terminal AI assistant
- Use when: installing CodeBuddy CLI, configuring CodeBuddy, using CodeBuddy commands, troubleshooting CodeBuddy issues
---
# CodeBuddy CLI Skill
AI-powered terminal programming assistant from Tencent.
## Installation
```bash
# Check prerequisites
node -v # Requires Node.js 18+
npm -v
# Install globally
npm install -g @tencent-ai/codebuddy-code
# Verify
codebuddy --version
```
## Quick Start
1. Navigate to project directory
2. Run `codebuddy` to start interactive session
3. Choose login method:
- **Google/GitHub**: International version (Gemini, GPT models)
- **WeChat (微信)**: China version (DeepSeek models)
## CLI Arguments
| Argument | Description |
|----------|-------------|
| `codebuddy "<prompt>"` | Execute single task |
| `-y` / `--dangerously-skip-permissions` | Skip permission confirmations (sandbox only) |
| `-p` / `--print` | Single execution mode (requires `-y` for file ops) |
| `--permission-mode <mode>` | `acceptEdits`, `bypassPermissions`, `default`, `plan` |
| `--version` | Show version |
### Examples
```bash
# Interactive mode
codebuddy
# Single task
codebuddy "帮我优化这个函数的性能"
codebuddy "生成这个 API 的单元测试"
codebuddy "检查这次提交的代码质量"
# Skip permissions (sandbox only)
codebuddy -p "Review code quality" -y
```
## Slash Commands
| Command | Description |
|---------|-------------|
| `/help` | Display available commands |
| `/status` | Show account info and current model |
| `/login` | Switch accounts |
| `/logout` | Sign out |
| `/clear` | Reset conversation history |
| `/exit` | End session |
| `/config` | Open configuration |
| `/doctor` | Diagnose issues |
| `/cost` | Token usage statistics |
| `/init` | Generate CODEBUDDY.md project guide |
| `/memory` | Edit project memory files |
Type `?` during session for keyboard shortcuts.
## Custom Commands
Create `.md` files in:
- **Project**: `.codebuddy/commands/`
- **Global**: `~/.codebuddy/commands/`
## Update
```bash
npm install -g @tencent-ai/codebuddy-code
```
## Security Notes
`--dangerously-skip-permissions` risks: file deletion, scope creep, data loss. **Never use in production.**
How this skill works
- Receives a coding task description from the agent
- Formats the task into a structured prompt
- Sends the prompt to the CodeBuddy `/generate` API endpoint
- Parses the generated code from the API response
- Returns the generated code to the agent
When to use it
- When the agent needs to generate code from natural language instructions using CodeBuddy
- When the agent requires code review, debugging, or refactoring via CodeBuddy
Best practices
- Set OPENAI_API_KEY environment variable as it is required
- Review generated code before executing or deploying it
- Monitor OpenAI API usage to manage costs and respect rate limits
- Provide specific details on programming language, libraries, and requirements in prompts
- Set low temperature (e.g., 0.2) for more reliable code generation
Example use cases
- Generating code snippets: Generate code in various programming languages from natural language descriptions, as provided by the generate_code tool.
- Explaining code: Provide step-by-step explanations of given code snippets, using the explain_code tool.
- Debugging code: Identify bugs and suggest fixes for provided code, via the debug_code tool.
- Code review: Review code for quality, best practices, and improvements with the review_code tool.
FAQs
What is the codebuddy-code skill?
CodeBuddy code tools for OpenClaw.
What tools does the codebuddy-code skill provide?
codebuddy-code-generate, codebuddy-code-explain, codebuddy-code-review.
What does the codebuddy-code-generate tool do?
Generate code from a prompt.
What are the parameters for codebuddy-code-generate?
prompt `str` required
What does the codebuddy-code-explain tool do?
Explain code.
What are the parameters for codebuddy-code-explain?
code `str` required, language `str` optional
What does the codebuddy-code-review tool do?
Review code.
What are the parameters for codebuddy-code-review?
code `str` required, language `str` optional
What are the triggers for the codebuddy-code skill?
codebuddy-code-generate, codebuddy-code-explain, codebuddy-code-review
More similar skills to explore
- achurch
An OpenClaw skill for church administration that handles member management, event scheduling, sermon retrieval, and donation processing. It provides tools to list members, add new members, schedule events, fetch sermons, and record donations.
- agent-config
An OpenClaw skill that enables agents to manage their configuration by loading from files, environment variables, or remote sources. It supports retrieving, setting, and validating configuration values. The skill allows for hot-reloading of configurations.
- agent-council
An OpenClaw skill named agent-council that enables the primary agent to summon a council of specialized sub-agents for deliberating on tasks. The council members discuss the query from unique perspectives, propose solutions, and vote to select the best response. The skill outputs the winning proposal with supporting rationale from the council.
- agent-identity-kit
An OpenClaw skill that equips agents with tools to craft, manage, and evolve digital identities, including generating personas, bios, avatars, and communication styles. It supports creating detailed agent personas with name, background, goals, personality traits; crafting bios for specific platforms; designing avatars; tuning voice and style; and adapting identities to new contexts.
- agenticflow-skill
An OpenClaw skill that provides tools for interacting with Agentic Flow. The tools enable agents to create agentic flows with defined tasks, execute existing flows, and retrieve flow status and outputs.
- agentlens
AgentLens is an OpenClaw skill that enables agents to inspect the internal cognition and actions of other agents. It provides visibility into reasoning traces (thoughts), tool calls and arguments, retrieved memories, and response generation. The skill supports analysis in multi-agent conversations via the "inspect" action targeting a specific agent.