搜索

PythonReactSEOPDF
GitHub Skill

code-stats

Analyze codebase statistics with tokei (line counts by language) and difft (semantic AST-aware diffs). Use for project composition, refactoring scope, codebase metrics.

kamushadenes☆ 0 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Code Statistics

Rapid codebase analysis using two complementary tools.

Tools

tokei - Language Statistics

Line-count statistics across programming languages:

  • File count per language
  • Total lines, code lines, comments, blank lines
  • Supports 150+ languages

Usage:

tokei                                    # Full project stats
tokei --type=TypeScript,JavaScript       # Filter by language
tokei --exclude="vendor/*"               # Exclude patterns
tokei -o json                            # JSON output for automation
difft - Semantic Diffs

AST-aware diffing that understands code structure:

  • Ignores formatting changes
  • Recognizes code moves and refactoring
  • Shows meaningful changes, not line shuffles

Usage:

difft file1.go file2.go                  # Compare two files
GIT_EXTERNAL_DIFF=difft git diff         # Git integration
GIT_EXTERNAL_DIFF=difft git show HEAD    # Show last commit
GIT_EXTERNAL_DIFF=difft git log -p       # Log with semantic diffs

Workflow

  1. Quick snapshot: tokei for project composition
  2. Deep analysis: tokei -o json | jq for automation
  3. Review changes: GIT_EXTERNAL_DIFF=difft git diff for meaningful diffs

MUST DO

  • Use tokei before estimating project scope
  • Use difft for refactoring reviews
  • Filter output when only specific languages matter

MUST NOT

  • Rely on raw line counts for complexity estimates
  • Ignore comment ratios in health assessments

Advanced Features

  • tokei advanced: See references/tokei-advanced.md for filtering, automation, CI patterns
  • difft advanced: See references/difft-advanced.md for git integration, display modes, config

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!