ThesisAgent
AGENTS.md2 starsChanged 4 days agoMITView on GitHub
Cross-agent guide for ThesisAgents. Mirrored from CLAUDE.md, kept short so any agent (Codex CLI, Cursor, Aider, Windsurf, Cline, Continue, or a future tool) can pick up the must-know rules without parsing the full project guide. CLAUDE.md remains the canonical, deeper reference — this file links the rules an agent is most likely to mis-handle. Python 3.12+ CLI + MCP server that searches papers, downloads PDFs, and produces .pptx / .xlsx / .bib. Default flow: multi-source search → dedup → per-source…
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Jeffrey-Automations/ThesisAgentword for word, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 1
- Jeffrey-Automations/ThesisAgent★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
21 rules. About 0 are common, 5 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Read each PDF, hand-author a PaperSummary with rich-tier fields, drop a scripts/regen_<query>.py script, run it.
- Distinctive: line 33
No LLM, no key (CI / cron / unattended scripts)
- Very specific: line 43
Do NOT: treat the per-paper lightweight .pptx as the final deliverable when the user asked for slides.
- Very specific: line 46
Do NOT: stop after download_pdfs reports "N PDFs saved" — that's the start of the rich-authoring phase, not the end.
- Distinctive: line 55
Do NOT: leave irrelevant downloads in the run directory.
- Very specific: line 81
Read the PDF yourself. If your editor's Read tool can't handle the full file, dump plain text via the project's internal extractor — from …
- Very specific: line 90
Only include numbers / claims that appear verbatim in the paper.
- Very specific: line 94
Call the exporter — either through the MCP export tool (when a live MCP server is in play) or directly in Python by constructing a Paper …
- Very specific: line 107
Run the headless overflow check before handing the deck back — every non-footer / non-page_number shape must have top + height ≤ 7.05" on a …
- Very specific: line 121
Rule: When hand-authoring a Paper, copy url / doi / arxiv_id *verbatim from the search xlsx that produced this run*.
- Distinctive: line 123
Never write them from memory.
- Very specific: line 145
After the regen script finishes, audit by comparing each paper's url back to that column:
- Distinctive: line 207
Keep: the aggregate xlsx / bib — those are the honest record of what the search returned.
- Very specific: line 242
All fifteen sources sit in the default mix (used when --source is not given): arxiv, semantic_scholar, openalex, pubmed, ieee, acm …
- Very specific: line 274
No live network in tests: Every fetcher test uses recorded fixtures under tests/fixtures/<source>/.
- Very specific: line 278
HTTPS-only: All outbound HTTP goes through thesisagents/fetchers/http.py::get_client(source).
- Very specific: line 282
Per-paper PPT gate: When --query results trigger pptx generation, a paywall ratio above 30 percent prompts the user before any slides are …
- Very specific: line 290
MUST go through visible Chrome — the IEEE plugin's WebRunner backend, the Scholar plugin's WebRunner backend, or a Bash + Selenium script …
- Distinctive: line 311
Feature claims must match the code; implemented ≠ evaluated: Before a paper / deck claims「已支援 X」, find X's module + test in the actual repo …
- Very specific: line 319
Commits: Never add Co-Authored-By lines.
- Very specific: line 323
Definition of Done: Every change must pass py -m pytest tests/, py -m ruff check ., and py -m bandit -c pyproject.toml -r thesisagents/ …
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Cross-agent guide for ThesisAgents. Mirrored from CLAUDE.md, kept
short so any agent (Codex CLI, Cursor, Aider, Windsurf, Cline, Continue,
or a future tool) can pick up the must-know rules without parsing the
full project guide. CLAUDE.md remains the canonical, deeper reference
— this file links the rules an agent is most likely to mis-handle.
Project shape
Python 3.12+ CLI + MCP server that searches papers, downloads PDFs,
and produces .pptx / .xlsx / .bib. Default flow: multi-source
search → dedup → per-source rate-limited fetch → per-paper PPT only
when the PDF is downloadable. See CLAUDE.md for the full architecture,
fetcher plugin layout, and Definition of Done gates.
LLM-as-agent default path (CRITICAL — read before any search work)
Rich thesis-style PPT is the default deliverable. Lightweight is a fallback, never the goal when an LLM is in the loop.
Decision tree
- Does the user have
ANTHROPIC_API_KEYset?- YES → the CLI auto-enriches; just run it and you are done.
- Does an LLM agent (you) drive this session?
- YES — you are reading this, so the answer is always yes when
this rule applies — you produce the rich summary yourself.
Read each PDF, hand-author a
PaperSummarywith rich-tier fields, drop ascripts/regen_<query>.pyscript, run it. The lightweight deck that the CLI just emitted is an intermediate artefact, not the deliverable.
- YES — you are reading this, so the answer is always yes when
this rule applies — you produce the rich summary yourself.
Read each PDF, hand-author a
- No LLM, no key (CI / cron / unattended scripts)
- The lightweight deck is acceptable. Authors get an abstract-based summary; that's the limit without an LLM.
Anti-patterns (do NOT do these)
- Do NOT end a multi-paper search by saying "set
ANTHROPIC_API_KEYfor a rich deck" — you ARE the LLM that could write the summaries. Telling the user to acquire a separate API key is offloading your own job. The user invoked you precisely so they wouldn't have to. - Do NOT treat the per-paper lightweight
.pptxas the final deliverable when the user asked for slides. Lightweight is page 1 of your work, not the report. - Do NOT stop after
download_pdfsreports "N PDFs saved" — that's the start of the rich-authoring phase, not the end. - Do NOT invent numbers, RQs, contributions, or limitations not in the paper. Every figure must trace back to text in the PDF.
- Do NOT fabricate
url/doi/arxiv_idfrom memory when hand-authoring aPaper. Publisher URL paths cannot be guessed (AAAI uses numeric IDs not author slugs; IEEE usesarnumber; ACM uses opaque DOIs). Always copy these fields verbatim from the xlsx the same search produced — see "URL / DOI verification" below. - Do NOT leave irrelevant downloads in the run directory. The
search keyword often pulls in off-topic papers (e.g. "code review"
matched a paper on object detection literature review; "Claude code"
matched a Viterbi decoder paper). Once you classify a downloaded
paper as off-topic for the user's actual intent, delete its
pdfs/<key>.pdfand the lightweight<key>.pptxso the run dir cleanly reflects the deliverable. The aggregate xlsx / bib record the full search and stay as-is.
Worked example
scripts/regen_fang2026.py is the canonical hand-authored rich summary
built exactly this way — read the PDF, author the PaperSummary, export
through PptxExporter. Reuse it as the template, a multi-paper batch is
the same shape with a tuple of papers in PaperCollection.
Per-paper flow
- Get the PDF into the exports dir, one of two ways:
py -m thesisagents --paper <url-or-id> --out ./exports/<run>/to fetch metadata and download the PDF (./exports/<run>/pdfs/<key>.pdflands automatically); orpy -m thesisagents --pdf <local-path> --out ./exports/<run>/when the user supplied a PDF themselves — the file is copied into./exports/<run>/pdfs/and a stubPaper(withsource="local") is built. Use--title --authors --year --venue --doi --arxiv-idto override metadata when the filename / heuristic isn't right.
- Read the PDF yourself. If your editor's Read tool can't handle the
full file, dump plain text via the project's internal extractor —
from thesisagents.intelligence.pdf import _extract_text— then chunk the output. Do not re-implement PDF extraction. - Hand-author a
PaperSummarypopulated with the rich-tier fields (pain_points,research_question,contributions_detailed,headline_metrics,technique_table,method_sections,evaluation_sections,system_flow,research_questions,rq_results,core_observation,limitations,future_work). Only include numbers / claims that appear verbatim in the paper. Setmodel="<your model id> (LLM-as-agent, read N-page PDF)"andraw_text_charsto the extracted length so provenance is visible on the deck. - Call the exporter — either through the MCP
exporttool (when a live MCP server is in play) or directly in Python by constructing aPaperwithsummary=…, wrapping it in aPaperCollection, and passing it toexport_collection(...). Save the script underscripts/regen_<authoryear>_<slug>.pyso the regen is reproducible. - Canonical filename, no
-richsuffix. Setfilename_stem=paper.bibtex_key()so the rich deck overwrites the CLI's lightweight emit at the same path. One.pptxper paper, the rich one. Do NOT keep both — the lightweight is not a deliverable. (Language variants are the only exception: a zh-tw companion usesf"{key}-zh-tw", but no en deck ever uses-rich.) - Cap
contributions_detailedat ≤ 4 entries. The contributions slide's stack layout overshoots the 7.05" footer guard above that. - Run the headless overflow check before handing the deck back — every
non-
footer/ non-page_numbershape must havetop + height ≤ 7.05"on a 16:9 widescreen slide.
Working template: scripts/regen_fang2026.py (single paper, rich-tier,
zh-tw, dark mode — every rich field populated). A batch follows the same
shape with a tuple of papers in PaperCollection.
URL / DOI verification (mandatory)
Publisher URL paths cannot be guessed — AAAI uses numeric article IDs
(v40i5.37389, not view/fang2026); IEEE uses arnumber; ACM uses
opaque DOIs. Fabricated identifiers ship broken links to the user.
Rule: When hand-authoring a Paper, copy url / doi /
arxiv_id verbatim from the search xlsx that produced this run.
Never write them from memory; never construct them from the title.
Concrete workflow:
# After running the search the user requested:
# py -m thesisagents --query "..." --out ./exports/<run>/
# the aggregate xlsx sits at exports/<run>/<slug>-<timestamp>.xlsx
# with columns: # | Title | Authors | Year | Source | Indexed via |
# DOI | URL | PDF | Citations | Abstract
#
# For each paper you author a PaperSummary for, copy:
# - column 7 (DOI) → Paper.doi
# - column 8 (URL) → Paper.url
# - extract the arxiv ID from column 8 if it points at arxiv.org
#
# Strip any "v1" / "v2" version suffix from arxiv URLs:
# "https://arxiv.org/abs/2506.09580v1" → arxiv_id "2506.09580"
#
# If a column is empty, leave the field as None — do NOT fabricate.After the regen script finishes, audit by comparing each paper's url
back to that column:
.venv/Scripts/python.exe -X utf8 -c "
from openpyxl import load_workbook
import sys; sys.path.insert(0, '.'); sys.path.insert(0, 'scripts')
from scripts.regen_<run> import ALL_PAPERS
wb = load_workbook('exports/<run>/<slug>-<ts>.xlsx')
real = {sh.cell(row=r, column=2).value: sh.cell(row=r, column=8).value
for sh in [wb['Papers']]
for r in range(2, sh.max_row + 1)}
for p in ALL_PAPERS:
actual = next((u for t, u in real.items() if p.title[:30] in (t or '')), None)
if actual and not (p.url == actual or p.url.split('v')[0] == actual.split('v')[0]):
print(f'! {p.bibtex_key():<30s} authored {p.url} vs real {actual}')
"Any ! line means a fabricated URL — fix it before handing the deck
to the user. An early batch regen script (since removed) had to be
rebuilt this way after two papers (Wen, Fang) were caught with
fabricated AAAI URLs that pointed nowhere.
The export also checks at run time. export_collection, the CLI,
the MCP export tool and the GUI Deck tab look up every DOI at doi.org
and request every URL once before writing anything. A DOI that is not
registered, a URL that answers 404, or an unreachable host stops the
export and names the paper and the identifier.
- Why: the audit above is a manual step, and it was skipped often enough that fabricated identifiers shipped.
- What it does not do: it proves an identifier exists, not that it belongs to this paper. A real DOI attached to the wrong paper passes. So the copy-verbatim rule and the audit above still apply.
- Example:
Paper(doi="10.1234/typo")fails withdoi 10.1234/typo is invalid (doi.org has no such DOI registered). - Anti-pattern: passing
--no-verify-identifiers/verify_identifiers=Falseto get past a failure. The opt-out is for a machine with no network. A failed identifier is fixed by copying the right value from the search xlsx.
Pruning irrelevant downloads (mandatory)
The search engine is keyword-based, so off-topic papers will slip in: a "Claude code" query returned a Viterbi decoder paper because both contain "code"; an "LLM code review" query returned a paper on object detection literature review. Once you read the abstracts and decide a paper is off-topic for the user's actual intent, prune the run dir:
from pathlib import Path
run = Path("exports/<run>")
irrelevant_keys = ("key-of-off-topic-paper-1", "key-of-off-topic-paper-2")
for key in irrelevant_keys:
for path in (run / "pdfs" / f"{key}.pdf", run / f"{key}.pptx"):
if path.exists():
path.unlink()Delete: exports/<run>/pdfs/<key>.pdf + exports/<run>/<key>.pptx.
Keep: the aggregate xlsx / bib — those are the honest record of what the search returned. Off-topic papers staying in the xlsx is fine; the user can see the full search outcome there.
Decision rule: a paper is off-topic when its actual research question doesn't match the user's intent. "Claude (Sonnet 4.6) across six languages" is off-topic for a "Claude Code code review" query (paper is about Claude the model's multilingual ability, not Claude Code the agentic tool). Borderline cases get a rich summary — better to over-include than to silently drop a possible match.
Start from the tool's recommendations, then read the abstracts. Run
the search with --diagnostics (CLI) or diagnostics=true (MCP
search). Each paper comes back with its score split into relevance,
recency and citations, the query terms that matched, and a keep /
review / prune recommendation naming the threshold that triggered
it. The CLI writes the same to exports/<run>/diagnostics.json, with
each paper's bibtex_key, the name its PDF and deck carry on disk.
- Why: the classification used to rest on the agent noticing an off-topic title among 25 results. The ranking already knew that a paper matched none of the query terms and threw that away.
- It is advice. Nothing is removed for you, and the rule is
lexical: a paper on the right topic that words it differently can be
marked
prune, and an off-topic paper that repeats the query words can be markedkeep. Read the abstract before deleting. - Example: for "LLM code review", an object-detection literature
review comes back
reviewwith "title matches 1 of 3 query terms (review)". Its abstract confirms it is off-topic, so it is pruned. - Anti-pattern: deleting every
prunepaper without opening one. The recommendation narrows where to look, it does not replace the judgement this section asks for.
Sources you can search
All fifteen sources sit in the default mix (used when --source is not
given): arxiv, semantic_scholar, openalex, pubmed, ieee, acm
(Crossref-scoped), dblp, crossref (unscoped), openaire, springer,
scholar, europepmc, doaj, hal, core — see
thesisagents.core.constants.DEFAULT_SOURCES.
Per-source gates (opt-out env vars and API keys):
ieee— default-on, search and document fetch go through visible Chrome via WebRunner (thesisagents/sources/ieee/webrunner_backend.py). See "IEEE / paywalled domains use WebRunner" below — this is a hard rule, not a perf hint. SetTHESISAGENTS_IEEE_API_KEYto switch to the official Xplore API path; setTHESISAGENTS_DISABLE_IEEE_SCRAPING=1to opt out entirely (CI / no-Chrome environments only).scholar— default-on, also goes through WebRunner (visible Chrome), not httpx, with aggressive ToS-respecting pacing. SetTHESISAGENTS_DISABLE_SCHOLAR_SCRAPING=1to opt out.springer— needsTHESISAGENTS_SPRINGER_API_KEY(free key from https://dev.springernature.com/). The plugin raisesConfigErrorwithout it, so the pipeline silently skips springer until the key is set.core— needsTHESISAGENTS_CORE_API_KEY(free key); silently skipped from the default mix without it, same pattern as springer.
The top-tier venue filter in thesisagents/core/top_venues.py (arXiv
passthrough plus a curated whitelist of CS conferences/journals and
multidisciplinary flagships — Nature, Science, PNAS, CACM, Lecture
Notes in CS, …) is off by default. Pass --top-tier-only to
enable it.
Other rules you will trip on
- No live network in tests. Every fetcher test uses recorded
fixtures under
tests/fixtures/<source>/. Re-recording is a separate manual step — save the upstream response into that directory and commit it; never let a test fetch live. - HTTPS-only. All outbound HTTP goes through
thesisagents/fetchers/http.py::get_client(source). The transport rejects non-HTTPS requests, including mid-flight redirects. Do not callhttpx.get/requests.getdirectly. - Per-paper PPT gate. When
--queryresults trigger pptx generation, a paywall ratio above 30 percent prompts the user before any slides are produced.--yesskips the prompt. Single-paper--papermode aborts with exit 1 if the PDF can't be retrieved. - IEEE / paywalled domains use WebRunner, not httpx. IEEE search,
IEEE document fetch, Google Scholar search, and any paywalled-PDF
download from publisher CDNs (ieeexplore.ieee.org, dl.acm.org,
link.springer.com, sciencedirect.com, wiley/oup/nature/science/…)
MUST go through visible Chrome — the IEEE plugin's WebRunner backend,
the Scholar plugin's WebRunner backend, or a Bash + Selenium script
(
thesisagents.fetchers.webrunner_browser.make_driver()) from the LLM-as-agent session. The httpx branch in those plugins is a CI safety net for environments without Chrome; on a user machine with VPN access, a silent fall-through to httpx is a bug, not an acceptable degradation. If you don't see a Chrome window open for an IEEE search, treat the result set as suspect. Full rule + audit checklist:.claude/agents/rules/compliance-auditor.md. - Slide-deck guards. 16:9 widescreen, body between 1.5" and 7.0",
FOOTER_GUARD = 7.05". Every textbox runs through_truncate(...)with the per-layout cap. Don't add slides that balance "stacks + tail callout" inside a fixed height — split onto their own slides. - Prose punctuation in paper / deck deliverables. Join clauses with
,/,; never use;/;or a 破折號 / em-dash (—,——,──,―) to break, insert, or join a clause — swap for,, or:to open an enumeration (English:,). CLI flags (--redact-secrets), HTML markers (<!-- … -->), en-dash ranges (1–5,[1]–[22]) and the minus sign (+a −b) are code / notation and stay. Full rule:CLAUDE.md"Prose punctuation in additions" +.claude/agents/rules/paper_rule.md"破折號 / em-dash banned as a clause break". - Feature claims must match the code; implemented ≠ evaluated. Before
a paper / deck claims「已支援 X」, find X's module + test in the actual
repo (manuscripts go stale in both directions — GitLab support had
shipped while the thesis §6.4.3 still called it future work), date
recent features from git log, and keep the honest boundary
(「已實作 + 單元測試,端到端效益未評估」) next to any feature list. Never
invent comparison numbers. Full rule:
CLAUDE.md+.claude/agents/tasks/thesis-deck-author.md"Conference / second-cut decks". - Commits. Never add
Co-Authored-Bylines. Never mention any AI tool / model name in commit messages, PR titles, PR descriptions, code comments, or docs. (SeeCLAUDE.md"Git Commits" for full detail.) - Definition of Done. Every change must pass
py -m pytest tests/,py -m ruff check ., andpy -m bandit -c pyproject.toml -r thesisagents/before it can be committed. New code requires new tests.
Stage commits, progress.md, docs/updates, architecture.md
Mirror of the CLAUDE.md section of the same name: commit at every stage (only the files that stage touched, never git add -A, no AI attribution; committing is not pushing); progress.md holds open items only; finished work goes to docs/updates/YYYY-MM.md with an index and query commands in docs/updates/README.md; architecture.md is the short architecture overview and is updated in the same commit as any structural change.
Where to look for the rest
- Slim overview + Git Commit hygiene + Browser-Automation hard rule:
CLAUDE.md(top-level, always loaded). - Code-quality / SOLID / linter / SonarQube rule list:
.claude/agents/rules/code-quality-reviewer.md. - Network safety, core-vs-source-plugin boundary, browser-automation
audit checklist, path-safety, suppression conventions, bandit-skip
config:
.claude/agents/rules/compliance-auditor.md. - pptx rendering tiers, truncation caps, semantic shape names, i18n,
enrichment dispatch:
.claude/agents/rules/slide-deck-rules.md. - Env vars + Python /
.venvtoolchain reference:.claude/agents/rules/env-vars.md. - DoD gate runner:
.claude/agents/tasks/dod-verify.md. - LLM-as-agent thesis-style authoring:
.claude/agents/tasks/paper-summary-author.mdtasks/post-author-audit.md+tasks/slide-overflow-check.md.
- Degree-thesis ORAL-DEFENCE deck from the candidate's own thesis (seven
paper_rulesections → rich deck via the existing exporter):.claude/agents/tasks/thesis-deck-author.md. - Per-source plugin contract and recorded fixtures:
thesisagents/sources/<name>/tests/fixtures/<name>/.
- General thesis evidence, academic writing, document versioning, reproducibility, and handoff principles:
.claude/agents/rules/thesis-authoring-lessons.md. - LLM-as-agent flow examples:
scripts/regen_*.py.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

