Skip to content

Repository files navigation

lifeline — autonomous harness engineering for Claude Code

English | 简体中文

A standalone Claude Code plugin marketplace that delivers an end-to-end agent workflow for autonomous harness engineering. The workflow chains specialist agents — initializer, coder, local reviewer, cloud reviewer, PR opener, PR finisher — into a single pipeline that takes a feature description and ships it behind a clean PR:

requirements → brainstormed product spec → phased feature list → coder + cross-vendor reviewer loop → cloud-review fix loop → merged PR

Nine skills cover the end-to-end pipeline (design → build → review → PR) plus standalone goal helpers: a /goal instruction composer and a goal-pursuit loop adapted from OpenAI Codex's /goal. The OCR build loop (/lifeline:iterate) runs on a configurable engine — claude, codex, or kimi — per role.

Skills

Listed in the order you'd hit them across one feature's lifecycle — design → build → local review → open PR → fix PR review findings → merge. /lifeline:set-goal, /lifeline:iterate, and /lifeline:deliver are exceptions: standalone goal helpers, not part of the PR pipeline.

Skill What it does
/lifeline:planner Self-contained design-spec writer: walks you through the brainstorming methodology, writes the spec to docs/superpowers/specs/, then runs Codex review on the result automatically and applies your chosen findings. v1 is spec-only — run /superpowers:writing-plans separately for the implementation plan.
/lifeline:set-goal Compose a copy-ready /goal instruction (for Codex or Claude Code) from a rough objective, filling the final outcome, verification evidence, constraints, boundaries, next-step rule, and blocker-report contract. Use the optional /set-goal wrapper below for a shorter alias.
/lifeline:loop Launch the autonomous development harness — gathers requirements, brainstorms a spec, generates app_spec.md, and starts the agent loop. Project- and language-agnostic; reads the project's CLAUDE.md / AGENTS.md for stack-specific build/test/lint commands.
/lifeline:iterate Config-driven OCR (orchestrator/coder/reviewer) loop: takes an objective and iterates coder→reviewer until a completion verdict passes. Coder and reviewer engines are selected per role via lifeline.config.json — each can be claude (in-session), codex (codex exec), or kimi (kimi --print). Supersedes /lifeline:deliver. See Engine selection below.
/lifeline:deliver [Deprecated — use /lifeline:iterate, or /goal for a simple self-audit.] Goal-driven in-session loop. Two modes: /lifeline:deliver <objective> (pure — Claude self-audits each iteration against the adapted Codex /goal continuation prompt) and /lifeline:deliver pair [N] <objective> (paired — completion check delegated to codex exec as an independent grader). Now a thin shim over the shared OCR library. Adapted from openai/codex /goal templates (Apache-2.0; see NOTICE).
/lifeline:review Run a local Codex code review against the staged diff (codex exec review --base main). Saves to .codex-reviews/latest.md.
/lifeline:request-pr Open a PR from the current branch with an autogenerated title + body (Summary from commit list, Test plan placeholder). Pairs with /lifeline:approve-pr.
/lifeline:upsource-review Self-driving loop that fetches PR review findings from GitHub (Claude Code Review + chatgpt-codex-connector), fixes them in atomic per-cycle batches, runs Codex verify on the staged diff, commits, pushes, replies + resolves connector threads, and polls for the next review.
/lifeline:approve-pr Finish a PR end-to-end — squash + delete remote branch, sync local main, delete the local feature branch, and clean up associated git worktrees safely.

Engine selection (lifeline.config.json)

/lifeline:iterate reads a repo-root lifeline.config.json to pick the engine for each OCR role:

{ "coder": "claude", "reviewer": "codex" }

Each of coder / reviewer accepts claude (in-session; a claude reviewer is a self-audit), codex (independent codex exec subprocess), or kimi (independent kimi --print subprocess). Defaults: coder: claude, reviewer: codex. Per-run overrides via the LIFELINE_CODER / LIFELINE_REVIEWER env vars. A codex or kimi reviewer is independent (fresh subprocess); the full schema, precedence, and validation live in skills/common/config.md.

Install in Codex

Lifeline ships as a Codex plugin marketplace too. From a local clone:

codex plugin marketplace add /absolute/path/to/lifeline
codex plugin add lifeline@lifeline

After the Codex marketplace changes are pushed to GitHub:

codex plugin marketplace add winoooops/lifeline --ref main
codex plugin add lifeline@lifeline

Start a new Codex thread after installing or reinstalling so Codex reloads the plugin's skills.

Install in Claude Code

Lifeline ships as a Claude Code plugin marketplace. Inside any Claude Code session, run:

/plugin marketplace add winoooops/lifeline       # 1. registers the marketplace catalog
/plugin install lifeline@lifeline                # 2. installs the plugin from it (plugin@marketplace)
/reload-plugins                                  # 3. surfaces the new slash commands in this session

Both steps are required — marketplace add alone only registers the catalog; plugin install activates the skills. The winoooops/lifeline shorthand resolves to https://github.com/winoooops/lifeline; you can also pass the full Git URL.

To install from a local clone instead (e.g. for development):

/plugin marketplace add /absolute/path/to/lifeline
/plugin install lifeline@lifeline
/reload-plugins

To uninstall:

/plugin uninstall lifeline@lifeline
/plugin marketplace remove lifeline

To upgrade to the latest commit on main after install:

/plugin marketplace update lifeline
/plugin install lifeline@lifeline

What gets installed

/plugin install syncs the entire repository into ~/.claude/plugins/cache/lifeline/lifeline/<version>/, including:

  • The skills under skills/ (autocompleted as /lifeline:<skill> after /reload-plugins).
  • The harness/ Python orchestrator that /lifeline:loop invokes — make sure python3 and the deps in harness/requirements.txt are available on $PATH before launching the loop. Install the deps once with pip3 install -r ~/.claude/plugins/cache/lifeline/lifeline/<version>/harness/requirements.txt.
  • The .claude-plugin/marketplace.json and plugin.json manifests Claude Code reads to register skills.

Autocomplete workaround

Plugin skills currently don't appear in / autocomplete due to a known Claude Code bug. Claude Code also namespaces plugin skills (for example /lifeline:set-goal), so the direct /set-goal form needs a local wrapper. Drop one thin wrapper file per skill into ~/.claude/commands/ by running this once:

mkdir -p ~/.claude/commands
cat > ~/.claude/commands/set-goal.md <<'EOF'
---
description: Compose a complete /goal instruction
---
Use the Skill tool to invoke `lifeline:set-goal` with these arguments: $ARGUMENTS
EOF

while IFS='|' read -r slug desc; do
  cat > ~/.claude/commands/lifeline-${slug}.md <<EOF
---
description: ${desc}
---
Use the Skill tool to invoke \`lifeline:${slug}\` with these arguments: \$ARGUMENTS
EOF
done <<'SKILLS'
planner|Brainstorm a design spec with automatic Codex review on the result
set-goal|Compose a complete /goal instruction
loop|Launch the autonomous development harness
deliver|Goal-driven in-session loop (pure or codex-paired)
review|Run local Codex code review against the staged diff
request-pr|Open a PR from the current branch with an autogenerated body
upsource-review|Fetch and fix PR review findings (Claude + Codex) in a self-driving loop
approve-pr|Finish a PR end-to-end (squash, delete branches, clean worktrees)
SKILLS

After /reload-plugins, the /set-goal direct alias and /lifeline-* aliases appear in autocomplete. Typing /lifeline:* directly continues to work either way.

Companion GitHub Action — Claude PR Review

/lifeline:upsource-review polls a real PR review comment authored by github-actions[bot]. To produce that comment, run the Claude PR Review workflow on every PR. Lifeline ships a working copy you can drop into any project:

File Purpose
.github/workflows/claude-review.yml Runs anthropics/claude-code-action@v1 on PR open/sync, returns structured JSON, and posts a single aggregated ## Claude Code Review comment with severity-tagged findings + IDEA blocks.
.github/codex/codex-output-schema.json The JSON schema the action constrains the model output to (severity, title, file, line range, IDEA fields).

Setup (per repo):

# From the lifeline plugin cache (after /plugin install lifeline@lifeline)
LIFELINE=~/.claude/plugins/cache/lifeline/lifeline/<version>
mkdir -p .github/workflows .github/codex
cp "$LIFELINE/.github/workflows/claude-review.yml" .github/workflows/
cp "$LIFELINE/.github/codex/codex-output-schema.json" .github/codex/

Then add a CLAUDE_CODE_OAUTH_TOKEN repo secret (Settings → Secrets and variables → Actions). Generate the token with claude login --print-token or follow the Claude Code GitHub Actions docs.

The workflow reads CLAUDE.md / AGENTS.md / docs/code-review.md if present for project-specific review standards — keep one of those at the repo root if you want consistent review output.

How it pairs with lifeline:

  1. PR opens → workflow runs → bot posts ## Claude Code Review comment.
  2. You run /lifeline:upsource-review → it fetches that comment + any inline comments from chatgpt-codex-connector, fixes findings in atomic per-cycle batches, runs codex verify, commits with watermark trailers, pushes, and polls for the next review.
  3. Loop continues until both reviewers report clean.

Migration from harness-plugin

If you previously used harness-plugin (the in-repo precursor that lifeline is extracted from), nothing changes for you automatically — both plugins can run side-by-side during a validation phase. After validation, remove harness-plugin from your project's marketplace.

One subtlety: the scratch directory was renamed from .harness-github-review/ to .lifeline-upsource-review/. If you have artifacts from a prior harness-plugin run sitting in .harness-github-review/ (especially cycle-*-aborted/ forensics dirs), they won't auto-recover under lifeline. Inspect those directories manually before deleting.

Requirements

  • Claude Code ≥ 1.0
  • Codex CLI on $PATH (used by review, upsource-review, planner). Lifeline does not pin a Codex model — by default codex picks the auth-mode-correct default (e.g. ChatGPT-account auth has different available models than API-key auth). To pin a specific model anyway, export LIFELINE_CODEX_MODEL=<name> (e.g. gpt-5.4) before launching /lifeline:loop.
  • GitHub CLI (gh) authenticated (used by upsource-review, request-pr, approve-pr)
  • git, GNU coreutils, optionally timeout (skills degrade gracefully if missing)

Contributing

After cloning, enable the verifier pre-commit hook (refuses commits that re-introduce harness-plugin references — see .githooks/pre-commit):

git config core.hooksPath .githooks

Acknowledgments

The harness/ Python orchestrator that powers /lifeline:loop is adapted from Anthropic's autonomous-coding quickstart. The two-agent (initializer + coder) pattern, feature_list.json scheduling, and settings-isolation security model originated there.

Lifeline extends the original with:

  • claude -p subprocess subagents in place of the Python SDK — the original quickstart spawned each subagent (initializer, coder) through the Anthropic Python SDK, which required an ANTHROPIC_API_KEY. /lifeline:loop instead drives subagents through the claude -p command-line subprocess, inheriting the operator's existing Claude Code CLI auth. Result: a Claude Code "Coding agent" subscription is sufficient to run the full agentic team — no API key, no separate billing path. The SDK backend remains available as an opt-in fallback via --client sdk for operators who need a custom ANTHROPIC_BASE_URL (proxies, self-hosted gateways) or run outside the CLI's reach.
  • Paired local + cloud Codex review loops on top of the coder iteration.
  • A /lifeline:set-goal composer for turning rough requests into complete /goal instructions (Codex or Claude Code) with objective, evidence, constraints, boundaries, iteration policy, and blocker reporting spelled out.
  • PR open/finish via gh (/lifeline:request-pr, /lifeline:approve-pr).
  • A self-driving upsource-review fix loop that polls both Claude Code Review and chatgpt-codex-connector.
  • An LLM-backed allowlist judge for bash command policy.
  • /lifeline:deliver — goal-driven in-session loop adapted from OpenAI Codex's /goal command (Apache-2.0). The shared OCR reviewer checklist (skills/common/engines/claude-reviewer-checklist.md, adapted from the upstream continuation.md) and the finalization text folded into skills/common/ocr-pattern.md (from budget_limit.md) are derivative works of the upstream templates; full attribution in NOTICE. Paired mode delegates the completion verdict to codex exec running as an independent grader — Outcomes-style isolation that mitigates self-audit confirmation bias.

License

MIT — see LICENSE.

About

Agent workflow for autonomous harness engineering on Claude Code — autonomous dev loop, paired Codex review, PR opener, PR finisher, codex-paired spec planner

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages