Clean up stream-of-consciousness academic drafts — resolve citation gaps, reword copy-paste chunks, fill in TODO markers, and delegate sourcing tasks. Stage 1 of the writing pipeline; must run BEFORE any reviewer or prose-quality pass.
Purpose: Take the user's flow-state academic draft and do the grunt work they deferred while writing — the tedious citation lookups, the "need more info" placeholders, the copy-paste insertions that need rewording, and the organizational scaffolding that needs condensing.
This is Stage 1 of the pipeline. Do NOT attempt to improve prose quality, restructure arguments, or compress length. That's for later stages. Your only job is mechanical cleanup so the draft is ready for reviewers.
Input: $ARGUMENTS — path to the drafting markdown file.
Read the entire drafting document. Build a categorized issue list:
Patterns to find:
(need more info), (need to expand), (need to expand on this)(CITE), (cite), (citation needed), [?], [TODO], (TODO)(find this), (look up), (check this), (verify)(need exact quote), (get page number)Action: Search the project's notes infrastructure:
articles/split_*/notes.md — paper reading notesarticles/theory_notes_*.md — deep theory extractionsarticles/notes_*.md — web-sourced notesdocs/paper_skims.md — comprehensive paper summariesreplication_book/literature_sources.qmd — synthesized lit reviewarticles/literature_filter_report.md — tier assignments.bib file — existing bibliography keysFill in the gap with sourced content. If the needed information isn't in any project file, flag it for manual resolution (don't hallucinate citations).
Statements that reference specific papers without proper citation syntax. Action: Match to existing bib keys. If no key exists, flag for bib addition.
Chunks clearly verbatim from notes — identifiable by sudden tone shifts, embedded bullet lists, or encyclopedic density. Action: Reword to match the surrounding narrative voice. Preserve factual content.
Markdown headers or inline notes that are structural reminders, not content. Action: Replace with proper transitions or remove if obvious.
Work through issues in document order. For each fix:
<!-- SLOP-FIX: [description] --> comment@authorYYYYdescriptor Quarto syntaxWhen rewording copy-paste chunks, also strip documented AI giveaways in economics manuscripts (Feyzollahi & Rafizadeh 2025; Walther et al.):
Produce a delegation report for remaining issues:
[filename]_BACKUP_[date].md<!-- SLOP-FIX --> markersThis skill is the minimum viable cleanup so that everything downstream has clean input.