git-advanced-sh-4kvau7

Gitadvanced specialized skill: helps an AI agent efficiently complete tasks related to Gitadvanced.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "git-advanced-sh-4kvau7" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-cc9aeecbbbf9fa24994a99ef2163dd75cc43d15385509c82dc053936890d3402. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/git-advanced-sh-4kvau7 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Gitadvanced specialized skill: helps an AI agent efficiently complete tasks related to Gitadvanced.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference

SkillPi interpretation

Tasks
Worktrees let you work on multiple branches simultaneously without stashing or committing WIP. Each worktree has its own working directory but shares the same `.git` repository.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: Gitadvanced
slug: git-advanced
version: 1.0.0
displayName: Gitadvanced
description: >
  Gitadvanced专用技能,帮助AI Agent高效完成相关任务。
  Gitadvanced专用技能,帮助AI Agent高效完成相关任务。
summary: "Gitadvanced专用技能,帮助AI Agent高效完成相关任务。"
license: MIT
category: 开发者工具
framework:
  - Claude Code
  - Codex
  - Hermes Agent
  - OpenClaw
  - QClaw
  - WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"

Git Advanced

Worktrees

# Create a worktree for a feature branch (avoids stashing)
git worktree add ../feature-auth feature/auth

# Create a worktree with a new branch
git worktree add ../hotfix-123 -b hotfix/123 origin/main

# List all worktrees
git worktree list

# Remove a worktree after merging
git worktree remove ../feature-auth

Worktrees let you work on multiple branches simultaneously without stashing or committing WIP. Each worktree has its own working directory but shares the same .git repository.

Bisect

# Start bisect, mark current as bad and known good commit
git bisect start
git bisect bad HEAD
git bisect good v1.5.0

# Git checks out a midpoint commit. Test it, then mark:
git bisect good   # if this commit works
git bisect bad    # if this commit is broken

# Automate with a test script
git bisect start HEAD v1.5.0
git bisect run npm test

# When done, reset
git bisect reset

Bisect performs binary search across commits to find which commit introduced a bug. Automated bisect with run is the fastest approach.

Interactive Rebase

# Rebase last 5 commits interactively
git rebase -i HEAD~5

# Common operations in the editor:
# pick   - keep commit as-is
# reword - change commit message
# edit   - stop to amend the commit
# squash - merge into previous commit, keep both messages
# fixup  - merge into previous commit, discard this message
# drop   - remove the commit entirely

# Rebase feature branch onto latest main
git fetch origin
git rebase origin/main

# Continue after resolving conflicts
git rebase --continue

# Abort if things go wrong
git rebase --abort

Git Hooks

#!/bin/sh
# .git/hooks/pre-commit

# Run linter on staged files only
STAGED_FILES=$(git diff --cached --name-only --diff-filter=d | grep -E '\.(ts|tsx|js|jsx)$')
if [ -n "$STAGED_FILES" ]; then
  npx eslint $STAGED_FILES --fix
  git add $STAGED_FILES
fi
#!/bin/sh
# .git/hooks/commit-msg

# Enforce conventional commit format
COMMIT_MSG=$(cat "$1")
PATTERN="^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .{1,72}$"

if ! echo "$COMMIT_MSG" | head -1 | grep -qE "$PATTERN"; then
  echo "Error: Commit message must follow Conventional Commits format"
  echo "Example: feat(auth): add OAuth2 login flow"
  exit 1
fi
#!/bin/sh
# .git/hooks/pre-push

# Run tests before pushing
npm test
if [ $? -ne 0 ]; then
  echo "Tests failed. Push aborted."
  exit 1
fi

Recovery Techniques

# Undo last commit but keep changes staged
git reset --soft HEAD~1

# Recover a deleted branch using reflog
git reflog
git checkout -b recovered-branch HEAD@{3}

# Recover a file from a specific commit
git checkout abc1234 -- path/to/file.ts

# Find lost commits (dangling after reset or rebase)
git fsck --lost-found
git show <dangling-commit-sha>

# Undo a rebase
git reflog
git reset --hard HEAD@{5}  # point before rebase started

Useful Aliases

# ~/.gitconfig
[alias]
  lg = log --graph --oneline --decorate --all
  st = status -sb
  co = checkout
  unstage = reset HEAD --
  last = log -1 HEAD --stat
  branches = branch -a --sort=-committerdate
  stash-all = stash push --include-untracked
  conflicts = diff --name-only --diff-filter=U

Anti-Patterns

  • Force-pushing to shared branches without --force-with-lease
  • Rebasing commits that have already been pushed and shared
  • Committing large binary files without Git LFS
  • Using git add . without reviewing git diff --staged
  • Not using .gitignore for build artifacts, dependencies, and secrets
  • Keeping long-lived feature branches instead of merging frequently

Checklist

  • [ ] Worktrees used for parallel branch work instead of stashing
  • [ ] git bisect run automates bug-finding with a test command
  • [ ] Interactive rebase cleans up commits before merging to main
  • [ ] Pre-commit hooks run linting on staged files
  • [ ] Commit message format enforced via commit-msg hook
  • [ ] --force-with-lease used instead of --force when force-pushing
  • [ ] Reflog consulted before any destructive operation
  • [ ] .gitignore covers build outputs, dependencies, and environment files

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供 Git 高级功能如 worktrees、bisect、interactive rebase 等实用技巧
  • 包含恢复技巧和防错清单,提升开发效率
Trigger Precision40/100

Areas to improve

  • description内容重复且模糊 Reported severity: Minor

    description 字段重复'Gitadvanced专用技能',未明确说明具体功能或触发场景

    Recommendation: 建议明确描述 Skill 的具体功能,如'提供 Git 高级操作命令和最佳实践,包括 worktrees、bisect、rebase 等'

Structure and Standards75/100

Areas to improve

  • 缺少When to Use说明 Reported severity: Minor

    未明确说明用户应在什么场景下使用此 Skill

    Recommendation: 建议添加 When to Use 章节,说明适用场景如'当需要并行开发多个分支、定位引入 bug 的提交、清理提交历史时'

Highlights

  • 内容结构清晰,分章节组织,配有详细代码示例
  • frontmatter 完整,包含版本、分类、支持框架等信息
Execution Reliability70/100

Areas to improve

  • pre-commit脚本未处理eslint失败 Reported severity: Major

    pre-commit hook 中运行 eslint --fix 后未检查退出码,若 linting 失败仍会继续提交

    Recommendation: 建议在 eslint 命令后添加 '|| exit 1' 以确保 linting 失败时阻止提交

Highlights

  • 提供了完整的 Git hooks 示例,覆盖 pre-commit、commit-msg、pre-push 场景
  • 包含恢复技巧和防错清单,提升操作安全性
Evidence Verifiability (mean of the first four)68/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Overwrite or clean a working tree

    May replace uncommitted files or remove untracked files. Check git status, commit or back up changes, and confirm target files first.

    Mentioned in main document · lines 145, 153
  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 102
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.