skills/overnight/SKILL.md
Usage `rdc:overnight [epic-id|label=<label>]` — Unattended end-to-end: drain the entire work queue autonomously (preplan → plan → build → review → report). Inherits mandatory per-wave code-review (pr-review-toolkit:code-reviewer) from rdc:build and rdc:review. Use when leaving Claude to run unsupervised for an extended session.
npx skillsauth add LIFEAI/rdc-skills rdc:overnightInstall 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.
⚠️ OUTPUT CONTRACT (READ FIRST):
guides/output-contract.mdChecklist-only output. No tool-call narration. No raw MCP/JSON/log dumps. One checklist upfront, updated in place, shown again at end with a 1-line verdict.
If dispatching subagents or running as a subagent: read
{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.mdfirst (fallback:{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md).
Sandbox contract: This skill honors
RDC_TEST=1perguides/agent-bootstrap.md§ RDC_TEST Sandbox Contract. Destructive external calls short-circuit under the flag.
/rdc:overnight — work all urgent/high priority todo epics/rdc:overnight <epic-id> — work a specific epic only/rdc:overnight label=<label> — work epics matching labelFirst action — set the overnight sentinel so the no-stop-open-epics Stop hook engages (interactive sessions are not gated by it):
mkdir -p {PROJECT_ROOT}/.rdc && touch {PROJECT_ROOT}/.rdc/overnight.lock
Last action at end of run (success OR failure) — remove the sentinel:
rm -f {PROJECT_ROOT}/.rdc/overnight.lock
If the sentinel file does not exist, the Stop hook will NOT block — which means interactive sessions stop freely and only rdc:overnight is held to the "drain the queue" contract.
Before touching any code, verify the environment is safe:
Clauth daemon alive:
curl -s http://127.0.0.1:52437/ping
If not responding: report BLOCKED: credential daemon offline and exit. Do not proceed.
Git state clean:
git status --short
Must be on the development branch with no uncommitted changes. If dirty: commit or stash first.
Baseline review:
Run rdc:review --unattended. If REVIEW_STATUS.verdict = "HAS_ISSUES" and
issues cannot be auto-fixed: report BLOCKED: codebase has pre-existing issues and exit.
A dirty baseline overnight compounds into a disaster by morning.
If all three pass: proceed to Phase 2.
Determine which epics to work:
get_work_items_by_epic()SELECT get_open_epics(p_label_filter := '<label>')SELECT get_open_epics() filtered to:
priority IN ('urgent', 'high')status IN ('todo', 'in_progress')created_atLog the epic queue at the start of .rdc/reports/overnight-<YYYY-MM-DD>.md (fallback: .rdc/reports/overnight-<YYYY-MM-DD>.md if .rdc/ does not exist).
rdc:overnight <epic-id>): work that one epic only. When it completes, remove the sentinel and exit — do NOT poll for more epics.rdc:overnight no args or label=X): drain all matching epics sequentially.For each epic in the queue, run this sequence:
Condition: epic has 0 child tasks AND no matching doc in .rdc/plans/ (or .rdc/plans/ as fallback)
rdc:preplan <topic> --unattended
Check PREPLAN_STATUS.recommendation_confidence:
"high" or "medium": proceed"low": escalate via advisor tool (see Escalation Protocol below)
Condition: epic has 0 child tasks after preplan
rdc:plan <epic-id> --unattended
Check PLAN_STATUS.task_count > 0 before continuing.
If 0 tasks created: escalate via advisor, then skip if still unresolved.
This skill delegates to rdc:build which uses typed agent dispatch. See rdc:build for agent type classification.
rdc:build <epic-id> --unattended
Agents receive the relevant guide file from .rdc/guides/ (fallback: .rdc/guides/) based on their work package type.
After each wave: check BUILD_STATUS. If escalated: true, log the escalation
in the overnight doc and continue — don't stop the loop.
Mandatory code-review gate inherited from rdc:build (Step 9b). Every wave inside rdc:build runs a pr-review-toolkit:code-reviewer pass before the next wave dispatches. Critical/high findings reopen the affected work items to todo and the next wave fixes them. Overnight does not skip or weaken this gate. If a wave's code-review escalates twice, advisor decides; otherwise the loop continues.
rdc:review --unattended
Check REVIEW_STATUS.verdict:
"CLEAN": mark epic done in work_items, push, continue to next epic"HAS_ISSUES" with escalations > 0: log issues, push what's clean, continue"HAS_ISSUES" with escalations = 0 (all auto-fixed): push, continueAfter each epic (pass or fail):
if [ "$RDC_TEST" != "1" ]; then
git push origin {development-branch}
else
echo "[RDC_TEST] skipping git push origin {development-branch}"
fi
This ensures every epic's work is saved regardless of what comes next.
After all epics are processed:
Run rdc:report --unattended
Write session summary to .rdc/reports/overnight-<YYYY-MM-DD>.md (fallback: .rdc/reports/overnight-<YYYY-MM-DD>.md):
# Overnight Session — YYYY-MM-DD
## Started
<timestamp>
## Epics Attempted
| Epic | Status | Tasks Done | Commits |
## Epics Completed
<list with epic IDs>
## Escalations
N advisor calls — details:
- <epic>: <what was escalated> → <advisor response>
## Blockers Remaining
<any epics skipped or partially done>
## Git Summary
- Total commits: N
- Push status: ✅
## Completed
<timestamp>
Final push:
if [ "$RDC_TEST" != "1" ]; then
git push origin {development-branch}
else
echo "[RDC_TEST] skipping final git push origin {development-branch}"
fi
The advisor tool pairs this executor with a high-level model for high-stakes decisions. Use it when genuinely stuck — not for every small uncertainty.
Escalation triggers:
PREPLAN_STATUS.recommendation_confidence = "low" (too many unknowns)PLAN_STATUS.task_count = 0 after planning (nothing actionable)REVIEW_STATUS has unfixable issues requiring architectural judgmentHow to escalate: Provide the advisor with:
After advisor responds:
blocked, log reason, skip to nextMax escalations: 3 per epic. After 3, skip the epic and log.
pnpm build — use npx tsc --noEmit for typecheck, vitest for tests only on modified packagesTIMEOUTtools
Convert Office documents to/from Markdown with the build-corpus CLI: .docx/.pptx/.ppt → Markdown (Word OMML equations become KaTeX-readable TeX; tables, images, headings preserved), and Markdown → Word (.docx) where inline $...$ and display $$...$$ LaTeX become NATIVE Office Math (OMML) that Word renders as real equations. Use this skill whenever the user asks to convert a Word/PowerPoint document to Markdown, build a Markdown corpus from Office files, turn Markdown into a .docx (optionally with a .dotx template), or "open the report" to edit. Install build-corpus straight from GitHub and run it in the session.
development
Usage `rdc:brochure <input> [--out <path>] [--template <name>] [--format Letter|A4]` — Turn a zip, folder, HTML file, URL, or markdown folder into a print-quality PDF brochure via Puppeteer. Auto-detects print-variant HTML, honors @page CSS, falls back to a Studio-token-aware template when no HTML exists.
tools
Usage `rdc:convert <input> [--out <dir>] [--to markdown|word] [--images assets|base64|s3]` — Convert .docx/.pptx/.ppt → Markdown (Word OMML equations as KaTeX TeX, tables, images) or Markdown → Word via the build-corpus CLI (PyPI `build-corpus`, npm `regen-mde`). Portable: runs in any session that can reach npm or PyPI — Claude Code CLI and claude.ai both fetch + run it. Use whenever the user asks to convert an Office document, build a Markdown corpus from .docx/.pptx, turn Markdown into a .docx, or 'open the report' in the regen-mde editor (Windows).
tools
Usage `rdc:fs-mcp <task>` — Use the File System MCP bridge for live repo reads, safe writes, cloud-to-local ingest, and GitHub-branch imports into a dirty local monorepo. Use when Claude.ai, Cowork, or CLI agents need fs_read/fs_write/fs_import_git_files guidance.