code-formatter199 OpenClaw Skill
Format Python, JavaScript, TypeScript, JSON, HTML, CSS, and Go code snippets
Installation
clawhub install code-formatter199
Requires npm i -g clawhub
317
Downloads
11
Stars
0
current installs
0 all-time
1
Versions
Power your OpenClaw skills with
the best open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
Explore Inference APIGLM
GLM 5
$1.00 / $3.20
per M tokens
Kimi
Kimi K2.5
$0.60 / $2.80
per M tokens
MiniMax
MiniMax M2.5
$0.30 / $1.20
per M tokens
Qwen
Qwen3.5 122B
$0.40 / $3.00
per M tokens
name: code-formatter
description: "Format Python, JavaScript, TypeScript, JSON, HTML, CSS, and Go code snippets"
version: 1.1.0
author: hahg199
tags:
- code
- formatter
- python
- javascript
- typescript
- json
- html
- css
- go
Description
This skill takes raw, poorly indented code and returns a nicely formatted, readable version following community standard style guides. It supports multiple languages and provides clear error messages when language is not recognized or code is invalid.
Supported Languages & Style Rules
- Python: PEP 8 – 4 spaces per indentation level; no unnecessary blank lines; single quotes preferred.
- JavaScript (JS): 2 spaces per level; semicolons optional but consistent;
{on same line. - TypeScript (TS): same as JavaScript, plus explicit return types for functions when possible.
- JSON: 2 spaces; no trailing commas; no comments; keys in double quotes.
- HTML: 2 spaces per level; inline elements should not be broken across lines; self-closing tags for void elements.
- CSS: 2 spaces; one selector per line; opening brace on same line; space after colon.
- Go: use
gofmtstyle – tabs for indentation (width 8); no extra spaces; consistent formatting.
Instructions
When the user provides a code snippet and specifies (or implies) a language:
- Detect or ask for language if not provided. Supported: python, javascript, typescript, json, html, css, go.
- Check for syntax errors – if the code is clearly invalid (e.g., unmatched braces, missing quotes), inform the user and suggest correction before formatting.
- Apply the corresponding style rules from above.
- Output the formatted code inside a Markdown code block with the correct language identifier.
- Add a brief explanation of what changes were made (e.g., "Added 2-space indentation and fixed spacing after commas").
If the language is not supported, respond with: "Sorry, I don't support formatting for {language} yet. Supported languages: python, javascript, typescript, json, html, css, go."
Examples
Example 1: Python
User: "Format this Python: def hello():print('world')"
AI:
def hello():
print('world')
Statistics
Author
hahg199
@hahg199
Latest Changes
v1.0.0 · May 22, 2026
- Added HTML, CSS, and Go to supported languages. - Now provides clear error messages for invalid code or unsupported languages. - Outputs formatted code in a Markdown code block with language identifier. - Includes a brief explanation of formatting changes after each output. - Updated instructions and examples for improved clarity.
Quick Install
clawhub install code-formatter199 Related Skills
Other popular skills you might find useful.
Chat with 100+ AI Models in one App.
Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.