Imported from Hjhnb-star/ecr_grpo_agent (
AGENTS.md). Install upstream withnpx skills add Hjhnb-star/ecr_grpo_agent. Copyright stays with the author.
AGENTS.md
OVERVIEW
CoPaper: structured academic paper writing
This is a CoPaper paper-writing project.
CoPaper uses a six-phase workflow, 22 agent skills, and a CLI (copaper) to guide you from research storyline to submission-ready LaTeX.
The core philosophy is structure-first, human-led, AI-assisted: AI polishes your expression and checks your logic, but never invents research content.
Your insight is the soul of the paper; the system helps you express it clearly and defend it rigorously.
STRUCTURE
Project files and their roles
storyline.md: Research storyline — problem, importance, insight, design, and evaluation plan. The highest-level narrative guiding all downstream writing.paper.md: The formal paper framework. Level 1-5 headings define structure; Level 6 (######) headings hold paragraph content (topic sentence + supporting text).writingrules.md: Definitive writing constraints — heading rules, character limits, metadata format, image handling.relatedwork/: Literature assets directory.literature.json: Canonical metadata catalog for all tracked papers (title, authors, venue, BibTeX, PDF URL, download status, summary path).paper_list.bib: BibTeX reference file, kept in sync withliterature.json.pdfs/: Downloaded paper PDFs.papers/: Per-paper markdown summaries generated by multimodal agents.summary.md: Categorized literature overview.
fig/: Paper figures and charts (JPG/PNG/GIF, max 5MB each).templates/: LaTeX conference/journal templates for final export..agents/state.json: Workflow state — phase statuses, checker results, literature counters, writing progress..agents/events.jsonl: Append-only operation log for all CLI and skill actions..agents/cross_index.json: Cross-reference index mapping technical concepts to literature summaries..agents/skills/: The 22 agent skills that power each workflow phase.AGENTS.md: This file — the project-level guide for agents.
SIX-PHASE WORKFLOW
From storyline to submission
CoPaper organizes work into six phases. The recommended forward order is:
| Phase | Name | Purpose | Key Skill(s) |
|---|---|---|---|
| 1 | storyline |
Define research problem, insight, design intent, evaluation plan | storyline-helper |
| 2 | literature |
Search, download, summarize, and index related work | relatedwork-finder |
| 3 | discussion |
Socratic questioning to stress-test claims and sharpen arguments | socratic-discussion |
| 4 | experiments |
Run experiments or skip with justification | experiment-analyzer |
| 5 | writing |
Draft paper.md section by section with quality gates | writing-orchestrator, markdown-helper, mad-writer |
| 6 | latex_review |
Convert to LaTeX, review, and prepare for submission | markdown2latex, submission-precheck |
Flexibility rules:
- Any phase can be skipped via
copaper skip <phase> --reason "...". - Any phase can be re-entered and repeated.
- Reverse paths are supported:
paper.mdcan backfillstoryline.md; LaTeX can be imported intopaper.md. - The CLI tracks
current_phaseautomatically based on actual phase statuses.
ARTIFACT MODEL
How data flows between files and skills
The system revolves around a few key artifacts rather than the phases themselves:
Primary artifacts and their producers/consumers:
| Artifact | Produced by | Consumed by |
|---|---|---|
storyline.md |
storyline-helper, user, reverse extraction from paper.md |
relatedwork-finder, socratic-discussion, experiment-analyzer, markdown-helper, writing-orchestrator |
paper.md |
markdown-helper, mad-writer, latex2markdown, user |
writing-orchestrator, markdown-review, 7 checkers, review-revise, submission-precheck, markdown2latex |
relatedwork/literature.json |
relatedwork-finder + copaper relatedwork CLI |
markdown-helper, markdown-review, review-revise, mad-writer |
relatedwork/papers/*.md |
relatedwork-finder (multimodal subagents) |
markdown-helper, writing-orchestrator, review-revise |
.agents/state.json |
copaper CLI, skills |
copaper status, writing-orchestrator, review-revise, socratic-discussion, experiment-analyzer |
.agents/cross_index.json |
copaper relatedwork build-index |
markdown-helper, writing-orchestrator, review-revise |
Supported data flow paths:
- Forward:
storyline.md→relatedwork/→ discussion → experiments →paper.md→ LaTeX - Reverse:
paper.md→storyline.md(viastoryline-helperreverse extraction) - Reverse: LaTeX →
paper.md(vialatex2markdown) - Fallback:
paper.md→relatedwork-finder(whenstoryline.mdis sparse) - Loop:
paper.md→ 7 checkers →review-revise→paper.md(iterative improvement)
SKILL CATALOG
22 skills organized by workflow purpose
Phase 1 — Storyline
| Skill | Trigger | Purpose |
|---|---|---|
storyline-helper |
"help me write storyline", "帮我写 storyline" | Interactive, section-by-section storyline construction. Polishes user input, never invents content. Also supports reverse extraction from paper.md. |
Phase 2 — Literature
| Skill | Trigger | Purpose |
|---|---|---|
relatedwork-finder |
"find related work" | Searches Google Scholar (via serper_google_search_scholar) and arXiv, caches metadata, manages BibTeX, downloads PDFs, and generates per-paper summaries using multimodal subagents (strictly sequential, one paper at a time). |
Phase 3 — Discussion
| Skill | Trigger | Purpose |
|---|---|---|
socratic-discussion |
"discuss my research", "苏格拉底讨论" | Structured Socratic questioning across 57 dimensions aligned with the 7 checker families. Helps stress-test insight, methods, and claims before writing. |
Phase 4 — Experiments
| Skill | Trigger | Purpose |
|---|---|---|
experiment-analyzer |
"analyze experiments" | Analyzes experiment code, results, and protocols. Maps research questions to experimental evidence. |
Phase 5 — Writing
| Skill | Trigger | Purpose |
|---|---|---|
writing-orchestrator |
"write the paper", "开始写论文" | Scans paper.md completion status, recommends writing order, routes to fine mode (markdown-helper) or fast mode (mad-writer), auto-triggers 7-checker review after each section. |
markdown-helper |
"help me write paper.md" | Fine mode: drafts one paragraph at a time via subagent, requires user confirmation for each. Best for critical sections (insight, method core). |
mad-writer |
(invoked by orchestrator) | Fast mode: write-check-fix loop for bulk section drafting. Can use relatedwork-finder and bogus-data-helper. Best for descriptive or comparative sections. |
bogus-data-helper |
(invoked by mad-writer) | Generates placeholder tables/figures/metrics for evaluation sections. All numbers must be replaced with real experimental results. |
Phase 5 — Quality Assurance (7 Checkers)
| Skill | What it checks |
|---|---|
problem-checker |
Problem definition clarity, importance, and evidence |
novelty-checker |
Insight novelty vs. existing literature |
technical-depth-checker |
Design depth, non-trivial challenges, and solutions |
logic-checker |
Claim-evidence consistency, contradictions, argumentation |
clarity-checker |
Undefined terms, unclear descriptions, readability |
evaluation-protocol-checker |
Research questions, evaluation design, threats to validity |
data-checker |
Placeholder/bogus data detection, reproduction script linkage |
Phase 5 — Review & Revision
| Skill | Trigger | Purpose |
|---|---|---|
markdown-review |
(auto-triggered by orchestrator) | Runs all 7 checkers on paper.md and persists results to .agents/state.json. |
review-revise |
"review and revise", "审稿修改" | Multi-round Review-Revise loop driven by checker output. Processes issues by severity (Critical → Major → Minor), one at a time, with user confirmation. Max 5 rounds. |
human-comment-helper |
(manual) | Helps add structured human reviewer comments to the draft, distinguishing real feedback from AI-generated examples. |
Phase 6 — LaTeX & Submission
| Skill | Trigger | Purpose |
|---|---|---|
markdown2latex |
"convert to latex" | Converts paper.md to conference-ready LaTeX. Supports user-provided templates in templates/. |
latex2markdown |
(manual) | Imports existing LaTeX papers into paper.md structure. |
submission-precheck |
"submission precheck", "投稿前检查" | 7-point pre-submission check: format, citations, figures, word count, completeness, data authenticity, quality. Generates .agents/precheck_report.md. |
Workflow Management
| Skill | Trigger | Purpose |
|---|---|---|
copaper-manage |
"manage this paper with copaper cli" | Teaches agents how to use the copaper CLI for project lifecycle management. |
RECOMMENDED WORKFLOW
Step-by-step guide for writing a paper
Standard Forward Path
- Initialize:
copaper init --name "Paper Title" --domain "research area" - Storyline (trigger: "help me write storyline"): Fill in
storyline.mdsection by section. Define problem, importance, insight, design, evaluation plan. - Literature (trigger: "find related work"): Search, download, summarize related papers. Build cross-index.
- Discussion (trigger: "discuss my research"): Socratic questioning to sharpen arguments before writing.
- Experiments (trigger: "analyze experiments" or
copaper skip experiments --reason "..."): Run experiments or skip if theoretical. - Writing (trigger: "write the paper"): Use orchestrator to draft
paper.mdsection by section. Each section gets 7-checker review. - Review-Revise (trigger: "review and revise"): Multi-round checker-driven revision until quality is satisfactory.
- Pre-submission (trigger: "submission precheck"): Final quality gate before export.
- LaTeX (trigger: "convert to latex"): Export to conference-ready LaTeX.
Alternative Entry Points
- Already have a paper draft: Use
latex2markdownto import, thenstoryline-helperreverse extraction to backfillstoryline.md. - Already have storyline but no literature: Start at Phase 2 directly.
- Want to iterate on a specific section: Use
markdown-helperdirectly on that section, then runmarkdown-review.
WHERE TO LOOK
Key files for common tasks
- Starting a new paper →
storyline.md(fill this first) - Writing paper content →
paper.md(the main document) - Understanding writing rules →
writingrules.md - Checking project progress →
copaper statusor.agents/state.json - Finding related work metadata →
relatedwork/literature.json - Reading paper summaries →
relatedwork/papers/*.md - Checking quality issues →
.agents/state.json→checkersfield - Finding technical concept coverage →
.agents/cross_index.json - Reviewing operation history →
copaper logor.agents/events.jsonl - CLI automation guidance →
.agents/skills/copaper-manage/SKILL.md
CONVENTIONS
Writing and CLI rules
Writing Rules (from writingrules.md)
- Level 1-5 headings (
#to#####) are structural only — never write body text under them. - Level 6 (
######) is the only level for paragraph content. - Level 6 title = topic sentence, max 50 characters.
- Paragraph body = supporting sentences, max 500 characters.
- Metadata uses HTML comments:
<!-- description: ... -->. - Inline math:
$...$. Block math:$$...$$. - Images: JPG/PNG/GIF in
fig/, max 5MB. - Nodes ending in numbers (e.g., "Challenge 1") can be duplicated by incrementing the number.
CLI Rules
--rootis a global option and must appear before the subcommand:copaper --root <dir> status, notcopaper status --root <dir>.- Use full phase names:
storyline,literature,discussion,experiments,writing,latex_review. - Prefer the CLI over hand-editing
.agents/state.jsonor.agents/events.jsonl.
Content Rules
- AI polishes expression and checks logic; it does not invent research content.
- Every claim in
paper.mdshould trace back tostoryline.mdor experimental evidence. - Literature summaries must be generated by multimodal subagents reading the actual PDF, not fabricated.
- Paper summaries in
relatedwork-findermust be processed one at a time, never in parallel.
ANTI-PATTERNS
Common mistakes to avoid
- Do not modify Level 2-5 headings in
paper.md— they define the structural framework. - Do not write body text directly under Level 1-5 headings — use Level 6 for all content.
- Do not rely on AI to generate meaningful research content — use it for optimization and checking only.
- Do not skip the 7-checker review after completing a section — it is mandatory.
- Do not auto-apply revisions without user confirmation — every change needs explicit approval.
- Do not fabricate checker results — always read from
.agents/state.json. - Do not fabricate literature summaries — always use multimodal subagents reading actual PDFs.
- Do not parallelize paper summaries — process one paper at a time to avoid errors.
- Do not use
.github/skills/(incorrect legacy path) — the correct path is.agents/skills/. - Do not place
--rootafter subcommands — it must come before. - Do not use stage letters (
A,B,D) — use full phase names (storyline,experiments). - Do not assume
commit,rollback, ordiffwork outside a Git repository.
COMMANDS
CLI commands for paper workflow management
copaper init --name "<project>" --domain "<domain>": Initialize project, scaffold skills and starter files.copaper status [--json]: View phase statuses and current phase.copaper set-phase <phase> --status <status> [--reason <reason>]: Explicitly set a phase status (not_started,in_progress,complete,skipped).copaper skip <phase> --reason "<reason>": Skip a phase.copaper log [--phase ...] [--operator ...] [--last N] [--since YYYY-MM-DD]: Query operation history.copaper report [--since YYYY-MM-DD] [--output file]: Generate progress report.copaper commit -m "<message>" [--phase <phase>]: Create a phase-aware Git commit.copaper rollback <phase> [-y]: Rollback to the latest commit of a phase.copaper diff <phase-a> <phase-b>: Compare two phase snapshots.copaper relatedwork status [--json]: View literature metadata catalog status.copaper relatedwork import --input <json>: Import search results into canonical catalog.copaper relatedwork sync-bib: Synchronizeliterature.jsonandpaper_list.bibbidirectionally.copaper relatedwork download [--paper-id ...] [--retry-failed]: Download PDFs with validation.copaper relatedwork register-summary --paper-id <id> --summary-path <path>: Register a completed paper summary.copaper relatedwork build-index: Rebuild.agents/cross_index.jsonfrom paper summaries.
NOTES
Additional information
copaper initis non-destructive: it will not overwrite existingstoryline.md,paper.md,writingrules.md,AGENTS.md, or already-present skill directories.current_phaseis automatically derived from actual phase statuses — it is not a static value.relatedwork/literature.jsonis the canonical metadata store;.agents/state.jsononly keeps aggregate counters (papers_found,papers_downloaded,download_failures,summaries_done).reportworks without Git but will note the missing repository.commit,rollback, anddiffrequire Git.- The 7 checkers are:
problem-checker,novelty-checker,technical-depth-checker,logic-checker,clarity-checker,evaluation-protocol-checker,data-checker. - Writing modes: Fine mode (
markdown-helper) for precision, Fast mode (mad-writer) for throughput. Thewriting-orchestratorhelps choose. - Socratic discussion covers 57 dimensions across the 7 checker families, with 5 question types: Clarification, Assumption, Evidence, Alternative, Implication.
- Review-Revise has a 5-round safety cap and processes issues by severity: Critical → Major → Minor.