← 返回 Skills 市场
hahg199

code-formatter199

作者 hahg199 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ pending
56
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install code-formatter199
功能描述
Format Python, JavaScript, TypeScript, JSON, HTML, CSS, and Go code snippets
使用说明 (SKILL.md)

\r \r

Description\r

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.\r \r

Supported Languages & Style Rules\r

  • Python: PEP 8 – 4 spaces per indentation level; no unnecessary blank lines; single quotes preferred.\r
  • JavaScript (JS): 2 spaces per level; semicolons optional but consistent; { on same line.\r
  • TypeScript (TS): same as JavaScript, plus explicit return types for functions when possible.\r
  • JSON: 2 spaces; no trailing commas; no comments; keys in double quotes.\r
  • HTML: 2 spaces per level; inline elements should not be broken across lines; self-closing tags for void elements.\r
  • CSS: 2 spaces; one selector per line; opening brace on same line; space after colon.\r
  • Go: use gofmt style – tabs for indentation (width 8); no extra spaces; consistent formatting.\r \r

Instructions\r

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

  1. Detect or ask for language if not provided. Supported: python, javascript, typescript, json, html, css, go.\r
  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.\r
  3. Apply the corresponding style rules from above.\r
  4. Output the formatted code inside a Markdown code block with the correct language identifier.\r
  5. Add a brief explanation of what changes were made (e.g., "Added 2-space indentation and fixed spacing after commas").\r \r 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."\r \r

Examples\r

\r

Example 1: Python\r

User: "Format this Python: def hello():print('world')"\r AI: \r

def hello():\r
    print('world')
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install code-formatter199
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /code-formatter199 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- 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.
元数据
Slug code-formatter199
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

code-formatter199 是什么?

Format Python, JavaScript, TypeScript, JSON, HTML, CSS, and Go code snippets. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 56 次。

如何安装 code-formatter199?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install code-formatter199」即可一键安装,无需额外配置。

code-formatter199 是免费的吗?

是的,code-formatter199 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

code-formatter199 支持哪些平台?

code-formatter199 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 code-formatter199?

由 hahg199(@hahg199)开发并维护,当前版本 v1.0.0。

💬 留言讨论