stacks-retro

$npx mdskill add stacksjs/stacks/stacks-retro

Analyzes git history to generate session-based development retrospectives.

  • Detects work sessions using a 45-minute gap threshold between commits.
  • Depends on git log and conventional commit parsing for categorization.
  • Computes focus scores based on primary area commit density.
  • Outputs a structured report with categories, streaks, and observations.

SKILL.md

.github/skills/stacks-retroView on GitHub ↗
---
name: stacks-retro
description: Use for git-based session retrospectives — session detection, commit categorization, focus scores, streak counting, and behavioral observations. Invoke with /stacks-retro.
license: MIT
compatibility: Bun >= 1.3.0, TypeScript
allowed-tools: Read Edit Write Bash Grep Glob
---

# /stacks-retro — Session Retrospective

Generate a retrospective analysis of recent development work based on git history.

## Step 1: Session Detection

Detect sessions using a **45-minute gap threshold** between commits.

```bash
git log --all --format="%H|%ai|%an|%s" --since="7 days ago"
```

Adjust `--since` if user specifies a range ("today", "this week", etc.).

## Step 2: Commit Categorization

| Category | Indicators | Icon |
|----------|-----------|------|
| Feature | `feat:`, new files, new exports | 🟢 |
| Fix | `fix:`, corrective changes | 🔴 |
| Refactor | `refactor:`, structural changes | 🔵 |
| Test | `test:`, test file changes | 🟡 |
| Docs | `docs:`, README changes | 📝 |
| Chore | `chore:`, deps, config, CI | ⚙️ |
| Style | `style:`, formatting, lint | 🎨 |

Parse `gitlint`-style conventional commit prefixes. Stacks uses these scopes: `core`, `auth`, `database`, `router`, `buddy`, `ui`, `build`, etc.

## Step 3: Session Analysis

### Focus Score (0-100)
```
focus_score = (commits_in_primary_area / total_commits) × 100
```

Primary area = most-touched `storage/framework/core/*/` package or top-level directory.

- **80-100**: Deep focus
- **50-79**: Moderate focus
- **0-49**: Scattered

```
### Session [N]: [start] → [end] ([duration])
**Focus**: [score]/100 — [assessment]
**Primary area**: [package/directory]
**Commits**: [count]

| Time | Category | Message | Files |
|------|----------|---------|-------|

**Observation**: [one behavioral insight]
```

## Step 4: Streaks

```bash
git log --all --format="%ad" --date=short | sort -u
```

```
## Streaks
🔥 Current streak: [N] days
📈 Longest streak: [N] days ([range])
📅 Active days: [N] / [total]
```

## Step 5: Per-Contributor Metrics (if multiple)

```
| Contributor | Commits | Primary Focus | Top Category | Avg Focus |
|-------------|---------|---------------|--------------|-----------|
```

## Step 6: Behavioral Observations

2-4 observations backed by data:

- "You wrote 12 fix commits after the auth refactor — consider adding tests before next refactor session."
- "Focus score drops in afternoon sessions. Morning sessions average 85."
- "No test commits this week despite 8 feature commits. Test debt accumulating."
- "3/4 sessions started with chore commits. Consider batching into a maintenance session."

## Output

```
# Retrospective: [date range]

## Overview
- **Period**: [range]
- **Sessions**: [count]
- **Total commits**: [count]

## Category Breakdown
[icons and counts]

## Sessions
[session details]

## Streaks
[streak data]

## Observations
[behavioral insights]

## Suggested Focus for Next Session
[one specific suggestion]
```

## Rules

- **Data-driven only.** Every observation backed by commits/metrics.
- **No judgment on work hours.** Don't comment on when someone works.
- **Default to 7 days** if no range specified.
- **Handle messy history gracefully.** Squash/merge/rebase can distort sessions.

More from stacksjs/stacks

SkillDescription
stacks-actionsUse when working with Stacks server actions — creating actions in app/Actions/, auto-generated API actions from the useApi model trait, the 80+ default framework actions (auth, dashboard, commerce, content, deployment, jobs), action request/response handling, or action registration. Covers @stacksjs/actions and storage/framework/defaults/actions/.
stacks-aiUse when integrating AI capabilities into a Stacks application — using Anthropic/OpenAI/Ollama/AWS Bedrock drivers, image generation (DALL-E), vision analysis, RAG/vector search, embeddings, MCP (Model Context Protocol) clients, text summarization, sentiment analysis, content classification, personalization, or the buddy AI assistant. Covers @stacksjs/ai and config/ai.ts.
stacks-aliasUse when working with path aliases in a Stacks project — import resolution, module aliasing, or debugging import paths. Covers @stacksjs/alias which defines 260+ path mappings for the entire framework.
stacks-analyticsUse when adding analytics to a Stacks application — configuring Fathom or self-hosted analytics, generating tracking scripts, privacy-friendly analytics setup, or the analytics configuration. Covers @stacksjs/analytics and config/analytics.ts.
stacks-apiUse when building, modifying, or debugging API endpoints in a Stacks application — defining routes, handling requests, API middleware, working with the API server, HTTP client (fetcher), API resources, or OpenAPI generation. Covers both @stacksjs/api utilities and the stacks-api server implementation.
stacks-arraysUse when working with array utilities in Stacks — statistical operations (average, median, mode, standard deviation, z-score, percentile, covariance), array manipulation (unique, flatten, partition, shuffle, sample, move), containment checks, or the Arr facade. Covers @stacksjs/arrays.
stacks-authUse when implementing authentication, authorization, passkeys, TOTP/2FA, RBAC, gates, policies, session auth, token management, email verification, password resets, or rate limiting in a Stacks application. Covers the @stacksjs/auth package, config/auth.ts, app/Gates.ts, and app/Middleware/.
stacks-auto-importsUse when working with the Stacks auto-import system — understanding how browser and server auto-imports work, configuring auto-imported functions/models/composables, the auto-import manifests, type generation, or how globals are injected. Covers the auto-import pipeline at storage/framework/auto-imports/.
stacks-brandkitUse when defining or exploring a brand identity for a Stacks project and you want premium brand-kit REFERENCE IMAGES first - logo directions, palettes, typography specimens, identity boards, and application/mockup decks. Generates IMAGES ONLY, never code. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems with intentional logo concepting, sparse type, strong symbolic meaning, and disciplined palettes a coding step can build against.
stacks-browseUse for headless browser QA on Stacks applications — navigation, screenshots, responsive testing, console/network monitoring, and accessibility snapshots. Dependency-free: drives a system browser over the Chrome DevTools Protocol using only Bun (no Playwright/Puppeteer). Invoke with /stacks-browse.