streaming-output-mcp
Stream structured content to persistent SQLite storage with automatic session break recovery. Core principle: The content IS the state. Every stream_write is automatically persistent. Supports multi-format export (Markdown, HTML, JSON, YAML, CSV, Text) and 7 document templates. Commands: /stream-init, /stream-status, /stream-read, /stream-write, /stream-export. ALWAYS call stream_status after session breaks to check for resume_from and preserved_context.
What this skill does
# Streaming Output MCP Skill
Agent instructions for using the streaming-output MCP to produce persistent, recoverable output.
## Overview
This skill enables you to stream structured content to persistent SQLite storage with automatic session break recovery. Use it when producing reports, analysis results, task lists, or any structured output that needs to survive session interruptions.
**Core Principle**: The content IS the state. Every `stream_write` is automatically persistent.
**Version 2.0 Features**:
- 7 pre-built document templates (security-audit, code-review, sprint-retrospective, etc.)
- 6 export formats (Markdown, HTML, JSON, YAML, CSV, Plain Text)
- Document finalization with completion verification
- File export with path expansion
## First Action Protocol
**CRITICAL**: Always follow this protocol at the start of any streaming task.
```
IF you have a document_id (from previous session or user):
1. Call stream_status(document_id) FIRST
2. Check for resume_from field
3. If preserved_context exists, READ IT and CONTINUE from that point
4. Do NOT restart blocks from scratch
IF you don't have a document_id:
1. Call stream_start() to create new document
2. Optionally use a template for structure
3. Begin writing blocks in sequence
```
### Why This Matters
Session breaks happen. When they do:
- The MCP knows which blocks are incomplete
- Partial content may be preserved in `preserved_context`
- You should CONTINUE from the interruption point, not restart
## Document Templates
Use templates for common document types with pre-defined structure:
| Template | Use Case | Pre-declared Blocks |
|----------|----------|---------------------|
| `security-audit` | Security assessments | executive_summary, scope, findings, recommendations |
| `code-review` | PR/code reviews | summary, critical_issues, suggestions, approval_status |
| `sprint-retrospective` | Sprint retros | what_went_well, improvements, action_items |
| `technical-spec` | Technical specs | overview, requirements, architecture, implementation_plan |
| `adr` | Architecture decisions | context, decision, consequences, alternatives |
| `research-report` | Research docs | abstract, methodology, findings, conclusions |
| `task-list` | Task tracking | No pre-declared blocks (dynamic) |
**To use a template:**
```json
{
"title": "Q4 Security Audit",
"template": "security-audit"
}
```
**List available templates:**
```json
stream_templates({})
```
## Tool Reference
### stream_start
Initialize a new document.
```json
// Minimal
{"title": "Code Review Report"}
// With template
{
"title": "Security Assessment",
"template": "security-audit"
}
// Custom structure
{
"title": "Custom Report",
"schema_type": "report",
"blocks": [
{"key": "summary", "type": "section"},
{"key": "findings", "type": "finding"}
]
}
```
### stream_write
Write content to a block. Each write is atomic and SHA-256 verified.
```json
{
"document_id": "doc_...",
"block_key": "summary",
"content": {
"title": "Executive Summary",
"body": "This audit identified 3 critical vulnerabilities..."
},
"block_type": "section"
}
```
**Block Types:**
| Type | When to Use | Required Fields |
|------|-------------|-----------------|
| `section` | Narrative content | title, body |
| `task` | Actionable items | id, title, status |
| `finding` | Analysis results | id, severity, description |
| `decision` | ADR-style decisions | id, title, decision, rationale |
| `raw` | Arbitrary JSON | content |
**Content Schemas:**
```json
// section
{"title": "...", "body": "..."}
// task
{"id": "T-001", "title": "...", "status": "pending|in_progress|complete", "assignee": "...", "notes": "..."}
// finding
{"id": "F-001", "severity": "critical|high|medium|low|info", "description": "...", "evidence": "...", "recommendation": "..."}
// decision
{"id": "ADR-001", "title": "...", "context": "...", "decision": "...", "rationale": "...", "alternatives": [...]}
```
### stream_status
Check document state. **Always call after session breaks.**
```json
// List recent documents
{}
// Check specific document with verification
{"document_id": "doc_...", "verify": true}
```
**Response Fields:**
```json
{
"resume_from": "findings", // ← Start here
"preserved_context": {
"block_key": "findings",
"partial_content": "Found 3 SQL injection..."
},
"summary": {
"total": 5,
"complete": 2,
"pending": 3
}
}
```
### stream_read
Read document content in various formats.
```json
// As JSON
{"document_id": "doc_...", "format": "json"}
// As Markdown
{"document_id": "doc_...", "format": "markdown"}
// Specific blocks
{"document_id": "doc_...", "format": "markdown", "blocks": ["summary", "recommendations"]}
```
### stream_export (NEW)
Export document to a file.
```json
{
"document_id": "doc_...",
"format": "html",
"output_path": "~/Documents/report.html"
}
```
**Supported Formats:**
- `markdown` - Clean Markdown with headers
- `html` - Styled HTML with embedded CSS
- `json` - Full structured data
- `text` - Plain text without formatting
- `yaml` - YAML representation
- `csv` - Tabular format (best for tasks/findings)
### stream_finalize (NEW)
Mark document as complete after all blocks are written.
```json
{"document_id": "doc_..."}
```
Returns verification of completion status.
### stream_delete (NEW)
Delete a document and all its blocks.
```json
{"document_id": "doc_..."}
```
### stream_templates (NEW)
List available document templates.
```json
{} // Returns all 7 templates with their structure
```
## Recovery Workflow
### Scenario 1: Session Break with Preserved Context
```
1. Call stream_status(document_id)
2. Response: resume_from: "analysis", preserved_context: "The security analysis..."
3. Action: Read preserved_context, CONTINUE from that point
4. Call stream_write("analysis", {complete_content}, repair=true)
```
### Scenario 2: Session Break without Preserved Context
```
1. Call stream_status(document_id)
2. Response: resume_from: "analysis", no preserved_context
3. Action: Check complete blocks, re-analyze source, write fresh
```
### Scenario 3: User Wants Previous Work
```
User: "Continue the security report from yesterday"
1. stream_status() - list recent documents
2. Identify by title/date
3. stream_status(document_id) - get details
4. Follow resume_from to continue
```
## Anti-Patterns
**DO NOT:**
1. Skip status check after session break
2. Restart blocks from scratch when preserved_context exists
3. Write multiple blocks without status checks
4. Use wrong content structure for block type
5. Forget `repair=true` when continuing interrupted blocks
## Workflow Examples
### Example 1: Using a Template
```
1. stream_start(title="Q4 Security Audit", template="security-audit")
→ Creates doc with: executive_summary, scope, findings, recommendations
2. stream_write(doc_xxx, "executive_summary", {title: "...", body: "..."})
3. stream_write(doc_xxx, "scope", {title: "...", body: "..."})
4. stream_write(doc_xxx, "findings", {severity: "critical", ...})
5. stream_write(doc_xxx, "recommendations", {title: "...", body: "..."})
6. stream_finalize(doc_xxx)
→ Document finalized
7. stream_export(doc_xxx, format="html", output_path="~/reports/q4-audit.html")
→ Exported to file
```
### Example 2: Resume After Interruption
```
User: "Continue the security report"
1. stream_status()
→ Lists recent docs, find "Security Audit"
2. stream_status("doc_xxx")
→ resume_from: "findings", preserved_context: {partial: "Scanned 45/120..."}
3. Read preserved_context, note endpoint 45
4. Continue from endpoint 46
5. stream_write(doc_xxx, "findings", {complete}, repair=true)
```
### Example 3: Multi-Format Export
```
1. Complete document with stream_write calls
2. stream_read(doc_xxx, format="markdown")
→ Preview in chat
3. stream_export(doc_xxx, format="html", output_path="~/report.html")
→ HTML file Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.