gemini-writer
Delegate large-context writing tasks to Gemini's 1M token window. Send an entire manuscript + detailed instructions in a single pass. Use for book rewrites, structural refactoring, redundancy analysis, and any writing task where the AI needs to see everything at once.
Best use case
gemini-writer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Delegate large-context writing tasks to Gemini's 1M token window. Send an entire manuscript + detailed instructions in a single pass. Use for book rewrites, structural refactoring, redundancy analysis, and any writing task where the AI needs to see everything at once.
Teams using gemini-writer should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/gemini-writer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How gemini-writer Compares
| Feature / Agent | gemini-writer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Delegate large-context writing tasks to Gemini's 1M token window. Send an entire manuscript + detailed instructions in a single pass. Use for book rewrites, structural refactoring, redundancy analysis, and any writing task where the AI needs to see everything at once.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Gemini Writer
Leverage Gemini 2.5 Pro's 1M token context window for writing tasks that exceed what Claude can hold in a single context. The key advantage: Gemini can read the ENTIRE manuscript plus all annotations, voice guides, and editorial instructions in a single pass, then produce a rewritten chapter that accounts for everything at once.
## When to Use
- **Book manuscript rewrites** — when the author has annotations across multiple chapters and cross-chapter issues need to be resolved simultaneously
- **Structural refactoring** — moving sections between chapters, resolving redundancy, reordering content
- **Voice-consistent rewrites** — when you have a voice guide + source material + current draft and need a revision that respects all three
- **Batch processing** — rewriting multiple chapters one at a time, but with full manuscript context for each
## When NOT to Use
- Quick edits to a single paragraph (just use Claude directly)
- Tasks requiring web search or real-time information (use deep-research instead)
- Tasks where the total context is under 100K tokens (Claude handles this fine)
## Architecture
The script sends content to Gemini's `generateContent` API (not the Interactions/research API). Two modes:
### Single-Pass Mode
Send everything, get one big output. Best for analysis tasks (redundancy audit, structural plan).
### Batch Mode (Recommended for Rewrites)
Send full manuscript as context, but process ONE chapter at a time. This means:
- Gemini sees everything (all chapters, all annotations, all instructions)
- But it only outputs one chapter per call
- This keeps output quality high (no truncation) while maintaining full cross-chapter awareness
## Workflow
### 1. Prepare the Prompt File
Create a markdown file with detailed instructions. Two levels:
**System instruction** (optional, `--system`): Voice guide, style rules, constraints that apply to every chapter.
**Prompt** (`--prompt`): Specific task instructions — what to fix, what to preserve, what to move, what annotations mean.
### 2. Dry Run
Always start with a dry run to verify token counts:
```bash
python3 .claude/skills/gemini-writer/scripts/gemini-writer.py \
--prompt prompt.md \
--context manuscript/revised/ \
--dry-run
```
### 3. Execute
**Batch mode (one chapter at a time):**
```bash
python3 .claude/skills/gemini-writer/scripts/gemini-writer.py \
--prompt prompt.md \
--system voice-guide.md \
--context manuscript/revised/ \
--output manuscript/v3/ \
--batch
```
**Single chapter:**
```bash
python3 .claude/skills/gemini-writer/scripts/gemini-writer.py \
--prompt prompt.md \
--context manuscript/revised/ \
--output manuscript/v3/ \
--batch --chapter 01-introduction.md
```
### 4. Review
Compare outputs against originals. Gemini's rewrites should be treated as strong first drafts that need human editorial review.
## Prompt Engineering Tips
1. **Be explicit about annotations.** Tell Gemini exactly what `{}` means: "Text in curly braces `{}` are the author's editorial comments. Execute these instructions, don't reproduce them."
2. **Give voice samples.** Include 2-3 paragraphs of the author's best writing and say "match this voice."
3. **Specify what to preserve.** Gemini will rewrite aggressively unless you tell it what's working. Say "The following sections are strong and should be preserved with minimal changes: [list]."
4. **Use the system instruction for invariants.** Voice guide, source material rules, theological constraints — anything that applies to every chapter goes in `--system`.
5. **Order matters.** Put the most important instructions first in the prompt. Gemini, like all LLMs, attends more to the beginning.
## Cost & Performance
- **Model:** `gemini-3-pro-preview` (falls back to `gemini-2.5-pro-preview-06-05`)
- **Input cost:** ~$1.25/1M input tokens, ~$10/1M output tokens (as of Feb 2026)
- **Typical manuscript rewrite:** 6 chapters × ~15K tokens each = ~90K input + ~60K output ≈ $0.75
- **Time:** 30-120 seconds per chapter depending on length
- **Max output:** 65,536 tokens per call (~50K words — more than enough for a chapter)
## Script Location
`.claude/skills/gemini-writer/scripts/gemini-writer.py`
Requires: `GEMINI_API_KEY` env var (set in `~/.zshrc`), `httpx` (auto-installed on first run)Related Skills
skill-stack-newsletter-writer
Format and structure skill for Skill Stack weekly newsletter. Handles frontmatter, sections, skill packages, and calls-to-action. REQUIRES writing-style skill for prose quality.
ghostwriter
Master the art of converting source material into authentic, human-written content. Transform transcripts, notes, and research into polished prose that avoids AI tells while maintaining distinctive voice. Combines anti-AI writing fundamentals with voice style adaptation.
dude-with-sign-writer
Creates punchy, conversational one-liners in "Dude With Sign" style - bold statements that challenge norms, validate feelings, or poke fun at everyday truths. Use when creating short social captions, easel reveal messages, or single-sentence hooks. Not for long-form content or formal messaging.
x-viral-template-miner
When the user wants to find proven-to-travel post templates in their niche and adapt them to their own product. Also use when the user mentions "what's going viral in my space", "what are competitors posting", "copy a viral post", "trending on X", "post ideas", "template mining", or "what to post this week". This is trend hunting, not plagiarism — the output is a template the user fills with their own assets.
x-linkedin-content-relay
When the user has X (Twitter) content that performed well and wants to relay it to LinkedIn 1-2 weeks later with reframing. Also use when the user mentions "repost to LinkedIn", "LinkedIn version of my tweet", "X to LinkedIn", "delayed repost", "LinkedIn for non-tech audience", or "LinkedIn relay". Also use when the user's ICP is non-tech and X is secondary — LinkedIn is the primary channel and this skill produces the content.
x-launch-video-structure
When the user is planning, scripting, or editing a product launch video for X (Twitter) and needs the structure. Also use when the user mentions "launch video", "demo video", "product launch on X", "60 second demo", "how to structure a launch", or "my launch video isn't working". Produces a beat-by-beat timing sheet, not copy.
x-account-warmup
When a user wants to grow an X (Twitter) account from zero before a product launch, or asks how to get first followers, warm up the algorithm, hit ~500-1,000 followers, or prepare an account to make a launch video land. Also use when the user mentions "new X account", "warm up my Twitter", "first 1000 followers", "building in public strategy", "X growth", or "engagement before launch".
skill-stack-thumbnails
Generate blog post thumbnails for Skill Stack using the brand aesthetic. Follows an iterative workflow - brainstorm concepts, get approval, generate with Gemini API.
youtube-ingest
Transcribe YouTube videos and playlists using Gemini Flash
web-scrape
Scrape web pages to clean markdown with optional AI summaries
voice-tyler-cowen
Write in Tyler Cowen's style - matter-of-fact, understated, treats enormous ideas as obvious observations. Read the passages. Absorb the flatness. Channel the HOW, not the content.
voice-trung-phan
Generate tweets and threads in the style of Trung Phan. Not just voice — captures his humor mechanics, format taxonomy, topic selection filter, and structural patterns. Use for trend-reactive tweets, meme commentary, and business/culture threads.