git-workspace-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Workspace Review
Git工作区检查
Table of Contents
目录
Verification
验证
Run after review to verify workspace state matches expectations.
git status完成检查后运行,验证工作区状态是否符合预期。
git statusTesting
测试
Run to validate review workflow.
pytest plugins/sanctum/tests/test_git_workspace_review.py运行以验证检查工作流。
pytest plugins/sanctum/tests/test_git_workspace_review.pyUsage
使用方法
Use this skill before workflows that depend on repository state, such as commit message generation, PR preparation, or release notes. Run it once per session or whenever staged changes are modified.
在依赖仓库状态的工作流(如提交消息生成、PR准备或发布说明)之前使用此Skill。每个会话运行一次,或在暂存变更被修改时运行。
Required Progress Tracking
必填进度跟踪
git-review:repo-confirmedgit-review:status-overviewgit-review:code-quality-checkgit-review:diff-statgit-review:diff-details
Mark each item as complete as you finish the corresponding step.
git-review:repo-confirmedgit-review:status-overviewgit-review:code-quality-checkgit-review:diff-statgit-review:diff-details
完成对应步骤后标记每个项目为已完成。
Step 1: Confirm Repository (repo-confirmed
)
repo-confirmed步骤1:确认仓库(repo-confirmed)
Run to confirm you are in the correct repository directory. Execute to view the current branch and short status, then capture the branch name and upstream information.
pwdgit status -sb运行确认你处于正确的仓库目录。执行查看当前分支和简要状态,然后记录分支名称和上游信息。
pwdgit status -sbStep 2: Review Status Overview (status-overview
)
status-overview步骤2:查看状态概览(status-overview)
Analyze the output for staged and unstaged changes. Stage or unstage files so that subsequent workflows operate on the intended diff.
git status -sb分析的输出,查看暂存和未暂存的变更。暂存或取消暂存文件,确保后续工作流基于预期的差异进行操作。
git status -sbStep 3: Check Code Quality (code-quality-check
)
code-quality-check步骤3:检查代码质量(code-quality-check)
Run to validate code quality before committing. Fix any errors immediately. Do not bypass pre-commit hooks with . This check identifies issues early and avoids late-stage pipeline failures.
make format && make lint--no-verify运行在提交前验证代码质量。立即修复所有错误。请勿使用绕过预提交钩子。此检查可提前发现问题,避免后期流水线失败。
make format && make lint--no-verifyStep 4: Review Diff Statistics (diff-stat
)
diff-stat步骤4:查看差异统计(diff-stat)
Run for staged changes (or for unstaged work). Note the number of files modified and identify hotspots with large insertion or deletion counts.
git diff --cached --statgit diff --stat运行查看暂存变更的统计信息(未暂存工作请使用)。记录修改的文件数量,并找出插入或删除行数较多的热点区域。
git diff --cached --statgit diff --statStep 5: Review Detailed Diff (diff-details
)
diff-details步骤5:查看详细差异(diff-details)
Run to examine the actual changes. For unstaged work, use . Identify key themes, such as Makefile adjustments or new skill additions, to provide context for downstream summaries.
git diff --cachedgit diff运行检查实际变更内容。未暂存工作请使用。识别关键主题,如Makefile调整或新Skill添加,为下游总结提供上下文。
git diff --cachedgit diffExit Criteria
退出条件
Complete all progress tracking items. You should have a clear understanding of modified files and areas, and the correct work should be staged. Subsequent workflows can then rely on this context without re-executing git commands.
完成所有进度跟踪项目。你应清楚了解修改的文件和区域,且正确的工作内容已被暂存。后续工作流可依赖此上下文,无需重新执行Git命令。
Supporting Modules
支持模块
- Git commands reference - diff, status, branch operations for sanctum workflows
- Git命令参考 - 适用于sanctum工作流的diff、status、分支操作
Troubleshooting
故障排除
If pre-commit hooks block a commit, resolve the reported issues instead of using . Run to fix styling errors automatically and use to isolate logical failures. If merge conflicts occur, use to return to a clean state before retrying.
--no-verifymake formatmake lintgit merge --abort如果预提交钩子阻止提交,请解决报告的问题,不要使用。运行自动修复样式错误,使用排查逻辑问题。如果发生合并冲突,使用恢复到干净状态后重试。
--no-verifymake formatmake lintgit merge --abort