Use when analyzing git history and past changes to identify patterns, recurring issues, and lessons learned from infrastructure changes.
View on GitHublgbarn/devops-skills
superpowers
skills/historical-pattern-analysis/SKILL.md
January 23, 2026
Select agents to install to:
npx add-skill https://github.com/lgbarn/devops-skills/blob/main/skills/historical-pattern-analysis/SKILL.md -a claude-code --skill historical-pattern-analysisInstallation paths:
.claude/skills/historical-pattern-analysis/# Historical Pattern Analysis
## Overview
Analyze git history and memory to learn from past infrastructure changes. Identify patterns, recurring issues, and apply lessons learned to current work.
**Announce at start:** "I'm using the historical-pattern-analysis skill to learn from past changes."
## When to Use
- Before making changes similar to past changes
- When investigating recurring issues
- To understand why infrastructure is configured a certain way
- To identify change patterns and team practices
## Process
### Step 1: Define Search Scope
Determine what history to analyze:
- Specific resources being changed
- Time period (last month, quarter, year)
- Specific team members or patterns
### Step 2: Git Archaeology
#### Find Related Commits
```bash
# Commits touching specific files
git log --oneline -20 -- "path/to/module/*.tf"
# Commits mentioning resource types
git log --oneline -20 --grep="aws_security_group"
# Commits by pattern in message
git log --oneline -20 --grep="fix\|rollback\|revert"
# Commits in date range
git log --oneline --since="2024-01-01" --until="2024-06-01" -- "*.tf"
```
#### Analyze Commit Patterns
```bash
# Most frequently changed files
git log --pretty=format: --name-only -- "*.tf" | sort | uniq -c | sort -rn | head -20
# Authors and their focus areas
git shortlog -sn -- "environments/prod/"
# Change frequency by day/time
git log --format="%ad" --date=format:"%A %H:00" -- "*.tf" | sort | uniq -c
```
#### Find Reverts and Fixes
```bash
# Revert commits
git log --oneline --grep="revert\|Revert"
# Fix commits following changes
git log --oneline --grep="fix\|hotfix\|Fix"
# Commits with "URGENT" or "EMERGENCY"
git log --oneline --grep="urgent\|emergency" -i
```
### Step 3: Analyze Change Patterns
#### Coupling Analysis
Which files change together?
```bash
# For a specific file, what else changes with it?
git log --pretty=format:"%H" -- "modules/vpc/main.tf" | \
xargs -I {} git show --name-only --pretty=format: {} | \