c-bash
make .sh files follow common C code conventions for readability and maintainability
от teknopaul★ 17 звёзд на GitHub
Установить c-bash в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
All .sh files should follow doc/bash-coding-standards.md
You MUST work on one file at a time, don't do bulk updates since these tend to break scripts subtly.
When replacing "${var}" it is not always safe to use $var, especially if the variable might contain spaces or unknown input.
It is only safe to use the shortened $var syntax when the variable is known to be a simple string value, usually that means its set earlier in the script.
It is also only safe to remove the {} if the use of this variable does not cause ambiguity, or if the text following it does not cause bash to interpret it as a different variable.
After making changes to each file one at a time you must bash -n the changed script and then run the script to make sure it still works.
converting non-compliant code
When asked to convert bash to to these conventions...
Never do mass sed/perl replacements across many files at once.
Each change must be read in context first. A variable that looks like a path may hold multi-line output, quoted strings, or JSON. The fix that is correct for one variable may silently corrupt another.
Quotes are load-bearing — check usage before removing them "$var" is NOT just style. It is required when:
the variable may contain spaces (file names, URLs with query strings, response bodies)
the variable may contain newlines (curl response bodies, grep output)
the variable may contain glob characters (*, ?, [)
the variable is on the right-hand side of and could contain * or ?
Only remove quotes when you can see, from reading the script, that none of these apply. echo "$var" must stay quoted when var is a response body echo $var word-splits and glob-expands. echo "$var" preserves newlines. Any variable holding HTTP response bodies, JSON, or log output must keep quotes.
Work iteratively — one file at a time
- Read the full file
- Identify violations
- Understand each variable's content and all its usages
- Make targeted changes
- Run bash -n and the test before moving to the next file
Never use automated tools (sed/perl/python) to rename variables across files
Variable names are not unique tokens — $body in one script is a response body requiring quotes; in another it is a simple path. Mass rename without reading context will introduce bugs. The rule is: remove ${braces} only, not quotes
"${foo}" → "$foo" is usually safe (keeps quotes, removes unnecessary braces). If any code uses "${foo}_baa" changing to "$foo_bar" is not safe.
"${foo}" → $foo is only safe after reading the specific usage.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
bash
Вложенные файлы
- bash-coding-standards.md
FAQ
Что делает скилл c-bash?
make .sh files follow common C code conventions for readability and maintainability
Как установить скилл c-bash?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл c-bash запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…