skills/coding/coding/SKILL.md
Root: language selection, paradigm guidance, code quality SOLID/DRY/YAGNI, PR standards
npx skillsauth add alphaonedev/openclaw-graph codingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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.
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.
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
--language specifies the language (e.g., "python", "java"); --paradigm sets guidance type (e.g., "oop"); --check enables quality checks (e.g., "solid", "dry").API Endpoint: POST to /api/coding/assist
Authorization: Bearer $OPENCLAW_API_KEYCode 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.
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.
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.
Example 1: Generating Code with Language Selection
openclaw code --language python --paradigm oop --prompt "Implement a counter class"$OPENCLAW_API_KEY, run the command, and integrate the response into your project.Example 2: Code Quality Review for PR
/api/coding/assist with body {"code": "function add(a) { return a + 1; } function addTwo(b) { return b + 2; }", "language": "js", "checks": ["dry"]}tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui