# Night Performance

> Performance loop. Measure one real bottleneck with repeated baseline and candidate runs, make one bounded optimisation, and retain it only when the measured gain exceeds noise and behaviour stays stable. Use for "night-performance", "night performance" or as /night performance.

- Skill: `amsborse/night-performance` (Agent Skill)
- Install (CLI): `npx get-skill add amsborse/night-performance`
- Raw SKILL.md: https://api.skillmd.com/api/skills/amsborse/night-performance/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: amsborse (https://skillmd.com/u/amsborse)
- Updated: 2026-11-17
- Page: https://skillmd.com/skills/amsborse/night-performance

---


# Night performance

One iteration tackles one bounded hypothesis, using `improve`, `verify`
for the craft. Read the shared contract in `../night/references/loop-interface.md`;
this skill supplies the target, evidence and stopping rules.

## Activation

- Use for a runnable workload with a repeatable latency, throughput or resource metric.
- Do not optimise a suspected hot path without measurements from a representative workload.
- Read the handoff first and avoid repeating a target already resolved by earlier iterations.

## Workflow

1. **Baseline:** Fix workload, environment and warm-up; record at least five baseline runs with `verify`.
2. **Choose:** Report raw values, units, median and spread (min-max); define the noise band before editing.
3. **One change:** Use `improve` to change one measured bottleneck while preserving output and public behaviour.
4. **Check:** Repeat at least five candidate runs under the same conditions; compare medians and spreads.
   For a web page, the workload is the experience bench: `audit-design`'s
   `visual-audit.mjs --perf` with `--save-baseline` before and `--baseline` after (same flags,
   same machine). Keep only on `improved`; `no measurable change` and `unknown` are not gains.
5. **Hand back:** run fast checks and report evidence, including failed or unavailable commands.
   The supervisor re-runs checks and decides keep/revert; never weaken tests or assertions.

## Evaluation

- Keep: The gain exceeds the defined noise band and correctness checks pass; include every raw number.
- Revert: The gain falls inside noise, resource use regresses beyond budget or outputs change.
- Inconclusive: missing evidence or unavailable checks cannot count as a successful iteration.
- Record baseline and candidate results with exact commands so the supervisor can repeat them.

## Stop conditions

- Never fabricate percentages; noisy or unavailable measurements are inconclusive.
- No measured bottleneck remains within scope, or repeatability cannot be established.
- Stop at the supplied time or iteration limit; report the next bounded hypothesis.

## Examples

- Day: "run night-performance on the search endpoint latency" investigates one target with the owner watching.
- Night: `/night performance` repeats bounded iterations within the supplied budget, with each
  outcome independently evaluated by the supervisor.

End the final message with `NIGHT_RESULT: {json}` using the shared contract's fields.
Report evidence rather than grading your own result. Include changed paths and reproducible checks.

