@retry-now/core
v0.2.4
Published
retry-now engine: scaffold, signal/state protocol, prompt synthesis, agent adapters, and the reincarnation loop driver.
Readme
@retry-now/core
The engine behind retry-now — an autonomous self-improvement loop (윤회 / reincarnation) whose context is reborn at 0 every iteration.
This package is the shared runtime that the CLI and every agent integration build on. It owns the scaffold, the agent ↔ driver protocol, prompt synthesis, the agent adapters, and the reincarnation loop driver itself.
Most users don't install this directly — reach for
@retry-now/clior one of the agent integrations. Install@retry-now/coreonly when building your own tooling on top of the engine.
Install
bun add @retry-now/core # or: npm install @retry-now/coreWhat's inside
| Area | Responsibility |
|---|---|
| scaffold | Creates and maintains the git-ignored .retry-now/ runtime directory |
| signal / state protocol | The one-way agent → driver signal.json and the driver-owned state.json convergence counters |
| prompt synthesis | Builds each life's analyze / improve prompts from the three intent prompts in the config |
| agent adapters | Spawns a fresh, headless, zero-context session for opencode | codex | claude |
| loop driver | Runs one life end-to-end (analyze → improve → record) and decides when the loop has consummated (converged) |
| frontends | Installs the /retry-now (or $retry-now) trigger for each agent |
Public API
import {
runDriverCli, // entrypoint used by the CLI / agent driver-entry scripts
installFrontend, // install the /retry-now trigger for an agent
buildFrontendBody, // synthesize the trigger command body
type FrontendInstallResult,
} from '@retry-now/core'The engine is dependency-light and runs on Bun ≥ 1.1.
How one life runs
Each iteration is a brand-new agent session with no memory of previous lives. It ANALYZEs the code read-only, produces a batch plan of independently revertible items, IMPROVEs them one by one (backing up and reverting per item on any regression), and the driver records the result. The loop stops only when several consecutive lives honestly find nothing left to improve.
See the main README for the full model, the convergence rules, and configuration.
