codebase-analyzer
Skill444 starsChanged 9 days agoMITView on GitHub
Statistical rule discovery from Go codebase patterns.
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 50
Read and follow the repository's CLAUDE.md before doing anything else -- project instructions override default behaviors.
- Distinctive: line 54
Check for standard structure (cmd/, internal/, pkg/)
- Distinctive: line 55
Verify sufficient file count: 50+ files for meaningful rules, 100+ ideal.
- Distinctive: line 67
No external dependencies needed (uses only Python standard library)
- Distinctive: line 76
Goal: Run statistical analysis scripts.
- Distinctive: line 93
Check file count matches expectations (no vendor pollution)
- Distinctive: line 94
Verify all three lenses produced data
- Distinctive: line 100
All percentages near 50%? May indicate mixed codebase or insufficient data
- Distinctive: line 124
Only derive rules from patterns with sufficient consistency.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
Deep References
Load on demand when the corresponding signal appears.
| Signal | Reference | Content |
| Three-lens methodology | references/three-lenses.md | Consistency, Signature, Idiom lens details |
| Phase banners, error catalog, reconciliation | references/phase-details.md | Phase templates, rule format, error catalog |
| 100-metric catalog | references/metrics-catalog.md | All metrics across 25 categories |
| Worked examples | references/examples.md | Single repo, multi-repo, evolution tracking workflows |
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
| Variant | Script | Metrics | Use When |
| Omni (recommended) | cartographer_omni.py | 100 across 25 categories | Full codebase profiling |
| Basic | cartographer.py | ~15 categories | Quick pattern overview |
| Ultimate | cartographer_ultimate.py | 6 focused categories | Performance 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/repoAlways 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
| Lens | Question | Measures |
| 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.
| Confidence | Threshold | Action | Example |
| HIGH | >85% consistency | Extract as enforceable rule | "96% use err not e" -> MUST use err |
| MEDIUM | 70-85% consistency | Extract as recommendation | "78% guard clauses" -> SHOULD prefer guards |
| Below 70% | Not extracted as rule | Report 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.jsonStep 2: Generate derived rules document
derived_rules/{repo_name}_rules.mdRule 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
Prerequisites
- Python 3.7+ (standard library only, no external dependencies)
- Go codebase with 50+ files (100+ ideal for meaningful rules)
Other versions3 projects use a version of this.
Word for word · 1
- notque/vexjoy-agent★ 444100% same
Edited · 0
None found.
Wrote their own version · 2
- sagy101/DotSkills★ 4same name
- AthenDrakomin-hub/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository64 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- assessmentSkill
- dataSkill
- business-opsSkill
- code-qualitySkill
- comment-qualitySkill
- condenseSkill
- joy-checkSkill
- content-engineSkill
- contentSkill
- headlinesSkill
- image-genSkill
- image-to-videoSkill
- series-plannerSkill
- topic-brainstormerSkill
- video-editingSkill
- writingSkill
- domainSkill
- cli-designSkill
- frontendSkill
- frontend-slidesSkill
- jev-designSkill
- webgl-card-effectsSkill
- game-asset-generatorSkill
- game-devSkill
- game-trailerSkill
- motion-pipelineSkill
- browser-jev-automationSkill
- cve-source-checkSkill
- deploySkill
- endpoint-validatorSkill
- headless-cron-creatorSkill
- kubernetesSkill
- githubSkill
- accountsSkill
- auto-dreamSkill
- building-with-jevSkill
- codexSkill
- docs-sync-checkerSkill
- doSkill
- dSkill
- grill-jevSkill
- toolkitSkill
- workflow-helpSkill
- debuggingSkill
- plant-seedSkill
- processSkill
- pr-workflowSkill
- quickSkill
- testingSkill
- with-anti-rationalizationSkill
- workflowSkill
- worktree-agentSkill
- programmingSkill
- architecture-deepeningSkill
- markdown-converterSkill
- news-collectionSkill
- researchSkill
- roastSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

