AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Optimize P95

skill-pktikkani-agent-skills-optimize-p95 · by pktikkani

Profiler-driven performance optimization loop using a dynamic workflow. Use ONLY when the user explicitly invokes /optimize-p95 or says "optimize p95" / "run the perf loop". Do not trigger for general performance questions.

No reviews yet
0 installs
15 views
0.0% view→install

Install

$ agentstack add skill-pktikkani-agent-skills-optimize-p95

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-pktikkani-agent-skills-optimize-p95)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
29d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Optimize P95? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Optimize p95 (dynamic workflow)

Goal: hit the user's stated latency target (default: p95 < 300ms) with measured proof.

  1. Confirm the target metric and the benchmark command that reports p95. If no

benchmark exists, create a minimal reproducible one first — the loop cannot self-verify without it.

  1. Detect the stack from repo markers before picking tools — do not assume:
  • pyproject.toml/requirements.txt → Python: profile with py-spy

(fallback cProfile), benchmark with pytest-benchmark or hyperfine.

  • package.json → Node/TS: profile with clinic flame or 0x

(fallback node --cpu-prof), benchmark with autocannon (HTTP) or hyperfine.

  • go.mod → Go: pprof (go test -cpuprofile or net/http/pprof),

benchmark with go test -bench or vegeta (HTTP).

  • Cargo.toml → Rust: cargo flamegraph, benchmark with criterion or

hyperfine.

  • Mixed repo: profile the service the p95 target refers to; ask if

ambiguous. Install the chosen profiler if missing; verify it runs before starting the loop.

  1. Launch a dynamic workflow (use "ultracode" if needed) with this loop:

profile → identify top hotspot → apply one fix → re-run benchmark → compare p95 → repeat until target met. Don't stop until the benchmark confirms the target.

Role hierarchy (optional — assumes a multi-agent setup with subagents and an external Codex CLI; on a single-agent setup run the loop yourself):

  • Fable (this session) = chief architect. Owns the loop, reads profiler

output, decides which hotspot to attack and when the target is met. Does not write the fixes itself.

  • Codex = solution architect. For each hotspot, Fable consults Codex

(codex exec) for the fix design; Fable reconciles it with its own plan and issues one agreed instruction.

  • Opus subagents = developers. Spawn with model: opus; they implement

exactly the agreed instruction in their own worktree — no improvising beyond it.

  1. Each candidate fix runs in its own Opus subagent/worktree; the chief

architect keeps only changes that measurably improve p95.

  1. Report: before/after p95, list of changes kept, profiler evidence. Write

the full log to a file; reply with the path + final numbers only.

Constraints: cap token usage if the user gives a budget; simplest fix first per design-best-practices; no speculative micro-optimizations.

Unforgiving mode (always on — no easy passes)

  • Never relax the target, change the benchmark, or shrink its scope

mid-run to make the number pass. Target set at start = target at end.

  • p95 must come from the same benchmark, same conditions every run —

no cherry-picked warm runs, no reduced load, no measuring a subset.

  • Every kept change must show a measured improvement in its own run;

revert changes that don't. No "probably faster" reasoning.

  • Done means the benchmark output showing p95 under target, pasted in the

final report. If unreachable, report the honest gap and remaining hotspots — never declare success without the passing numbers.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.