codebase-analysis
Skill1 starsChanged 8 months agoApache-2.0View on GitHub
Systematic codebase analysis and pre-production review. 4-phase dissection, 8-domain health scoring, architecture mapping, dead code detection, remediation planning. Use when auditing or onboarding to any codebase.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- medy-gribkov/arcanaword for word, first seen Nov 1, 2026
- monsefchafik/claude-code-skillstheir own version, first seen Oct 20, 2026
- ArduPilot/MethodicConfiguratortheir own version, first seen Oct 8, 2026
- tony-adamson/groundworktheir own version, first seen Jul 15, 2026
- ptsilivis/autonomousguytheir own version, first seen Jul 4, 2026
- enzowyf/codebase-analysistheir own version, first seen Apr 10, 2026
Other versions7 projects use a version of this.
Word for word · 1
- medy-gribkov/arcana★ 1100% same
Edited · 0
None found.
Wrote their own version · 6
- ArduPilot/MethodicConfigurator★ 173same name
- Ycsyyds/codebase-analysis-skill★ 34same name
- ptsilivis/autonomousguy★ 33same name
- tony-adamson/groundwork★ 4same name
- enzowyf/codebase-analysis★ 0same name
- monsefchafik/claude-code-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 repository21 other files it gives its agents.
- accessibility-wcagSkill
- api-designSkill
- bugbounty-reportSkill
- ci-cd-pipelinesSkill
- database-designSkill
- design-docSkill
- docker-kubernetesSkill
- git-workflowSkill
- go-devSkill
- i18n-localizationSkill
- llm-integrationSkill
- nextjs-16Skill
- oauth-authSkill
- performance-optimizationSkill
- python-best-practicesSkill
- scraping-automationSkill
- security-reviewSkill
- seo-metaSkill
- tailwind-cssSkill
- testingSkill
- ts-devSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
2
Distinctive
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 186
Look for patterns that span multiple domains:
- Distinctive: line 252
Run 4 agents in parallel for large codebases:
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are a codebase analyst. Perform systematic, evidence-based analysis. Never guess. Always cite file:line. Score findings by severity and effort. Output actionable remediation plans.
When to Use
- Onboarding to an unfamiliar codebase
- Pre-production quality review
- Architecture audit or tech debt assessment
- Dead code detection and cleanup planning
- Security or performance review of existing systems
4-Phase Dissection Process
Phase 1: Structural Mapping
# 1. Project identity
cat package.json # or go.mod, pyproject.toml, Cargo.toml
git log --oneline -20
git shortlog -sn --no-merges | head -10
# 2. Entry points
grep -r "func main\|app.listen\|createServer\|if __name__" --include="*.go" --include="*.ts" --include="*.py" -l
# 3. Directory structure (depth 3)
find . -maxdepth 3 -type f -not -path '*/node_modules/*' -not -path '*/.git/*' | head -200Output a structural map:
project-name/
├── cmd/ → Entry points (2 binaries)
├── internal/ → Business logic (12 packages)
├── api/ → HTTP handlers (REST, 3 routes)
├── migrations/ → DB schema (PostgreSQL, 8 migrations)
└── tests/ → Integration tests (47 files)Phase 2: Data Layer Analysis
Trace data from input to storage:
HTTP Request → Handler → Service → Repository → Database
↓ ↓ ↓ ↓ ↓
Validate Transform Business Query Schema
(dto.go) (mapper.go) (svc.go) (repo.go) (001.sql)BAD - Data flow with no validation boundary:
func CreateUser(w http.ResponseWriter, r *http.Request) {
var user User
json.NewDecoder(r.Body).Decode(&user)
db.Create(&user) // Raw input straight to DB
}GOOD - Clear validation boundary:
func CreateUser(w http.ResponseWriter, r *http.Request) {
var dto CreateUserDTO
if err := json.NewDecoder(r.Body).Decode(&dto); err != nil {
http.Error(w, "invalid JSON", http.StatusBadRequest)
return
}
if err := dto.Validate(); err != nil {
http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return
}
user := dto.ToUser() // Explicit mapping
if err := svc.CreateUser(r.Context(), user); err != nil {
http.Error(w, "internal error", http.StatusInternalServerError)
return
}
}Phase 3: Logic & Flow Analysis
Check each concern:
Concurrency:
// BAD - shared map without mutex
var cache = map[string]string{}
func Get(key string) string { return cache[key] } // race condition
// GOOD - sync.Map or mutex
var cache sync.Map
func Get(key string) (string, bool) {
v, ok := cache.Load(key)
if !ok { return "", false }
return v.(string), true
}Error handling:
// BAD - swallowed errors
result, _ := doSomething()
// GOOD - every error handled or explicitly ignored with comment
result, err := doSomething()
if err != nil {
return fmt.Errorf("do something: %w", err)
}Dead code detection:
# Go: find unreferenced exports
grep -rn "^func [A-Z]" --include="*.go" | while read line; do
func_name=$(echo "$line" | grep -oP 'func \K[A-Z]\w+')
count=$(grep -rn "$func_name" --include="*.go" | wc -l)
if [ "$count" -le 1 ]; then echo "UNUSED: $line"; fi
done
# Go (preferred): deadcode ./... (golang.org/x/tools/cmd/deadcode)
# TypeScript: find unused files, exports, and dependencies
npx knipPhase 4: Remediation Planning
Score each finding by priority: severity (1-5) × likelihood (1-5). Record effort to fix as a separate estimate; it orders the work inside a priority band, it does not set the band.
| Priority | Score | Action |
| Critical | 20-25 | Fix before ship |
| High | 12-19 | Fix this sprint |
| Medium | 6-11 | Backlog |
| Low | 1-5 | Tech debt tracker |
8-Domain Health Scoring
Score each domain 0-100. Overall health = weighted average.
| Domain | Weight | What to Check |
| Security | 20% | OWASP Top 10, secrets in code, auth patterns |
| Data | 15% | Schema design, migrations, query performance |
| Backend | 15% | Error handling, concurrency, API design |
| External Services | 10% | Timeout config, retry logic, circuit breakers |
| Frontend | 10% | Bundle size, accessibility, state management |
| Infrastructure | 10% | Docker, CI/CD, env config, health checks |
| Performance | 10% | N+1 queries, missing indexes, memory leaks |
| Quality | 10% | Test coverage, lint config, type safety |
Health Score Formula
domain_score = 100 - (critical_findings × 20) - (high_findings × 10) - (medium_findings × 3)
overall_score = Σ(domain_score × domain_weight)BAD - Vague report:
The codebase has some security issues and could use more tests.GOOD - Quantified report:
Health Score: 62/100
Security (45/100):
- CRITICAL: SQL injection in api/users.go:47 (raw string concat)
- HIGH: JWT secret hardcoded in config/auth.go:12
- MEDIUM: No rate limiting on /api/login endpoint
Data (78/100):
- HIGH: Missing index on users.email (used in WHERE, 2M rows)
- MEDIUM: No down migration for 005_add_roles.sqlCross-Domain Pattern Detection
Look for patterns that span multiple domains:
- Auth bypass chain: Missing middleware on one route + IDOR in handler = privilege escalation
- Data leak chain: Verbose error messages + missing field filtering = PII exposure
- Performance chain: N+1 queries + no caching + no pagination = cascading slowdown
Report Template
# Codebase Analysis: [project-name]
## Summary
- Health Score: XX/100
- Critical Findings: N
- Files Analyzed: N
- Test Coverage: XX%
## Domain Scores
| Domain | Score | Critical | High | Medium |
|--------|-------|----------|------|--------|
| Security | XX | N | N | N |
| ...
## Critical Findings
### [CRIT-001] SQL Injection in User Search
- **File:** api/users.go:47
- **Impact:** Full database access
- **Fix:** Use parameterized query
- **Effort:** 1 hour
## Remediation Phases
### Phase 1 (This Week): Critical Security
- [ ] Fix SQL injection (CRIT-001)
- [ ] Rotate hardcoded JWT secret (CRIT-002)
### Phase 2 (This Sprint): High Priority
- [ ] Add missing indexes (HIGH-001)
- [ ] Implement rate limiting (HIGH-002)
### Phase 3 (Backlog): Medium Priority
- [ ] Add down migrations
- [ ] Increase test coverage to 80%Language-Specific Checklists
Go
- All errors handled (no
_on error returns) - Context propagation through call chain
- Graceful shutdown with signal handling
- No goroutine leaks (check with
runtime.NumGoroutine())
TypeScript/Node.js
- Strict mode enabled (
"strict": true) - No
anytypes (useunknown+ type guards) - Async errors caught (no unhandled promise rejections)
- Dependencies audited (
npm audit)
Python
- Type hints on public functions
- No bare
except:clauses - Virtual environment configured
- Dependencies pinned with hashes
Parallel Analysis Strategy
Run 4 agents in parallel for large codebases:
Agent 1: Structural mapping + entry points
Agent 2: Security domain (OWASP scan, secrets, auth)
Agent 3: Data domain (schema, queries, migrations)
Agent 4: Quality domain (tests, coverage, dead code)Merge results into single report with unified scoring.
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.

