code-formatter199
Format Python, JavaScript, TypeScript, JSON, HTML, CSS, and Go code snippets
hahg199
@hahg199
What This Skill Does
Takes raw, poorly indented code snippets and returns them formatted according to community-standard style guides for Python, JavaScript, TypeScript, JSON, HTML, CSS, and Go. It detects syntax errors before formatting and explains what changes were made.
Replaces manually fixing indentation and style inconsistencies across multiple programming languages by applying PEP 8, gofmt, and other standard rules automatically.
When to Use It
- Clean up a messy Python script to follow PEP 8 conventions
- Format a block of JavaScript or TypeScript with consistent 2-space indentation
- Pretty-print a minified JSON file for readability
- Fix spacing and brace placement in an HTML or CSS snippet
- Apply gofmt-style formatting to a Go code snippet
- Check a code snippet for syntax errors before formatting it
Install
$ openclaw skills install @hahg199/code-formatter199Description
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')
Top skills in this category
Skill Vetter
@spclaudehomeSecurity-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
Github
@steipeteInteract with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Humanizer
@biostartechnologyRemove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
Free Ride - Unlimited free AI
@shaivpidadiManages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates opencla...
Elite Longterm Memory
@nextfrontierbuildsUltimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.