git-advanced-sh-4kvau7

Gitadvanced 专用技能:用于帮助 AI Agent 高效完成与 Gitadvanced 相关的任务。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "git-advanced-sh-4kvau7":https://skillpi.com/zh/skills/deepskill-cc9aeecbbbf9fa24994a99ef2163dd75cc43d15385509c82dc053936890d3402。安装前核对上游来源和版本:https://skillhub.cn/skills/user_3c6cb52e/git-advanced-sh-4kvau7。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

Gitadvanced 专用技能:用于帮助 AI Agent 高效完成与 Gitadvanced 相关的任务。

0 下载

介绍来源: third_party · user_3c6cb52e · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
来源文档未说明。
输入和输出
来源文档未说明。
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
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

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

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

待提升项

  • description内容重复且模糊 原报告严重程度:轻微

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

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

结构规范75/100

待提升项

  • 缺少When to Use说明 原报告严重程度:轻微

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

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

亮点

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

待提升项

  • pre-commit脚本未处理eslint失败 原报告严重程度:重大

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

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

亮点

  • 提供了完整的 Git hooks 示例,覆盖 pre-commit、commit-msg、pre-push 场景
  • 包含恢复技巧和防错清单,提升操作安全性
证据可验 (前四项均值)68/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

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

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 覆盖或清理工作区

    可能覆盖未提交文件或清除未跟踪文件。先查看 git status,提交或备份改动,确认目标文件后再操作。

    主文档提及 · 第 145, 153 行
  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 102 行
文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • github.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。