Логотип Document Export

Document Export

Сообщество
Kaminoikari
document-export

Use when the user wants the plan rendered as an interactive HTML report or exported to PDF/DOCX/PPTX. Triggers on 'HTML report', 'export to PDF', 'export document', 'downloadable report', 'PDF/DOCX/PPTX', and the same intent in any language.

Обзор

ИздательKaminoikari
Репозиторийproduct-playbook
Название навыкаdocument-export
Звёзды
26
Форки
1
Файлы в комплекте
2
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 2

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — Kaminoikari. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Document Export в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/Kaminoikari/product-playbook/tree/main/skills/document-export
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Kaminoikari/product-playbook.git /tmp/product-playbook
mkdir -p .claude/skills
cp -r /tmp/product-playbook/skills/document-export .claude/skills/document-export
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Document Export в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Document Export, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Document Export не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Document Export

Detect the user's language and reply in it; the framework below is authored in English.

Provenance: when you produce an HTML report or a PDF/DOCX/PPTX export, contribute the framework tags HTML Report and PDF Export to the meta-skill's provenance line (— Frameworks: … · HTML Report · PDF Export · …).

Framework

HTML Product Planning Report Output

Triggered when the user says "produce a report" or confirms the last stage content is correct.

Design Specifications

Use a modern design style: a single HTML file (CSS and JS fully inlined), ensuring it's readable offline.

Overall Style:

  • Gradient background Hero section (with mode, audience, date labels)
  • Card-based layout (rounded corners + shadows), each section like an independent information card
  • Clear typography hierarchy and comfortable reading spacing
  • Responsive design, smooth reading on mobile

Color Scheme:

  • Primary: Deep blue #1a1a2e → #16213e → #0f3460
  • Accent: #e94560 or #533483
  • Content area background: #f8f9fa, cards: white with box-shadow

Font: Load Inter from Google Fonts CDN first, fall back to system fonts:

css
/* In <head> */
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap" rel="stylesheet">

/* In CSS */
font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

This is the only permitted external CDN dependency. If Google Fonts is unavailable, the page will still render correctly.

Page Structure (Dynamically rendered based on completed stages)

┌──────────────────────────────────────────────────────────────┐
│  Hero Section (Product name, one-liner, mode, audience, date)│
├──────────────────────────────────────────────────────────────┤
│  Table of Contents Navigation (Sticky, only shows completed) │
├──────────────────────────────────────────────────────────────┤
│  🧭 Strategy Section (if completed)                          │
│     ├─ Strategy Blocks hierarchy diagram                     │
│     ├─ Rumelt's Kernel of Good Strategy (Diagnosis/Policy/   │
│     │  Actions)                                              │
│     └─ Shreyas' Three Levels of Product Work                 │
│  ✅ Opportunity Check Section (if completed)                  │
│  🔍 Discovery Section (if completed)                          │
│     ├─ Persona Table (card-style table)                      │
│     ├─ Persona Cards (one per persona)                       │
│     ├─ JTBD Analysis Table (four types)                      │
│     ├─ Opportunity Solution Tree (visual tree)               │
│     └─ User Journey Map (overview + accordion detail)        │
│  🎯 Define Section (if completed)                            │
│     ├─ Pain Point Summary Table                              │
│     ├─ April Dunford Positioning Framework Card              │
│     ├─ HMW Question Cards (with JTBD type tags)             │
│     └─ Opportunity Assessment Table (opportunity cost view)  │
│  💡 Develop Section (if completed)                           │
│     ├─ PR-FAQ Card (simulated press release format)          │
│     ├─ Solution Ideation (three-column parallel cards)       │
│     ├─ Pre-mortem Risk Table (color-coded High/Med risk)     │
│     ├─ GEM Matrix + Impact/Effort Quadrant Chart             │
│     ├─ RICE Prioritization Table (if completed)              │
│     ├─ User Story Table (if completed)                       │
│     └─ MVP Scope (three-column cards + Not Doing List)       │
│  🚀 Deliver Section (if completed)                           │
│     ├─ Aha Moment Definition Card (prominently displayed)    │
│     ├─ North Star Metric Card                                │
│     ├─ Three-Layer Signal Metrics Table                      │
│     ├─ PMF Level Assessment (four-level visual + current     │
│     │  position marker)                                      │
│     ├─ GTM Strategy (channel selection + first 100 users     │
│     │  plan, if completed)                                   │
│     ├─ Business Model & Pricing (revenue model + pricing     │
│     │  strategy, if completed)                               │
│     ├─ Hypothesis Validation Plan Table (if completed)       │
│     └─ Product Spec Summary (three-section structure:        │
│        Decision Summary / Execution Boundaries / Deep Ref)   │
│  ⭐ Best Entry Point Analysis (full logic chain visual)       │
├──────────────────────────────────────────────────────────────┤
│  Footer: Output date + mode + framework attribution          │
└──────────────────────────────────────────────────────────────┘

Section Design Details

Table Styling: Zebra stripes, dark header, rounded corners, hover highlight

Persona Cards: One card per Persona, pain points with red left border, JTBD emphasized with blue/purple color blocks

Opportunity Solution Tree: Use CSS or lightweight SVG to draw the tree structure, clearly showing the Goal → Opportunity → Solution hierarchy

PMF Level Chart: Use a progress bar or step diagram showing four levels, marking the user's current position

PR-FAQ Card: Simulated press release format with headline, subtitle, lead paragraph, visually resembling a real document

Pre-mortem Risk Table: High-risk items in red alert, medium-risk in yellow

Best Entry Point Logic Chain: Visualize the full reasoning chain, each node as a small card, connected by arrows

Interactive Effects

  • scroll-behavior: smooth — Smooth scrolling on TOC click
  • Intersection Observer — Highlight current section in TOC while scrolling
  • Card hover micro-lift (transform: translateY(-2px) + transition)
  • Accordion expand/collapse (User Journey Map stages, <details>/<summary>)
  • @media print — Hide interactive elements when printing, ensure tables aren't truncated

Important Notes

  • All CSS and JS inlined in HTML, with no external dependencies except Google Fonts CDN for Inter
  • If a stage was not completed, don't render an empty section; just skip it
  • The Hero section displays the "Mode" and "Audience" so readers immediately understand the document's context
  • The page can be very long, so TOC navigation is critical for quick jumping

Framework Attribution & Further Reading (in footer)

ThinkerKey ContributionSource
Teresa TorresContinuous Discovery, Opportunity Solution TreeLenny's Podcast + Continuous Discovery Habits
Shreyas DoshiLNO Framework, Pre-mortem, Three Levels of Product Work, Opportunity Cost ThinkingLenny's Podcast Ep.3
Gibson BiddleDHM Model, GEM PrioritizationLenny's Podcast
April DunfordPositioning FrameworkLenny's Podcast + Obviously Awesome
Todd JacksonFour-Level PMF Framework, Four P'sLenny's Podcast (First Round Capital)
Richard RumeltGood Strategy / Bad Strategy, Kernel of Good StrategyLenny's Podcast + Good Strategy Bad Strategy
Marty CaganEmpowered Teams, Product DiscoveryLenny's Podcast + Inspired, Empowered
Chandra JanakiramanStrategy BlocksLenny's Newsletter (Headspace / Meta)
Clayton ChristensenJobs to Be DoneCompeting Against Luck
AmazonWorking Backwards / PR-FAQWorking Backwards
Sean EllisSean Ellis Score, ICE ScoringHacking Growth
Lenny RachitskyShape / Ship / Synchronize, North Star ThinkingLenny's Newsletter + Podcast

Multi-Format Document Export Rules

Loaded when the user triggers /export [format] or selects an export format after the flow ends. On first use, load rules-document-tools.md first to confirm tools are installed.

Supported Export Formats

FormatCommandConversion PathTools
PDF/export pdfHTML+CSS → Playwright → pikepdf bookmarksPlaywright MCP + pikepdf
DOCX/export docxMD → Pandocpandoc + reference.docx
PPTX/export pptxMD → Pandocpandoc
HTML/export htmlExisting 06-html-report.md rulesBuilt-in
Markdown/export mdDirect outputBuilt-in

PDF Export (Core Flow)

Path Selection

PDF export has two paths, automatically selected based on source content:

SourcePathReason
Planning output direct export (PRD / incremental update / spec)Path A: setContentNo external JS dependencies, all resources can be inlined
HTML planning report to PDF (with Mermaid diagrams / CDN fonts)Path B: HTTP ServerNeeds to load external JS (mermaid.js) and CDN fonts

Path A: Standalone Document → PDF (setContent)

Applicable to: PRD, feature extension incremental updates, specs, any content without external JS.

Step 1: Generate HTML Content

Claude reads ${CLAUDE_PLUGIN_ROOT}/skills/document-export/assets/prd-style.css and generates a complete HTML document:

html
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<style>
/* Read the full contents of ${CLAUDE_PLUGIN_ROOT}/skills/document-export/assets/prd-style.css and inline here */
</style>
</head>
<body>

<!-- Cover page -->
<div class="cover-page">
  <h1>[Document Title]</h1>
  <div class="subtitle">[Subtitle or one-line description]</div>
  <div class="version-badge">[Version Number]</div>
  <div class="meta-info">
    <strong>PM</strong> [PM Name]<br>
    <strong>Date</strong> [ISO Date]<br>
    <strong>Status</strong> [Status]
  </div>
</div>

<!-- Legend (only for incremental update documents) -->
<div class="diff-legend">
  <div class="diff-legend-item"><div class="diff-legend-swatch swatch-new"></div> New in this version</div>
  <div class="diff-legend-item"><div class="diff-legend-swatch swatch-upd"></div> Modified in this version</div>
  <div class="diff-legend-item"><div class="diff-legend-swatch swatch-unchanged"></div> Unchanged</div>
</div>

<!-- Table of Contents page -->
<div class="toc-page">
  <h2>Table of Contents</h2>
  <ul class="toc">
    <!-- Claude auto-generates TOC items based on h2 headings -->
    <li>
      <span class="toc-title">[Section Name]</span>
      <span class="toc-dots"></span>
      <span class="toc-page-num">[Page Number]</span>
    </li>
  </ul>
</div>

<!-- Body content -->
[Body HTML]

<!-- Footer -->
<div class="doc-footer">
  [Document Code] [Version] | [Date] | Generated by Product Playbook
</div>

</body>
</html>

Important:

  • CSS must be fully inlined (no external links)
  • Fonts use system fonts: "PingFang TC", "Noto Sans TC", system-ui (Playwright will automatically embed in PDF)
  • No <script> tags or external resource references
  • TOC page numbers are estimates (may need fine-tuning after PDF generation)

Step 2: Playwright Renders PDF

Save the HTML content to /tmp/export-{timestamp}.html, then call Playwright MCP:

javascript
// mcp__plugin_playwright_playwright__browser_run_code
async (page) => {
  const fs = require('fs');
  const html = fs.readFileSync('/tmp/export-{timestamp}.html', 'utf8');
  await page.setContent(html, { waitUntil: 'networkidle' });
  await page.pdf({
    path: '{output_path}',
    format: 'A4',
    margin: { top: '1.8cm', bottom: '1.8cm', left: '2cm', right: '2cm' },
    printBackground: true,
    displayHeaderFooter: true,
    headerTemplate: '<div></div>',
    footerTemplate: '<div style="font-size:8pt;color:#999;text-align:center;width:100%;">p.<span class="pageNumber"></span> / <span class="totalPages"></span></div>'
  });
  return 'PDF generated';
}

Note: If the HTML content is too large (>500KB), setContent may time out. In that case, switch to Path B (HTTP Server).

Step 3: pikepdf Bookmark Injection

python
import pikepdf, re

pdf = pikepdf.open('{output_path}')

# Extract h2 headings from HTML as bookmarks
# Claude should record the estimated page number for each h2 when generating HTML
bookmarks = [
    # (title, page index 0-based)
    ("Revision History", 2),
    ("User Story", 4),
    ("Development Architecture", 6),
    # ... generated based on actual content
]

with pdf.open_outline() as outline:
    for title, page_idx in bookmarks:
        page_idx = min(page_idx, len(pdf.pages) - 1)
        outline.root.append(
            pikepdf.OutlineItem(title, page_idx)
        )

# Set PDF metadata
with pdf.open_metadata() as meta:
    meta['dc:title'] = '[Document Title]'
    meta['dc:creator'] = ['[PM Name]']
    meta['pdf:Producer'] = 'Product Playbook + Playwright'

pdf.save('{output_path}')

Step 4: Notify User

✅ PDF exported to: {output_path}
  📄 {page_count} pages | {file_size}
  📑 Includes bookmark navigation ({bookmark_count} sections)

Path B: HTML Report → PDF (HTTP Server)

Applicable to: HTML reports with Mermaid diagrams, CDN fonts, interactive elements.

Step 1: HTML Report Already Generated

The HTML report is generated by 06-html-report.md rules and saved as /tmp/report-{timestamp}.html.

Step 2: Start HTTP Server

bash
cd /tmp && python3 -m http.server 18899 &
echo $!  # Record PID

Step 3: Playwright Rendering

javascript
// mcp__plugin_playwright_playwright__browser_run_code
async (page) => {
  await page.goto('http://localhost:18899/report-{timestamp}.html', {
    waitUntil: 'networkidle',
    timeout: 30000
  });
  // Wait for Mermaid chart rendering to complete
  await page.waitForTimeout(3000);
  // Expand all accordion (<details>) elements
  await page.evaluate(() => {
    document.querySelectorAll('details').forEach(d => d.open = true);
  });
  await page.pdf({
    path: '{output_path}',
    format: 'A4',
    margin: { top: '1.8cm', bottom: '1.8cm', left: '2cm', right: '2cm' },
    printBackground: true,
    displayHeaderFooter: true,
    headerTemplate: '<div></div>',
    footerTemplate: '<div style="font-size:8pt;color:#999;text-align:center;width:100%;">p.<span class="pageNumber"></span> / <span class="totalPages"></span></div>'
  });
  return 'PDF generated';
}

Step 4: Shut Down HTTP Server + pikepdf Bookmarks

bash
kill {SERVER_PID}

Then perform the same pikepdf bookmark injection step as Path A.

Playwright MCP Unavailable Fallback

If Playwright MCP is not connected, use Node.js directly:

bash
node -e "
const { chromium } = require('playwright');
const fs = require('fs');
(async () => {
  const browser = await chromium.launch({ headless: true });
  const page = await browser.newPage();
  const html = fs.readFileSync('/tmp/export-{timestamp}.html', 'utf8');
  await page.setContent(html, { waitUntil: 'networkidle' });
  await page.pdf({
    path: '${OUTPUT_PATH}',
    format: 'A4',
    printBackground: true,
    margin: { top: '1.8cm', bottom: '1.8cm', left: '2cm', right: '2cm' }
  });
  await browser.close();
  console.log('PDF generated');
})();
"

DOCX Export

Step 1: Generate Markdown

Claude organizes the planning output into clean Markdown format and saves it as /tmp/export-{timestamp}.md.

Step 2: Pandoc Conversion

bash
pandoc /tmp/export-{timestamp}.md \
  -o "{output_path}" \
  --from markdown \
  --to docx \
  --reference-doc="reference.docx" \
  --toc \
  --toc-depth=2

If no reference.docx template is available, omit the --reference-doc parameter (uses Pandoc default styles).

Step 3: Notify User

✅ Word document exported to: {output_path}
  📄 Includes table of contents | {file_size}

PPTX Export

bash
pandoc /tmp/export-{timestamp}.md \
  -o "{output_path}" \
  --from markdown \
  --to pptx \
  --slide-level=2

Tip: Pandoc PPTX quality is limited. It's recommended to use the PPTX as an outline, then polish it with PowerPoint/Keynote.


Special Handling for Incremental Update Documents

When exporting Feature Extension or Revision mode incremental update documents:

Diff Visual Marking Rules

  1. Paragraphs marked [NEW]:

    • Use <span class="new">NEW</span> marker
    • Table rows get class="new-row"
    • Paragraphs get class="diff-added"
  2. Paragraphs marked [UPDATED]:

    • Use <span class="upd">UPDATED</span> marker
    • Table rows get class="upd-row"
    • If original content exists, original content gets class="diff-removed", new content gets class="diff-added"
  3. Unchanged paragraphs: Display normally, no special markers

  4. Legend at document start:

html
<div class="diff-legend">
  <div class="diff-legend-item">
    <div class="diff-legend-swatch swatch-new"></div> New in this version
  </div>
  <div class="diff-legend-item">
    <div class="diff-legend-swatch swatch-upd"></div> Modified in this version
  </div>
  <div class="diff-legend-item">
    <div class="diff-legend-swatch swatch-unchanged"></div> No marker = Unchanged
  </div>
</div>

Output Path Rules

Default output to ~/Downloads/, filename format:

[Document Code] [Document Title] [Version].{ext}

Examples:
[D-221] Virtual Account v1.0.14 Full Merged Version.pdf
Product Planning Report - UPASS Virtual Account.docx

If the user specifies a path, use the user-specified path.


Quality Checklist

Before export, Claude self-checks:

  • No residual Markdown syntax in HTML (**, ##, |---|)
  • All table row and column counts match the original content
  • [NEW] / [UPDATED] markers correctly mapped to corresponding CSS classes
  • Cover page information (title, version, PM, date) is correct
  • TOC items match the body h2 headings
  • CSS is fully inlined (Path A) or CDN is accessible (Path B)
  • Bookmark count matches h2 heading count

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Document Export?

Use when the user wants the plan rendered as an interactive HTML report or exported to PDF/DOCX/PPTX. Triggers on 'HTML report', 'export to PDF', 'export document', 'downloadable report', 'PDF/DOCX/PPTX', and the same intent in any language.

Зачем использовать Document Export в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Document Export — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Document Export в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/Kaminoikari/product-playbook/tree/main/skills/document-export. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Document Export?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Document Export?

С любым количеством. В TypingMind вы можете использовать Document Export с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Document Export?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — Kaminoikari. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇