Skip to content
check-history logo

Git History Context Skill

check-history

⚠️ MANDATORY - YOU MUST invoke this skill at the start of EVERY task. Reviews git history, status, and context before starting any work. Runs parallel git commands to understand current state, recent changes, and related work. NEVER gather git context manually.

SKILL.md

Full skill instructions

Git History Context Skill

⚠️ MANDATORY SKILL - YOU MUST INVOKE THIS

Purpose

This skill gathers comprehensive git context before starting any work. It helps understand the current state of the repository, recent changes, and identify related previous work.

CRITICAL: You MUST invoke this skill - NEVER gather git context manually with individual git commands.

🚫 NEVER DO THIS

  • ❌ Running git status manually
  • ❌ Running git diff manually
  • ❌ Running git log manually
  • ❌ Gathering git context with individual commands

If you need git context, invoke this skill. Manual execution is FORBIDDEN.


⚠️ SKILL GUARD - READ BEFORE USING BASH TOOL

Before using Bash tool for git commands, answer these questions:

❓ Are you about to run git status?

→ STOP. Invoke check-history skill instead.

❓ Are you about to run git diff?

→ STOP. Invoke check-history skill instead.

❓ Are you about to run git log?

→ STOP. Invoke check-history skill instead.

❓ Are you gathering git context at the start of a task?

→ STOP. Invoke check-history skill instead.

❓ Are you about to run multiple git commands in parallel (git status & git diff & git log)?

→ STOP. Invoke check-history skill instead.

IF YOU PROCEED WITH BASH FOR THESE GIT COMMANDS, YOU ARE VIOLATING YOUR CORE DIRECTIVE.

This skill runs these commands for you, in parallel, with proper analysis. Use it.


Workflow

Step 1: Run Parallel Git Status Commands

Execute these commands in parallel for efficiency:

git status & git diff & git log --oneline -10 &

What to look for:

  • Current branch name
  • Uncommitted changes (staged or unstaged)
  • Untracked files
  • Recent commit messages and their scope
  • Commit patterns and conventions in use

Step 2: Analyze Current State

Based on the parallel command output:

  1. Branch Status:

    • Verify branch name follows mriley/ prefix convention
    • Check if branch is ahead/​behind remote
    • Note if on main/​master vs feature branch
  2. Working Directory State:

    • Identify any uncommitted changes
    • Note files that might conflict with planned work
    • Check for untracked files that might be relevant
  3. Recent Work:

    • Review last 10 commits for context
    • Identify patterns in commit messages
    • Note any related work or recent changes in relevant areas

Step 3: Search for Related Work (If Applicable)

If the task relates to a specific feature, bug, or area:

git log --grep="<keyword>" --oneline -10

Example keywords:

  • Feature names (e.g., "auth", "parser", "api")
  • Bug identifiers (e.g., "fix", "bug", "issue")
  • Scope identifiers from conventional commits

Step 4: Get Detailed Context (If Needed)

For more detailed information about recent changes:

git show --name-only HEAD                  # Files changed in last commit
git diff --name-only origin/​main           # Files changed vs main branch
git log --graph --oneline -10              # Visual commit graph

Step 5: Generate Context Summary

Provide a concise summary including:

  1. Current State:

    • Branch: <branch-name>
    • Status: Clean working directory / Has uncommitted changes
    • Position: Up to date / Ahead by N commits / Behind by N commits
  2. Recent Activity:

    • Last 3-5 relevant commits with their scope and purpose
    • Any ongoing work that might be related
  3. Relevant History:

    • Related previous work (if found via grep)
    • Patterns or conventions observed
  4. Recommendations:

    • Any concerns or conflicts to address
    • Suggested next steps based on current state

Example Output

Git Context Summary:
==================

Current State:
- Branch: mriley/​feat/​user-authentication
- Status: Clean working directory
- Position: Ahead of origin/​main by 2 commits

Recent Activity:
1. feat(auth): add JWT token generation (3 hours ago)
2. feat(auth): implement user login endpoint (5 hours ago)
3. test(auth): add unit tests for password hashing (1 day ago)

Relevant History:
- Found 3 commits related to "auth" in past week
- Project consistently uses conventional commits with scope
- Security-focused: all auth changes include tests

Recommendations:
- Safe to proceed with auth-related work
- Follow existing pattern: feature + tests in same commit
- Consider reviewing recent auth commits for context

Error Handling

If git command fails:

  • Verify we're in a git repository
  • Check git is installed and accessible
  • Report error to user with specific command that failed

If not in a git repo:

  • Note this is not a git repository
  • Skip git-specific checks
  • Proceed with file system context if needed

Integration with Other Skills

This skill should be invoked by:

  • sparc-plan - Before creating implementation plans
  • safe-commit - To understand what's being committed
  • create-pr - To generate meaningful PR descriptions

Best Practices

  1. Always run parallel commands - Don't run git commands sequentially
  2. Be concise - Summarize, don't dump raw git output
  3. Focus on relevance - Highlight information relevant to the current task
  4. Note patterns - Identify conventions and patterns in commit history
  5. Flag concerns - Highlight any potential conflicts or issues early

Related Commands

  • /​quick-status - Quick visual git dashboard (lighter weight alternative for simple status checks)
  • /​review-branch - Full branch code review against main

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View