skills/night-shift/SKILL.md
Autonomous overnight codebase improvement with bounded runtime, evidence-gated changes, and verification.
npx skillsauth add paulrberg/dot-agents night-shiftInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Improve a codebase autonomously within a fixed deadline, keeping only safe changes supported by concrete evidence.
A valid run ends with verified improvements or a verified no-op. Never invoke an ask-user mechanism or end a user-facing message with a question. Convert every unresolved decision into a deferred-work entry with its evidence, risk, and required choice while continuing any independent safe work.
path: Optional absolute or relative path. Default to the current Git worktree root. Resolve it canonically and
accept it only when it is inside that worktree.--max-runtime DURATION: Optional positive integer followed by m or h, such as 45m or 3h. Default to 2h.Treat an invalid path, duration, unknown option, or ambiguous positional input as a blocker. Report it and stop.
Calculate the deadline before auditing. Reserve the final 15% for aggregate validation and reporting, clamped to 5–30 minutes and never exceeding the total runtime.
When the client supports persistent goals, create one containing the resolved outcome, deadline, safety limits, and verification bar. Keep working inline when goal mode is unavailable.
Work in the current worktree and preserve changes that this run does not own. Local, reversible edits and non-destructive validation are authorized. Do not change public contracts, commit, push, sync, deploy, release, write to external systems, incur paid-service costs, change credentials or permissions, perform destructive migrations, or expand scope.
Stop when the deadline arrives, no safe candidates remain, or every remaining candidate requires a prohibited or unclear decision. Enter final validation when the reserved window begins even if a change wave is unfinished.
Completion of this phase requires a recorded baseline and an ownership boundary that prevents this run from overwriting unrelated edits.
Audit the resolved scope using these lenses:
Treat source files over 1000 lines and test files over 2000 lines as discovery candidates only. Split a file only when cohesion, coupling, change risk, or testability establishes a better seam; line count alone is not evidence.
Rank candidates by impact, evidence, regression risk, isolation, and verification cost:
Do not retain a performance change without a recorded baseline metric and repeatable benchmark.
Use the smallest effective team when subagents are available, with at most five concurrent children. Otherwise execute the same workflow inline.
Implement focused candidates in dependency waves. Require targeted correctness checks for every kept change and broaden validation only when a shared contract requires it.
If an experiment fails its evidence bar, revert only that experiment's attributable edits. Never use repository-wide clean, checkout, or reset commands.
After each nontrivial wave, run $code-polish over the exact union of files changed by that wave when it is available.
Otherwise apply the same fixed-scope contract inline: simplify only where comprehension or defect risk measurably
improves, review by severity, fix evidenced defects, and rerun the narrowest proving checks.
During the reserved window, stop new implementation, reconcile all owned edits, and run the aggregate format, lint, type, test, build, and invariant checks justified by the final changed-file union. Compare final results with the recorded baseline. Ground every kept change and progress claim in tool evidence from this run.
For long runs, send sparse phase updates only after evidence-backed transitions: 🌙 Grounded, 🔎 Audit complete,
🛠 Wave <N> verified, and ⏳ Entering final validation. Do not use a percentage bar because candidate discovery has
no stable denominator.
Lead with ### 🌙 Night Shift complete — <elapsed> · <stop reason>. Compare checks in a compact
Check | Baseline | Final table, then report:
Group retained work under ✅ Kept, failed experiments under ↩ Reverted, and unresolved work under ⚠️ Deferred,
always with text and counts. Keep commands, diagnostics, paths, and the no-commit/push/sync statement undecorated. A
verified no-op is complete. Write the report as a self-contained re-grounding for a user who did not observe the run.
development
Refactor naming and repository structure exhaustively while preserving behavior and external contracts.
tools
Uses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to `--slim` mode (MCP configuration).
testing
Audit an entire repository with fresh eyes for correctness errors, bugs, omissions, duplication, inconsistencies, and other evidenced mistakes; fix every safe issue and verify the result.
tools
Use to build interactive single-file HTML playgrounds, explorers, or tools with visual controls, live preview, and prompt copy-out.