@flosrn/nightshift
v0.0.1
Published
A PRD goes in at night. Merged PRs are waiting in the morning.
Maintainers
Readme
Nightshift
A PRD goes in at night. Merged PRs are waiting in the morning.
Nightshift runs multi-issue builds the way a real construction site runs its night shift: a deterministic, zero-LLM CLI owns the schedule and the gates; AI crews do the work; and nothing ships without an inspection, a permit, and — when it matters — your signature.
It is the layer above the skills you already use. mattpocock/skills writes the program and the tickets. compound-engineering plans and builds one slice at a time. Nightshift turns them into a site that pours, cures, and turns over work while you sleep.
On hot days, real crews pour concrete at night — it cures better. That's the whole product.
Why
- Conversational orchestrators drift. A 700-line orchestration prompt burns tokens re-remembering its own protocol, and forgets a gate exactly once per night.
- One-shot autopilots ship one PR.
lfgis a great crew. A program is thirty PRs with dependencies, migrations, and a merge order that must never be guessed. - Overnight autonomy needs state that survives. Sessions die, laptops sleep. The schedule can't live in a context window.
So the spine is not a model. nightshift is a plain CLI: it reads the master
schedule from a comment on your PRD issue, enforces every gate, and spawns agents only
where judgment or code is actually needed. Kill the session, switch machines, come back
tomorrow — the site is exactly where you left it.
The site
| Role | Who / what | Job |
|---|---|---|
| Owner | you | Writes the program, answers RFIs, signs what's structural |
| Architect | you + agent | Breaks the program into buildable tickets (/to-tickets) |
| Project Controls | nightshift CLI — zero LLM | Master schedule, gates, permits, punch lists, RFIs |
| Night Foreman | one orchestration run per pour | Releases the pour's work packages to crews, in parallel |
| Detailer | plan agent (ce-plan) | Draws the shop drawings for a slice |
| Submittal review | a different agent (ce-doc-review) | Approved, or Revise & Resubmit — once |
| Crews | lfg by default — any sub you configure | Execute work packages: code, tests, a PR |
| Inspector | reviewer agent (ce-code-review) | Walks the finished work, files the punch list |
| Owner's Advisor | premium model, rare | Consulted only at commitment boundaries |
Vocabulary that does real work (full glossary in CONTEXT.md):
- Pour — one batch of independent slices, like concrete poured at night: each pour must cure (merge) before the next is poured. The cure gate is why a half-finished night never corrupts the next morning's work.
- Work package — the bounded packet a crew receives: objective, success conditions, verification commands. Crews never commit, push, or merge — and a crew's word is never evidence: Project Controls re-runs the verification itself on the PR head.
- Punch list — the defect list after inspection.
nightshift reworkre-enters only the punched slices; green work is never rebuilt. - RFI — a slice that needs a human answer stops and waits. The rest of the site keeps moving.
- Limited Notice to Proceed — the explicit, per-shift grant that lets green, non-structural PRs turn over on their own. Never stored, never standing.
- Morning report — what a shift writes before it ends: what poured, what merged, what's in inspection, which RFIs wait for you. Read it with your coffee.
How a pour runs
flowchart TD
O["Owner — /to-spec"] --> A["Architect — /to-tickets"]
A --> MS[("Master schedule\n(a comment on the PRD issue)")]
MS --> ADV["nightshift advance"]
ADV --> F["Night Foreman opens the next pour"]
F --> D["Detailer — shop drawings"]
D --> SR{"Submittal review\n(different agent)"}
SR -- "Revise & Resubmit (once)" --> D
SR -- rejected twice --> RFI1["RFI — Owner decides"]
SR -- approved --> C["Crews execute work packages\n(lfg per slice, in parallel)"]
C --> I{"Inspection"}
I -- defects --> PL["Punch list"]
PL -- "nightshift rework — punched slices only" --> C
I -- clean --> TO["Turnover — PRs merge\n(NTP, or you)"]
TO -- "pour cured" --> ADV
TO -- "structural / no NTP" --> RFI2["Waits for your signature"]Architecture
┌────────────────────────────────────────────┐
│ THE OWNER │
│ program · RFIs · signatures │
└─────────────────────┬──────────────────────┘
─ ─ ─ ─ ─ ─ ─ ─ ─ the human/autonomous boundary ─ ─ ─ ─ ─ ─ ─
│
┌──────────────────────────────────────────▼─────────────────────────┐
│ NIGHTSHIFT (this repo) │
│ │
│ project controls — zero LLM one run per pour │
│ ┌────────────────────────────┐ ┌───────────────────────────┐ │
│ │ master schedule (PRD issue)│ │ Night Foreman │ │
│ │ status·schedule·advance· │─────►│ shop drawings → review → │ │
│ │ rework · gates · permits · │ │ crews → inspection │ │
│ │ RFIs · circuit breaker │◄─────│ (parallel workflows) │ │
│ └────────────────────────────┘ └───────────────────────────┘ │
│ │
│ subs interface — work packages in, evidence out │
└─────────┬───────────────────────┬───────────────────────┬──────────┘
│ │ │
┌────────▼────────┐ ┌─────────▼────────┐ ┌──────────▼─────────┐
│ default crew │ │ your own crew │ │ specialty sub │
│ lfg (CE) │ │ any skill │ │ (optional, later) │
└────────┬────────┘ └──────────────────┘ └────────────────────┘
│
┌─────────▼───────────────────────────────────────────────────────────┐
│ FOUNDATIONS — pinned, MIT │
│ mattpocock/skills: to-spec · to-tickets · triage │
│ compound-engineering: ce-plan · ce-doc-review · lfg · ce-babysit-pr │
└──────────────────────────────────────────────────────────────────────┘Runs anywhere a shell runs: interactively inside Claude Code, headless via claude -p,
nightly from cron, GitHub Actions, or a cloud routine. Parallel fan-out uses dynamic
workflows where available and degrades to sequential everywhere else. A single-vendor,
Claude-only setup is first-class — subs are opt-in.
Quickstart (target CLI)
nightshift schedule 1234 # draft the master schedule from PRD #1234 → you confirm
nightshift status # where is the site?
nightshift advance # build the next pour (add --dry-run to preview)
nightshift rework # re-enter only the punched slices
nightshift advance --ntp # tonight, green non-structural PRs turn over themselvesSlice statuses: scheduled · detailing · building · inspection · rework · rfi · accepted.
What's different
- The schedule lives in the PRD issue itself — one validated comment, visible to anyone watching the PRD. It survives sessions, machines, and you. Live status is re-derived from GitHub on every read; the schedule never lies for long.
- The spine is deterministic. Gates, merge order, rework selection: code, not prompts. Models plan, build, and review; they never grade their own work.
- Repair is surgical. A punch list re-enters failed slices only — never the green ones.
- Autonomy is granted, never assumed. Permits for production-touching work, a per-shift NTP for merges, structural work always human, and a circuit breaker that stops the night when the site is systemically broken.
Status
Under construction — Nightshift is building itself. The hand-built skeleton (this CLI, these docs) becomes the site that executes its own remaining roadmap as its first master schedule. The public flip happens when Nightshift completes a pour on Nightshift.
Credits
Built on compound-engineering
and mattpocock/skills (both MIT, pinned).
The derive-status-from-git and volatile-vs-structural state patterns are credited to
compound-engineering-orchestrator,
which found them first. Decisions and their reasons live in docs/adr/.
License
MIT.
