retrospective
Reconstructs project documentation from git history. Analyzes commit logs, diffs, and merge patterns to generate Architecture Decision Records (ADRs), module chronologies, and contributor maps. Use this for existing projects that have no structured documentation but a rich git history.
Best use case
retrospective is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Reconstructs project documentation from git history. Analyzes commit logs, diffs, and merge patterns to generate Architecture Decision Records (ADRs), module chronologies, and contributor maps. Use this for existing projects that have no structured documentation but a rich git history.
Teams using retrospective should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/retrospective/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How retrospective Compares
| Feature / Agent | retrospective | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Reconstructs project documentation from git history. Analyzes commit logs, diffs, and merge patterns to generate Architecture Decision Records (ADRs), module chronologies, and contributor maps. Use this for existing projects that have no structured documentation but a rich git history.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Skill: Retrospective
## What This Skill Does
Reconstructs **"why" documentation** from git history that `generate-docs` cannot produce. While `generate-docs` analyzes the current codebase (what exists now), `retrospective` analyzes the project's evolution (how it got here and why).
Produces:
- **Architecture Decision Records (ADRs)**: significant technical decisions detected from large refactors, dependency changes, or structural reorganizations
- **Module Chronology**: when each module was introduced, major changes, and growth patterns
- **Pattern Evolution**: how coding patterns changed over time (e.g., callback → promise → async/await migration)
- **Contributor Map**: who owns which areas of the codebase (based on commit concentration)
## When to Use
- When onboarding to an existing project with no documentation
- When the team asks "why was this built this way?"
- When preparing architecture documentation for a project with years of history
- After `generate-docs` has created the "what" docs, to add the "why" context
Do NOT use this for projects with fewer than ~50 commits — there isn't enough history to analyze meaningfully.
## Execution Model
- **Phase 1**: the primary agent gathers git metadata (lightweight, git commands only).
- **Phase 2**: the primary spawns `doc-explorer` to write the retrospective documents based on the gathered metadata.
- **Rationale**: Phase 1 is cheap (git log parsing). Phase 2 requires writing multiple documents, which is doc-explorer's domain.
## Workflow
### Step 1: Assess Git History Scope
Get a high-level picture of the project's history:
```bash
# Total commits and date range
git log --oneline | wc -l
git log --reverse --format="%ai" | head -1
git log --format="%ai" | head -1
# Contributors
git shortlog -sn --no-merges | head -10
# Most changed files (hotspots)
git log --format=format: --name-only | sort | uniq -c | sort -rn | head -20
```
If the project has fewer than 50 commits, inform the user and suggest `generate-docs` instead.
### Step 2: Detect Significant Events
Scan the git history for events that indicate architectural decisions:
1. **Large commits** (>20 files changed): likely refactors or structural changes
```bash
git log --oneline --shortstat | awk '/files? changed/ {if ($1 > 20) print prev" "$0} {prev=$0}'
```
2. **Dependency changes**: additions/removals of major dependencies
```bash
git log --oneline --all -- package.json pyproject.toml go.mod Cargo.toml
```
3. **New directories**: creation of new top-level or module directories
```bash
git log --diff-filter=A --oneline --name-only -- '*/README.md' '*/index.*' '*/mod.*' '*/main.*'
```
4. **Renames/moves**: structural reorganization
```bash
git log --diff-filter=R --summary --oneline | head -30
```
5. **Merge patterns**: feature branches, release branches
```bash
git log --merges --oneline | head -20
```
### Step 3: Analyze Key Events
For each significant event detected in Step 2, gather context:
- Read the commit message (often contains rationale)
- Check the diff stats (which files/directories were affected)
- Look for related commits in the surrounding timeframe
- Check for PR/merge commit messages that may contain discussion summaries
**Do NOT read full diffs** — this would be extremely expensive. Use `--stat` and commit messages only.
### Step 4: Build Module Timeline
For each module (directory) in the project, construct a timeline:
```bash
# When was it created?
git log --reverse --oneline --diff-filter=A -- <module_path>/ | head -1
# Major milestones (commits with >5 files changed in this module)
git log --oneline --shortstat -- <module_path>/ | head -20
```
### Step 5: Detect Pattern Evolution
Look for patterns that changed over time:
- File extension changes (`.js` → `.ts`: TypeScript migration)
- Directory structure changes (flat → nested: modularization)
- Config file additions (ESLint, TypeScript, Docker: tooling adoption)
- Test framework changes
### Step 6: Generate Retrospective Documents
Delegate to `doc-explorer` with the gathered metadata. The subagent writes:
1. **`docs/retrospective.md`** — overview of the project's evolution with timeline
2. **`docs/adrs/`** — individual ADR files for each detected significant decision. You MUST use the exact same heading structure and order as `adr-create`:
```markdown
# ADR-NNN: <Title>
## Status
Accepted | Proposed | Superseded by ADR-NNN
## Date
<YYYY-MM-DD, inferred from commit date>
## Context
<what was happening in the project at the time, detected from git>
## Decision
<what was changed and why (inferred from commit messages and diff patterns)>
## Alternatives Considered
### Alternative A: <name>
- **Pros**: ...
- **Cons**: ...
- **Why rejected**: ...
### Alternative B: <name>
- **Pros**: ...
- **Cons**: ...
- **Why rejected**: ...
## Consequences
### Positive
- <expected benefit based on observed outcomes>
### Negative
- <expected downside or trade-off>
### Risks
- <what could go wrong>
## References
- Commit: <hash> — <message>
- Files affected: <count>
```
### Step 7: Present Summary
Present a summary of findings to the user and ask:
- Are the inferred decisions accurate?
- Should any be merged, split, or removed?
- Is there additional context the user can provide for ambiguous events?
## Rules
1. **Git metadata only**: use `git log`, `git shortlog`, `git diff --stat`. Never read full file contents from historical commits. The goal is to reconstruct context from metadata, not to re-analyze old code.
2. **Infer, don't fabricate**: clearly mark inferred decisions with language like "appears to be" or "likely motivated by". The git history provides evidence, not certainty.
3. **Commit messages are gold**: well-written commit messages are the primary source of "why" information. Poorly written messages ("fix", "update") provide less value — note this in the retrospective.
4. **Focus on decisions, not changes**: the goal is to document WHY things changed, not WHAT changed. Module docs already cover the "what".
5. **Chronological order**: present events in chronological order. This helps readers understand the project's evolution narrative.
6. **Reasonable scope**: for projects with >1000 commits, focus on the top 10-20 most significant events. Do not attempt to document every commit.
7. **No built-in explore agent**: do NOT use the built-in `explore` subagent type.Related Skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
update-oo-component-documentation
Update existing object-oriented component documentation following industry best practices and architectural documentation standards.
tailored-resume-generator
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
sync-docs
Sync documentation with code. Use when user asks to update docs, check docs, fix stale documentation, update changelog, or after code changes.
social-content
When the user wants help creating, scheduling, or optimizing social media content for LinkedIn, Twitter/X, Instagram, TikTok, Facebook, or other platforms. Also use when the user mentions 'LinkedIn...
scientific-writing
Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA/AMA/Vancouver), figures/tables, reporting guidelines (CONSORT/STROBE/PRISMA), for research papers and journal submissions.
readme
When the user wants to create or update a README.md file for a project. Also use when the user says 'write readme,' 'create readme,' 'document this project,' 'project documentation,' or asks for he...
readme-blueprint-generator
Intelligent README.md generation prompt that analyzes project documentation structure and creates comprehensive repository documentation. Scans .github/copilot directory files and copilot-instructions.md to extract project information, technology stack, architecture, development workflow, coding standards, and testing approaches while generating well-structured markdown documentation with proper formatting, cross-references, and developer-focused content.
postmortem-writing
Write effective blameless postmortems with root cause analysis, timelines, and action items. Use when conducting incident reviews, writing postmortem documents, or improving incident response proce...
plan-writing
Structured task planning with clear breakdowns, dependencies, and verification criteria. Use when implementing features, refactoring, or any multi-step work.
mkdocs-translations
Generate a language translation for a mkdocs documentation stack.