git-worktree-status

GitHub

检查 git worktree 中后台验证任务(类型检查、测试、构建)的状态,提供非阻塞的健康反馈。

examples/skills/git-worktree-status/SKILL.md FlorianBruniaux/claude-code-ultimate-guide

Trigger Scenarios

用户需要确认当前 worktree 的构建或测试状态 用户想查看后台运行的 CI 任务进度或结果

Install

npx skills add FlorianBruniaux/claude-code-ultimate-guide --skill git-worktree-status -g -y
More Options

Non-standard path

npx skills add https://github.com/FlorianBruniaux/claude-code-ultimate-guide/tree/main/examples/skills/git-worktree-status -g -y

Use without installing

npx skills use FlorianBruniaux/claude-code-ultimate-guide@git-worktree-status

指定 Agent (Claude Code)

npx skills add FlorianBruniaux/claude-code-ultimate-guide --skill git-worktree-status -a claude-code -g -y

安装 repo 全部 skill

npx skills add FlorianBruniaux/claude-code-ultimate-guide --all -g -y

预览 repo 内 skill

npx skills add FlorianBruniaux/claude-code-ultimate-guide --list

SKILL.md

Frontmatter
{
    "name": "git-worktree-status",
    "effort": "low",
    "description": "Check status of background verification tasks running in a git worktree",
    "when_to_use": "Use to see all active worktrees and their current branch status.",
    "disable-model-invocation": true
}

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

Situation Output
All checks pass Green status, ready to work
Checks still running "RUNNING..." with PID
Type errors found Error count + first 5 errors
Test failures Failure count + failed test names
No logs found "NOT RUN" (use --fast or logs deleted)
Not in worktree Error message with instructions

Usage

/git-worktree-status

No arguments needed. Run from inside any worktree directory.

Version History

  • fa57065 Current 2026-07-25 10:18

Same Skill Collection

.agents/skills/guide-recap/SKILL.md
.agents/skills/self-assessment/SKILL.md
.agents/skills/source-command-audit-prose/SKILL.md
.agents/skills/source-command-audit-whitepapers/SKILL.md
.agents/skills/source-command-ccguide-daily/SKILL.md
.agents/skills/source-command-ccguide-diff-docs/SKILL.md
.agents/skills/source-command-ccguide-init-docs/SKILL.md
.agents/skills/source-command-ccguide-refresh-docs/SKILL.md
.agents/skills/source-command-methodology-advisor/SKILL.md
.agents/skills/source-command-track-mentions/SKILL.md
.agents/skills/source-command-update-infos-release/SKILL.md
.claude/skills/self-assessment/SKILL.md
examples/skills/audit-agents-skills/SKILL.md
examples/skills/audit-codebase/SKILL.md
examples/skills/autoresearch/SKILL.md
examples/skills/canary/SKILL.md
examples/skills/catchup/SKILL.md
examples/skills/ccboard/SKILL.md
examples/skills/check-cache-bugs/SKILL.md
examples/skills/ci-all/SKILL.md
examples/skills/ci-pipeline/SKILL.md
examples/skills/ci-status/SKILL.md
examples/skills/ci-tests/SKILL.md
examples/skills/commit/SKILL.md
examples/skills/cyber-defense-team/SKILL.md
examples/skills/design-patterns/SKILL.md
examples/skills/diagnose/SKILL.md
examples/skills/eval-agents/SKILL.md
examples/skills/eval-hooks/SKILL.md
examples/skills/eval-rules/SKILL.md
examples/skills/eval-skills/SKILL.md
examples/skills/explain/SKILL.md
examples/skills/git-ai-archaeology/SKILL.md
examples/skills/git-worktree-clean/SKILL.md
examples/skills/git-worktree-remove/SKILL.md
examples/skills/git-worktree/SKILL.md
examples/skills/guide-recap/SKILL.md
examples/skills/handoff-create/SKILL.md
examples/skills/handoff-resume/SKILL.md
examples/skills/handoff-update/SKILL.md
examples/skills/investigate/SKILL.md
examples/skills/issue-triage/SKILL.md
examples/skills/land-and-deploy/SKILL.md
examples/skills/landing-page-generator/SKILL.md
examples/skills/learn-alternatives/SKILL.md
examples/skills/learn-quiz/SKILL.md
examples/skills/learn-teach/SKILL.md
examples/skills/mcp-integration-reference/SKILL.md
examples/skills/methodology-advisor/SKILL.md

Metadata

Files
0
Version
a8d88fe
Hash
5ba52c7f
Indexed
2026-07-25 10:18

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 23:17
浙ICP备14020137号-1 $방문자$