commit-analyzer

📁 chipagosfinest/claude-meta-learning 📅 7 days ago
1
总安装量
1
周安装量
#42891
全站排名
安装命令
npx skills add https://github.com/chipagosfinest/claude-meta-learning --skill commit-analyzer

Agent 安装分布

replit 1
openclaw 1
opencode 1
codex 1
claude-code 1

Skill 文档

Commit Analyzer

Purpose

Analyzes git commit history to surface patterns, recurring issues, and extractable knowledge. Designed to feed insights into /claudeception for continuous learning and skill generation.

When to Use

  • After a debugging session to identify what went wrong and why
  • Before refactoring to understand the evolution of problematic code
  • When noticing repeated fixes for similar issues
  • During retrospectives to extract learnings
  • When the user asks to “analyze commits” or “review commit history”

Analysis Process

Step 1: Gather Commit Data

# Get recent commits with stats
git log --oneline --stat -n 60

# Get commits with full messages for categorization
git log --pretty=format:"%h|%s|%b" -n 60

# Get commits touching specific files (for focused analysis)
git log --oneline --follow -- path/to/file

Step 2: Categorize Commits

Analyze commit messages and classify into categories:

Category Indicators Weight
Bug Fix “fix”, “bug”, “issue”, “error”, “broken”, “crash” 1.5x (problem indicator)
Feature “add”, “feature”, “implement”, “new”, “support” 1.0x
Refactor “refactor”, “clean”, “improve”, “optimize”, “simplify” 1.0x
Config “config”, “env”, “setting”, “deploy”, “ci” 0.8x
Docs “doc”, “readme”, “changelog”, “comment” 0.5x
Test “test”, “spec”, “coverage” 0.8x
Security “security”, “auth”, “token”, “encrypt”, “vulnerability” 2.0x

Step 3: Identify Patterns

Look for these anti-patterns:

  1. Repeated Fixes: Multiple commits fixing the same component/file

    • Signal: Same filename in 3+ fix commits
    • Extract: Root cause analysis needed
  2. Fix-Feature Ratio: High ratio indicates technical debt

    • 40% fixes = Concerning

    • 60% fixes = Critical

  3. Churn Files: Files with many modifications

    • Signal: >10 commits touching same file
    • Extract: Might need architectural review
  4. Cascading Fixes: Fix followed by “fix fix” or revert

    • Signal: Commits referencing previous commits
    • Extract: Testing/review process gap
  5. Pattern Clusters: Similar fixes across different files

    • Signal: Same keywords (e.g., “env var”, “null check”) in multiple fixes
    • Extract: Systematic issue, needs pattern fix

Step 4: Generate Root Cause Analysis

For each pattern found, generate:

## Root Cause: [Name]

**Evidence:**
- Commit A: [hash] [message]
- Commit B: [hash] [message]
- Commit C: [hash] [message]

**Pattern:** [Description of what's happening]

**Root Cause:** [Why this keeps happening]

**Fix:** [What would prevent this class of bugs]

**Skill Extraction:** [If this should become a Claude Code skill]

Step 5: Feed to Claudeception

After analysis, automatically invoke /claudeception with:

Based on the commit history analysis:

## Recurring Issues Found

[List of patterns with evidence]

## Proposed Skills to Extract

1. **[skill-name]** - [Description of when to use and what it solves]
   - Trigger: [When this skill should activate]
   - Solution: [What the skill should do]

Please review and create appropriate skills for the valuable learnings.

Example Output

# Commit Analysis Report: clawdbot-railway

## Summary
- Total commits analyzed: 60
- Bug fixes: 26 (43%)  <-- WARNING: High fix ratio
- Features: 18 (30%)
- Refactors: 8 (13%)
- Other: 8 (14%)

## Recurring Patterns

### Pattern 1: Module-Level Env Var Reads (6 commits)
**Commits:**
- ee510f6: Fix env var timing in cron tracker
- a1b2c3d: Fix SUPABASE_URL undefined in health check
- x4y5z6a: Fix module-level constant capture

**Root Cause:** In serverless environments, module-level `const X = process.env.X`
can capture `undefined` before env vars are initialized during cold start.

**Skill to Extract:** `vercel-serverless-env-vars`

### Pattern 2: Markdown Escaping (4 commits)
**Commits:**
- 52a110c: Fix markdown escaping in telegram
- 8c9be65: Another markdown escape fix
- 2f89a9d: Escape backslash first

**Root Cause:** Telegram MarkdownV2 requires specific escape order (backslash first)
and 3 different implementations exist.

**Skill to Extract:** `telegram-markdownv2-escaping`

## Recommended Actions

1. Create skill: `vercel-serverless-env-vars` (already exists - verify usage)
2. Create skill: `telegram-markdownv2-escaping`
3. Consolidate 3 escapeMarkdown implementations into one
4. Add pre-commit TypeScript check

## Feeding to /claudeception...
[Auto-invokes claudeception with findings]

Integration with Claudeception

This skill should automatically call /claudeception when:

  • Analysis finds 2+ recurring patterns
  • A pattern has 3+ related commits
  • A root cause is identified that isn’t already captured in a skill

The handoff format:

/claudeception

Session learning from commit analysis:

1. **Pattern Name**: [Description]
   - Evidence: [Commit hashes]
   - Root cause: [Why it happens]
   - Solution: [How to prevent]

Please extract any valuable skills from these findings.

Command Aliases

  • /commit-analyzer – Run full analysis
  • /analyze-commits – Alias
  • /commit-patterns – Alias
  • “analyze my commit history” – Natural language trigger
  • “what patterns do you see in recent commits” – Natural language trigger

Notes

  • Focus on patterns, not individual commits
  • Weight security and fix commits higher in analysis
  • Always cross-reference with existing skills to avoid duplication
  • Consider project-specific vs universal patterns
  • Invoke claudeception only for genuinely useful learnings

References

  • Claudeception skill: ~/.claude/skills/claudeception/SKILL.md
  • Continuous learning system: Extracts reusable knowledge from sessions