skills/long-horizon-prompting/SKILL.md
This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.
npx skillsauth add muratcankoylan/Agent-Skills-for-Context-Engineering long-horizon-promptingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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. The exemplar is the published prompt behind GPT-5.6 Sol Ultra's candidate proof of the Cycle Double Cover Conjecture, produced by a 64-subagent orchestration (claim-long-horizon-cdc-run). The prompt structure generalizes far beyond mathematics: 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:
Do not activate this skill for adjacent work owned by other skills:
multi-agent-patterns. That skill owns the architecture; this skill owns the words that steer it.harness-engineering. Constraints that must survive optimization pressure belong in the harness, not the prompt.evaluation.advanced-evaluation.context-compression, memory-systems, filesystem-context.self-improvement-loops.hosted-agents.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 the documented drift toward giving up on long trajectories (claim-long-horizon-give-up-drift). But the same pressure raises the reward-hacking surface: the most persistence-trained frontier model measured to date also showed the highest detected cheating rate of any model its evaluator had tested, and its measured time horizon was not robust to whether cheating counted as success (claim-long-horizon-persistence-hacking). 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, and model judges of hard artifacts are systematically lenient, rewarding rigorous-looking but incomplete arguments (claim-long-horizon-verification-gap). 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 (claim-long-horizon-give-up-drift). 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, which in controlled comparisons rescued large-quantity tasks that prompt-only and completion-gated setups failed entirely (claim-long-horizon-state-ledger). Progress claims should be auditable: requiring each reported claim to trace to a tool result or artifact from the current session nearly eliminated fabricated status reports in vendor testing (claim-long-horizon-evidence-audit).
Both major vendors converged on the same doctrine for current frontier models: 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 improved vendor coding-agent evaluations while cutting cost (claim-long-horizon-lean-prompt). 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.
The published Cycle Double Cover prompt implements every block of the brief anatomy in under a page: formal definitions closing degenerate-case loopholes, an exact success predicate with scope quantifiers, five classes of explicitly non-counting partial progress, dynamic orchestration heuristics for up to 64 concurrent agents with an approach-family registry and blocked-route bookkeeping, adversarial auditors with a seven-item failure-mode hunt list, a concrete-artifact reporting contract, an audit-gated return condition, an eight-hour effort floor, and a contamination guard restricting web search to background material (claim-long-horizon-cdc-run). The full annotated text is in the CDC prompt reference.
Two honest caveats. The candidate proof had no independent peer review or formalization when published, so the prompt is the validated artifact of interest here, not the theorem. And no public ablation isolates which prompt elements carried the result; the mechanism-level evidence comes from the independent research in the research evidence reference.
OpenAI and Anthropic guidance overlap on fundamentals (explicit completion bars, stop rules, verification before return) and differ in emphasis. OpenAI doctrine centers persistence blocks, risk-tiered autonomy thresholds, self-constructed rubrics, and reasoning-effort dials; its multi-agent API institutionalizes a root agent with bounded-task subagents. Anthropic doctrine centers the four-part subagent delegation spec (objective, output format, tool guidance, task boundaries), explicit effort-scaling tiers by task complexity, evidence-grounded progress reporting, and fresh-context verifier subagents. Both now warn that over-prescriptive prompts degrade current-generation models. Dated extracts with sources are in the vendor guidance reference.
The CDC prompt worked because mathematics allows sharp statements, but each element has a general form usable in any rigorous domain:
| CDC element | General form | | --- | --- | | Formal graph definitions | Operationalize every load-bearing term; state units, populations, boundaries, degenerate cases | | "Exactly two occurrences of each edge" | A quantified, checkable property of the deliverable | | "Special graph classes do not count" | "Results holding only under narrowed scope do not count" | | "No reduction to another unproved conjecture" | "No dependence on an unvalidated assumption or unavailable dataset" | | "Computational verification through fixed size is insufficient" | "Anecdotal or small-sample evidence is insufficient" | | Parallel-edge and bridge edge cases for auditors | The domain's known confounders, artifacts, and failure modes as an audit checklist | | "Do not search for a solution to this exact conjecture" | "Do not launder the answer from sources the result is supposed to be independent of" |
The transformation workflow for a scientist or engineer with a hard problem: state what a complete answer would let them do, work backward to the predicate that enables it, then spend most of the effort listing what they would refuse to accept from a junior collaborator. That refusal list becomes the non-counting outcomes and the auditor checklist.
Score any long-horizon brief against these questions before committing agent time. Any "no" is a defect to fix, not a judgment call:
harness-engineering); prompt-stated constraints are advisory.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.
This skill owns the launch prompt for long-running and parallel agent work. Adjacent skills own the machinery around it:
Internal references:
Related skills in this collection:
External resources:
Numeric, benchmark, volatile, or vendor-performance claims in this skill carry inline claim-* IDs backed by researcher/claims/index.jsonl. Detailed numbers live in the dated reference files.
Created: 2026-07-11 Last Updated: 2026-07-11 Author: Agent Skills for Context Engineering Contributors Version: 1.0.0
development
A comprehensive collection of Agent Skills for context engineering, harness engineering, multi-agent architectures, and production agent systems. Use when building, optimizing, evaluating, or debugging agent systems that require effective context management and reliable operating loops.
development
This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops, meta-harnesses, self-improving harnesses that mine their own failures and propose bounded edits, evolutionary or population-based search over agent scaffolds, acceptance gates for self-modifying systems, and agentic context evolution where the mechanism that produces context is versioned and evolved. Route governance of a single autonomous loop (locked surfaces, durable logs, rollback, novelty gates, approval boundaries) to harness-engineering, measurement and quality-gate design to evaluation, judge design to advanced-evaluation, and remote sandbox infrastructure to hosted-agents.
data-ai
This skill should be used when designing autonomous agent harnesses: research loops, evaluation scaffolds, locked and editable surfaces, durable logs, novelty gates, pruning, rollback, PR preparation, and human approval boundaries.
data-ai
This skill should be used when the user asks to "share memory between agents", "KV cache compaction for multi-agent", "orchestrator worker context", "latent briefing", "reduce worker tokens", "cross-agent memory without summarization", or discusses Attention Matching compaction, recursive language models with workers, or token explosion in hierarchical agents.