MCP HubMCP Hub
スキル一覧に戻る

git-sync-manager-3-repository-status-check

vamseeachanta
更新日 Today
7 閲覧
3
2
3
GitHubで表示
その他general

について

このスキルは、複数のGitリポジトリの同期ステータスを、未コミットの変更、未プッシュのコミット、リモートブランチからの分岐を検出することでチェックします。複数のリポジトリを管理し、保留中の変更を素早く把握する必要がある開発者にとって便利です。このツールは自動化されたワークフロー統合のため、「uncommitted」や「behind_remote」のような明確なステータスコードを返します。

クイックインストール

Claude Code

推奨
メイン
npx skills add vamseeachanta/workspace-hub
プラグインコマンド代替
/plugin add https://github.com/vamseeachanta/workspace-hub
Git クローン代替
git clone https://github.com/vamseeachanta/workspace-hub.git ~/.claude/skills/git-sync-manager-3-repository-status-check

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

3. Repository Status Check (+1)

3. Repository Status Check

Get detailed status for multiple repositories:

#!/bin/bash
# ABOUTME: Check git status across multiple repositories
# ABOUTME: Reports uncommitted, unpushed, and behind-remote states

check_repo_status() {
    local repo="$1"

    if [[ ! -d "$repo/.git" ]]; then
        echo "not_git"
        return
    fi

    cd "$repo" || return

    # Check for uncommitted changes
    if ! git diff --quiet 2>/dev/null || ! git diff --cached --quiet 2>/dev/null; then
        echo "uncommitted"
        return
    fi

    # Check for unpushed commits
    local branch
    branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
    local ahead
    ahead=$(git rev-list --count "origin/$branch..HEAD" 2>/dev/null || echo "0")

    if [[ "$ahead" -gt 0 ]]; then
        echo "unpushed"
        return
    fi

    # Check if behind remote
    git fetch origin "$branch" --quiet 2>/dev/null
    local behind
    behind=$(git rev-list --count "HEAD..origin/$branch" 2>/dev/null || echo "0")

    if [[ "$behind" -gt 0 ]]; then
        echo "behind"
        return
    fi

    echo "clean"
}

# Batch status check
batch_status() {
    local repos=("$@")

    printf "%-30s %-15s %s\n" "Repository" "Status" "Branch"
    printf "%s\n" "────────────────────────────────────────────────────────"

    for repo in "${repos[@]}"; do
        local status
        status=$(check_repo_status "$repo")

        local branch="N/A"
        if [[ -d "$repo/.git" ]]; then
            branch=$(cd "$repo" && git rev-parse --abbrev-ref HEAD 2>/dev/null)
        fi

        local color=""
        case "$status" in
            clean)      color="${GREEN}" ;;
            uncommitted) color="${YELLOW}" ;;
            unpushed)   color="${CYAN}" ;;
            behind)     color="${RED}" ;;
            *)          color="${NC}" ;;
        esac

        printf "%-30s ${color}%-15s${NC} %s\n" "$repo" "$status" "$branch"
    done
}

4. Category-Based Operations

Filter repositories by category (Work/Personal):

#!/bin/bash
# ABOUTME: Category-based repository filtering
# ABOUTME: Parse categories from .gitignore comments

declare -A REPO_CATEGORIES

# Parse categories from .gitignore comments
# Format: repo_name/   # Category
parse_categories() {
    local gitignore="$1"

    while IFS= read -r line; do
        if [[ "$line" =~ ^([a-zA-Z0-9_-]+)/[[:space:]]*#[[:space:]]*(Personal|Work|Both)$ ]]; then
            local name="${BASH_REMATCH[1]}"
            local category="${BASH_REMATCH[2]}"
            REPO_CATEGORIES["$name"]="$category"
        fi
    done < "$gitignore"
}

# Get repos by category
get_repos_by_category() {
    local target_category="$1"
    local repos=()

    for repo in "${!REPO_CATEGORIES[@]}"; do
        local category="${REPO_CATEGORIES[$repo]}"

        if [[ "$category" == "$target_category" ]] || \
           [[ "$target_category" == "all" ]] || \
           [[ "$category" =~ $target_category ]]; then
            repos+=("$repo")
        fi
    done

    printf '%s\n' "${repos[@]}" | sort
}

# Usage
parse_categories ".gitignore"

echo "Work repositories:"
get_repos_by_category "Work"

echo "Personal repositories:"
get_repos_by_category "Personal"

GitHub リポジトリ

vamseeachanta/workspace-hub
パス: .claude/skills/_core/bash/git-sync-manager/3-repository-status-check

関連スキル

algorithmic-art

メタ

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

スキルを見る

subagent-driven-development

開発

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

スキルを見る

executing-plans

デザイン

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

スキルを見る

cost-optimization

その他

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

スキルを見る