---
name: bigstack-retro
version: 0.1.0
description: |
  Weekly retrospective powered by git history. Analyzes commits,
  PRs, and patterns to generate a structured retro with
  what went well, what didn't, and action items.
allowed-tools:
  - Bash
  - Read
  - Glob
  - Grep
  - AskUserQuestion
---

{{PREAMBLE}}

# /bigstack-retro — Weekly Retrospective

Generate a structured retrospective based on the past week's work.

## Workflow

### Step 1: Detect Time Range

```bash
# Default: last 7 days
SINCE=$(date -d "7 days ago" +%Y-%m-%d 2>/dev/null || date -v-7d +%Y-%m-%d 2>/dev/null)
echo "Retro period: $SINCE to today"
```

Ask the user if they want a different time range.

### Step 2: Gather Data

```bash
# Commits in period
echo "=== Commits ==="
git log --since="$SINCE" --oneline --no-merges

echo ""
echo "=== Files changed ==="
git log --since="$SINCE" --no-merges --pretty=format: --name-only | sort | uniq -c | sort -rn | head -20

echo ""
echo "=== Authors ==="
git log --since="$SINCE" --no-merges --format='%an' | sort | uniq -c | sort -rn

echo ""
echo "=== Commit frequency by day ==="
git log --since="$SINCE" --no-merges --format='%ad' --date=short | sort | uniq -c
```

```bash
# PRs merged in period (if using GitHub)
gh pr list --state merged --search "merged:>=$SINCE" --limit 50 2>/dev/null || true
```

### Step 3: Analyze Patterns

From the data, identify:

**Velocity:**
- Total commits and PRs
- Average commits per day
- Largest changes (by files touched)

**Focus areas:**
- Which directories/modules got the most attention?
- Were changes concentrated or spread across the codebase?

**Health signals:**
- Ratio of new code vs. fixes/refactors (from commit messages)
- Any revert commits?
- Any unusually large commits that might indicate batched work?

### Step 4: Generate Retro

#### What went well
- Identify completed features, successful refactors, good patterns
- Note any especially clean or well-tested PRs

#### What didn't go well
- Identify reverts, repeated fixes to the same area, conflicts
- Note areas with high churn (many changes to same files)

#### Patterns and observations
- Emerging trends in the codebase
- Technical debt indicators
- Knowledge concentration risks (single-author areas)

#### Action items
- Suggest 2-3 concrete, actionable improvements for next week
- Each action item should be specific and achievable in one week

### Step 5: Present

Format as a clean report. Ask the user if they want to save it to a file.
