← 返回
未分类

code-formatter199

Format Python, JavaScript, TypeScript, JSON, HTML, CSS, and Go code snippets
格式化 Python、JavaScript、TypeScript、JSON、HTML、CSS 和 Go 代码片段
hahg199 hahg199 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 11
Stars
📥 283
下载
💾 0
安装
1
版本
#latest

概述

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 gofmt style – tabs for indentation (width 8); no extra spaces; consistent formatting.

Instructions

When the user provides a code snippet and specifies (or implies) a language:

  1. Detect or ask for language if not provided. Supported: python, javascript, typescript, json, html, css, go.
  2. Check for syntax errors – if the code is clearly invalid (e.g., unmatched braces, missing quotes), inform the user and suggest correction before formatting.
  3. Apply the corresponding style rules from above.
  4. Output the formatted code inside a Markdown code block with the correct language identifier.
  5. 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')

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-23 23:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

random-fact

hahg199
从预设趣闻库中随机提供科学、历史或日常生活的有趣事实,无需外部数据源。
★ 11 📥 322
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 328,972
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 75 📥 182,319