本文へ移動
cccskills
無料GitHub で公開

git-worktree-status

Check status of background verification tasks running in a git worktree

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Git worktree status

Check background verification tasks (type check, tests, build) launched by /git-worktree.

Core principle: Non-blocking feedback on worktree health without interrupting development flow.

Part of: Worktree Lifecycle Suite | /git-worktree | /git-worktree-remove | /git-worktree-clean

Process

  1. Detect Current Worktree: Verify we're inside a git worktree
  2. Check Log Files: Read .worktree-logs/ for background task results
  3. Parse Results: Extract pass/fail counts, errors
  4. Report Status: Color-coded summary with actionable next steps

Worktree detection

# Check if inside a worktree (not main repo)
git rev-parse --git-common-dir 2>/dev/null | grep -q "\.git/worktrees" || {
  echo "Not inside a worktree. Use from a worktree directory."
  exit 1
}

# Get worktree info
WORKTREE_PATH=$(git rev-parse --show-toplevel)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
MAIN_REPO=$(git rev-parse --git-common-dir | sed 's|/\.git/worktrees/.*||')

Background task checks

Type check status

LOG=".worktree-logs/typecheck.log"

if [ -f "$LOG" ]; then
  if grep -q "error TS" "$LOG"; then
    ERROR_COUNT=$(grep -c "error TS" "$LOG")
    echo "Type check: FAIL ($ERROR_COUNT errors)"
    # Show first 5 errors
    grep "error TS" "$LOG" | head -5
  else
    echo "Type check: PASS"
  fi
elif pgrep -f "tsc --noEmit" > /dev/null; then
  echo "Type check: RUNNING..."
else
  echo "Type check: NOT RUN"
fi

Test status

LOG=".worktree-logs/tests.log"

if [ -f "$LOG" ]; then
  if grep -q '"numFailedTests":0' "$LOG"; then
    TOTAL=$(grep -o '"numTotalTests":[0-9]*' "$LOG" | cut -d: -f2)
    echo "Tests: PASS ($TOTAL tests)"
  else
    FAILED=$(grep -o '"numFailedTests":[0-9]*' "$LOG" | cut -d: -f2)
    echo "Tests: FAIL ($FAILED failures)"
    # Show failed test names
    grep '"fullName"' "$LOG" | head -5
  fi
elif pgrep -f "vitest run" > /dev/null; then
  echo "Tests: RUNNING..."
else
  echo "Tests: NOT RUN"
fi

Build status

LOG=".worktree-logs/build.log"

if [ -f "$LOG" ]; then
  if [ $? -eq 0 ]; then
    echo "Build: PASS"
  else
    echo "Build: FAIL"
    tail -10 "$LOG"
  fi
elif pgrep -f "cargo build\|next build\|go build" > /dev/null; then
  echo "Build: RUNNING..."
else
  echo "Build: NOT RUN"
fi

Report format

Worktree Status: .worktrees/feat/auth
Branch: feat/auth (from main, 3 commits ahead)

Checks:
  Type check:  PASS
  Tests:       PASS (142 tests)
  Build:       NOT RUN

Dependencies: symlinked from main
Disk usage: 2.3 MB (excl. node_modules)

Log files: .worktree-logs/

If failures detected:

Worktree Status: .worktrees/feat/auth
Branch: feat/auth (from main, 3 commits ahead)

Checks:
  Type check:  FAIL (3 errors)
    src/auth.ts:42 - error TS2345: Argument of type 'string' is not assignable
    src/auth.ts:67 - error TS2304: Cannot find name 'AuthConfig'
    src/middleware.ts:12 - error TS7006: Parameter 'req' implicitly has an 'any' type
  Tests:       FAIL (2 failures)
    auth.test.ts > should validate token
    auth.test.ts > should reject expired token
  Build:       NOT RUN

Action: Fix type errors before proceeding. Run `npx tsc --noEmit` for full output.

Log management

# Clean old logs (useful for re-running checks)
rm -rf .worktree-logs/*.log

# Re-run all checks
npx tsc --noEmit > .worktree-logs/typecheck.log 2>&1 &
npx vitest run --reporter=json > .worktree-logs/tests.log 2>&1 &

Quick reference

SituationOutput
All checks passGreen status, ready to work
Checks still running"RUNNING..." with PID
Type errors foundError count + first 5 errors
Test failuresFailure count + failed test names
No logs found"NOT RUN" (use --fast or logs deleted)
Not in worktreeError message with instructions

Usage

/git-worktree-status

No arguments needed. Run from inside any worktree directory.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Audit Claude Code agents, skills, and commands for quality and production readiness. Use when evaluating skill quality, checking production readiness scores, or comparing agents against best-practice templates.

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

Codebase health audit scoring 7 categories with progression plan

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

Autonomous improvement loop: scan codebase metrics, scaffold experiment files, run agent-driven iterations until metric improves

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

best-of-n

無料

Generate bounded independent candidates, score them against a frozen rubric, and verify the selected result with a proof log.

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

canary

無料

Post-deploy monitoring: watch production after a deploy and alert on regressions

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

catchup

無料

Restore context after /clear by summarizing recent work and project state

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

FlorianBruniaux のスキルをすべて見る

このスキルの問題を報告する