Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

codebase-analyzer代码库分析器

Agent Skill

codebase-analyzer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

170

周安装

7

GitHub Stars

353

下载量

55
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:codebase-analyzer(代码库分析器)
来源仓库:https://github.com/notque/claude-code-toolkit
仓库路径:skills/codebase-analyzer
安装命令:
npx skills add https://github.com/notque/claude-code-toolkit --skill codebase-analyzer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/notque/claude-code-toolkit --skill codebase-analyzer

简介

codebase-analyzer 用于查找、检索和筛选相关信息。

  • 适合在需要根据关键词、任务场景或来源线索快速定位候选结果时使用。
  • 可结合来源仓库和原始 README 继续核验具体用法,支持代码库分析。
  • 安装命令:npx skills add https://github.com/notque/claude-code-toolkit --skill codebase-analyzer。
  • 使用前请确认权限范围、维护状态及是否会触发联网或文件读写操作。

SKILL.md

Codebase Analyzer Skill

Statistical rule discovery through measurement of Go codebases. Python scripts count patterns to avoid LLM training bias, then statistics are interpreted to derive confidence-scored rules. The core principle is Measure First, Interpret Second -- what IS in the code is the local standard, not what an LLM thinks "should be" there.

Reference Loading

Load these files when the corresponding signals appear:

SignalLoad
Understanding the three lenses (Consistency, Signature, Idiom)references/three-lenses.md
Worked examples, phase banners, error catalog, reconciliation matrixreferences/phase-details.md
Full 100-metric catalog across 25 categoriesreferences/metrics-catalog.md
Additional real-world analysis workflowsreferences/examples.md

Reference Loading Table

SignalLoad These FilesWhy
example-driven tasksexamples.mdLoads detailed guidance from examples.md.
tasks related to this referencemetrics-catalog.mdLoads detailed guidance from metrics-catalog.md.
tasks related to this referencephase-details.mdLoads detailed guidance from phase-details.md.
tasks related to this referencethree-lenses.mdLoads detailed guidance from three-lenses.md.

Instructions

Phase 1: CONFIGURE

Goal: Validate target and select analyzer variant.

Read and follow the repository's CLAUDE.md before doing anything else -- project instructions override default behaviors.

Step 1: Validate the target

  • Confirm path points to a Go repository root with.go files
  • Check for standard structure (cmd/, internal/, pkg/)
  • Verify sufficient file count: 50+ files for meaningful rules, 100+ ideal. Below 50 files, statistics produce high variance -- patterns that look consistent may be coincidence. For small repos, combine analysis across multiple team repos rather than treating thin data as definitive.

Step 2: Select cartographer variant

VariantScriptMetricsUse When
Omni (recommended)cartographer_omni.py100 across 25 categoriesFull codebase profiling
Basiccartographer.py~15 categoriesQuick pattern overview
Ultimatecartographer_ultimate.py6 focused categoriesPerformance pattern detection

Step 3: Verify environment

  • Python 3.7+ available
  • No external dependencies needed (uses only Python standard library)
  • Output directories exist or can be created

See references/phase-details.md for the CONFIGURE banner template.

Gate: Target directory exists, contains 50+ Go files, variant selected. Proceed only when gate passes.

Phase 2: MEASURE

Goal: Run statistical analysis scripts. Pure measurement -- no interpretation yet.

This phase is strictly mechanical. Scripts count and measure; keep interpretation separate from data collection. Combining measurement with interpretation introduces LLM training bias -- the model reports what "should be" instead of what IS. Run scripts first, interpret the numbers second, always as separate steps.

Automatically filter vendor/, testdata/, and generated code (files with "Code generated by..." markers) to avoid polluting statistics with external patterns.

Step 1: Execute the cartographer

python3 ${CLAUDE_SKILL_DIR}/scripts/cartographer_omni.py /path/to/go/repo
# Or for quick overview: python3 ${CLAUDE_SKILL_DIR}/scripts/cartographer.py /path/to/go/repo

Always run the cartographer scripts for measurement; reserve LLM interpretation for Phase 3. When an LLM sees return err it may report "not wrapping errors properly" even if that IS the local standard. The scripts produce deterministic, reproducible counts; the LLM's role begins at interpretation in Phase 3.

Step 2: Verify output integrity

  • Confirm JSON output is valid and complete
  • Check file count matches expectations (no vendor pollution)
  • Verify all three lenses produced data
  • Confirm derived_rules section exists in output

Step 3: Check for data quality issues

  • File count suspiciously high? Vendor code may be included
  • File count suspiciously low? Subdirectories may be missed
  • All percentages near 50%? May indicate mixed codebase or insufficient data

See references/phase-details.md for the MEASURE banner template.

Gate: Script completed without errors, JSON output is valid, file count is reasonable. Proceed only when gate passes.

Phase 3: INTERPRET

Goal: Derive rules from statistics. This is where LLM interpretation happens -- AFTER measurement is complete.

Report facts and show complete statistics rather than describing them. Report facts without editorializing about code quality -- the numbers speak for themselves.

Step 1: Review the three lenses

LensQuestionMeasures
Consistency (Frequency)"How often do they use X?"Imports, test frameworks, logging, modern features
Signature (Structure)"How do they name/structure things?"Constructors, receivers, parameter order, variables
Idiom (Implementation)"How do they implement patterns?"Error handling, control flow, context usage, defer

For detailed lens explanations, see references/three-lenses.md.

Step 2: Extract rules by confidence

Only derive rules from patterns with sufficient consistency. Forcing rules from weak patterns causes false positives in reviews and may impose standards the team has not organically adopted.

ConfidenceThresholdActionExample
HIGH>85% consistencyExtract as enforceable rule"96% use err not e" -> MUST use err
MEDIUM70-85% consistencyExtract as recommendation"78% guard clauses" -> SHOULD prefer guards
Below 70%Not extracted as ruleReport as observation only"55% single-letter receivers" -> No rule

Step 3: Review Style Vector (Omni only)

  • 10 composite scores (0-100): Consistency, Modernization, Safety, Idiomaticity, Documentation, Testing Maturity, Architecture, Performance, Observability, Production Readiness
  • Identify strengths (scores >75) and gaps (scores <50)
  • Note shadow constitution entries (accepted linter suppressions)

Step 4: Cross-reference lenses

  • Pattern confirmed across multiple lenses = higher confidence
  • Pattern in one lens only = standard confidence
  • Contradictions between lenses = investigate further

Gate: Rules extracted with evidence and confidence levels. Style Vector reviewed. Proceed only when gate passes.

Phase 4: DELIVER

Goal: Produce actionable output artifacts.

Step 1: Save statistical report

cartography_data/{repo_name}_cartography.json

Step 2: Generate derived rules document

derived_rules/{repo_name}_rules.md

Rule and Style Vector formats, plus the DELIVER banner template, live in references/phase-details.md.

Step 3: Summarize Style Vector (Omni only) — see phase-details.md

Step 4: Recommend next steps

  • Compare with pr-workflow (miner) data if available (explicit vs implicit rules)
  • Suggest CLAUDE.md updates for high-confidence rules
  • Identify golangci-lint rules that could enforce discovered patterns
  • Suggest quarterly re-analysis schedule -- coding patterns evolve with team growth and new Go versions, so a one-time snapshot becomes stale within months

Gate: JSON report saved, rules document generated, next steps documented. Analysis complete.


Complementary Skills, Examples, Error Handling

Load references/phase-details.md for:

  • Complementary skills (pr-workflow miner) and reconciliation matrix
  • Worked examples: single repo, team-wide discovery, onboarding
  • Error catalog: no Go files found, no rules derived, vendor/generated pollution

References

Reference Files

  • ${CLAUDE_SKILL_DIR}/references/three-lenses.md: Detailed explanation of the three analysis lenses
  • ${CLAUDE_SKILL_DIR}/references/examples.md: Real-world analysis examples and workflows
  • ${CLAUDE_SKILL_DIR}/references/metrics-catalog.md: Complete 100-metric catalog across 25 categories
  • ${CLAUDE_SKILL_DIR}/references/phase-details.md: Phase banners, reconciliation matrix, examples, error handling

Prerequisites

  • Python 3.7+
  • Go codebase to analyze (50+ files recommended)
  • No external dependencies (uses only Python standard library)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude

32.1%
按下载量换算18

Codex

31.39%
按下载量换算17

Cursor

19.36%
按下载量换算11

Gemini CLI

8.7%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills