overnight-pipeline

Autonomous overnight development pipeline. Analyzes a feature idea and selects the right pipeline pattern (Sequential, Continuous Claude, Ralphinho, or Infinite Loop). Generates all required files and waits for user confirmation before starting.

8 stars

Best use case

overnight-pipeline is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Autonomous overnight development pipeline. Analyzes a feature idea and selects the right pipeline pattern (Sequential, Continuous Claude, Ralphinho, or Infinite Loop). Generates all required files and waits for user confirmation before starting.

Teams using overnight-pipeline should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/overnight-pipeline/SKILL.md --create-dirs "https://raw.githubusercontent.com/marvinrichter/clarc/main/skills/overnight-pipeline/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/overnight-pipeline/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How overnight-pipeline Compares

Feature / Agentovernight-pipelineStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Autonomous overnight development pipeline. Analyzes a feature idea and selects the right pipeline pattern (Sequential, Continuous Claude, Ralphinho, or Infinite Loop). Generates all required files and waits for user confirmation before starting.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Overnight Pipeline Skill

A meta-pipeline that decides *which* autonomous pattern fits your feature before setting anything up. You describe an idea; it picks Sequential Pipeline, Continuous Claude, Ralphinho, or Infinite Agentic Loop based on signals in the description and codebase.

## When to Activate

- User says "overnight", "run while I sleep", "autonomous", "unattended", "can this run itself"
- User invokes `/overnight <feature description>`
- User asks how to automate a development pipeline
- User asks which loop pattern to use for a task
- Choosing between Sequential Pipeline, Continuous Claude, Ralphinho, or Infinite Agentic Loop based on feature scope and iteration style
- Setting up a SHARED_TASK_NOTES.md context bridge so multiple sequential `claude -p` steps can share state across fresh context windows

---

## Pattern Selection

The command evaluates the feature description and codebase against these signals — in order:

```plantuml
@startuml
start
if (Spec unclear / exploratory?) then (yes)
  :NanoClaw\nInteractive session to\ndefine spec first;
  stop
else (no)
  if (Many variations\nof the same thing?) then (yes)
    :Infinite Agentic Loop\nSpec-driven parallel\ncontent generation;
    stop
  else (no)
    if (Open-ended quality goal?\ne.g. "fix all", "iterate\nuntil CI passes") then (yes)
      :Continuous Claude\nIterates with CI gate\nuntil completion signal;
      stop
    else (no)
      if (Large / cross-cutting?\n15+ files, multiple\nparallel work units) then (yes)
        if (ralph-loop\navailable?) then (yes)
          :Ralphinho\nRFC-driven DAG\nParallel worktrees;
          stop
        else (no)
          :Sequential Pipeline\nwith phases\n(medium/large tier);
          stop
        endif
      else (no)
        :Sequential Pipeline\novernightsh\n(trivial / small / medium);
        stop
      endif
    endif
  endif
endif
@enduml
```

### Signal Reference

| Signal | Keywords / Indicators | Pattern |
|--------|----------------------|---------|
| Exploratory | "not sure", "explore", "investigate", "try out" | NanoClaw |
| Well-defined, bounded | Clear acceptance criteria, single module, < 10 files | Sequential |
| Open-ended iteration | "fix all", "improve coverage", "keep going until done" | Continuous Claude |
| CI-gate needed | Success = CI green, not just local tests | Continuous Claude |
| Parallel units | Multiple independent components, "across services" | Ralphinho |
| Large scope | 15+ files, "redesign", "migrate", "entire system" | Ralphinho |
| Many variations | "generate N", "10 versions", "batch", "content" | Infinite Loop |

### Complexity Tiers (Sequential Pipeline)

| Tier | Scope | Steps Generated |
|------|-------|----------------|
| trivial | 1-2 files, single function | implement → verify → commit |
| small | 2-5 files, one module | plan → implement → verify → commit |
| medium | 5-15 files, multiple modules | plan → [api-contract] → implement → de-sloppify → verify → commit |
| large | 15+ files, cross-cutting | plan → [api-contract] → implement → de-sloppify → verify → commit + Ralphinho if available |

---

## The Four Patterns

### 1. Sequential Pipeline (`overnight.sh`)

Best for: single, well-defined features with clear acceptance criteria.

```plantuml
@startuml
participant "claude -p\n(Opus)" as Plan
participant "claude -p\n(Sonnet)" as Impl
participant "claude -p\n(Haiku)" as Slop
participant "claude -p\n(Haiku)" as Verify
participant "claude -p\n(Haiku)" as Commit

Plan -> Plan : reads spec\nwrites plan
Plan --> Impl : SHARED_TASK_NOTES.md

Impl -> Impl : TDD\nRED→GREEN→REFACTOR
Impl --> Slop : working code + tests

Slop -> Slop : removes test slop\nruns tests
Slop --> Verify : clean code

Verify -> Verify : build + types\n+ lint + tests
Verify --> Commit : all green

Commit -> Commit : conventional commit\nno push
@enduml
```

Generated: `scripts/overnight.sh`, `docs/specs/`, `SHARED_TASK_NOTES.md`

---

### 2. Continuous Claude

Best for: open-ended quality goals, iterative fixes, tasks where "done" = CI passing.

```plantuml
@startuml
start
repeat
  :claude -p\n"do the next thing from the spec";
  :review-prompt\nrun tests + lint;
  :commit + push\nopen PR;
  :wait for CI;
  if (CI fail?) then (yes)
    :auto-fix pass;
  endif
  :merge PR;
repeat while (completion signal? or max-duration?) is (no)
-> yes;
stop
@enduml
```

Generated: `scripts/overnight.sh` (wraps `continuous-claude`), `docs/specs/`, `SHARED_TASK_NOTES.md`

Key flags:
```bash
continuous-claude \
  --prompt "..." \
  --max-duration 6h \
  --max-cost 5.00 \
  --completion-signal "OVERNIGHT_PIPELINE_COMPLETE" \
  --completion-threshold 2 \
  --review-prompt "bun test && bun lint"
```

---

### 3. Ralphinho (RFC-Driven DAG)

Best for: large features with parallel work units, multiple interdependent components, real risk of merge conflicts.

```plantuml
@startuml
start
:RFC Document;
:AI Decomposition\nWork units + dependency DAG;
partition "Per DAG Layer (parallel per layer)" {
  partition "Per Unit (own worktree)" {
    :Research → Plan → Implement → Test;
    :PRD Review + Code Review;
    :Review Fix;
  }
  partition "Merge Queue" {
    :Rebase → Tests → Land;
    if (Conflict or fail?) then (yes)
      :Evict — capture context;
      :Re-enter next Ralph pass;
    endif
  }
}
stop
@enduml
```

Generated: `docs/rfc-<feature>.md` (RFC document for AI decomposition), instructions for starting ralph-loop

---

### 4. Infinite Agentic Loop

Best for: generating many variations of the same spec (components, tests, content, examples).

```plantuml
@startuml
package "Orchestrator" {
  [Parse spec]
  [Scan output dir\nfind highest N]
  [Assign unique\ncreative directions]
  [Deploy wave\nof 3-5 agents]
}
package "Sub-Agents (×N, parallel)" {
  [Read spec + snapshot]
  [Generate iteration N\n(unique direction)]
  [Save to output dir]
}
[Deploy wave\nof 3-5 agents] -right-> [Read spec + snapshot] : each agent
@enduml
```

Generated: `.claude/commands/overnight-loop.md` (project command)

---

## The Context Bridge: SHARED_TASK_NOTES.md

The key pattern that makes multi-step autonomous work reliable. Each `claude -p` call starts with a fresh context window — `SHARED_TASK_NOTES.md` is how steps communicate:

```
Step 0 (Plan)     → writes implementation plan
Step 2 (Impl)     → reads plan, writes "what was done / what remains"
Step 3 (Cleanup)  → reads status, updates
Step 4 (Verify)   → reads status, logs failures and fixes
Step 5 (Commit)   → reads all notes → accurate commit message
```

### Template

```markdown
# Overnight Pipeline — <Feature Name>

**Pattern:** Sequential (medium)
**Started:** 2025-03-05T21:00:00Z
**Spec:** docs/specs/overnight-2025-03-05-oauth2-login.md

## Status

- [x] Step 0: Plan
- [x] Step 1: API Contract
- [x] Step 2: Implementation (TDD)
- [ ] Step 3: De-Sloppify
- [ ] Step 4: Verify
- [ ] Step 5: Commit

## Implementation Plan

(written by Step 0)

## Decisions Made

- Used existing SessionsTable — avoids new migration
- Rate limit callback at 10 req/min using existing RateLimiter middleware

## Issues Encountered

- GitHub returned 422 on malformed state param — added validation in callback

## What Was Done

- src/auth/github.ts (OAuth2 flow)
- src/routes/auth.ts (added /auth/github + /auth/github/callback)
- tests/auth/github.test.ts (12 tests, all passing)

## What Remains

- De-sloppify: remove console.log on line 47
- Verify: full build not run yet
```

---

## Writing an Effective Spec

The spec is the only thing Claude has when the pipeline starts. Concrete > Vague.

```markdown
# Overnight Spec: OAuth2 Login with GitHub

## Goal

Users can log in using their GitHub account. On first login, a new user account
is created. On subsequent logins, the existing account is used.

## Scope

### In Scope
- GitHub OAuth2 flow (authorization + callback)
- User creation on first login
- Session token as httpOnly cookie

### Out of Scope
- Other OAuth providers (Google, Apple)
- Email/password login changes

## Acceptance Criteria

- [ ] GET /api/v1/auth/github redirects to GitHub with correct scopes
- [ ] GET /api/v1/auth/github/callback exchanges code for token
- [ ] New users created with GitHub profile data
- [ ] Existing users matched by GitHub ID (not email)
- [ ] Tests pass with 80%+ coverage on new code

## Notes for Claude

- Read src/auth/local.ts to understand existing auth patterns
- Use existing RateLimiter from src/middleware/rate-limit.ts
- Sessions use the sessions table — do not add a new tokens table
```

---

## Model Routing

| Step | Model | Reason |
|------|-------|--------|
| Plan | Claude Opus (most capable tier) | Deep architectural reasoning |
| API Contract | Claude Sonnet (balanced tier) | Standard, fast |
| Implement | Claude Sonnet (balanced tier) | Fast, capable |
| De-Sloppify | Claude Haiku (fast tier) | Simple pattern matching |
| Verify | Claude Haiku (fast tier) | Runs commands, interprets output |
| Commit | Claude Haiku (fast tier) | Summarization task |

For large/complex features, upgrade Implement to Opus:
```bash
# Use current Claude Opus model ID from anthropic.com/api
claude -p --model <claude-opus-model-id> "Implement the payment reconciliation logic..."
```

---

## Morning Review Checklist

```bash
# 1. What happened
git log --oneline -5
cat SHARED_TASK_NOTES.md

# 2. What changed
git diff HEAD~1

# 3. Any issues in the log
grep -E "ERROR|WARN|FAIL" logs/overnight-*.log

# 4. Verify locally
bun test  # or your test command

# 5. Ship when ready
git push origin <branch>
gh pr create
```

---

## Anti-Patterns

| Anti-Pattern | Problem | Fix |
|-------------|---------|-----|
| No spec file | Claude guesses intent | Write spec before confirming |
| One giant `claude -p` prompt | Context overflow, no checkpoints | Split into 4-6 focused steps |
| No SHARED_TASK_NOTES.md | Each step starts blind | Bridge every step via notes |
| Pattern mismatch | Continuous Claude for a simple feature wastes cost; Sequential for "fix all 47 issues" fails at iteration 1 | Let `/overnight` analyze first |
| Push inside the script | Can't review before shipping | Commit only; push manually |
| No `set -euo pipefail` | Silent failures cascade | Always use strict mode |
| No log file | Can't debug what happened overnight | `tee -a "$LOG_FILE"` on every call |

---

## Quick Start

```
/overnight implement OAuth2 login with GitHub
```

Claude analyzes → presents pattern decision → waits for confirmation → generates files.

Then:
```bash
./scripts/overnight.sh          # start
tail -f logs/overnight-*.log    # monitor (optional)
```

Tomorrow:
```bash
git log --oneline -3
cat SHARED_TASK_NOTES.md
git diff HEAD~1
```

---

## Related Skills

- `autonomous-loops` — full pattern library and reference implementations
- `api-contract` — invoked in the API Contract step when endpoints change
- `plankton-code-quality` — quality standards applied in the De-Sloppify step

Related Skills

cost-aware-llm-pipeline

8
from marvinrichter/clarc

Cost optimization patterns for LLM API usage — model routing by task complexity, budget tracking, retry logic, and prompt caching.

zero-trust-patterns

8
from marvinrichter/clarc

Zero-Trust security patterns — mTLS between microservices (Istio/SPIFFE), SPIRE workload identity, OPA/Envoy authorization, NetworkPolicy default-deny-all, short-lived credentials, service mesh security, and Kubernetes RBAC hardening.

wireframing

8
from marvinrichter/clarc

Wireframing and prototyping workflow: fidelity levels (lo-fi sketch → mid-fi wireframe → hi-fi prototype), tool selection (Figma, Excalidraw, Balsamiq), user flow diagrams, wireframe annotation standards, information architecture (IA) mapping, and the handoff from wireframe to visual design. For developers who need to communicate UI structure before writing code.

webrtc-patterns

8
from marvinrichter/clarc

WebRTC patterns — peer connection setup, ICE/STUN/TURN configuration, signaling server design, SFU vs mesh topology, screen sharing, media track management, and reconnect/ICE restart handling.

webhook-patterns

8
from marvinrichter/clarc

Webhook patterns for receiving, verifying (HMAC), and idempotently processing third-party events. Covers Stripe, GitHub, and generic webhook patterns, delivery guarantees, retry handling, and testing.

web-performance

8
from marvinrichter/clarc

Web performance optimization: Core Web Vitals (LCP, CLS, INP), Lighthouse CI with budget configuration, bundle analysis (webpack-bundle-analyzer, vite-bundle-visualizer), hydration performance, network waterfall reading, image optimization (WebP/AVIF, srcset), and font performance.

wasm-performance

8
from marvinrichter/clarc

WebAssembly performance: wasm-opt binary optimization, size reduction (panic=abort, LTO, strip), profiling WASM in Chrome DevTools, memory management (linear memory, avoiding GC pressure), SIMD, and multi-threading with SharedArrayBuffer.

wasm-patterns

8
from marvinrichter/clarc

WebAssembly patterns: wasm-pack, wasm-bindgen (JS↔Wasm interop), WASI, Component Model, wasm-opt, Rust-to-WASM compilation, JS integration (web workers, streaming instantiation), and production deployment (CDN, Content-Type headers).

visual-testing

8
from marvinrichter/clarc

Visual Regression Testing: tool comparison (Chromatic/Percy/Playwright screenshots/BackstopJS), pixel-diff vs AI-based comparison, baseline management, flakiness strategies (masks, tolerances, waitForLoadState), CI integration with GitHub Actions, and Storybook integration.

visual-identity

8
from marvinrichter/clarc

Brand identity development: color palette construction (primary/secondary/semantic/neutral), logo concept brief writing, typeface pairings, brand voice definition, mood board direction, and Brand Guidelines document structure. Use when establishing or evolving a visual brand — not for implementing existing tokens.

ux-micro-patterns

8
from marvinrichter/clarc

UX micro-patterns for every product state: Empty States, Loading States (skeleton screens, spinners, optimistic UI), Error States, Success States, Confirmation Dialogs, Onboarding Flows, and Progressive Disclosure. These patterns apply to every feature — done wrong, they're the biggest source of user confusion.

typography-design

8
from marvinrichter/clarc

Typography as a creative discipline: typeface selection criteria, type pairing (serif + sans, display + body), modular scale systems, line-height and tracking ratios, hierarchy construction, and web/mobile rendering considerations. The decisions behind design tokens, not the tokens themselves.