MCPInstall

coding

Root: language selection, paradigm guidance, code quality SOLID/DRY/YAGNI, PR standards

Installs
69
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/alphaonedev/openclaw-graph --skill coding
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads coding automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

coding

Purpose

This skill enables OpenClaw to assist with coding tasks, including selecting programming languages, guiding on paradigms (e.g., OOP, functional), enforcing code quality principles like SOLID, DRY, and YAGNI, and adhering to PR standards such as meaningful commits and code reviews.

When to Use

Use this skill when writing new code, refactoring existing code, or reviewing pull requests. Apply it for language selection in multi-language projects, paradigm decisions in complex systems, or quality checks to avoid anti-patterns. Ideal for developers facing decisions on code structure or standards compliance.

Key Capabilities

  • Language selection: Automatically suggests languages based on project needs, e.g., recommending Python for scripting or Java for enterprise apps.
  • Paradigm guidance: Provides advice on paradigms like OOP (e.g., use classes for encapsulation) or functional programming (e.g., prefer immutability).
  • Code quality enforcement: Checks for SOLID principles (e.g., Single Responsibility: ensure classes have one reason to change) and DRY/YAGNI (e.g., detect duplicated code blocks).
  • PR standards: Validates commits against rules like atomic changes and descriptive messages.
  • Integration with tools: Parses Git diffs for PR reviews or analyzes code snippets for quality metrics.

Usage Patterns

To use this skill, invoke OpenClaw via CLI or API, specifying inputs like code snippets or project context. For language selection, provide project requirements; for paradigm guidance, include code samples. Always pass an API key via environment variable, e.g., set $OPENCLAW_API_KEY before commands. Structure requests with JSON payloads containing fields like "language", "code", and "paradigm". Handle responses by parsing JSON for suggestions or corrections. Example pattern: Pipe code through OpenClaw for real-time feedback in a CI/CD pipeline.

Common Commands/API

Use the OpenClaw CLI for quick tasks or the REST API for programmatic access. CLI commands require $OPENCLAW_API_KEY set. API endpoints use POST requests with JSON bodies.

  • CLI Command: openclaw code --language python --paradigm oop --check solid < input.txt

    • Flags: --language specifies the language (e.g., "python", "java"); --paradigm sets guidance type (e.g., "oop"); --check enables quality checks (e.g., "solid", "dry").
    • Output: JSON with suggestions, e.g., {"suggestion": "Use a class for this function."}
  • API Endpoint: POST to /api/coding/assist

    • Body: JSON like {"code": "def add(a, b): return a + b", "language": "python", "checks": ["dry", "yagni"]}
    • Headers: Include Authorization: Bearer $OPENCLAW_API_KEY
    • Response: JSON object, e.g., {"quality_score": 8, "issues": ["Function violates DRY principle"]}
  • Code Snippet for API Call (Python):

    import requests
    api_key = os.environ.get('OPENCLAW_API_KEY')
    response = requests.post('https://api.openclaw.ai/api/coding/assist', headers={'Authorization': f'Bearer {api_key}'}, json={'code': 'some code', 'language': 'js'})
    print(response.json()['suggestion'])
    
  • Config Format: Use JSON for configurations, e.g.,

    {
      "default_language": "python",
      "checks": ["solid", "dry"],
      "paradigm": "functional"
    }
    

    Save as .openclaw-config.json in your project root for CLI overrides.

Integration Notes

Integrate this skill into IDEs like VS Code via extensions or scripts that call the API. For CI/CD, use it in GitHub Actions by adding a step: run: openclaw code --check solid --input path/to/code.py. Ensure $OPENCLAW_API_KEY is stored securely, e.g., in GitHub Secrets as OPENCLAW_API_KEY. For web apps, embed API calls in backend services, handling rate limits (e.g., 100 requests/min). Test integrations with mock responses to avoid live API hits during development.

Error Handling

When errors occur, check HTTP status codes from API responses (e.g., 401 for unauthorized, indicating missing $OPENCLAW_API_KEY). For CLI, parse error messages like "Error: Invalid language specified" and retry with corrections. Implement retry logic for transient errors (e.g., 5xx status codes) using exponential backoff. In code, wrap API calls in try-except blocks:

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()
except requests.exceptions.HTTPError as e:
    print(f"Error: {e.response.status_code} - {e.response.text}")

Log errors with context, such as the input code, for debugging.

Concrete Usage Examples

  1. Example 1: Generating Code with Language Selection

    • Task: Write a simple function in Python using OOP paradigm.
    • Command: openclaw code --language python --paradigm oop --prompt "Implement a counter class"
    • Expected: Output JSON with code like {"code": "class Counter: def init(self): self.count = 0"}
    • How: Set $OPENCLAW_API_KEY, run the command, and integrate the response into your project.
  2. Example 2: Code Quality Review for PR

    • Task: Check a JavaScript snippet for DRY and SOLID violations.
    • API Call: POST to /api/coding/assist with body {"code": "function add(a) { return a + 1; } function addTwo(b) { return b + 2; }", "language": "js", "checks": ["dry"]}
    • Expected: Response like {"issues": ["Functions are similar; consider a generic add function to follow DRY"]}
    • How: Use the response to refactor code before committing, e.g., merge functions in your editor.

Graph Relationships

  • Related to: debugging (shares code analysis capabilities), testing (enforces quality for testability), deployment (guides on production-ready code).
  • Clusters: coding (primary), software (secondary for broader development tasks).

FAQ

What does the coding skill do?

Root: language selection, paradigm guidance, code quality SOLID/DRY/YAGNI, PR standards

How do I install coding?

Run npx skills add https://github.com/alphaonedev/openclaw-graph --skill coding in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/coding/ (personal) or .claude/skills/coding/ (project).

Which AI agents can use coding?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is coding safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains coding?

It is published by alphaonedev in alphaonedev/openclaw-graph. It has 69 recorded installs.

More from alphaonedev/openclaw-graph

View all →

playwright-scraper

alphaonedev/openclaw-graph

Playwright web scraping: dynamic content, auth flows, pagination, data extraction, screenshots

Testing & QA1.6K installs

humanize-ai-text

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

463 installs

gcp-iam

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

DevOps & Cloud431 installs

macos-automation

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

food-order

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

249 installs

tavily-web-search

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.