Agent skill

argument-selfloop

Argument self-loop: maintain an argument ledger + premise consistency report for drafted sections. **Trigger**: argument self-loop, argument chain, premise consistency, section self-check, paragraph contract, 论证自循环, 论证链路, 前提一致性, 段落论证动作. **Use when**: you are in C5 (PROSE allowed), `sections/*.md` exist, and you want to prevent “smooth but hollow” writing by enforcing argument moves + premise hygiene before merge. **Skip if**: you are pre-C2 (NO PROSE), or evidence packs are scaffolded/thin (route upstream to `evidence-selfloop` first). **Network**: none. **Guardrail**: do not invent facts; do not add/remove/move citation keys; do not move citations across subsections; the argument ledger is an intermediate artifact and must never be inserted into the paper.

Stars 377
Forks 25

Install this agent skill to your Project

npx add-skill https://github.com/WILLOSCAR/research-units-pipeline-skills/tree/main/.codex/skills/argument-selfloop

SKILL.md

Argument Self-loop (write -> self-check -> ledger -> revise)

Purpose: upgrade C5 from “generate text” to “execute argument actions under explicit constraints”.

This skill operationalizes the mechanism you described as a reusable, pipeline-native component:

  • write section-by-section
  • self-check paragraph-by-paragraph
  • maintain a small argument ledger that makes dependencies explicit
  • revise only what fails until the chain is continuous

It complements (not replaces) the other self-loops:

  • evidence-selfloop: blocks writing when packs are not writeable (do not pad)
  • writer-selfloop: blocks template voice, missing sections/leads, scope/citation violations
  • argument-selfloop (this skill): blocks argument discontinuity and premise drift (even when prose is fluent)

Core idea: two intermediate artifacts (never in the paper)

This skill treats “argument structure” as a first-class intermediate artifact, like evidence packs.

Outputs:

  • output/SECTION_ARGUMENT_SUMMARIES.jsonl (structured; per-section/per-paragraph argument moves)
  • output/ARGUMENT_SKELETON.md (compact narrative + dependency map; not a prose restatement)
  • output/ARGUMENT_SELFLOOP_TODO.md (PASS/FAIL + actionable edits)

These files are not reader-facing and must never be merged into output/DRAFT.md.

Downstream:

  • paragraph-curator uses output/SECTION_ARGUMENT_SUMMARIES.jsonl (moves/outputs) + the ## Consistency Contract to run a controlled select->evaluate->subset->fuse pass without changing citation keys.

What this self-loop enforces (your 3 invariants)

After you complete a section (H3 or key front matter), the section must satisfy:

  1. Correct narrative linkage (paragraph-to-paragraph)
  • the relation between adjacent paragraphs is explicit (cause/contrast/refinement/boundary)
  • no silent topic-switch; no “jump cut”
  1. Closed argument loop (section-level) The section answers, in its own text (not in a hidden outline):
  • what question is it resolving?
  • what argument path does it take?
  • what is the conclusion?
  • what premises does the conclusion rely on?
  1. Premises + definitions are explicit and stable
  • new terms / protocol assumptions are defined at first use
  • the definition matches global usage (no drift)
  • task/metric/constraint assumptions do not silently change across sections

The self-check must result in concrete edits: add a missing definition, add a bridge sentence, add an explicit contrast, add a scope boundary, delete/reorder a paragraph, or strengthen the local conclusion.

Paragraph contract (argument actions)

Every paragraph must execute at least one argument action and be locally self-consistent. Use this action set (can be combined, but never empty):

  • Claim: a testable judgement/conclusion (avoid generic background)
  • Definition/Setup: introduce a concept, assumption, task definition, protocol, comparison set
  • Justification: reasoning chain or evidence support (including citations)
  • Contrast/Differentiation: clarify differences, remove ambiguity
  • Boundary/Failure: applicability limits, failure modes, threats to validity
  • Local Conclusion: a reusable takeaway / constraint that downstream paragraphs can rely on

One-sentence self-check (per paragraph):

  • "This paragraph’s action(s) are: <…>. Its output is: <…>."

If you cannot answer, the paragraph must be rewritten/merged/split until the action and output are clear.

How to run it (LLM-first workflow)

  1. Pick the scope of this pass
  • default: run it after writer-selfloop PASS, before merge
  • incremental: run it after finishing 1-2 H3s, so you catch drift early
  1. For each target section file (start with H3 bodies)
  • read the section
  • do a paragraph-by-paragraph action labeling in the ledger, not in the prose
  • identify failures (missing definition, missing bridge, missing conclusion, implicit premise)
  • apply the fix to the section file (sections/S<sub_id>.md) without changing citation keys
  1. Update the two-level ledger
  • write/update the record for that section in output/SECTION_ARGUMENT_SUMMARIES.jsonl
  • update output/ARGUMENT_SKELETON.md so it reflects:
    • the section’s functional role in the paper
    • what premises it consumes
    • what conclusions/definitions it produces for downstream sections
  1. Write output/ARGUMENT_SELFLOOP_TODO.md
  • - Status: FAIL + a list of concrete edits when any section fails
  • - Status: PASS only when all required sections are coherent and premises are stable
  1. Rerun until PASS

Output contract

output/ARGUMENT_SELFLOOP_TODO.md

Must exist and start with:

  • - Status: PASS|FAIL

Recommended structure (keep it short and debuggable):

  • ## Failures (blocking)
  • ## Fix plan (actionable edits) (per file)
  • ## Premise drift watchlist (non-blocking)

output/SECTION_ARGUMENT_SUMMARIES.jsonl

JSONL (one record per section/subsection).

Required fields per record:

  • kind: h3 | front_matter | discussion | conclusion (minimal set)
  • id: for H3 use the subsection id (e.g., "3.2")
  • title
  • section_id, section_title (for H3)
  • section_role: what this unit does in the paper (e.g., mechanism, evaluation_lens, risk_lens, synthesis)
  • depends_on: list of premises/definitions it assumes
  • adds: list of premises/definitions/conclusions it introduces
  • paragraphs: list of objects, each with:
    • i (1-based paragraph index)
    • moves (non-empty list; pick from: claim, definition_setup, justification, contrast, boundary_failure, local_conclusion)
    • output (one sentence: what this paragraph produces)

Notes:

  • This is an intermediate ledger: short, structural, no prose restatement.
  • Do not paste long sentences from the draft. Use short summaries.

output/ARGUMENT_SKELETON.md

A compact narrative/dependency map (not a retelling of the paper).

It should include:

  • each H2/H3's necessity (what gap it fills)
  • explicit dependencies (premises consumed, outputs produced)
  • a global Consistency Contract section (single source of truth) that must not drift across edits:
    • canonical terminology + synonym policy (what to call the same thing)
    • task/environment/threat-model boundary (what counts as in-scope)
    • evaluation protocol fields that make numbers interpretable (task + metric + constraint/budget/tool access)
    • comparison set naming policy (baseline families; avoid drifting labels)

Minimum format requirement:

  • output/ARGUMENT_SKELETON.md must contain a heading line: ## Consistency Contract

Change rule (regression trigger):

  • If you change any definition/protocol assumption/term naming, update the Consistency Contract first, then revise the affected sections/*.md to match, and rerun this self-loop until PASS.

Keep it "writer-facing": no reader signposting, no “in this section we…”.

Routing rules (avoid polishing around missing substance)

  • If a section cannot produce a justified claim without new evidence: STOP and route to evidence-selfloop.
  • If a section fails due to template voice / missing citations / out-of-scope keys: route to writer-selfloop / citation-* first.
  • This skill is for argument continuity and premise hygiene, not for adding new facts.

Script (generator + validator)

This skill includes a validator script so the pipeline can block on missing ledgers. It does not write paper prose, but it does generate the required ledger artifacts from existing sections/*.md files and then validates coverage/consistency.

Quick Start

  • python .codex/skills/argument-selfloop/scripts/run.py --workspace workspaces/<ws>

All Options

  • --workspace <dir>
  • --unit-id <U###>
  • --inputs <semicolon-separated>
  • --outputs <semicolon-separated>
  • --checkpoint <C#>

Examples

  • Validate the ledgers exist + are PASS + cover all H3:
    • python .codex/skills/argument-selfloop/scripts/run.py --workspace workspaces/<ws>

Expand your agent's capabilities with these related and highly-rated skills.

WILLOSCAR/research-units-pipeline-skills

thesis-compile-review

对中文毕业论文进行编译、warning 分级、模板模式检查、数据与引用复查,并把问题回写成可继续迭代的 review checklist。 **Trigger**: 毕业论文编译检查, thesis compile review, warning 分级, 终稿复查, main.pdf 检查. **Use when**: 论文已经回写到 TeX 交付层,需要确认是否真正达到“可提交”的质量,而不是只做到能编译。 **Skip if**: 还处于中间层重构阶段,`chapters/*.tex` 尚未形成稳定交付稿。 **Network**: none. **Guardrail**: 不在这里重构章节主线;如果发现结构问题,明确回退到上游修复。

377 25
Explore
WILLOSCAR/research-units-pipeline-skills

front-matter-writer

Write the survey's front matter files (Abstract, Introduction, Related Work, Discussion, Conclusion) in paper voice, with high citation density and a single evidence-policy paragraph. **Trigger**: front matter writer, introduction writer, related work writer, abstract writer, discussion writer, conclusion writer, 引言, 相关工作, 摘要, 讨论, 结论. **Use when**: you are in C5 (prose allowed) and need the paper-like shell to stop the draft reading like stitched subsections. **Skip if**: `Approve C2` is missing in `DECISIONS.md`, or `citations/ref.bib` is missing. **Network**: none. **Guardrail**: no invented facts/citations; no pipeline jargon in final prose; no repeated evidence disclaimers; only use keys present in `citations/ref.bib`.

377 25
Explore
WILLOSCAR/research-units-pipeline-skills

thesis-question-list

维护中文毕业论文的 `codex_md/question_list.md`:把本轮问题、边界、优先级、协作方案和验收口径结构化,作为整条 thesis pipeline 的控制面。 **Trigger**: 毕业论文问题清单, thesis question list, 论文修改清单, 本轮目标, 结构问题梳理, review问题整理. **Use when**: 你已经有一批材料或上一轮 review 结果,需要明确这一轮到底修什么、不修什么,并给后续重构与编译复查提供统一入口。 **Skip if**: 当前只是在做一次性局部措辞修改,且没有形成新一轮结构/证据/编译问题。 **Network**: none. **Guardrail**: 不在这里写正文;不把问题单写成长篇散文;每条问题必须可执行、可验收。

377 25
Explore
WILLOSCAR/research-units-pipeline-skills

novelty-matrix

Create a novelty/prior-work matrix comparing the submission’s contributions against related work (overlaps vs deltas). **Trigger**: novelty matrix, prior-work matrix, overlap/delta, 相关工作对比, 新颖性矩阵. **Use when**: peer review 中评估 novelty/positioning,需要把贡献与相关工作逐项对齐并写出差异点证据。 **Skip if**: 缺少 claims(先跑 `claims-extractor`)或你不打算做新颖性定位分析。 **Network**: none (retrieval of additional related work is out-of-scope unless provided). **Guardrail**: 明确 overlap 与 delta;尽量给出可追溯证据来源(来自稿件/引用/作者陈述)。

377 25
Explore
WILLOSCAR/research-units-pipeline-skills

protocol-writer

Write a systematic review protocol into `output/PROTOCOL.md` (databases, queries, inclusion/exclusion, time window, extraction fields). **Trigger**: protocol, PRISMA, systematic review, inclusion/exclusion, 检索式, 纳入排除. **Use when**: systematic review pipeline 的起点(C1),需要先锁定 protocol 再开始 screening/extraction。 **Skip if**: 不是做 systematic review(或 protocol 已经锁定且不允许修改)。 **Network**: none. **Guardrail**: protocol 必须包含可执行的检索与筛选规则;需要 HUMAN 签字后才能进入 screening。

377 25
Explore
WILLOSCAR/research-units-pipeline-skills

rubric-writer

Write a rubric-based peer review report (`output/REVIEW.md`) using extracted claims and evidence gaps (novelty/soundness/clarity/impact). **Trigger**: rubric review, referee report, peer review write-up, 审稿报告, REVIEW.md. **Use when**: peer-review pipeline 的最后阶段(C3),已有 `output/CLAIMS.md` + `output/MISSING_EVIDENCE.md`(以及可选 novelty matrix)。 **Skip if**: 上游产物未就绪(claims/evidence gaps 缺失)或你不打算输出完整审稿报告。 **Network**: none. **Guardrail**: 给可执行建议(actionable feedback),并覆盖 novelty/soundness/clarity/impact;避免泛泛而谈。

377 25
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results