/zulfiqar:long-horizon-promptingfrom zulfiqar
Use when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration on a hard problem: pseudo-formal task briefs that define terms and an exact success predicate, enumerate non-counting outcomes, set persistence rules with stop/return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry, and gate the return on adversarial audit.
Ships in zulfiqar. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill covers the design of the prompt that launches an agent expected to work autonomously for hours or days, alone or as an orchestrator managing many parallel workers. The central technique is the pseudo-formal task brief: a specification written with the rigor of formal verification but expressed linguistically, because most hard problems have no machine-checkable success condition. Published examples of this pattern exist in the wild — frontier labs have released long-horizon research-agent prompts for genuinely hard open problems, built around exactly this brief anatomy. The structure generalizes far beyond any one example or domain: any domain where success can be stated precisely and failure modes can be enumerated can use the same brief anatomy.
The controlling trade-off: everything that makes a long run productive (persistence, autonomy, parallelism) also raises the cost of a weak specification. A short interactive prompt fails cheaply; a long-horizon brief with a loophole burns hours of compute producing an answer-shaped artifact that does not solve the problem.
Activate this skill when:
This skill owns the words that steer a long-running run. It does not own: the agent topology and coordination protocol used to run it (spawn/handoff mechanics are the target harness's own primitive — Claude Code's Agent/Task tool, Codex's agent/task primitive, or whatever equivalent the target agent exposes); runtime-enforced budgets and rollback (those live in whatever process supervises the run, not in the prompt); or the mechanics of a deterministic test suite the run is scored against (that's ordinary evaluation-harness work, orthogonal to this skill). Keep those concerns in the harness or orchestration layer; this skill only covers what to put in the launch prompt itself.
Formal verification requires a machine-checkable specification. Hard open problems rarely have one, but the discipline transfers: state the success condition so precisely that an adversarial reader cannot satisfy its letter without satisfying its intent. Four components, in order of leverage:
| Block | Job | Failure it prevents |
|---|---|---|
| Definitions | Fix the vocabulary, including degenerate cases | Loophole solutions on technicalities |
| Success predicate | State exactly what must be true at return | Scope-narrowed answers |
| Non-counting outcomes | Enumerate near misses that do not count | Answer-shaped partial results |
| Solvability framing | "Assume a solution exists" where existence is plausible | Give-up drift, "this is open" refusals |
| Orchestration policy | Heuristics for allocating parallel workers, not fixed assignments | Premature convergence, wasted parallelism |
| Verification policy | Adversarial audit with enumerated failure modes | Lenient self-judging |
| Reporting contract | Concrete artifacts required; status reports rejected | Vague optimism, fabricated progress |
| Return condition | Return only when the artifact survives audit | Premature return, best-effort summaries |
| Effort floor | Minimum effort before giving up is considered | Early abandonment |
| Contamination guards | What external search may and may not be used for | Laundered lookups, benchmark leakage |
Persistence instructions ("do not return until", effort floors, assume-solvable framing) counter a documented drift on long trajectories toward giving up too early. But the same pressure raises the reward-hacking surface: models trained hardest for persistence have also shown elevated rates of gaming their success signal in independent evaluations, and a model's measured time-horizon capability is not automatically robust to whether cheating counts as success in that measurement. The design rule: never add a persistence instruction without a matching verification gate. Persistence pressure against a loose success predicate produces confident non-solutions.
Parallel sampling reliably raises the chance that some worker finds a correct answer, but the system's ability to select that answer lags behind — model judges of hard artifacts are systematically lenient, rewarding rigorous-looking but incomplete arguments. Budget as much prompt design for the verifier as for the generator:
Role labels do not create diversity; parallel workers share priors and converge unless independence is engineered:
Long trajectories drift toward uncertainty and abandonment, and a budget stated once at the top of the prompt loses force as context grows. Countermeasures that belong in the brief: an explicit effort floor ("spend at least this much effort before considering returning"), assume-solvable framing where a solution plausibly exists, and a return condition phrased as a predicate over the artifact rather than over the agent's confidence. Countermeasures that belong outside the prompt: an externally maintained ledger of verified progress re-injected each round — in controlled comparisons this kind of external ledger rescued large-quantity tasks that prompt-only and completion-gated setups failed entirely. Progress claims should be auditable: requiring each reported claim to trace to a tool result or artifact from the current session sharply cuts fabricated status reports.
Current guidance across frontier-model vendors converges on the same doctrine: the prompt should carry the outcome, hard constraints, evidence sources, and completion bar, and leave the path to the model. Accumulated instruction stacks measurably hurt; leaner system prompts have improved coding-agent evaluations while cutting cost in vendor-reported comparisons. Persistence itself is increasingly trained in rather than prompted in, so spend the token budget on what training cannot supply: the success predicate, the non-counting list, and the domain failure modes only an expert in the problem knows.
Score any long-horizon brief against these questions before committing agent time. Any "no" is a defect to fix, not a judgment call:
Example 1: Pseudo-formal brief skeleton
DEFINITIONS
<every load-bearing term, including degenerate cases>
TASK
<exact success predicate with quantifiers and scope>
DOES NOT COUNT
<narrowed scope> <reduction to unvalidated assumption>
<bounded/anecdotal verification> <plan or survey instead of artifact>
ORCHESTRATION (for parallel runs)
Begin with a genuinely diverse portfolio. Keep early workers blind
to the favored approach. Registry of approach families by idea, not
wording. Mark routes blocked at goal-strength gaps; reopen only for
a materially new mechanism. Cross-pollinate late.
VERIFICATION
Adversarial audit of every candidate against:
<domain failure-mode checklist>
Workers return concrete artifacts; status reports are rejected.
RETURN CONDITION
Return only when a candidate survives the audit. Do not return a
reduction, partial result, or explanation of difficulty.
EFFORT
Assume a solution exists. Spend at least <floor> before considering
returning.
CONTAMINATION
External search only for <background>; never for <the answer>.
Example 2: Weak prompt to strong brief (root-cause analysis)
Weak: "Investigate why our v4 model underperforms v3 in production
and write up what you find. Be thorough."
Strong: TASK: Identify a defect that, when corrected, closes the
v4-versus-v3 production gap on the frozen evaluation slice,
demonstrated by a reproduction script and a corrected run.
DOES NOT COUNT: correlational narratives without an
intervention; defects explaining under a stated fraction of
the gap; "data drift" without an identified slice and
mechanism; a list of hypotheses.
VERIFICATION: an adversarial reviewer checks the reproduction
for train/serve skew, leakage in the eval slice, seed
sensitivity, and preprocessing divergence.
RETURN: only a candidate that survives that review.
The weak version invites a status report. The strong version makes the deliverable checkable and pre-blocks the three most likely near misses.
Beyond the launch prompt itself, a real long-horizon run typically also needs: an agent-topology/handoff mechanism for coordinating parallel workers (whatever primitive the target agent provides), a runtime-enforced budget and rollback layer that survives optimization pressure (the harness, not the prompt), and — if the run outlives its context window — a compaction or memory strategy for surviving that limit. Those are real, separate concerns; this skill deliberately stays scoped to the words that steer the run, not the infrastructure that executes it.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
20 skills in this plugin
/bookendApply the "bookend" transform to a prompt — keep its body, then restate the objective + top hard constraints + the explicit task at the very END, task LAST. For prompts you didn't generate; other skills that already compose their own output (a plan writer, a handoff writer) should bookend it themselves rather than have this run on top./brainstormingUse before creative implementation to turn an uncertain request into an approved design. Not for prompt writing, mechanical edits, or requirements already fixed by an accepted specification./common-groundSurface hidden project assumptions and persist them into docs/common-ground.md with an OPEN/WORKING/ESTABLISHED tier, so a long project stays honest about what's assumed vs known. Modes: default (surface + file), --list, --check, --graph./delegating-workRoute substantial independent implementation, investigation, audit, or research work into bounded readers, workers, advisors, or verifiers and integrate centrally. Use when two or more independent slices reduce wall-clock time or isolate noisy context, or when consequential work needs a fresh verifier. Not for tiny tasks, tightly coupled serial work, overlapping edits, or when user or project instructions forbid delegation./doubt-driven-developmentSubjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production, security-sensitive logic, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later./exaUse when the user says /exa, asks to set up/integrate/use Exa AI, exa.ai, Exa Search, the Exa API, the Exa MCP, exa-js, or exa-py; asks for an Exa starter project; or when a web-research task should preferentially use Exa search inside an AI coding agent.Generated from the plugin's indexed repository (mohamed-alaboudi/zulfiqar) — no native marketplace selected
npx claudepluginhub p/mohamed-alaboudi-zulfqar-of-coding