A multi-agent AI-assisted workflow for writing "Books and Blogs and just about anything else". It is a clone of the repo https://github.com/l0r3zz/SLOBlackSwan-Cursor with all the title related stuff taken out. So it can be used as a more generic implementation to be dropped into any other writing project. This project uses Cursor 2.0 to orchestrate multiple AI agents (Claude, Perplexity, OpenAI, Gemini) for research, drafting, critique, and technical validation, with semi-automated integration into Scrivener (optional).
Author: Geoff White
Project Type: Technical Book Writing
Status: Active Development
This README was written collaboratively by AI and human. The structure, technical details, and workflow descriptions were drafted by AI agents, then reviewed and refined by the author. Think of it as a living document that reflects both the efficiency of AI-assisted documentation and the judgment of human experience. If something doesn't make sense or feels off, that's probably the AI part -- feel free to open an issue or submit a PR.
The goal here isn't to hide the AI involvement, but to be transparent about it. After all, this entire project is about using AI to augment human capability, not replace it. The agents handle the tedious parts; humans handle the thinking.
This workspace implements a streamlined book writing process that:
- Reduces manual copy-paste work by 70%+
- Enables parallel agent execution for faster iteration
- Maintains Scrivener as the manuscript source of truth
- Provides consistent output formatting and organization
- Tracks costs and optimizes model selection
Expected ROI: Save 10-15 hours/month of tedious content transfer work.
SLOBlackSwan-Cursor/
├── agents/ # AI agent configurations (.mdc files)
│ ├── research-agent.mdc # Perplexity research specialist
│ ├── writing-agent.mdc # Claude drafting agent
│ ├── critique-agent.mdc # GPT-4 editorial reviewer
│ └── technical-agent.mdc # Gemini technical validator
├── outputs/ # Generated content (git-ignored)
│ ├── research/ # Research notes and findings
│ ├── drafts/ # Draft chapters and sections
│ ├── critiques/ # Editorial feedback
│ └── images/ # Visual assets
├── staging/ # Curated outputs for Scrivener
│ └── ready-for-scrivener/ # Organized by chapter
├── scripts/ # Python automation helpers
│ ├── organize_outputs.py # Organize outputs by chapter
│ ├── convert_to_rtf.py # Markdown to RTF conversion
│ ├── cost_tracker.py # API cost estimation
│ └── validate_mdc.py # Validate agent configs
├── .cursor/rules/ # Global agent behavior rules (.mdc format)
├── .env # API keys (git-ignored)
└── README.md # This file
- Cursor 2.0 (or later) with subscription
- Python 3.8+ for automation scripts
- Pandoc (for RTF conversion, optional)
- API Keys for:
- Anthropic (Claude)
- OpenAI (GPT-4)
- Perplexity
- Google AI (Gemini)
-
Clone or navigate to the workspace:
cd ~/Documents/SLOBlackSwan-Cursor
-
Configure API keys: Create
.envfile in workspace root:ANTHROPIC_API_KEY=sk-ant-xxxxx OPENAI_API_KEY=sk-xxxxx PERPLEXITY_API_KEY=pplx-xxxxx GOOGLE_AI_API_KEY=xxxxx
⚠️ Never commit.envto git. -
Set up Python environment (optional, for scripts):
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install pypandoc python-dotenv pathlib
-
Install Pandoc (for RTF conversion, optional):
- Mac:
brew install pandoc - Windows: Download from https://pandoc.org/installing.html
- Linux:
sudo apt install pandoc
- Mac:
-
Configure MCP in Cursor:
- Press
Cmd/Ctrl + Shift + P - Search for "Cursor Settings" → MCP
- Add MCP servers for API access (see
cursor-book-workflow-guide.mdfor details)
- Press
-
Open workspace in Cursor:
- File → Open Folder
- Select
SLOBlackSwan-Cursor
-
Research Phase:
- Open Agent in Cursor (
Cmd/Ctrl + L) - Select "Research Agent" from dropdown
- Provide research query:
Research recent black swan events in tech infrastructure from 2024-2025. Focus on incidents that were genuinely unprecedented. Find 3-5 examples with postmortems. Save output to outputs/research/research_black_swans_2024_25.md
- Open Agent in Cursor (
-
Drafting Phase:
- Switch to "Writing Agent"
- Provide writing prompt:
Using the research in outputs/research/research_black_swans_2024_25.md, draft a 1500-word section for Chapter 2 covering: - Brief intro to each incident - Why each qualifies as black swan - Lessons learned Match author's voice per .cursor/rules/. Save to outputs/drafts/draft_chapter2_black_swans_2024_v1.md
-
Review Phase:
- Use "Critique Agent" for editorial feedback
- Use "Technical Agent" for fact-checking
- Review outputs in Cursor
-
Staging for Scrivener:
python scripts/organize_outputs.py --chapter 2
-
Import to Scrivener:
- Review files in
staging/ready-for-scrivener/ - Drag markdown files into Scrivener project
- Scrivener automatically converts markdown
- Review files in
Run multiple agents simultaneously for faster iteration:
- Chat 1 - Writing Agent: Draft technical explanation
- Chat 2 - Technical Agent: Validate best practices (parallel)
- Chat 3 - Research Agent: Find real-world examples (parallel)
All agents work in parallel, then combine insights.
- Model: Perplexity
- Purpose: Web research, fact-finding, citation gathering
- Output: Structured research notes with sources
- Use for: Finding incidents, postmortems, industry reports
- Model: Claude Sonnet 4
- Purpose: Drafting book content matching author voice
- Output: Markdown drafts with proper formatting
- Use for: Initial drafts, revisions, code examples
- Model: GPT-4o
- Purpose: Editorial feedback on clarity, flow, impact
- Output: Structured critiques with specific suggestions
- Use for: Reviewing drafts before finalizing
- Model: Gemini 2.5 Pro
- Purpose: Technical fact-checking, accuracy validation
- Output: Validation reports with verified claims
- Use for: Ensuring technical accuracy, identifying gaps
Organizes generated content into staging area for Scrivener import.
# Organize all outputs
python scripts/organize_outputs.py
# Organize specific chapter
python scripts/organize_outputs.py --chapter 5
# Organize only research notes
python scripts/organize_outputs.py --research
# Organize only images
python scripts/organize_outputs.py --imagesOutput: Creates organized folders in staging/ready-for-scrivener/ with manifest.
Converts markdown files to RTF format for Scrivener (optional).
# Convert all markdown in staging
python scripts/convert_to_rtf.py
# Convert specific directory
python scripts/convert_to_rtf.py --input staging/ready-for-scrivener/Chapter_5Estimates API costs based on usage patterns.
python scripts/cost_tracker.pyExpected Costs (Moderate Usage):
- Light (10 hours/month): $50-75
- Moderate (20 hours/month): $100-150
- Heavy (40 hours/month): $200-300
All outputs follow consistent naming patterns:
- Research:
research_TOPIC_YYYYMMDD.md - Drafts:
draft_CHAPTER_SECTION_vN.md - Critiques:
critique_CHAPTER_SECTION_YYYYMMDD.md - Validations:
validation_CHAPTER_SECTION_YYYYMMDD.md
Examples:
research_black_swan_incidents_2025_20250127.mddraft_chapter2_black_swans_2024_v1.mdcritique_chapter2_black_swans_2024_20250128.md
- Organize outputs:
python scripts/organize_outputs.py - Review staged files in
staging/ready-for-scrivener/ - Check
MANIFEST.mdfor file list - Drag markdown files into Scrivener project
- Scrivener automatically converts markdown
Advantages:
- Zero risk of project corruption
- Quality gate before import
- Full control over organization
- In Scrivener: File → Sync → with External Folder
- Choose sync folder:
staging/scrivener-sync - Format: Plain Text or RTF
- Sync on project open/close
When you open Scrivener, it detects changes and prompts to import.
The .cursor/rules/ directory defines the author's voice and style:
- Technical but accessible - Principal-level depth without academic jargon
- Concrete examples - Real incidents, not just theory
- Short paragraphs - 3-5 sentences max
- Active voice - Direct and engaging
- Informal tone - Occasional dry humor
- Code examples - Python pseudo-code for clarity
All agents follow these guidelines when generating content.
-
Use cheaper models for drafts:
- Claude Haiku for initial drafts
- Claude Sonnet for final polish
- GPT-4o-mini for quick critiques
-
Batch operations:
- Process multiple sections in one prompt
- Reduces per-request overhead
-
Cache context:
- Reuse research across multiple drafts
- Store frequently used instructions in
.cursor/rules/
-
Monitor usage:
- Check provider dashboards regularly
- Set budget alerts at 50%, 75%, 90%
See scripts/cost_tracker.py for cost estimation.
- Check
.mdcfile has correctmodel:in frontmatter - Verify API keys in
.env - Restart Cursor
- Manually select model from dropdown in Agent chat
- Be explicit in prompt: "Save to outputs/research/filename.md"
- Check workspace folder is correctly set in Cursor
- Use full paths if relative paths fail
- Add delays between agent calls
- Use cheaper models for drafts
- Monitor usage at provider dashboards
- Use RTF conversion:
python scripts/convert_to_rtf.py - In Scrivener, ensure "Preserve formatting" is checked
- Set Scrivener to recognize markdown: Preferences → Import → Markdown
- Break large tasks into smaller chunks
- Reference specific sections, not entire files
- Use
@filementions to only include relevant files - Upgrade to long-context models (Claude Sonnet 4: 200K tokens)
cursor-book-workflow-guide.md- Complete implementation guidemcp_coaching_guide.md- MCP configuration and usagecursor_ai_book_test_plan.md- Testing strategy
Cmd/Ctrl + L- Open AgentCmd/Ctrl + K- Inline editCmd/Ctrl + I- Insert at cursorCmd/Ctrl + Shift + P- Command paletteCmd/Ctrl + N- New agent chatShift + Tab- Toggle Plan Mode@- Context menu (tag files, docs, etc.)
- Create new
.mdcfile inagents/directory - Define frontmatter with model, description, tools
- Add agent-specific instructions
- Test with simple query
- Update this README
Scripts are modular and can be extended:
- Add new organization patterns to
organize_outputs.py - Add format conversions to
convert_to_rtf.py - Add cost tracking for new models in
cost_tracker.py
This is primarily a personal project for writing "SLOs Can't Catch a Black Swan," but contributions are welcome. Here's how to help:
-
Report Issues: Found a bug in the workflow? Something unclear in the docs? Open an issue with details.
-
Improve Documentation: The README, workflow guides, or agent instructions could always be clearer. PRs welcome.
-
Enhance Scripts: The Python automation scripts are modular and extensible. Add features, fix bugs, or optimize performance.
-
Share Workflows: If you've adapted this workflow for your own book project, share what worked (and what didn't).
-
Agent Improvements: Found a better prompt structure or model configuration? Submit improvements to the
.mdcfiles.
- Fork the repository (if it's public) or create a branch
- Make your changes
- Test thoroughly -- especially if modifying scripts or agent configs
- Update documentation if your changes affect usage
- Submit a PR with a clear description of what changed and why
- Python scripts should follow PEP 8
- Markdown should be readable and well-formatted
- Agent configs (
.mdc) should include clear frontmatter and instructions - Comments are your friend -- explain the "why," not just the "what"
If you're unsure about something or want to discuss a larger change before implementing it, feel free to open an issue for discussion. This is a collaborative space, and good ideas come from conversation.
Use freely for SLO Black Swan book project.
- v1.0 (November 2025) - Initial workflow implementation
- Active development - See git history for changes
For issues or questions:
- Check
cursor-book-workflow-guide.mdfor detailed instructions - Review troubleshooting section above
- Check Cursor documentation: https://cursor.com/docs
Remember: The automation eliminates tedium, not thinking. Always review agent outputs before importing to Scrivener. Your judgment on quality, tone, and narrative flow is irreplaceable.
Geoff White
Principal SRE | Author of "SLOs Can't Catch a Black Swan"
This workflow represents 30+ years of experience in operations, reliability engineering, and technical writing, combined with modern AI-assisted tooling. The goal is to write better books faster, without sacrificing quality or authenticity.
Questions, feedback, or just want to chat about SRE and risk management? Feel free to reach out.