
Git Workspace Review
Give agents copy-paste git status and diff command patterns so they confirm repo, branch, and staged versus unstaged changes before Sanctum commits and stack workflows.
Overview
Git Workspace Review is a journey-wide agent skill that supplies Sanctum-standard git status and diff commands—usable whenever a solo builder needs the agent to confirm branch and workspace changes before committing or o
Install
npx skills add https://github.com/athola/claude-night-market --skill git-workspace-reviewWhat is this skill?
- pwd and git status -sb for repository and branch confirmation in one line
- Staged versus unstaged stats and full diffs via --cached and working tree diffs
- Branch comparison against main using origin/main...HEAD stat and full diff
- Documents parsing patterns for ahead/behind and branch name from short status output
- Shared parent skill pattern consumed by stack-push and other Sanctum git workflows
Adoption & trust: 1 installs on skills.sh; 304 GitHub stars; trending (+100% hot-view momentum).
What problem does it solve?
Your agent runs git ad hoc and misreads branch state, mixes staged with unstaged changes, or compares the wrong base before a Sanctum workflow step.
Who is it for?
Builders using Sanctum stacked-diff or PR workflows who want agents to review the git workspace with the same commands every time.
Skip if: Teams that need interactive merge conflict resolution UI, non-git VCS, or deep code-quality review beyond diff inspection.
When should I use this skill?
Composed inside Sanctum workflows whenever the agent must confirm correct repo, branch, staged changes, unstaged changes, or divergence from main before commit or PR steps.
What do I get? / Deliverables
The agent follows a fixed command set to report branch, tracking, staged deltas, working tree deltas, and divergence from main in a review-ready format.
- Structured workspace summary from standard git commands
- Parsed branch and ahead/behind context for downstream workflow skills
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
Run git diff --cached and git status -sb before approving a commit message in pr-prep.
Summarize origin/main...HEAD stats so you know slice scope before splitting a stack.
Quickly confirm ahead/behind upstream before pulling or rebasing during hotfix iteration.
Double-check unstaged noise is zero immediately before stack-push publishes branches.
How it compares
Reference pattern sheet for git inspection, not a full code-review or stack-push workflow on its own.
Common Questions / FAQ
Who is git-workspace-review for?
It is for solo developers and agents following athola Sanctum workflows who need reliable git status and diff recipes before commits, PR prep, or stack push.
When should I use git-workspace-review?
Use in Ship/review before commits; in Build when validating what changed; in Operate when checking branch drift; whenever stack-push or pr-prep requires confirmed staged and unstaged diffs.
Is git-workspace-review safe to install?
It only documents read-only git inspection commands—review the Security Audits panel on this page; actual risk comes from downstream workflows that commit or push after review.
Workflow Chain
Then invoke: stack push, pr prep
SKILL.md
READMESKILL.md - Git Workspace Review
# Git Commands for Sanctum Workflows ## Repository Confirmation ### Verify Working Directory ```bash pwd ``` validates you are in the correct repository before running git operations. ### Check Branch and Status ```bash git status -sb ``` Shows current branch, upstream tracking, and short status in one line. ## Diff Commands ### Staged Changes Statistics ```bash git diff --cached --stat ``` Shows file-by-file statistics for staged changes (insertions/deletions). ### Staged Changes Details ```bash git diff --cached ``` Full diff of staged changes for review before commit. ### Unstaged Changes Statistics ```bash git diff --stat ``` File-by-file statistics for unstaged working directory changes. ### Unstaged Changes Details ```bash git diff ``` Full diff of unstaged working directory changes. ### Branch Comparison Statistics ```bash git diff --stat origin/main...HEAD ``` Shows statistics for all commits in current branch since diverging from main. ### Branch Comparison Details ```bash git diff origin/main...HEAD ``` Full diff of all changes in current branch compared to main. ## Status Parsing Patterns ### Extract Branch Name From `git status -sb` output, the first line shows: ``` ## branch-name...origin/branch-name [ahead N, behind M] ``` Parse the branch name from the `##` line. ### Identify Staged vs Unstaged - Lines starting with `M ` (M-space): staged modification - Lines starting with ` M` (space-M): unstaged modification - Lines starting with `A ` (A-space): staged new file - Lines starting with `??`: untracked file ### Count Changes Use `--stat` output to count affected files: ``` file1.md | 10 +++++++--- file2.py | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) ``` ## Branch Operations ### Get Merge Base ```bash git merge-base origin/main HEAD ``` Finds the common ancestor commit for comparison. ### List Recent Commits ```bash git log --oneline -10 ``` Shows last 10 commits in compact format. ### Show Commit Details ```bash git show <commit-hash> ``` Displays commit message and diff for a specific commit. ## Best Practices ### Always Run in Sequence 1. `pwd` - Confirm location 2. `git status -sb` - Check branch/status 3. `git diff --cached --stat` - Review staged stats 4. `git diff --cached` - Review staged details ### Use Limits - Always limit `git log` output (e.g., `-10`, `-20`) - Use `--stat` before full diffs to understand scope - For large diffs, consider `git diff --cached -- <specific-file>` ### Error Handling - Check if `git status` shows "Not a git repository" - Verify upstream tracking exists before comparing to origin - Handle empty diffs (no staged changes) gracefully --- name: git-workspace-review description: Verifies workspace state and staged changes as a read-only preflight. Use before commits or PRs to confirm staged set is clean and correct. alwaysApply: false category: workspace-ops tags: - git - preflight - status - diff - staged tools: [] complexity: low model_hint: fast estimated_tokens: 500 dependencies: - sanctum:shared modules: - modules/git-commands.md hooks: PreToolUse: - matcher: Bash command: "# Log git analysis commands\nif echo \"$CLAUDE_TOOL_INPUT\" | grep -qE\ \ \"git (status|diff|log|show|branch)\"; then\n echo \"[skill:git-workspace-review]\ \ Git analysis initiated: $(date)\" >> ${CLAUDE_CODE_TMPDIR:-/tmp}/skill-audit.log\n\ fi\n" once: true Stop: - command: 'echo "[skill:git-workspace-review] === Analysis completed at $(date) ===" >> ${CLAUDE_CODE_TMPDIR:-/tmp}/skill-audit.log ' role: library --- # Git Workspace Review ## Table of Contents 1. [Usage](#usage) 2. [Required Progress Tracking](#required-progress-tracking) ## Verification Run `git status` after review to verify workspace state matches exp