Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Enterprise-grade research with multi-source synthesis, citation tracking, and verification. 8-phase pipeline with auto-continuation.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
reference/report-assembly.md
1# Report Assembly: Progressive File Generation23## Length Requirements by Mode45| Mode | Target Words | Description |6|------|--------------|-------------|7| Quick | 2,000-4,000 | Baseline quality threshold |8| Standard | 4,000-8,000 | Comprehensive analysis |9| Deep | 8,000-15,000 | Thorough investigation |10| UltraDeep | 15,000-20,000+ | Maximum rigor (at output limit) |1112---1314## Output Token Safeguard1516**Claude Code default limit:** 32,000 output tokens (~24,000 words total per execution)1718**Practical limits:**19- Target <=20,000 words total output20- Leave safety margin for tool call overhead21- Reports >20,000 words require auto-continuation (see continuation.md)2223---2425## Progressive Section Generation2627**Core Strategy:** Generate and write each section individually using Write/Edit tools. This allows unlimited report length while keeping each generation manageable.2829### Phase 8.1: Setup3031```bash32# Create folder: ~/Documents/[TopicName]_Research_[YYYYMMDD]/33mkdir -p ~/Documents/[folder_name]3435# Initialize markdown file with frontmatter36# Path: [folder]/research_report_[YYYYMMDD]_[slug].md37```3839### Phase 8.2: Section Generation Loop4041**Pattern:** Generate section -> Write/Edit to file -> Move to next section42Each Write/Edit call contains ONE section (<=2,000 words per call)4344**Initialize research run (persist to disk):**45```bash46# Create run manifest and artifact files using citation_manager CLI47python scripts/citation_manager.py init-run --out-dir [folder] --query "[question]" --mode [mode]48# Creates: run_manifest.json, sources.jsonl, evidence.jsonl, claims.jsonl49```5051**Register each source as you encounter it:**52```bash53python scripts/citation_manager.py register-source \54--json '{"raw_url": "...", "title": "...", "source_type": "academic", "year": "2024"}' \55--dir [folder]56# Returns stable source_id (sha256-based, survives renumbering and continuation)57```5859**Assign display numbers after all sources registered:**60```bash61python scripts/citation_manager.py assign-display-numbers --dir [folder]62# Maps stable source_ids to [1], [2], [3]... for rendering63```6465Source identity is stable across edits and continuation. Display numbers are derived at render time, never stored in state. This survives context compaction and enables continuation agents to pick up citation state via stable IDs.6667**Section sequence:**68691. **Executive Summary** (200-400 words)70- Tool: Write(file, frontmatter + Executive Summary)71- Track citations72- Progress: "Executive Summary complete"73742. **Introduction** (400-800 words)75- Tool: Edit(file, append Introduction)76- Track citations77- Progress: "Introduction complete"78793. **Finding 1-N** (600-2,000 words each)80- Tool: Edit(file, append Finding N)81- Track citations82- Progress: "Finding N complete"83844. **Synthesis & Insights**85- Novel insights beyond source statements86- Tool: Edit(append)87885. **Limitations & Caveats**89- Counterevidence, gaps, uncertainties90- Tool: Edit(append)91926. **Recommendations**93- Immediate actions, next steps, research needs94- Tool: Edit(append)95967. **Bibliography** (CRITICAL)97- EVERY citation from citations_used list98- NO ranges, NO placeholders, NO truncation99- Tool: Edit(append)1001018. **Methodology Appendix**102- Research process, verification approach103- Tool: Edit(append)104105---106107## File Organization108109**1. Create dedicated folder:**110- Location: `~/Documents/[TopicName]_Research_[YYYYMMDD]/`111- Clean topic name (remove special chars, use underscores)112113**2. File naming convention:**114All files use same base name:115- `research_report_20251104_topic_slug.md`116- `research_report_20251104_topic_slug.html`117- `research_report_20251104_topic_slug.pdf`118119**3. Also save copy to:** `~/.claude/research_output/` (internal tracking)120121---122123## Word Count Per Section124125**CRITICAL:** No single Edit call should exceed 2,000 words.126127Example: 10 findings x 1,500 words = 15,000 words total128- Each Edit call: 1,500 words (under limit)129- File grows to 15,000 words130- No single tool call exceeds limits131