From statusline-builder
Claude Code statusline を番号選択で組み立てる対話型ビルダー。 1-5 行構成 × 21 widget カタログから番号入力で選択、 preview → 全承認 → backup → atomic 書出し で `~/.claude/statusline-command.sh` を安全に生成する。 既存 statusline は BEGIN/END marker block 外を独自処理として検出表示し、 保持希望は「修正」選択で新 script に統合。 公式 statusline JSON schema 準拠。 トリガー = statusline 作りたい / statusline 変えたい / /statusline-builder / ステータスライン カスタマイズ
How this skill is triggered — by the user, by Claude, or both
Slash command
/statusline-builder:statusline-builderThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Claude Code statusline を **対話型番号選択** で組み立てる。
Claude Code statusline を 対話型番号選択 で組み立てる。
/statusline-builder を起動するエンドユーザー。 必須コマンド = bash >= 4.0 (macOS 標準 3.2 不可、 brew install bash 必須)、 jq。 推奨 = git (widget #6/#8/#9/#10 利用時)、 awk (#1/#2/#5 利用時、 #5 は不在時 bash 整数除算 fallback)。 Windows ネイティブ PowerShell は対応外。/statusline-builder skill を起動する別セッション Claude: 本 SKILL.md + references/widget-catalog.md + references/apply-flow.md を読んで対話実行する Claude。 受け手 1 に対して 4 step 対話 + AskUserQuestion + 公式 schema 準拠の jq 抽出式生成を担当。~/.claude/statusline-command.sh を実行する Claude Code 本体: 起動時 subshell で bash 実行、 stdin = JSON (公式 statusline schema)。 受け手 3 が出力する stdout が statusline に表示される。本 skill が生成する statusline-command.sh は Claude Code 公式 schema (https://code.claude.com/docs/en/statusline) の field path を使用。 widget jq 式詳細は references/widget-catalog.md を参照。 公式 schema 更新時の保守手順も同ファイルに記述。
| Case | 条件 | 編集動作 | AskUserQuestion 選択肢 |
|---|---|---|---|
| A | settings.json ファイル未存在 | {} 起点で {"statusLine":{...}} 生成 | 3 択 (適用 / 修正 / 中止) |
| B | settings.json あり、 statusLine 未設定 | jq merge で statusLine 追記 | 3 択 (適用 / 修正 / 中止) |
| C | settings.json あり、 statusLine.command が ~/.claude/statusline-command.sh 以外 | 差分表示 + 切替分岐 | 4 択 (適用 (切替) / 適用 (script のみ) / 修正 / 中止) |
| D | settings.json あり、 statusLine.command が ~/.claude/statusline-command.sh | 編集無し (整合済) | 3 択 (適用 / 修正 / 中止) |
詳細手順 = references/apply-flow.md 参照。
# bash version >= 4.0 確認 (macOS 標準 3.2 不可)
if [ -z "${BASH_VERSION:-}" ]; then echo "bash 必須"; exit 1; fi
BASH_MAJOR="${BASH_VERSION%%.*}"
if [ "$BASH_MAJOR" -lt 4 ]; then echo "bash 4.0+ 必須 (現状: $BASH_VERSION、 macOS は brew install bash で更新)"; exit 1; fi
command -v jq >/dev/null 2>&1 || { echo "jq 必須 (install: brew install jq / apt install jq)"; exit 1; }
不在/低 version 検出時はエラー表示 + references/widget-catalog.md の OS 別 install 手順表に誘導して skill 終了。
AskUserQuestion で 4 択提示: 1 行 / 2 行 / 3 行 / 4-5 行。 4-5 選択時は更に 「4 か 5 か」 自由入力で確認。
references/widget-catalog.md の 21 widget 表を提示。 行ごとに番号入力を受付:
1,3,7 → widget #1, #3, #71 3 7 も許容1-3 → #1, #2, #3AskUserQuestion y/n)。 y → preset 自動採用 (line1=11,1,2 / line2=6,7,8,9,10 / line3=21)、 n → 番号入力要求references/apply-flow.md Step 4.1 に従って:
tests/fixtures/input-default.json を食わせた想定出力) も表示~/.claude/statusline-command.sh の BEGIN/END marker block 外の行を独自処理として検出表示 (存在時のみ)AskUserQuestion で承認:
「適用」 → references/apply-flow.md Step 4.3 の set -Eeuo pipefail + fail() + atomic 書出し (backup → tmp 書出し → atomic rename、 失敗時 cleanup_on_failure で全 rollback) を実行。 「修正」 → Step 2 に戻る。 「中止」 → ファイル変更無し終了。
#!/usr/bin/env bash
# Generated by statusline-builder on YYYY-MM-DD HH:MM:SS
# 公式 statusline JSON schema 準拠: https://code.claude.com/docs/en/statusline
# Edit this file directly only OUTSIDE BEGIN/END marker block. Inside marker block = builder generated, will be overwritten on next /statusline-builder regenerate.
# bash version >= 4.0 確認 (macOS 標準 3.2 不可)
if [ -z "${BASH_VERSION:-}" ] || [ "${BASH_VERSION%%.*}" -lt 4 ]; then exit 0; fi
# 必須 command 存在確認 (jq 不在時は早期 exit 0、 statusline は空表示で graceful degrade)
command -v jq >/dev/null 2>&1 || { exit 0; }
# 推奨 command (不在時は対応 widget が個別に fallback or 空文字に縮退):
# - git: #6 / #8 / #9 / #10 で利用、 widget 内で `command -v git` チェック → 不在時 空文字
# - awk: #1 / #2 (printf %.0f 内蔵で代替可) / #5 (bash 整数除算で fallback)
# BEGIN statusline-builder managed (v0.1.0)
input=$(cat)
dir=$(echo "$input" | jq -r '.workspace.current_dir // "."')
# 各 widget の jq + bash 実装 (widget-catalog.md と整合) を選択番号順に並べる
{{widget 別 jq 式}}
# 出力契約: 各 widget = stdout 1 片 (空文字可)、 区切り = ` | `、 空文字 widget は skip
format_line() {
local out=""
local w
for w in "$@"; do
if [ -n "$w" ]; then
if [ -n "$out" ]; then out="${out} | ${w}"; else out="$w"; fi
fi
done
echo "$out"
}
# 3 行構成例 (行数に応じて引数 + printf format 調整)
printf "%s\n%s\n%s" "$(format_line "$w1" "$w2" "$w3")" "$(format_line "$w4" "$w5" "$w6" "$w7" "$w8")" "$(format_line "$w9")"
# END statusline-builder managed
注意: format_line は local -n (bash 4.3+ namref) を使わず、 "$@" 引数渡しで bash 4.0+ 互換。
必須コマンド (bash >= 4.0、 jq) の OS 別 install 手順は references/widget-catalog.md 末尾の表を参照。 /statusline-builder 起動時に Step 0 で command -v bash jq + bash version 確認、 不在 / 低 version 時はエラー表示で skill 終了し install 案内。
npx claudepluginhub arkatom/claude-plugins --plugin statusline-builderGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Synthesizes the current conversation into a structured spec (PRD) and publishes it to the project issue tracker with a ready-for-agent label, without interviewing the user.