history
Smart temporal analysis using git history - Hotspots, Coupling, and Recent Contributors
What this skill does
# SourceAtlas: Smart Temporal Analysis (Git History)
> **Constitution**: [ANALYSIS_CONSTITUTION.md](../../../ANALYSIS_CONSTITUTION.md) v1.0
## Context
**Analysis Scope:** $ARGUMENTS (default: entire repository)
**Goal:** Extract actionable insights from git history
**Time Limit:** 5-10 minutes
**Prerequisite:** code-maat (will ask permission to install if missing)
## Quick Start
1. **Check cache** (skip if `--force` flag present)
2. **Check code-maat** installation (install if needed with permission)
3. **Generate git log** (last 12 months, code-maat compatible)
4. **Run analyses**: Hotspots, Coupling, Contributors
5. **Risk assessment** combining all dimensions
6. **Generate report** following [output-template.md](output-template.md)
7. **Verify output** using [verification-guide.md](verification-guide.md)
8. **Auto-save** to `.sourceatlas/history.md`
## Your Task
You are analyzing git commit history to understand:
1. **Hotspots** - Files changed most frequently (likely complex/risky)
2. **Temporal Coupling** - Files that change together (hidden dependencies)
3. **Recent Contributors** - Who has knowledge of which areas (bus factor)
4. **Risk Areas** - Aggregate assessment for prioritization
### What You'll Discover
| Analysis Type | Insight | Business Value |
|---------------|---------|----------------|
| **Hotspots** | Complexity indicators | Refactoring priorities, technical debt |
| **Coupling** | Hidden dependencies | Architecture review targets |
| **Contributors** | Knowledge distribution | Bus factor risks, training needs |
| **Risk** | Aggregate assessment | Resource allocation decisions |
---
## Core Workflow
Execute these steps in order. See [workflow.md](workflow.md) for complete details.
### Step 0: Check Prerequisites (30 seconds)
**Purpose:** Ensure code-maat is installed and Java is available.
**Check code-maat:**
```bash
if [ -f "$HOME/.sourceatlas/bin/code-maat-1.0.4-standalone.jar" ]; then
export CODEMAAT_JAR="$HOME/.sourceatlas/bin/code-maat-1.0.4-standalone.jar"
fi
```
**If not found, use AskUserQuestion:**
- "code-maat required for analysis. Install now? (requires Java 8+)"
- If yes → run `./scripts/install-codemaat.sh`
- If no → show manual installation steps
→ See [workflow.md#step-0](workflow.md#step-0-check-prerequisites-30-seconds)
### Step 1: Generate Git Log (1 minute)
**Purpose:** Create code-maat compatible git log file.
**Default: Last 12 months**
```bash
git log --all --numstat --date=short \
--pretty=format:'--%h--%ad--%aN' \
--after="$(date -v-12m +%Y-%m-%d)" \
> /tmp/git-history.log
```
**If scope specified:** Filter to directory (e.g., "src/")
→ See [workflow.md#step-1](workflow.md#step-1-generate-git-log-1-minute)
### Step 2: Hotspot Analysis (2 minutes)
**Purpose:** Identify frequently changed files.
**Run code-maat revisions:**
```bash
java -jar "$CODEMAAT_JAR" -l /tmp/git-history.log -c git2 -a revisions
```
**Calculate complexity scores:** LOC × Revisions
**Identify top 10 hotspots** sorted by complexity
→ See [workflow.md#step-2](workflow.md#step-2-hotspot-analysis-2-minutes)
### Step 3: Temporal Coupling Analysis (2 minutes)
**Purpose:** Find files that change together.
**Run code-maat coupling:**
```bash
java -jar "$CODEMAAT_JAR" -l /tmp/git-history.log -c git2 -a coupling
```
**Filter significant couplings:** degree ≥ 0.5
**Categorize:** Expected vs Suspicious
→ See [workflow.md#step-3](workflow.md#step-3-temporal-coupling-analysis-2-minutes)
### Step 4: Recent Contributors Analysis (2 minutes)
**Purpose:** Map knowledge distribution across modules.
**Run code-maat entity-ownership:**
```bash
java -jar "$CODEMAAT_JAR" -l /tmp/git-history.log -c git2 -a entity-ownership
```
**Generate knowledge map** by area (src/api/, src/core/, etc.)
**Identify bus factor risks:** Single-contributor modules
→ See [workflow.md#step-4](workflow.md#step-4-recent-contributors-analysis-2-minutes)
### Step 5: Risk Assessment (1 minute)
**Purpose:** Combine all dimensions into actionable priorities.
**Calculate composite risk:** (Revisions × Coupling_Count) / Contributor_Count
**Risk categories:**
- Bus Factor Risk
- Complexity Risk
- Coupling Risk
- Testing Gap Risk
→ See [workflow.md#step-5](workflow.md#step-5-risk-assessment-1-minute)
---
## Output Format
Your analysis should follow this Markdown structure:
```markdown
🗺️ SourceAtlas: History
───────────────────────────────
📜 [repo name] │ [N] months
**Analysis Period**: [start] → [end]
**Commits Analyzed**: [count]
**Files Analyzed**: [count]
## 1. Hotspots (Top 10)
[Table with Rank, File, Changes, LOC, Complexity Score]
[Insights paragraph]
## 2. Temporal Coupling (Significant Pairs)
[Table with File A, File B, Coupling, Co-changes]
[Expected vs Suspicious coupling analysis]
## 3. Recent Contributors (Knowledge Map)
[Per-area tables with Contributor, Commits, Last Active]
[Bus Factor Risks section]
## 4. Risk Summary
[Risk aggregation table]
[Priority Actions numbered list]
## 5. Recommendations
[Refactoring candidates, knowledge sharing, architecture review]
## Recommended Next
[Dynamic suggestions based on findings]
```
→ See [output-template.md](output-template.md) for complete specification and examples
---
## Critical Rules
### 1. Privacy Aware
- Use "Recent Contributors" not "Ownership %"
- Focus on knowledge distribution, not blame
- Frame findings as opportunities, not criticisms
### 2. Actionable Insights
- Every finding must have recommended action
- Reference specific commit counts and file paths
- Provide concrete next steps (not vague suggestions)
### 3. Evidence-Based
- All hotspot files must exist (verify)
- Commit counts must match git history (±20% tolerance)
- Contributor names must be in git log
### 4. Time-Bounded
- Default: 12 months (good balance)
- Minimum: 3 months (for meaningful patterns)
- Maximum: 24 months (avoid ancient history)
### 5. Verification Required
- Execute [verification-guide.md](verification-guide.md) after analysis
- Verify file paths, commit counts, contributors
- Correct discrepancies before output
### 6. Constitutional Compliance
Follow [ANALYSIS_CONSTITUTION.md](../../../ANALYSIS_CONSTITUTION.md):
- **Article I**: Evidence-based (all claims from git/code-maat)
- **Article III**: Verification (run V1-V4 checks)
- **Article IV**: Evidence format (file:line references)
- **Article V**: Transparency (show analysis period, cache age)
- **Article VII**: User Empowerment (actionable recommendations)
---
## Self-Verification
After generating your analysis, execute verification steps:
### Step V1: Extract Verifiable Claims
Parse output for all quantifiable claims:
- File paths (hotspots, coupled files)
- Commit counts (total, per file, per contributor)
- Contributor names
- Coupling pairs
- Date ranges
### Step V2: Parallel Verification
- Verify hotspot files exist (sample 3-5)
- Verify commit counts (±20% tolerance)
- Verify contributors in git history
- Verify coupling pairs (both files exist)
- Verify date ranges within repository history
### Step V3: Handle Results
- ✅ All checks pass → Proceed to output
- ⚠️ Minor issues (1-2 checks) → Correct and note
- ❌ Major issues (3+ checks) → Re-execute analysis
### Step V4: Add Verification Summary
```yaml
verification_summary:
checks_performed: [...]
confidence_level: "high" # high|medium|low
notes: [...]
```
→ See [verification-guide.md](verification-guide.md) for complete checklist
---
## Advanced
### Cache Behavior
- **Default**: Use cache if exists
- **Force flag**: Skip cache with `--force`
- **Cache location**: `.sourceatlas/history.md` (fixed path)
- **Cache age warning**: If >30 days old
→ See [reference.md#cache-behavior](reference.md#cache-behavior)
### Auto-Save Mechanism
Complete Markdown report auto-saves after verification:
```
💾 Saved to .sourceatlas/history.md
```
→ See [reference.md#auto-save-behavior](reference.md#auto-save-behavior)
### Handoffs to Next Commands
BRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.