Use when running substantial work as a hypothesis-first paper loop — initializing a project-local .paper-stack, creating or closing a closed-loop paper, validating before/after gates, combining paper intervals, or ranking reference papers.
Resources
8Install
npx skillscat add youndukn/loop-paper Install via the SkillsCat registry.
Loop Paper
Loop Paper treats meaningful work as a paper-backed loop: claim, prior work,
implementation plan, validation plan, evidence, verdict, review, and impact.
Operating Model
The loop runs autonomously. Papers walkDraft -> Research Ready -> Plan Ready -> Implementing -> Implemented -> AI Validated -> Accepted without any human checkbox gate. The agent is
expected to keep producing papers indefinitely, one after the next.
Review is itself a paper, not a checkbox. When a target paper needs
review, write a review paper whose body assesses the targets via a
structured multiple-choice walk. The review paper sits in the same paper
stack and flows through the same loop. It does not block or modify the
target papers; it cites them.
Use scripts/new_review_paper.py to drive the review:
# Phase 1 — render the multiple-choice prompts for the host agent:
python3 scripts/new_review_paper.py \
--root .paper-stack \
--title "Quarter Review of PAPER-0010 and PAPER-0011" \
--target PAPER-0010 --target PAPER-0011 \
--format claude --prompt-out .paper-stack/inbox/prompts.json
# (Host agent presents the prompts to the user and writes answers.json)
# Phase 2 — generate the review paper from answers:
python3 scripts/new_review_paper.py \
--root .paper-stack \
--title "Quarter Review of PAPER-0010 and PAPER-0011" \
--target PAPER-0010 --target PAPER-0011 \
--answers .paper-stack/inbox/answers.json--format selects the prompt rendering: cli (interactive stdin),json (canonical), claude (AskUserQuestion-shape JSON), codex (codex
interactive block), pi (pi-mono YAML-style). Same questions in every
format. The per-target dimensions are: hypothesis verdict, evidence
strength, production readiness, recommended action. The cross-paper
dimensions are: coherence and recommended next direction.
Purpose
The loop exists so a human can reconstruct the full path of the work by
reading only the Abstract sections of the papers, in numeric order. Every
abstract must:
- Stand alone (no jargon that requires reading the body).
- Name the work unit, the hypothesis, the verdict, and the next step.
- Read as the next sentence in the project's running narrative when placed
after the previous paper's abstract.
When writing or updating an abstract, optimize for the reader who has not
read any other section of any paper. The abstract is the only deliverable
guaranteed to be read.
Production Bar
A loop is "done" only when its work is production-level. The AI treats any
state below production — TODOs, untested code, mocks, partial validation,
unmeasured outcomes — as in-progress, regardless of how many checkboxes are
ticked. Acceptable terminal states are:
- The paper reaches
Acceptedwith production-level evidence, and the loop
is paused intentionally because no further production-impacting work
remains for now. - The paper reaches
Rejectedbecause the hypothesis failed. - The paper is
Supersededby a stronger one.
Do not pause a loop just because the immediate change runs locally. Keep
iterating until the change would survive being shipped.
Use .paper-stack/ in the active project unless the user gives another root.
Resolve scripts relative to this SKILL.md and execute them with absolute
paths when working outside the skill directory.
Initialize A Project
For a new project or a repo without a clear paper structure, initialize first:
python3 scripts/init_loop_paper.py \
--root .paper-stack \
--project-name "Project Name"This creates the generalizable directory contract:
.paper-stack/
papers/ canonical paper loops
runs/ command, validation, benchmark, and inspection evidence
fixes/ implementation change records and rollback notes
references/ stable prior work and source notes
inbox/ untriaged claims, links, and ideas
dashboard/ generated reports; do not hand-edit
config/ local Loop Paper config
archive/ superseded or exported materialUse --seed-paper when the initialization itself should create the first
closed-loop paper.
Core Rules
- Create or locate the active paper before substantial implementation.
- Record the hypothesis, baseline evidence, implementation TODOs, validation
plan, and references before changing code or prompts. - Keep
Validation Planseparate fromValidation; the plan says what would
count, and validation records what actually happened. - Mark AI-actionable validation only after executing or inspecting evidence.
- The loop runs autonomously through
Accepted. There is no human-checkbox
gate. If a paper needs human assessment, write a review paper withscripts/new_review_paper.pythat cites the target viaReferences:.
Do not pause or stall waiting for a human on the target paper. - Use deterministic scripts for paper metadata, graph edges, dashboards,
impact components, reports, transitions, and combined summaries. - If work happened before the paper existed, mark the evidence as
retrospective. Do not rewrite history to make the hypothesis earlier.
Main Workflow
Create a closed-loop paper:
python3 scripts/new_closed_loop_paper.py \ --root .paper-stack \ --title "Short Work Unit Title" \ --hypothesis "The change will produce a measurable effect" \ --finding "Concrete prior finding that justifies this work" \ --reference "docs/current_findings.md"Fill all
BEFORE_REQUIREDslots, then check the before phase:python3 scripts/check_closed_loop_paper.py \ .paper-stack/papers/PAPER-XXXX-title.md \ --phase beforeImplement only the active hypothesis.
Record after evidence, verdicts, run/fix records, and reference edges:
References: PAPER-0001 Depends on: PAPER-0002 Supersedes: None Contradicts: None Extends: PAPER-0003Check the after phase and run the deterministic pipeline:
python3 scripts/check_closed_loop_paper.py \ .paper-stack/papers/PAPER-XXXX-title.md \ --phase after python3 scripts/pipeline.py .paper-stackThe pipeline is also a gate: papers in
Plan Ready,Implementing, orImplementedmust pass--phase before; papers inAI ValidatedorAcceptedmust pass--phase after.
Deterministic Combine
Use scripts/combine_papers.py when closing multiple papers, creating a
summary across nearby papers, or choosing references for a new paper.
Always select papers by an explicit deterministic interval or explicit IDs:
python3 scripts/combine_papers.py .paper-stack \
--from PAPER-0030 \
--to PAPER-0045 \
--interval-size 5 \
--mode both \
--target-paper PAPER-0046 \
--output .paper-stack/dashboard/combined-PAPER-0030-PAPER-0045.mdSelection is stable by numeric paper ID, and explicit --from/--to
interval boundaries must both exist in the stack. Summary chunks are stable by--interval-size. Reference candidates are ranked without model judgment using
status, inbound graph references, explicit relationship edges, paper-ID
distance to the target, and deterministic text-term overlap.
Use:
--mode summaryfor interval summaries only.--mode referencesfor ranked reference candidates and relationship lines.--mode bothwhen closing a set of papers and preparing a next paper.--target-paper PAPER-NNNNonly when that target paper exists in the stack.--last Nonly for a recent deterministic suffix.--ids PAPER-0001 PAPER-0007only when the user names exact papers.
Paper States
Use these statuses exactly unless the project defines a local variant:
Draft
Research Ready
Plan Ready
Implementing
Implemented
AI Validated
Accepted
Rejected
SupersededAllowed progression:
Draft -> Research Ready -> Plan Ready -> Implementing -> Implemented -> AI Validated -> AcceptedMove to Rejected when a hypothesis fails or the user rejects the paper. Move
to Superseded when a later paper replaces it.
Required Sections
Each paper must contain these top-level sections:
# PAPER-0001 Title
## Abstract
## Hypothesis
## Prior Research
## References
## Implementation Plan
## Validation Plan
## Validation
## Agent Review
## Impact ScoreResources
assets/structure-template.md: Project-local.paper-stack/structure.mdtemplate.references/paper-states.md: Detailed state and gate rules.references/impact-scoring.md: Evidence-based impact scoring.scripts/init_loop_paper.py: Initialize the generalizable.paper-stackstructure.scripts/new_closed_loop_paper.py: Create a hypothesis-first paper.scripts/new_review_paper.py: Create a review paper from structured multiple-choice answers across one or more target papers.scripts/check_closed_loop_paper.py: Validate before/after closed-loop slots.scripts/check_paper.py: Validate required sections.scripts/combine_papers.py: Deterministically summarize intervals and rank references.scripts/pipeline.py: Run metadata sync, graph index, impact scoring, phase gates, dashboard render, and report export.scripts/index_references.py: Builddashboard/references.json.scripts/score_impact.py: Calculate deterministic impact components.scripts/transition_paper.py: Enforce allowed status transitions.scripts/update_paper_metadata.py: Synchronize paper frontmatter with deterministic paper contents.scripts/agent_review.py: Record or refresh theAgent Reviewsection on a paper.scripts/render_dashboard.py: Builddashboard/data.jsonand dashboard HTML.scripts/export_report.py: Generatedashboard/report.md.scripts/watch_pipeline.py: Poll papers and rerun the deterministic pipeline on changes.scripts/paperstack_common.py: Shared deterministic helpers for bundled scripts.scripts/install_skill.py: Install the portable skill payload into supported agent skill directories.scripts/validate_skill_repo.py: Validate the public skill repository contract.scripts/smoke_test.py: Run the end-to-end happy-path workflow smoke test.scripts/edge_case_test.py: Run deterministic rejection-path tests for review and combine CLIs.