git-workspace-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Workspace Review

Git工作区检查

Table of Contents

目录

Verification

验证

Run
git status
after review to verify workspace state matches expectations.
完成检查后运行
git status
,验证工作区状态是否符合预期。

Testing

测试

Run
pytest plugins/sanctum/tests/test_git_workspace_review.py
to validate review workflow.
运行
pytest plugins/sanctum/tests/test_git_workspace_review.py
以验证检查工作流。

Usage

使用方法

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

必填进度跟踪

  1. git-review:repo-confirmed
  2. git-review:status-overview
  3. git-review:code-quality-check
  4. git-review:diff-stat
  5. git-review:diff-details
Mark each item as complete as you finish the corresponding step.
  1. git-review:repo-confirmed
  2. git-review:status-overview
  3. git-review:code-quality-check
  4. git-review:diff-stat
  5. git-review:diff-details
完成对应步骤后标记每个项目为已完成。

Step 1: Confirm Repository (
repo-confirmed
)

步骤1:确认仓库(repo-confirmed)

Run
pwd
to confirm you are in the correct repository directory. Execute
git status -sb
to view the current branch and short status, then capture the branch name and upstream information.
运行
pwd
确认你处于正确的仓库目录。执行
git status -sb
查看当前分支和简要状态,然后记录分支名称和上游信息。

Step 2: Review Status Overview (
status-overview
)

步骤2:查看状态概览(status-overview)

Analyze the
git status -sb
output for staged and unstaged changes. Stage or unstage files so that subsequent workflows operate on the intended diff.
分析
git status -sb
的输出,查看暂存和未暂存的变更。暂存或取消暂存文件,确保后续工作流基于预期的差异进行操作。

Step 3: Check Code Quality (
code-quality-check
)

步骤3:检查代码质量(code-quality-check)

Run
make format && make lint
to validate code quality before committing. Fix any errors immediately. Do not bypass pre-commit hooks with
--no-verify
. This check identifies issues early and avoids late-stage pipeline failures.
运行
make format && make lint
在提交前验证代码质量。立即修复所有错误。请勿使用
--no-verify
绕过预提交钩子。此检查可提前发现问题,避免后期流水线失败。

Step 4: Review Diff Statistics (
diff-stat
)

步骤4:查看差异统计(diff-stat)

Run
git diff --cached --stat
for staged changes (or
git diff --stat
for unstaged work). Note the number of files modified and identify hotspots with large insertion or deletion counts.
运行
git diff --cached --stat
查看暂存变更的统计信息(未暂存工作请使用
git diff --stat
)。记录修改的文件数量,并找出插入或删除行数较多的热点区域。

Step 5: Review Detailed Diff (
diff-details
)

步骤5:查看详细差异(diff-details)

Run
git diff --cached
to examine the actual changes. For unstaged work, use
git diff
. Identify key themes, such as Makefile adjustments or new skill additions, to provide context for downstream summaries.
运行
git diff --cached
检查实际变更内容。未暂存工作请使用
git diff
。识别关键主题,如Makefile调整或新Skill添加,为下游总结提供上下文。

Exit 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
--no-verify
. Run
make format
to fix styling errors automatically and use
make lint
to isolate logical failures. If merge conflicts occur, use
git merge --abort
to return to a clean state before retrying.
如果预提交钩子阻止提交,请解决报告的问题,不要使用
--no-verify
。运行
make format
自动修复样式错误,使用
make lint
排查逻辑问题。如果发生合并冲突,使用
git merge --abort
恢复到干净状态后重试。