science_blog_fun

Skill: Scientific AI Super-Agent

Purpose

Given a scientific hypothesis (or research question), this skill orchestrates a complete research pipeline:

  1. Hypothesis clarification and decomposition
  2. Literature search and review
  3. Rapid Python prototyping and experimentation
  4. Results extraction and verification
  5. Full paper writing in LaTeX
  6. Reference compilation into a BibTeX file
  7. Compile verification and author review flags

The final outputs are paper.tex and references.bib, both compile-ready under pdflatex or xelatex with the natbib package.


Stage 0: Hypothesis Intake

Before any work begins, parse the user’s input to extract:

If the hypothesis is ambiguous or compound, decompose it into sub-questions and confirm with the user before proceeding.

Placeholder if hypothesis is underspecified: [HYPOTHESIS NEEDS CLARIFICATION]


Stage 1: Literature Review Agent

1.1 Search Strategy

Use web search and, where available, connected academic databases (e.g., via MCP connectors for Google Scholar, Semantic Scholar, arXiv, PubMed) to retrieve relevant papers. Execute the following searches:

Collect at minimum 10 relevant papers. For each paper, extract:

1.2 Reference Classification

Classify every retrieved reference as:

1.3 Gap Analysis

After reviewing the literature, produce a structured gap analysis:

This gap analysis feeds directly into the Introduction and Related Work sections of the paper.

1.4 Hallucination Prevention for References

Never fabricate a citation. If a paper cannot be verified through search, mark it [VERIFY] in the BibTeX file and note it in the author review flags. Do not reconstruct bibliographic details from memory.


Stage 2: Ideation and Experimental Design Agent

2.1 Hypothesis Decomposition

Break the hypothesis into testable sub-claims. For each sub-claim:

2.2 Experimental Plan

Produce a concise experimental plan covering:

Flag any experiment that requires resources not available in the current environment with [RESOURCE NEEDED: ...].


Stage 3: Python Prototyping Agent

3.1 Code Requirements

Write clean, self-contained Python code that implements the experimental plan. The code must:

3.2 Code Style

3.3 Output Artefacts

The prototype must produce at minimum:

3.4 Error Handling

If the code cannot run due to missing data or compute, do not silently generate fake results. Instead:


Stage 4: Results Verification Agent

4.1 Sanity Checks

Before writing the Results section, verify:

4.2 Statistical Validity

Where applicable, check:

4.3 Reproducibility Check

Confirm that the code, with the fixed random seed, produces the same results on re-run. If stochastic variance is high, report the mean and standard deviation over multiple runs.

4.4 Discrepancy Handling

If any result does not pass a sanity check:


Stage 5: Paper Writing Agent

5.1 Output Files

Produce exactly two files:

Both files must be compile-ready. The command pdflatex paper.tex followed by bibtex paper followed by two more pdflatex paper.tex runs must complete without fatal errors.

5.2 Document Class and Packages

Use the following default preamble unless the user specifies a journal class:

\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{hyperref}
\usepackage[round]{natbib}
\bibliographystyle{plainnat}

If the user specifies a journal (e.g., NeurIPS, ICML, Nature, PLOS ONE), switch to that class and adjust citation style accordingly. Common overrides:

Venue Class Citation style
NeurIPS neurips_2024 \citep{}
ICML icml2024 \citep{}
Nature family article + unsrtnat numbered
PLOS ONE article + plos2015 numbered
IEEE IEEEtran \cite{}

5.3 Manuscript Structure (Default: IMRaD)

  1. Title — informative and specific; include the key method or finding.
  2. Authors — use [AUTHOR NAME] if not provided.
  3. Abstract — 150 to 250 words; state the problem, method, key result, and implication. No citations in the abstract.
  4. Introduction — motivate the problem, state the hypothesis, summarise contributions, and outline the paper structure.
  5. Related Work — synthesise the literature review from Stage 1; group by theme, not by paper. Cite using \citet{} or \citep{}.
  6. Methods — describe the experimental design from Stage 2 and the implementation from Stage 3. Enough detail for reproducibility.
  7. Results — report findings from Stage 3 and verified in Stage 4. Use tables and figures produced by the prototype. Reference them with \ref{}. Do not interpret here; only report.
  8. Discussion — interpret results, connect back to the hypothesis, discuss limitations, and suggest future work.
  9. Conclusion — restate the hypothesis, summarise what was shown, and state the main implication. No new content.
  10. Acknowledgements — use [ACKNOWLEDGEMENTS] placeholder if not provided.
  11. References — generated by BibTeX; do not write manually.
  12. Appendices — include full code listings and supplementary figures if the paper is long-form.

5.4 Writing Rules

5.5 Figures and Tables


Stage 6: Reference Compilation Agent

6.1 BibTeX File Rules

6.2 Required BibTeX Fields by Entry Type

Type Required fields
@article author, title, journal, year, volume, pages, doi
@inproceedings author, title, booktitle, year, pages
@book author or editor, title, publisher, year
@misc author, title, year, howpublished or url, note

6.3 Citation Consistency Check

Before finalising:


Stage 7: Compile Verification

7.1 Compile Sequence

Run the following sequence and confirm no fatal errors:

pdflatex paper.tex
bibtex paper
pdflatex paper.tex
pdflatex paper.tex

7.2 Common Errors to Resolve Before Delivery

7.3 If Compilation Cannot Be Run

If the bash environment is unavailable, perform a manual syntax check:

Flag any unresolved potential compile errors in the author review section.


Stage 8: Author Review Flags

Append a clearly marked section at the end of paper.tex as a LaTeX comment block (not typeset in the PDF):

%% ============================================================
%% FLAGS FOR AUTHOR REVIEW — REMOVE BEFORE SUBMISSION
%% ============================================================

This block must list:

  1. Every [CITATION NEEDED] with its location and the claim requiring support.
  2. Every [VERIFY] BibTeX entry with known and missing fields.
  3. Every [DATA NEEDED] placeholder with the result that was not generated.
  4. Every [CLARIFY: ...] note with the ambiguity.
  5. Every [RESOURCE NEEDED] item from Stage 3.
  6. Any structural assumption made during drafting.
  7. A compile-readiness summary: “Compiles cleanly” or list of unresolved errors.

Hallucination Prevention (Global Rule)

This rule applies to every stage of the pipeline without exception.


Placeholders Reference

Placeholder Use case
[HYPOTHESIS NEEDS CLARIFICATION] Input hypothesis is ambiguous
[AUTHOR NAME] Author name not provided
[YEAR] Publication year unknown
[JOURNAL NAME] Journal or venue unknown
[VOLUME/PAGES] Bibliographic detail missing
[DOI] DOI not retrieved
[CITATION NEEDED] Claim needs a reference not found
[DATA NEEDED] Result requires code execution
[RESOURCE NEEDED: ...] Experiment requires unavailable resource
[VERIFY RESULT: ...] Numeric result failed a sanity check
[CLARIFY: ...] Ambiguous passage for author to resolve
[ACKNOWLEDGEMENTS] Acknowledgements not provided
[UNKNOWN] BibTeX field cannot be determined

Deliverables Checklist

Before closing the pipeline, verify every item:

Manuscript

Code

References

Compilation

Author review


Quick-Start Invocation

When a user provides a hypothesis, begin with:

  1. Restate the hypothesis in one sentence to confirm understanding.
  2. State the domain and paper format you will target.
  3. List the stages you are about to execute.
  4. Ask for any missing critical information (data source, compute constraints, target venue) before starting Stage 1.

If the user says “just go”, proceed with best-guess assumptions and flag them in the author review section.