Token导航 LogoToken导航

Agent Skill · 待分类

shfmt-configuration(移动配置)

shfmt-configuration 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

shfmt-configuration 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证为 MIT,第三方扫描有未通过项,按安装量在待分类类的 11,209 个 Skill 里排第 7,230。

总安装 376周安装 16GitHub Stars 142下载 132核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shfmt-configuration(移动配置)
来源仓库:https://github.com/thebushidocollective/han
仓库路径:skills/shfmt-configuration
安装命令:
npx skills add https://github.com/thebushidocollective/han --skill shfmt-configuration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/thebushidocollective/han --skill shfmt-configuration

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。适合整理代码变更、跟踪任务状态或分析协作流程。可通过 GitHub API 获取仓库元数据和事件历史。安装前需确认账号权限,避免越权访问敏感仓库。

shfmt-configuration 属于待分类类 Skill,可作为该场景下的辅助能力补充。建议结合原始 README 了解具体命令和数据格式。

来源仓库内路径:skills/shfmt-configuration

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/thebushidocollective/han --skill shfmt-configu…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

shfmt-configuration 怎么安装?

在终端执行 npx skills add https://github.com/thebushidocollective/han --skill shfmt-configuration。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

shfmt-configuration 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

shfmt-configuration 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/thebushidocollective/han --skill shfmt-configuration;npx skills add thebushidocollective/han --skill "shfmt-configuration" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

shfmt-configuration 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

shfmt-configuration 用的人多吗?

公开数据是累计安装 376 次,近一周安装 16 次,下载 132 次,GitHub 142 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

shfmt-configuration 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
shfmt-configuration

移动配置 · 本页

376142执行命令MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

shfmt Configuration

Master shfmt configuration for consistent shell script formatting across projects, including configuration files, EditorConfig integration, and team standardization.

Overview

shfmt is a shell parser, formatter, and interpreter that supports POSIX Shell, Bash, and mksh. Configuration allows you to define consistent formatting rules for your shell scripts.

Configuration Methods

shfmt supports multiple configuration approaches, in order of precedence:

  1. Command-line flags (highest precedence)
  2. EditorConfig settings
  3. .shfmt.toml or shfmt.toml file

TOML Configuration File

Basic Configuration

Create .shfmt.toml or shfmt.toml in your project root:

# Shell dialect (posix, bash, mksh, bats)
shell = "bash"

# Indent with spaces (0 for tabs)
indent = 2

# Binary operators at start of line
binary-next-line = true

# Switch cases indented
switch-case-indent = true

# Redirect operators followed by space
space-redirects = false

# Keep column alignment paddings
keep-padding = false

# Function opening brace on next line
func-next-line = false

Configuration Options Explained

shell

Specifies the shell dialect for parsing:

# POSIX-compliant shell (most portable)
shell = "posix"

# Bash (default for .bash files)
shell = "bash"

# MirBSD Korn Shell
shell = "mksh"

# Bats (Bash Automated Testing System)
shell = "bats"

Auto-detection based on shebang if not specified:

  • #!/bin/sh -> posix
  • #!/bin/bash or #!/usr/bin/env bash -> bash
  • #!/bin/mksh -> mksh
indent

Controls indentation style:

# 2 spaces (common)
indent = 2

# 4 spaces
indent = 4

# Tabs (use 0)
indent = 0
binary-next-line

Controls binary operator positioning:

# Operators at end of line (default)
binary-next-line = false
# Result:
if [ "$a" = "foo" ] &&
   [ "$b" = "bar" ]; then
    echo "match"
fi
# Operators at start of next line
binary-next-line = true
# Result:
if [ "$a" = "foo" ] \
    && [ "$b" = "bar" ]; then
    echo "match"
fi
switch-case-indent

Controls case statement indentation:

# Cases at same level as switch (default)
switch-case-indent = false
# Result:
case "$1" in
start)
    do_start
    ;;
stop)
    do_stop
    ;;
esac
# Cases indented inside switch
switch-case-indent = true
# Result:
case "$1" in
    start)
        do_start
        ;;
    stop)
        do_stop
        ;;
esac
space-redirects

Controls spacing around redirections:

# No space before redirect (default)
space-redirects = false
# Result:
echo "hello" >file.txt
cat <input.txt
# Space before redirect
space-redirects = true
# Result:
echo "hello" > file.txt
cat < input.txt
keep-padding

Preserves alignment padding:

# Remove extra alignment spaces (default)
keep-padding = false
# Input with alignment:
short="value"
longer_var="another"

# Result (alignment removed):
short="value"
longer_var="another"
# Preserve alignment
keep-padding = true
# Result (alignment kept):
short=     "value"
longer_var="another"
func-next-line

Controls function brace placement:

# Opening brace on same line (default)
func-next-line = false
# Result:
my_function() {
    echo "hello"
}
# Opening brace on next line
func-next-line = true
# Result:
my_function()
{
    echo "hello"
}

EditorConfig Integration

shfmt respects EditorConfig settings. Create or update .editorconfig:

# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.sh]
indent_style = space
indent_size = 2

# shfmt-specific options
shell_variant = bash
binary_next_line = true
switch_case_indent = true
space_redirects = false
keep_padding = false
function_next_line = false

EditorConfig Option Mapping

shfmt flagEditorConfig key
-iindent_size (0 for tabs)
-lnshell_variant
-bnbinary_next_line
-ciswitch_case_indent
-srspace_redirects
-kpkeep_padding
-fnfunction_next_line

Command-Line Flags

Basic Usage

# Format file in place
shfmt -w script.sh

# Show diff of changes
shfmt -d script.sh

# List files that need formatting
shfmt -l .

# Format and output to stdout
shfmt script.sh

Formatting Options

# Set indent to 4 spaces
shfmt -i 4 script.sh

# Use tabs for indentation
shfmt -i 0 script.sh

# Specify shell dialect
shfmt -ln bash script.sh

# Binary operators on next line
shfmt -bn script.sh

# Indent switch cases
shfmt -ci script.sh

# Space after redirects
shfmt -sr script.sh

# Preserve padding
shfmt -kp script.sh

# Function brace on next line
shfmt -fn script.sh

Combined Example

# Common configuration
shfmt -i 2 -ci -bn -w script.sh

Project Configuration Patterns

Minimal Bash Project

# .shfmt.toml
shell = "bash"
indent = 2

POSIX-Compliant Scripts

# .shfmt.toml
shell = "posix"
indent = 4
binary-next-line = false
switch-case-indent = false

Modern Bash with All Features

# .shfmt.toml
shell = "bash"
indent = 2
binary-next-line = true
switch-case-indent = true
space-redirects = false
func-next-line = false

Team Standardization

# .shfmt.toml - enforce team standards
shell = "bash"
indent = 2
binary-next-line = true
switch-case-indent = true
keep-padding = false

CI/CD Integration

GitHub Actions

name: Shell Format Check
user-invocable: false
on: [push, pull_request]
jobs:
  shfmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install shfmt
        run: |
          curl -sS https://webinstall.dev/shfmt | bash
          export PATH="$HOME/.local/bin:$PATH"
      - name: Check formatting
        run: shfmt -d .

Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/scop/pre-commit-shfmt
    rev: v3.8.0-1
    hooks:
      - id: shfmt
        args: ["-w"]

Makefile Target

.PHONY: fmt-check fmt

fmt-check:
 shfmt -d .

fmt:
 shfmt -w .

Best Practices

  1. Commit Configuration - Always commit .shfmt.toml for team consistency
  2. Match Dialect - Set shell to match your script shebangs
  3. EditorConfig First - Use EditorConfig for IDE integration
  4. CI Enforcement - Run shfmt -d in CI to catch formatting issues
  5. Consistent Indentation - Pick 2 or 4 spaces and stick with it
  6. Document Choices - Add comments explaining non-default options
  7. Version Lock - Pin shfmt version in CI for reproducibility

Troubleshooting

Configuration Not Applied

Check precedence order:

  1. Command-line flags override everything
  2. EditorConfig in file's directory
  3. .shfmt.toml in project root

Wrong Shell Dialect

Verify shebang matches configuration:

# If using shell = "bash", ensure scripts have:
#!/usr/bin/env bash
# or
#!/bin/bash

EditorConfig Not Detected

Ensure EditorConfig file is in parent directory chain and has correct section:

[*.sh]
shell_variant = bash

When to Use This Skill

  • Setting up shfmt in new projects
  • Configuring team-wide formatting standards
  • Integrating shfmt with CI/CD pipelines
  • Troubleshooting configuration issues
  • Migrating between configuration methods
  • Setting up EditorConfig for shell scripts

平台分布

Claude Code

27.44%
按下载量换算36

Codex

21.53%
按下载量换算28

OpenCode

16.09%
按下载量换算21

trae

12.26%
按下载量换算16

Antigravity

7.69%
按下载量换算10

windsurf

3.15%
按下载量换算4

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/thebushidocollective/han --skill shfmt-configuration;npx skills add thebushidocollective/han --skill "shfmt-configuration" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills