analyze-codebase-improvements
Read-only repo audit: maintainability, correctness, tests, docs, deps, perf.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- analyze-codebase-improvements
- description
- Read-only repo audit: maintainability, correctness, tests, docs, deps, perf.
02 资源文件 1
- 参考文档agents/openai.yaml390 B
03 SKILL.md 正文
Analyze Codebase Improvements
Read-only repo audit. Do not edit code.
Inputs
- Scope: paths/globs/dirs. Default: whole repo.
- Focus:
architecture,complexity,time-complexity,duplication,dead-code,legacy-code,tests,errors,types,comments,docs,deps,simplify,all. Default:all.
Workflow
- Read repo docs/local instructions first.
- Parse scope/focus. Exclude generated, vendored, build, lockfile-only areas unless asked.
- Map repo shape: dirs, languages, frameworks, tooling, hotspots, large/stale areas.
- Pick lenses from focus. Use subagents when allowed/useful; shard by subsystem or concern.
- For every finding: cite files/symbols, evidence, failure mode or maintenance cost, smallest viable change.
- Merge duplicates. Drop speculative/style-only/low-signal items.
- Rank by impact, effort, confidence, regression risk.
- For
comments,docs, orall: usetechnical-writerif available; otherwise audit locally.
Lenses
- Architecture: boundaries, ownership, coupling, layering.
- Complexity/simplify: hard control flow, oversized files, needless abstraction, smaller equivalent code.
- Deletion/deps/dead-code: unused files, stale abstractions, removable paths, unused/outdated/overlapping deps.
- Time complexity: hot loops, repeated scans/lookups/sorts/allocations/recompute; include current complexity, bottleneck, lower-complexity alternative, expected complexity, space/readability trade-off, worth doing.
- Duplication/legacy: copy-paste, near-duplicate modules, compatibility bridges, old patterns, hard-coded values, orphan flows.
- Tests: missing coverage, weak assertions, risky untested behavior.
- Errors: silent failures, swallowed exceptions, weak reporting.
- Types: weak invariants, leaky models, unclear boundaries.
- Comments/docs: stale/misleading/redundant comments, missing durable docs, setup/API/contributor drift. Validate comment accuracy and language docs standards: JSDoc/TSDoc, docstrings, Go doc, rustdoc, DocC.
Deletion-first tags for complexity/deps/dead-code/simplify findings:
delete:dead code, unused flexibility, speculative feature. Replacement: nothing.stdlib:hand-rolled code stdlib already covers. Name API.native:dependency/custom code platform/framework/DB/browser/OS already covers. Name feature.yagni:abstraction/config/layer with one impl, no real caller, or unproven need.shrink:same behavior with fewer concepts/lines. Show shorter replacement when concise.
Rules
- Analysis only; no code edits.
- Prefer high-leverage findings over exhaustive nitpicks.
- Favor deletion/simplification over new abstraction.
- Prefer stdlib, native features, and existing deps over custom code/new deps.
- For over-engineering, name what to cut and what replaces it; include
net: -N lines possiblewhen meaningful and cheap. - Correctness, tests, docs, deps, and perf gaps still count even when line count grows or does not shrink.
- Do not chase tiny line cuts that obscure behavior or fight repo conventions.
- Validate against existing patterns/local rules.
- Separate quick wins from strategic refactors.
- Report uncertainty when confidence low.
- Do not force optimization when asymptotic win/trade-off is poor.
- If nothing useful to cut in simplify-only pass, say lean already.
Output
# Codebase Improvement Summary
## Executive Summary
- 2-4 sentences: health + biggest opportunities
## Top Improvements To Make Now
- [Impact | Effort | Confidence] Title
- Files/Symbols:
- Evidence:
- Smallest viable change:
- Why now:
## Quick Wins
- Low-risk, high-leverage cleanups
## Strategic Refactors
- Larger changes needing planning
## Deletion / De-scope Opportunities
- Code, configs, abstractions, or deps likely removable
## Test / Docs / Dependency Gaps
- Missing coverage, stale docs, missing API docs, toolchain cleanup
## Questions / Assumptions
- Uncertainties needing confirmation
04 同仓库更多 Skills
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
workflow-from-chats
Extract preferences from agent chats → skills, rules, workflow docs. For learning preferences, mining feedback, personalizing workflows.
winui3-csharp-app
WinUI 3 / Windows App SDK desktop apps in C#/XAML. MVVM, bindings, navigation, Mica/Acrylic, windowing, packaging, performance.
why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.
what-did-i-get-done
Summarize authored commits over a user-specified time period into a concise status update.
weekly-review
Produce a short weekly synthesis of authored commits with highlights by bugfix, tech debt, and net-new work.