Skip to content

jeremylongshore/tons-of-skills-marketplace / plugins/devops/git-commit-smart/skills/generating-smart-commits

generating-smart-commits

Verified

Execute use when generating conventional commit messages from staged git changes. Trigger with phrases like "create commit message", "generate smart commit", "/commit-smart", or "/gc". Automatically analyzes changes to determine commit type (feat, fix, docs), identifies breaking changes, and formats according to conventional commit standards.

FileKindSize
SKILL.mdskill md4.0 KB
assets/README.mdmarkdown234 B
assets/commit_template.txtmarkdown3.7 KB
assets/example_diff.txtmarkdown4.1 KB
references/README.mdmarkdown59 B
scripts/README.mdmarkdown434 B
scripts/commit_analyzer.pyexecutablescript4.6 KB

scripts/commit_analyzer.py

View on GitHub
#!/usr/bin/env python3
"""
git-commit-smart - Analysis Script
Analyzes staged changes to determine commit type and breaking changes using AI.
Generated: 2025-12-10 03:48:17
"""

import json
import argparse
from pathlib import Path
from typing import Dict
from datetime import datetime


class Analyzer:
    def __init__(self, target_path: str):
        self.target_path = Path(target_path)
        self.stats = {"total_files": 0, "total_size": 0, "file_types": {}, "issues": [], "recommendations": []}

    def analyze_directory(self) -> Dict:
        """Analyze directory structure and contents."""
        if not self.target_path.exists():
            self.stats["issues"].append(f"Path does not exist: {self.target_path}")
            return self.stats

        for file_path in self.target_path.rglob("*"):
            if file_path.is_file():
                self.analyze_file(file_path)

        return self.stats

    def analyze_file(self, file_path: Path):
        """Analyze individual file."""
        self.stats["total_files"] += 1
        self.stats["total_size"] += file_path.stat().st_size

        # Track file types
        ext = file_path.suffix.lower()
        if ext:
            self.stats["file_types"][ext] = self.stats["file_types"].get(ext, 0) + 1

        # Check for potential issues
        if file_path.stat().st_size > 100 * 1024 * 1024:  # 100MB
            self.stats["issues"].append(f"Large file: {file_path} ({file_path.stat().st_size // 1024 // 1024}MB)")

        if file_path.stat().st_size == 0:
            self.stats["issues"].append(f"Empty file: {file_path}")

    def generate_recommendations(self):
        """Generate recommendations based on analysis."""
        if self.stats["total_files"] == 0:
            self.stats["recommendations"].append("No files found - check target path")

        if len(self.stats["file_types"]) > 20:
            self.stats["recommendations"].append("Many file types detected - consider organizing")

        if self.stats["total_size"] > 1024 * 1024 * 1024:  # 1GB
            self.stats["recommendations"].append("Large total size - consider archiving old data")

    def generate_report(self) -> str:
        """Generate analysis report."""
        report = []
        report.append("\n" + "=" * 60)
        report.append("ANALYSIS REPORT - git-commit-smart")
        report.append("=" * 60)
        report.append(f"Target: {self.target_path}")
        report.append(f"Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
        report.append("")

        # Statistics
        report.append("πŸ“Š STATISTICS")
        report.append(f"  Total Files: {self.stats['total_files']:,}")
        report.append(f"  Total Size: {self.stats['total_size'] / 1024 / 1024:.2f} MB")
        report.append(f"  File Types: {len(self.stats['file_types'])}")

        # Top file types
        if self.stats["file_types"]:
            report.append("\nπŸ“ TOP FILE TYPES")
            sorted_types = sorted(self.stats["file_types"].items(), key=lambda x: x[1], reverse=True)[:5]
            for ext, count in sorted_types:
                report.append(f"  {ext or 'no extension'}: {count} files")

        # Issues
        if self.stats["issues"]:
            report.append(f"\n⚠️  ISSUES ({len(self.stats['issues'])})")
            for issue in self.stats["issues"][:10]:
                report.append(f"  - {issue}")
            if len(self.stats["issues"]) > 10:
                report.append(f"  ... and {len(self.stats['issues']) - 10} more")

        # Recommendations
        if self.stats["recommendations"]:
            report.append("\nπŸ’‘ RECOMMENDATIONS")
            for rec in self.stats["recommendations"]:
                report.append(f"  - {rec}")

        report.append("")
        return "\n".join(report)


def main():
    parser = argparse.ArgumentParser(
        description="Analyzes staged changes to determine commit type and breaking changes using AI."
    )
    parser.add_argument("target", help="Target directory to analyze")
    parser.add_argument("--output", "-o", help="Output report file")
    parser.add_argument("--json", action="store_true", help="Output as JSON")

    args = parser.parse_args()

    print(f"πŸ” Analyzing {args.target}...")
    analyzer = Analyzer(args.target)
    stats = analyzer.analyze_directory()
    analyzer.generate_recommendations()

    if args.json:
        output = json.dumps(stats, indent=2)
    else:
        output = analyzer.generate_report()

    if args.output:
        Path(args.output).write_text(output)
        print(f"βœ“ Report saved to {args.output}")
    else:
        print(output)

    return 0 if len(stats["issues"]) == 0 else 1


if __name__ == "__main__":
    import sys

    sys.exit(main())
rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product β€” it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product β€” not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial β€” a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
claude-apianthropics/skillsReference for the Claude API / Anthropic SDK β€” model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER β€” read BEFORE opening the target file; don't skip because it "looks like a one-liner" β€” whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) β€” never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named β€” don't Read the file).Stars: 198kUpdated Claude CodeCodexUnverifiedInstall
doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.Stars: 198kUpdated Claude CodeCodexVerifiedInstall