CommunityResearch & Data Analysisgithub.com

paper-structure-diagnosis

Six-dimension structural diagnosis skill for research manuscripts. Analyzes a complete manuscript for structural and logical issues (research question, chapter structure, argument chain, paragraph relationships, redundancy, conclusion boundaries), pinpoints problems to specific sections/paragraphs/sentences, provides actionable edit actions (move/merge/split/narrow), outputs a claim-evidence mapping table with traceable source quotes, and writes the final result to /app/output/result.json.

What is paper-structure-diagnosis?

This skill provides a rigorous, structured diagnostic framework for evaluating the structure and logic of a complete research manuscript. It operates on six dimensions: alignment of research questions with contributions, chapter structure and narrative flow, argument chain and evidence mapping, paragraph relationships, content redundancy, and conclusion boundary precision. The skill does not perform language polishing or invent defects; it only reports problems supported by verbatim evidence. It runs a set of Python scripts (skeleton, evidence, verify) within a 15-minute budget, first generating a skeleton result.json, then incrementally enriching it with evidence extraction, six-dimension diagnosis, actionable edit plans, and a self-verification report. The final output includes a structured diagnosis, a claim-evidence map with locators and quotes, version boundaries, and a clear list of limitations and pending human confirmations. It supports multiple input formats (PDF, Markdown, LaTeX) and handles missing data gracefully by degrading to partial results with explicit notes.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/xiaofengmu123/bohr-product-arena-skills/tree/HEAD/p4/writing-06/writing06r04

Installed? Explore more Research & Data Analysis skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Paper Structure and Logic Diagnosis

1. Role and When to Use

This Skill is used for: Given a (or partial) research manuscript and its factual materials, produce a verifiable structural diagnosis and actionable revision plan, not a language-polished version. The core deliverable answers four questions:

  • Accurate Diagnosis: Locate problems to specific sections, paragraphs, or even sentences, and categorize the type of structural issue.
  • Actionable Fixes: Provide executable edit actions—move to where, merge with which paragraph, split from where, which statement needs narrowing—rather than a rewritten draft.
  • Coherent Chain: Verify whether the research question—method—results—conclusion form a closed loop, and whether every claim has corresponding evidence.
  • Clear Justification: Each judgment points back to the original text position and verbatim basis, allowing the author to decide to accept/partially accept/reject.

Applicable: Structural diagnosis of a complete manuscript, argument chain verification, conclusion boundary checking, cross-chapter redundancy identification, revision plan delivery. Not Applicable: Language polishing, filling gaps that require new experiments or data (in such cases, honestly report the gap, do not fabricate).

The breakthrough of this Skill is "claim-evidence mapping + six-dimensional structural diagnosis": first extract claims and establish evidence source mappings (coherent chain), then classify problems according to the six dimensions and give edit actions (accurate diagnosis, actionable fixes), each judgment with locator + verbatim quote (clear justification). The boundary with language polishing tools is: this Skill only diagnoses structure and logic, does not rewrite style; when evidence is lacking, it does not fabricate defects.

2. Input Contract (Runtime)

  • Raw Input: /input/case.json (case metadata, task description, material list, possible output_contract) and /input/task.md.
  • Material Files: Manuscript PDF, Markdown/LaTeX, images, tables, statistical output, references provided under /input/ according to the list; PDFs may have no pre-parsed layers, file content must be actually read, cannot guess based on file name or domain label.
  • Working Directory: /app/work (intermediate artifacts); final product directory: /app/output/.
  • Scripts are located at the root of this Skill directory scripts/: If the Harness starts from /app/work, first cd /skills/weekly-skill then call with relative paths.
  • Environment variables can override default paths: CASE_JSON, TASK_MD, INPUT_DIR, WORK_DIR, OUTPUT_DIR, RESULT_JSON, EVIDENCE_JSON, VERIFY_REPORT.

3. Output Contract

Must produce /app/output/result.json (UTF-8, valid JSON) with the following structure:

  • case_id: Taken from case.json's case_id, id, or armiId, preserved as-is.
  • All fields of the output_contract: Read key names from case.json's output_contract (if present) and fill back all keys as-is; missing values get null/[], do not rename or delete unknown keys. If no explicit output_contract is given, output according to the default contract (full JSON Schema in references/structure-taxonomy.md section 8):
    • diagnosis: Main structural diagnosis product (structured JSON, see section 6).
    • source_map: Fact and source mapping (array, each with claim_id, claim, locator, quote, confidence).
    • version_boundary: Revision diffs, human confirmation items, material gaps (object).
    • artifacts: Editable files and rendered preview paths (object).
  • status: One of complete / partial / failed.
  • sources: Array, each {claim_id, claim, locator, quote, confidence}; locator writes "file + section/paragraph/figure number", quote is verbatim snippet.
  • uncertainty: Array, each with insufficient material, conflict, unconfirmed item and reason.
  • pending_human: Array, each with judgments needing author confirmation.
  • limitations: Array, each with limitations of this method (e.g., unread images, truncated manuscript, no references).
  • change_log: Array, in chronological order {time, action, status}, must include at least the skeleton landing and each incremental modification.

result.json allows multiple incremental overwrite updates, each write maintaining JSON validity and complete fields. Editable products (Markdown) are written to /app/output/.

4. Execution Flow (Total Budget 900 seconds, 64 Model Requests)

Hard requirement: Within 3 minutes after start, the first version of result.json skeleton must be written (status=in_progress), then only incremental improvements; any failure must not result in no landing.

  • Step 0 (0–1 min): Read /input/case.json and /input/task.md, confirm case_id, genre, audience, format, output_contract. Run python scripts/skeleton.py to generate skeleton (status=in_progress, output_contract fields set to null values, first entry in change_log). Input: case.json/task.md; Output: /app/output/result.json skeleton.
  • Step 1 (1–5 min): Inventory materials. Run python scripts/evidence.py to generate /app/work/evidence.json, classify files and extract candidate chapter anchors, candidate values, units, statistics, and claim clues, mark files that cannot be directly read (images/OCR, oversize, truncated). Input: /input; Output: evidence.json and material manifest.
  • Step 2 (5–10 min): Extract claims and evidence mappings. Extract claims one by one from the manuscript body, annotate each with position and supporting evidence source; mark missing if no evidence found, circular/leap for circular or leaping reasoning. Cross-check candidate values and figures/tables. Incrementally write back result.json's source_map and sources. Input: evidence.json + manuscript; Output: result.json.source_map/sources.
  • Step 3 (10–12 min): Six-dimension diagnosis. Check each dimension according to the six-dimension framework in section 5, for each problem give issue_id, dimension, severity, location, problem_type, verbatim evidence, edit_action; if no problem is found in a dimension, write "No structural issue found" with its basis, do not fabricate defects. Incrementally write diagnosis.issues and dimension_coverage. Input: sources + manuscript; Output: result.json.diagnosis.
  • Step 4 (12–14 min): Write actionable revision plan and version boundary. For each issue, supplement edit_action (action_type + target_location + minimal change suggestion), fill pending_human, limitations, version_boundary, artifacts. Input: diagnosis; Output: main result.json product.
  • Step 5 (14–15 min): Self-check and finalize. Run python scripts/verify.py to validate contract and traceability, fix FAIL/WARN; set status to complete/partial/failed. Input: result.json; Output: /app/output/result.json final + /app/output/verify_report.json.

Remaining time incremental improvements: Prioritize supplementing source mappings, limitations, and pending items; do not overthrow already landed content. If a step lacks material, immediately downgrade (section 8), do not spin idle.

5. Six-Dimension Diagnostic Framework

Six dimensions (problem types and judgment details in references/structure-taxonomy.md):

  1. Research Question and Contribution Claim Alignment
  2. Chapter Structure and Narrative Order
  3. Argument Chain and Evidence Correspondence
  4. Paragraph Relationships
  5. Redundant Content
  6. Conclusion Boundary and Expression Scope

Each issue must include: issue_id, dimension, severity (critical/major/minor), location (section/paragraph/sentence), problem_type, problem_description, evidence (locator + verbatim quote), edit_action (action_type + target_location + instruction), confidence (high/medium/low), acceptance (accept/partial/reject, for author review).

Anti-fabrication Rule: Only report structural problems supported by verbatim evidence; if a dimension has no real problem, explicitly write "No structural issue found in this dimension" with basis; do not treat style preferences as structural errors; do not fabricate defects due to missing materials.

6. Diagnosis Main Product Structure

diagnosis is a structured JSON object:

  • summary: {manuscript_identity, overall_assessment, issue_counts{critical,major,minor}}
  • issues: Array, elements with issue fields as per section 5.
  • claim_evidence_map: Array, each {claim_id, claim, claim_location, evidence_refs, strength(sufficient/insufficient/missing/circular/leap), verdict}
  • dimension_coverage: Object, six dimensions each with {checked, status("Structural issue found"/"No structural issue found"/"Insufficient evidence"), note}
  • edit_plan: Actionable revision list sorted by priority.

Full JSON Schema in references/structure-taxonomy.md section 8.

7. Self-Checklist (Check Each Item, Corresponding to Scoring Dimensions)

Actual Effect (40 points):

  • Produce structural diagnosis and actionable revision plan for a complete manuscript, not a rewritten draft (task completion).
  • Each problem located to section/paragraph/sentence, consistent verbatim with original text, no fabricated defects, no missed real breaks, no style preference treated as structural error (correctness).
  • All six dimensions checked and conclusion recorded (problem/no problem/insufficient evidence); missing items honestly explained (completeness).
  • Each judgment and claim can be traced back to locator + verbatim quote (verifiability).

Usage Gain (25 points):

  • Materials and candidate anchors inventoried by script before diagnosis, not by memory (quality/efficiency).
  • Skeleton-first, incremental improvement, rework recorded in change_log (gain verifiable).

Innovation Gain (15 points):

  • Claim-evidence mapping table built item by item, missing/circular/leaping explicitly annotated (new capability).
  • Six-dimension problem classification + uniform actionable edit action types (move/merge/split/narrow/...) (method improvement).

Reliable Experience (10 points):

  • Trigger conditions clear, scripts runnable, relative paths valid (usability/stability).
  • Missing chapters, no references, missing figures/tables/formulas, messy formatting, truncated manuscript all marked and downgraded, not fabricated (error handling).

Ecosystem Contribution (10 points):

  • Description, dependencies (only Python standard library), configuration, scope, limitations complete (documentation completeness).
  • Six-dimension classification, checklist, claim-evidence mapping table reusable (reusability).

8. Degradation Strategy (No Fabrication for Missing Data/Software)

  • Missing files/missing software (no OCR, no renderer, no pdftotext): Honestly mark in limitations and uncertainty as "not provided/unavailable", leave corresponding fields empty with explanation, set status to partial; never fake readings or software status.
  • Unclear figure readings, unknown units, uncertain statistics: Do not guess, mark as pending (pending_human), use "[To be confirmed: xxx]" placeholder in text or use robust phrasing.
  • No references: Only write source mapping based on the manuscript's own claims, mark "no reference support".
  • Truncated manuscript / missing chapters: Record truncation position in limitations, only diagnose read parts, do not fabricate missing sections.
  • Insufficient evidence for a dimension: Mark coverage for that dimension as "insufficient evidence", do not write specific issues.
  • Runtime failure or timeout: Retain already landed partial result.json (including status, sources, uncertainty, change_log), explain failure reason.

9. Script Calls (Only Python Standard Library)

  • python scripts/skeleton.py: Generate skeleton result.json (early landing).
  • python scripts/evidence.py: Inventory materials and extract candidate anchors/values → /app/work/evidence.json.
  • python scripts/verify.py: Validate result.json contract and traceability → /app/output/verify_report.json.
  • python scripts/selftest.py: Self-test with empty input / bad JSON, verify scripts are runnable.

Prohibited from using scripts or other means to fake evaluation scores or running results.

10. Minimal Invocation Example (Illustrative, Not Official Case Result)

Input: /input/case.json (with case_id), /input/task.md, /input/paper.md (example manuscript).

cd /skills/weekly-skill
python scripts/skeleton.py      # Land skeleton of /app/output/result.json
python scripts/evidence.py      # Generate /app/work/evidence.json
# (Agent writes diagnostic content incrementally according to section 4 steps 2–4)
python scripts/verify.py        # Generate /app/output/verify_report.json

Illustrative output snippet (only interface shape, does not pretend to be an official case result):

{
  "case_id": "example-case-000",
  "status": "partial",
  "diagnosis": {
    "summary": {"manuscript_identity": "Example manuscript", "overall_assessment": null, "issue_counts": {"critical": 0, "major": 1, "minor": 0}},
    "issues": [
      {"issue_id": "I01", "dimension": "Argument chain and evidence correspondence", "severity": "major",
       "location": {"section": "3. Results", "paragraph": "Paragraph 2", "sentence_quote": "The conclusion is X."},
       "problem_type": "Argument gap", "problem_description": "This claim does not provide supporting evidence.",
       "evidence": {"locator": "paper.md#3-Results-Paragraph2", "quote": "The conclusion is X."},
       "edit_action": {"action_type": "narrow", "target_location": "paper.md#3-Results-Paragraph2",
                        "instruction": "Narrow this sentence to 'Under the present experimental conditions, X shows a trend (p=0.07).'", "suggested_revision": null},
       "confidence": "high", "acceptance": "accept"}
    ],
    "claim_evidence_map": [],
    "dimension_coverage": {"Argument chain and evidence correspondence": {"checked": true, "status": "Structural issue found", "note": "See I01"}},
    "edit_plan": [{"priority": 1, "issue_id": "I01", "action": "Narrow conclusion statement"}]
  },
  "source_map": [{"claim_id": "C01", "claim": "The conclusion is X.", "locator": "paper.md#3-Results-Paragraph2", "quote": "The conclusion is X.", "confidence": "high"}],
  "version_boundary": {"diffs": [], "human_confirm": [], "material_gaps": []},
  "artifacts": {"diagnosis_md": null, "preview": null},
  "sources": [{"claim_id": "C01", "claim": "The conclusion is X.", "locator": "paper.md#3-Results-Paragraph2", "quote": "The conclusion is X.", "confidence": "high"}],
  "uncertainty": [{"item": "All other dimensions of the manuscript", "reason": "Example input contains only a single paragraph", "status": "pending"}],
  "pending_human": [],
  "limitations": [{"scope": "Example", "detail": "Illustrative output, not an official case result"}],
  "change_log": [{"time": "2026-01-01T00:00:00+08:00", "action": "skeleton", "status": "in_progress"}]
}

Related Skills