com um clique
history
// Smart temporal analysis using git history - Hotspots, Coupling, and Recent Contributors
// Smart temporal analysis using git history - Hotspots, Coupling, and Recent Contributors
Analyze the impact scope of code changes using static dependency analysis
Get project overview - scan <5% of files to achieve 70-80% understanding
Learn design patterns from the current codebase
List saved SourceAtlas analysis results
Clear saved SourceAtlas analysis results
Analyze dependency usage for library/framework/SDK upgrades
| name | history |
| description | Smart temporal analysis using git history - Hotspots, Coupling, and Recent Contributors |
| model | sonnet |
| allowed-tools | Bash, Glob, Grep, Read, Write, AskUserQuestion |
| argument-hint | (optional) [path or scope, e.g., "src/", "frontend", "last 6 months"] [--force] |
Constitution: ANALYSIS_CONSTITUTION.md v1.0
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)
--force flag present).sourceatlas/history.mdYou are analyzing git commit history to understand:
| 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 |
Execute these steps in order. See workflow.md for complete details.
Purpose: Ensure code-maat is installed and Java is available.
Check code-maat:
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:
./scripts/install-codemaat.sh→ See workflow.md#step-0
Purpose: Create code-maat compatible git log file.
Default: Last 12 months
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
Purpose: Identify frequently changed files.
Run code-maat revisions:
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
Purpose: Find files that change together.
Run code-maat coupling:
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
Purpose: Map knowledge distribution across modules.
Run code-maat entity-ownership:
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
Purpose: Combine all dimensions into actionable priorities.
Calculate composite risk: (Revisions × Coupling_Count) / Contributor_Count
Risk categories:
→ See workflow.md#step-5
Your analysis should follow this Markdown structure:
🗺️ 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 for complete specification and examples
Follow ANALYSIS_CONSTITUTION.md:
After generating your analysis, execute verification steps:
Parse output for all quantifiable claims:
verification_summary:
checks_performed: [...]
confidence_level: "high" # high|medium|low
notes: [...]
→ See verification-guide.md for complete checklist
--force.sourceatlas/history.md (fixed path)→ See reference.md#cache-behavior
Complete Markdown report auto-saves after verification:
💾 Saved to .sourceatlas/history.md
→ See reference.md#auto-save-behavior
Based on findings, suggest:
/sourceatlas:impact "[hotspot]"/sourceatlas:flow "[entry point]"/sourceatlas:pattern "[pattern]"→ See reference.md#handoffs
~/.sourceatlas/bin/code-maat-1.0.4-standalone.jar./scripts/install-codemaat.sh→ See reference.md#code-maat-installation
→ See reference.md#interpretation-guidelines
Detailed documentation available in:
Start your output with:
🗺️ SourceAtlas: History
───────────────────────────────
📜 [repo name] │ [N] months
Then follow complete structure in output-template.md.