Skip to content
/ wtf-p Public

The academic meta-prompting framework for Claude Code. Features citation-aware drafting, hallucination checks, and rigorous structural planning. Built for PhDs and PIs who are tired of writer's block. Claude Code is powerful; WTF-P makes it tenured.

License

Notifications You must be signed in to change notification settings

akougkas/wtf-p

Repository files navigation

WTF-P

Write The Freaking...

  • Paper
  • Proposal
  • Presentation
  • Poster

Context engineering for academic writing with Claude Code.

npx wtf-p

What This Does

WTF-P turns Claude Code into a structured academic writing system. Instead of chatting with AI and hoping for the best, you get:

  • Spec-driven writing — Define your paper's vision, then execute section by section
  • Grounded output — BibTeX integration, citation mapping, no hallucinated references
  • State management — Pause, resume, track progress across sessions
  • Venue templates — ACM, IEEE, Nature, arXiv-ML structures built in

The philosophy: context engineering beats prompt engineering. The files you prepare matter more than what you type.


Quick Start

npx wtf-p

Then in Claude Code:

/wtfp:new-paper        # Define your paper
/wtfp:create-outline   # Build the structure
/wtfp:plan-section 1   # Plan first section
/wtfp:write-section    # Execute the plan

Run /wtfp:help for the full command reference.

Installation Options
# Global install (recommended)
npx wtf-p --global

# Local to current project
npx wtf-p --local

# Custom Claude config directory
npx wtf-p --global --config-dir ~/research/.claude

# Check installation status
npx wtf-p status

# Diagnose issues
npx wtf-p doctor
Upgrading
# Update existing installation
npx wtf-p update

# Or reinstall with conflict handling
npx wtf-p --global              # Interactive: prompts for conflicts
npx wtf-p --global --force      # Overwrite everything
npx wtf-p --global --backup-all # Backup before overwriting
Uninstalling
npx wtf-p-uninstall --global
npx wtf-p-uninstall --global --dry-run  # Preview first

Only WTF-P files are removed. Your CLAUDE.md and other configs stay intact.


Why AI Writing Tools Fail Researchers

Most researchers using AI for writing hit the same walls:

Problem What Happens
Dump and pray Paste a PDF, ask for a lit review, get hallucinated citations
No verification layer AI sounds confident, but claims aren't grounded in your actual sources
Monolithic approach Try to write 10k words at once, context window fills, quality degrades
No structure Generic AI doesn't know IMRaD from a blog post

WTF-P solves these by treating academic writing as a specification problem, not a generation problem.


The Approach: Context Engineering

The insight behind WTF-P: what you prepare matters more than what you prompt.

1. Specification First

Before any writing, WTF-P interviews you to extract:

  • Research questions and hypotheses
  • Core argument structure
  • Evidence and data inventory
  • Target venue requirements

This becomes your PROJECT.md — the grounding document that keeps every section aligned.

2. Hierarchical Planning

Papers aren't written in one shot. WTF-P breaks them down:

Paper Vision → Section Outline → Section Plan → Paragraph Execution

Each level has its own document. Each document is version-controlled. You always know where you are.

3. Isolated Execution

When writing a section, WTF-P spawns a fresh context with only what's needed:

  • The paper vision
  • That section's plan
  • Relevant citations from your BibTeX
  • Prior sections for continuity

No context pollution. No degradation over long documents.

4. Human Verification

AI drafts. Humans verify. Every section goes through:

  • Citation audit (are these real? are they relevant?)
  • Argument check (does this follow from the evidence?)
  • Rubric validation (does this meet venue requirements?)

The system flags issues. You fix them. Iterate until solid.


The Workflow

Starting Fresh

/wtfp:new-paper         # Deep interview about your research
/wtfp:create-outline    # Generate section structure + word budgets

Creates .planning/ with your paper's specification:

  • PROJECT.md — Vision, requirements, constraints
  • ROADMAP.md — Section breakdown with status
  • STATE.md — Writing progress and context

Writing Sections

/wtfp:plan-section 1    # Create detailed plan for section 1
/wtfp:write-section     # Execute the plan
/wtfp:progress          # Check status, get next action

Each section gets its own planning documents. Plans are explicit — you see exactly what Claude intends before it writes.

Review and Polish

/wtfp:review-section 1  # Three-layer verification
/wtfp:polish-prose      # Remove AI-speak, improve flow
/wtfp:check-refs        # BibTeX audit

Export

/wtfp:export-latex      # Generate .tex with proper formatting

Reviving Stalled Projects

Got a half-finished paper? WTF-P can work with existing material.

/wtfp:map-project       # Index your existing files
/wtfp:new-paper         # Initialize with awareness of prior work

The mapping phase analyzes:

  • Existing drafts and their state
  • Your BibTeX and how citations are used
  • Data files and figures
  • What's missing vs. what's done

Citation Expert (v0.4.0)

WTF-P includes a specialized tiered pipeline for bibliography management.

/wtfp:analyze-bib      # Deep analysis of impact (seminal vs rising)
/wtfp:research-gap     # Intent-aware search (seminal/recent)
/wtfp:check-refs       # Auto-suggest missing citations

Capabilities:

  • Tiered Search: Integrated Semantic Scholar, SerpAPI (Google Scholar), and CrossRef.
  • Impact Ranking: Automatically scores papers by citations, velocity, and venue prestige.
  • Deduplication: universal anchoring via DOI and Scholar Cluster IDs.
  • Provenance: Entries track their metadata source and verification status.

Command Reference

Setup

Command Purpose
/wtfp:new-paper Initialize paper with deep context gathering
/wtfp:create-outline Generate section structure
/wtfp:map-project Index existing project materials
/wtfp:analyze-bib Deep analysis of your bibliography

Planning

Command Purpose
/wtfp:discuss-section [N] Articulate vision before planning
/wtfp:plan-section [N] Create execution plan
/wtfp:list-assumptions [N] See what Claude plans to write
/wtfp:research-gap [N] Literature analysis for a section

Writing

Command Purpose
/wtfp:write-section Execute a plan
/wtfp:progress Status + intelligent next action
/wtfp:pause-writing Save state for later
/wtfp:resume-writing Restore context and continue

Review

Command Purpose
/wtfp:review-section [N] Three-layer verification
/wtfp:plan-revision [N] Create fix plan from issues
/wtfp:polish-prose Improve readability
/wtfp:check-refs Citation audit

Export

Command Purpose
/wtfp:export-latex Generate .tex output
/wtfp:submit-milestone Archive submission version

Contributing

Command Purpose
/wtfp:report-bug File a GitHub issue
/wtfp:request-feature Request new functionality
/wtfp:contribute Submit a pull request

Venue Templates

Template Structure
acm-cs Intro → Background → Approach → Evaluation → Related Work → Conclusion
ieee-cs Intro → Background → Design → Implementation → Evaluation → Conclusion
arxiv-ml Intro → Related Work → Preliminaries → Method → Experiments → Conclusion
nature Intro → Methods → Results → Discussion
thesis Flexible chapter structure

WCN Mode (Reduced Tokens)

For smaller models or limited context windows, WTF-P includes compressed workflows:

./tools/wcn/swap-workflows.sh wcn      # Switch to compressed
./tools/wcn/swap-workflows.sh verbose  # Switch back

35-50% token reduction with equivalent output quality. Verified on Claude Haiku and Sonnet.


Origin

WTF-P was built at the Gnosis Research Center at Illinois Tech.

The problem: research teams with grants to win, papers to publish, and no time to waste on writer's block. Existing AI tools either hallucinated citations or produced generic output that required complete rewrites.

The solution: treat Claude Code as a structured writing system, not a chatbot. Give it proper context, explicit specifications, and verification layers. Let humans focus on ideas while AI handles the mechanical synthesis.

The result: papers that ship.


Contributing

Found a bug? Want a feature? WTF-P includes commands to help:

/wtfp:report-bug        # Creates a GitHub issue
/wtfp:request-feature   # Submits a feature request
/wtfp:contribute        # Guides you through a PR

Or visit github.com/akougkas/wtf-p.


License

MIT License. Open source, open science.


Stop staring at the cursor. Start shipping papers.

About

The academic meta-prompting framework for Claude Code. Features citation-aware drafting, hallucination checks, and rigorous structural planning. Built for PhDs and PIs who are tired of writer's block. Claude Code is powerful; WTF-P makes it tenured.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published