Created academic_papers.py with 12 established academic paper types:
RESEARCH PAPERS:
1. Empirical Paper - experiments, data collection
2. Theoretical Paper - concepts, models, proofs
3. Methodology Paper - new methods/techniques
4. Case Study Paper - in-depth single case
5. Survey Paper - comprehensive field overview
ARGUMENTATIVE:
6. Position Paper - argue for a stance
7. Policy Brief - recommendations to decision-makers
CRITICAL ANALYSIS:
8. Critical Review - evaluate existing work
9. Meta-Analysis - statistical synthesis
SHORT FORMS:
10. Short Communication - brief findings report
11. Conference Proposal - conference abstract
12. Thesis Proposal - graduate research proposal
Each includes:
- Detailed stages
- Prompt templates
- Tone guidance
- Typical length
- Audience
Functions:
- get_academic_paper_types()
- suggest_academic_paper()
Created research_integration.py to connect research agent to pipeline:
ResearchIntegrator class:
- research_for_book(): Research for entire book
- research_chapter(): Research specific chapter
- should_use_research(): Determine if purpose needs research
- get_research_stages(): When to integrate research
Research stages:
- Pre-writing: Gather research before writing
- Per-chapter: Research each chapter
- Verification: Check facts post-writing
- Enhancement: Strengthen content with research
Purpose-specific research config:
- UNDERSTAND: Deep research, include academic
- DECIDE: Deep, studies, data, comparisons
- TRANSFORM: Case studies, success stories
- LEARN_HANDS_ON: Best practices, methods
- REFERENCE: Comprehensive documentation
- BE_INSPIRED: Stories, journeys, examples
Functions:
- get_research_config_for_purpose()
The research agent is now integrated into the nonfiction pipeline.
- Created opus_orchestrator/nonfiction/classifier.py
- PurposeClassifier class with keyword-based classification
- LLM-enhanced classification (optional)
- ReaderPurpose enum (6 purposes)
- ClassificationResult dataclass
- Keyword classification covers:
- LEARN_HANDS_ON: how to, learn to, tutorial, skills, etc.
- UNDERSTAND: understand, why, concept, mental model, etc.
- TRANSFORM: change, become, improve, habits, etc.
- DECIDE: decide, choose, compare, vs, analysis
- REFERENCE: manual, handbook, comprehensive, API
- BE_INSPIRED: inspire, story, journey, biography
- Tests pass for all 6 purposes with high confidence
This is the foundation for the entire nonfiction pipeline (Issue #18).