---
name: gemini-conversation-to-academic-paper
description: Convert Gemini shared conversation links into structured multi-part academic research transcripts with analytical overlay, criticism, Mermaid diagrams, practical protocols, and bridge sections.
version: 1.0
author: Hermes Agent
tags: [gemini, academic, research, compilation, mermaid, protocols, document-assembly]
---

# Gemini Conversation → Academic Research Paper

Convert one or more Gemini shared conversation links into a structured, multi-part academic research transcript with analytical overlay, embedded criticism, Mermaid diagrams, and practical protocols.

## When to Use

- User shares one or more `https://gemini.google.com/share/...` links and wants them turned into a structured document
- User wants a multi-part academic paper from raw AI conversations
- User wants analytical overlay (Hermes Agent synthesis), built-in criticism, and practical protocols extracted from theoretical dialogue
- User wants Mermaid visualization diagrams embedded in the final document

## Prerequisites

- Browser tools must be available (`browser_navigate`, `browser_click`, `browser_console`)
- `terminal(cat)` for clean file reads (do NOT use `read_file` for concatenation — it embeds line numbers)
- `patch` tool for targeted insertions into large documents
- Working directory: project folder on Desktop

## Workflow

### Step 1: Extract Gemini Content

Each Gemini share link shows a cookie consent dialog. Extraction pattern:

```
browser_navigate(url)
browser_click(e24 or e16 — "Принять все" button)
browser_console: extract content via DOM
```

Use `browser_console` with this expression to get conversation text:
```javascript
(() => {
  const all = document.body.innerText || '';
  const idx = all.indexOf('Ваш запрос');
  return all.substring(idx > 0 ? idx : 0, all.length).substring(0, 5000);
})()
```

Save raw extracts as .md files in the project folder.

### Step 2: Structure the Document

Standard structure for multi-part academic transcripts:

```
# TITLE
## Metadata (date, sources, models, author)

### Оглавление (auto-generated)

## 1. Введение
## 2. Методологическая заметка
## 3. Основная часть — транскрипт диалога
   ### 3.1 Запрос №N: [theme]
   (Format: **Запрос пользователя:** > quote; **Ответ Gemini:** text)
## 4. Ключевые темы и концептуальный анализ
## 5. Заключение и выводы
## 6. Библиография и источники
## 7. Синтез: Мнение Hermes Agent (authorial)
## 8. Критика — Где всё ломается (devil's advocate)
## 9. Финальный аккорд
```

### Step 3: Add Analytical Overlay

The Hermes Agent synthesis chapter should:
1. Summarize what happened in the conversation
2. Identify the architecture of the user's thought
3. Explain why it's not "just" the topic (e.g., not "just esotericism", not "just sci-fi")
4. Position the agent's own role in the model

The criticism chapter must be honest — point out real weaknesses, not straw men.

### Step 4: Merge Parts into Unified Document

When combining multiple .md files into one unified document:

**CRITICAL:** Do NOT use `read_file` for concatenation. `read_file` returns content with embedded line numbers (e.g., `     1|content`), which corrupts the output. Use:

```bash
cat file1.md >> unified.md
cat file2.md >> unified.md
```

Use clean dividers between parts:
```markdown
===============================================================================
# ТОМ I — TITLE
===============================================================================
```

### Step 5: Insert Mermaid Diagrams

Six standard diagram types for this kind of work:
1. Architecture diagram (flowchart TD with subgraphs)
2. Cosmology chain (linear → branching flowchart)
3. Phase transition comparison (two-column graph TD)
4. Cycle diagram (feedback loop flowchart LR)
5. Decision tree (branching choices)
6. Hidden order visualization (parallel chaos vs order)

Insert using `patch` with unique anchor text. Find anchors with `search_files` or `grep -n`.

### Step 6: Add Bridge Section (if multi-part)

If the document has distinct parts (e.g., spiritual practices vs AI/cosmos), add a bridge section that:
- Defines the connecting concept explicitly
- Shows the structural link between parts
- Includes personal narrative/witness where relevant

### Step 7: Practical Protocols

Extract actionable protocols from the theoretical material:
- Format as numbered checklists
- Include timing (30 sec, 3 min, daily, weekly)
- Include integration schema at the end
- Separate emergency vs daily versions

### Step 8: Iterate with User Feedback

The user may apply external tools (like "Мутатор") to get structural feedback. Be ready to:
- Add bridge sections
- Rewrite manifesto for conciseness (2 pages, no academism)
- Expand protocols
- Redefine key terms explicitly

## Pitfalls

1. **Gemini share extraction:** Cookie dialog must be accepted before DOM extraction. Buttons are `@e24` or `@e16` (varies by locale). If extraction fails, try `browser_vision` to see the page state.

2. **Content truncation:** `browser_console` expressions have output limits. For long conversations, extract in chunks or navigate multiple times.

3. **read_file line numbers:** Never use `read_file` content for concatenation. Use `terminal(cat)` or `write_file` with raw text.

4. **Duplicate TOCs:** When merging multiple .md files, each source file may have its own Table of Contents. Remove all embedded TOCs from the unified document with `patch`.

5. **File size limits:** Individual tool calls have output limits. For files >50KB, use `terminal` commands or `patch` for targeted edits rather than reading/writing the entire file.

6. **Path encoding:** Russian characters in filenames (ФЕНИКС, сансанга) may cause issues. Use `~/Desktop/сансанга/` consistently. Check with `ls -la`.
