ds-perf-plan
Skill20 starsChanged 46 days agoMITView on GitHub
Analyze code for optimization opportunities and produce a graded performance plan — a ranked set of moves, each tagged by the architectural cost it incurs (L1/L2/L3). Language-agnostic. Reports a plan; changes nothing.
In this repository52 other files it gives its agents.
- ds-dev-skill-benchSkill
- ds-agent-reviewSkill
- ds-architecture-planSkill
- ds-arenaSkill
- ds-blast-radiusSkill
- ds-blueprintSkill
- ds-bug-reviewSkill
- ds-clarity-reviewSkill
- ds-code-quality-reviewSkill
- ds-comment-reviewSkill
- ds-data-modeSkill
- ds-data-reviewSkill
- ds-debugSkill
- ds-deslopSkill
- ds-doc-quality-reviewSkill
- ds-exploreSkill
- ds-git-modeSkill
- ds-go-reviewSkill
- ds-grill-meSkill
- ds-handoffSkill
- ds-howSkill
- ds-humanizeSkill
- ds-interaction-modeSkill
- ds-java-reviewSkill
- ds-notebook-reviewSkill
- ds-onboardingSkill
- ds-osvSkill
- ds-project-checkpointSkill
- ds-project-resumeSkill
- ds-python-reviewSkill
- ds-quality-gateSkill
- ds-reflectSkill
- ds-retroSkill
- ds-roadmapSkill
- ds-rust-reviewSkill
- ds-security-reviewSkill
- ds-semgrepSkill
- ds-shell-reviewSkill
- dsSkill
- ds-specSkill
- ds-step-modeSkill
- ds-tdd-modeSkill
- ds-test-modeSkill
- ds-test-quality-reviewSkill
- ds-tiger-style-modeSkill
- ds-tldtSkill
- ds-ts-reviewSkill
- ds-ui-modeSkill
- ds-ui-quality-reviewSkill
- ds-verify-thisSkill
- ds-zig-reviewSkill
- ds-zoom-outSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Treat positional args as scope (files, directories, globs).
- Distinctive: line 18
Every finding is tagged with the architectural cost of *applying* it:
- Distinctive: line 26
Read the actual execution path and estimate cost — don't pattern-match "loops are slow." Run a benchmark or profile when it's cheap.
- Very specific: line 58
Never propose an optimization that trades away correctness or safety (Safety > Performance).
- Very specific: line 59
Don't optimize without a measurement — state the baseline.
- Distinctive: line 66
Prefer pre-allocated buffers.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
When invoked, analyze the code in scope against one question: where is this doing more work than it needs to, and what would each speedup cost? Not "is it clean" (that's /ds-code-quality-review), not frontend render performance (that's /ds-ui-quality-review), not the idiom-level checklist the language reviews already run — this is the cross-cutting hotspot hunt that names the price of each optimization so a speedup that damages the architecture is a deliberate choice, not a silent one. Every finding carries a cost model; a "slow" claim with no model behind it is noise. Do not edit any files. When a finding is worth pursuing, /ds-verify-this proves the win with a same-machine baseline/treatment.
Arguments
- Treat positional args as scope (files, directories, globs). With no scope, review the code changed on the current branch.
--full→ analyze the entire codebase instead of just the branch's changes. Explicit positional scope still wins;--fullonly replaces the no-scope default.--max-level=<1|2|3>(or freeform "no architecture changes", "free wins only") → clamp: suppress findings above that tier. Default: report all tiers, tagged.--no-tiger→ skip the Tiger Style section; run the hotspot hunt and cost models only.
Levels
Every finding is tagged with the architectural cost of applying it:
- L1 — Free win. Behavior- and structure-preserving: better algorithm/data structure within the same boundaries, remove redundant work, hoist invariants, fix N+1, cut hot-path allocations, batch IO. Safe to apply as-is.
- L2 — Localized restructuring. Preserves public contracts and layer boundaries, but changes a module's internals: caching/memoization, a data-structure change that ripples within the module, precompute, reshape a loop nest.
- L3 — Architectural / boundary-breaking. Trades clean architecture for speed: denormalize, inline across layers, collapse abstractions, hand-rolled allocators, SIMD, API-reshaping batching. State the architecture/clarity cost explicitly — per Tiger Style this trade is never made blindly.
What to hunt
Read the actual execution path and estimate cost — don't pattern-match "loops are slow." Run a benchmark or profile when it's cheap; measured beats argued.
1. Algorithmic complexity. Quadratic-or-worse work on input that grows, nested loops over the same collection, repeated recomputation of a value that's invariant in the loop, accidental O(n²) from contains/indexOf inside a loop.
2. Data structures. Linear scan where a map/set/index fits, wrong container for the access pattern, sorted-vs-hashed mismatch, missing DB index behind a frequent query.
3. Redundant work. Re-fetching, re-serializing, re-parsing, or recomputing across calls; work inside a loop that could be hoisted; eager computation of something rarely used.
4. Allocation & memory. Allocation in a path actually identified as hot, avoidable copies, unbounded growth/retention. Do not flag ordinary allocation — only where a cost model shows it matters.
5. I/O & data access. N+1 queries, chatty round-trips that could batch, synchronous IO on a latency-critical path, missing caching where the data is safely cacheable.
6. Concurrency & parallelism. Serial work that's embarrassingly parallel, lock contention, false sharing, oversized critical sections. Propose carefully — concurrency trades correctness risk for speed.
7. Architecture-level (L3). Where a clean boundary forces repeated cost: denormalization, crossing-layer batching, collapsing an abstraction that's on a hot path.
Output
A plan: the candidate moves ranked by impact ÷ cost (free, high-impact wins first), grouped by level. Respect --max-level if given.
For each finding:
- Anchor to
file:line. - State the hotspot in one line.
- Give the cost model — why it's slow: Big-O, allocation/IO/query/syscall counts, or a measured profile. No cost model → don't report it.
- The optimization, and its level tag. For L2/L3, name the architecture/clarity cost it incurs.
- Evidence label:
measured(profile/benchmark),reasoned(sound cost model, unmeasured), orspeculative(plausible, unproven) — plus your confidence. - The
/ds-verify-thisclaim that would prove the win (e.g. "tool process big.jsonruns ≥2× faster on this branch vs parent").
Rules:
- Real, measurable wins over theoretical ones. A short, high-confidence list beats a long speculative one.
- Never propose an optimization that trades away correctness or safety (
Safety > Performance). If a speedup adds a correctness risk, say so and treat it as a cost. - Don't optimize without a measurement — state the baseline. Mark unmeasured findings
reasoned/speculativehonestly. - Change nothing. The output is the list.
Tiger Style (skipped with --no-tiger)
- Sketch the performance budget — network, disk, memory, compute — before proposing a change.
- Separate control plane (low-frequency) from data plane (high-frequency, latency-critical); spend the effort on the data plane.
- Prefer pre-allocated buffers; no dynamic allocation in hot paths after initialization.
Safety > Performance > Developer Experience. Never trade correctness for speed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

