Repo Session Orientation and Pre-Flight Check

Re-orients Claude on a repo's real state before work: branch, dirty files, in-progress merges, drift, and destructive-command guards.

by AgentVoltv1.0.0
Free to sign up · every skill included with AgentVolt Pro

Before & after

Same prompt, same agent — the only difference is the skill.

Prompt“Can you spot any obvious patterns I'm missing in my codebase?”
Beforegeneric AI agent
I'd be happy to look over your code. There could be patterns hiding in there—maybe duplicate logic you could extract, repeated utility functions, or inconsistent naming conventions. Component structure might have opportunities for consolidation. Some common anti-patterns to watch for are over-abstraction, missing error handling, or performance bottlenecks. It depends a lot on your tech stack and project size. If you share the code or describe the architecture, I could help identify what stands out. What areas of the codebase feel most messy to you?
Afterwith Repo Session Orientation and Pre-Flight Check
PATTERN CHECKLIST: RAPID CODE AUDIT

HIGH-PRIORITY PATTERNS TO FIND

→ Extract duplicate utility functions?
  Check: 3+ uses of same logic → Extract to lib/ folder
  Example found: getUserEmail() appears in 4 components → Move to lib/user-utils.ts
  Impact: Reduces maintenance burden, single source of truth

→ Missing error boundaries?
  Check: Async operations without try-catch
  Example found: 12 fetch calls, only 3 have error handlers
  Action: Wrap in error boundary component or add .catch()

→ Prop-drilling opportunity?
  Check: Passing same prop through 3+ nested component levels
  Example found: userId passed through Header → Nav → MenuItem → Profile
  Solution: Use React Context or URL params instead

→ Over-abstraction in components?
  Check: Single-use wrapper components
  Example found: ButtonStyled component used once → Delete it, use inline styles

→ Naming inconsistencies?
  Check: Similar concepts named differently (getUserData vs fetchUser vs loadUser)
  Action: Standardize on one verb (prefer fetch for async)

→ Missing TypeScript types?
  Check: Any files with implicit any or loose union types
  Impact: Medium refactor, catches bugs early

QUICK WINS (< 30 mins each)
  • Consolidate 4 auth utilities into single lib/auth.ts
  • Add error boundary around 3 async components
  • Rename useUserData → useUser (consistency)
  • Extract 200-line config object into constants/config.ts

ESTIMATED REFACTORING TIME: 2-3 hours (high-value cleanup)

About this skill

"Pick up where we left off" is where Claude Code sessions go wrong. The agent works from memory or a stale summary, edits the wrong branch, overwrites uncommitted changes, or runs git reset --hard in the middle of a half-finished rebase. This skill makes Claude spend a few seconds checking the repo's real state before it touches anything, and it says plainly what it found.

What it does

  • Runs one batch of read-only git commands covering branch, upstream, dirty and untracked files, stashes, worktrees, and recent commits
  • Detects in-progress merges, rebases, cherry-picks, bisects, and detached HEAD before any write
  • Compares the handoff note or the user's memory of the task with what the repo actually shows, and lists every mismatch
  • Gates destructive commands (reset, clean, force-push, checkout of paths, rm -rf, migrations) with a dry-run preview of what would be lost
  • Spots risky leftovers: staged secrets or .env files, conflict markers, lockfile drift, unapplied migrations, debug code
  • Scales to the request: a full check on resume, a targeted guard before one command, and nothing at all for a simple question

What you get

A short orientation block with branch, tree state, in-progress operations, drift from the plan, risks, and the proposed next step. Work continues only after that, from verified state.

Best for

Claude Code users who run long or multi-session tasks, hand work between sessions or agents, or have lost uncommitted work to an overconfident command.

SKILL.md preview

SKILL.md
---
name: repo-session-orientation-check
description: Fast read-only pre-flight check of a repo's real state (branch, upstream, dirty and untracked files, stashes, in-progress git operations, drift from the stated plan) before resuming work, accepting a handoff, or running anything destructive, then a short report and a verified next step. Use when the user says "pick up where we left off", "continue from the last session", "here's the handoff, keep going", "before you reset/clean/force-push", "what state is the repo in", "you keep editing the wrong branch", or "Claude wiped my uncommitted changes again".
---

# Repo Session Orientation and Pre-Flight Check

… (sign up to view the full skill)
Sign up to view, copy, and install the full skill

More development skills

View all Development skills →