doc-processor
Skill96 starsChanged 7 months agoMITView on GitHub
Generate and parse office documents — PDF, DOCX, XLSX, PPTX, CSV. Use when creating reports, exporting tabular data, or processing uploaded office files. NOT for project documentation (use docs).
- Installs packages
In this repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- llms.txtllms.txt
- adversarySkill
- asset-creatorSkill
- auditSkill
- autopsySkill
- baSkill
- brainstormSkill
- browser-pilotSkill
- completion-gateSkill
- constraint-checkSkill
- context-engineSkill
- context-packSkill
- convergeSkill
- cookSkill
- councilSkill
- dbSkill
- debugSkill
- dependency-doctorSkill
- deploySkill
- designSkill
- diagramSkill
- docs-seekerSkill
- docsSkill
- fixSkill
- gitSkill
- graftSkill
- hallucination-guardSkill
- improve-architectureSkill
- incidentSkill
- integrity-checkSkill
- journalSkill
- launchSkill
- logic-guardianSkill
- marketingSkill
- mcp-builderSkill
- neural-memorySkill
- onboardSkill
- perfSkill
- planSkill
- preflightSkill
- problem-solverSkill
- quarantineSkill
- rescueSkill
- researchSkill
- retroSkill
- review-intakeSkill
- reviewSkill
- safeguardSkill
- sastSkill
- scaffoldSkill
- scope-guardSkill
- scoutSkill
- sentinel-envSkill
- sentinelSkill
- sequential-thinkingSkill
- session-bridgeSkill
- skill-forgeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Document format utility. Generates and parses office documents (PDF, DOCX, XLSX, PPTX, CSV).
- Very specific: line 54
If Node.js project → use Node.js libraries
- Distinctive: line 55
If Python project → use Python libraries
- Very specific: line 56
If unclear → default to Node.js (wider ecosystem)
- Distinctive: line 145
Run the generation script.
- Distinctive: line 222
MUST verify output file exists and is non-empty after generation
- Very specific: line 223
MUST handle missing libraries gracefully — suggest npm install / pip install if not found
- Distinctive: line 224
MUST NOT embed secrets or sensitive data in generated documents
- Distinctive: line 225
MUST preserve formatting fidelity — generated docs should look professional
- Distinctive: line 227
MUST use appropriate library for each format — don't force one library for all formats
≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
doc-processor
Purpose
Document format utility. Generates and parses office documents (PDF, DOCX, XLSX, PPTX, CSV). Pure utility — no business logic, just format handling. Other skills call doc-processor when they need to produce or consume structured documents.
Triggers
- Called by
docswhen export to PDF/DOCX is requested - Called by
marketingfor generating PDF reports, PPTX presentations - Called by Rune Pro packs for business document generation
/rune doc-processor generate <format> <source>— manual document generation/rune doc-processor parse <file>— manual document parsing
Calls (outbound)
None — pure L3 utility. Receives content, produces formatted output.
Called By (inbound)
docs(L2): export documentation to PDF/DOCXmarketing(L2): generate PDF reports, PPTX pitch decks- Rune Pro packs: business document generation (invoices, proposals, reports)
- User:
/rune doc-processordirect invocation
Format Reference
Supported Formats
| Format | Generate | Parse | Node.js Library | Python Library |
| Yes | Yes (via the runtime's document/PDF reader) | jsPDF, Puppeteer (HTML→PDF) | reportlab, weasyprint | |
| DOCX | Yes | Yes | docx (officegen) | python-docx |
| XLSX | Yes | Yes | ExcelJS | openpyxl |
| PPTX | Yes | Yes | pptxgenjs | python-pptx |
| CSV | Yes | Yes | Built-in (fs + string ops) | Built-in (csv module) |
| HTML | Yes | Yes | Built-in | Built-in |
Library Selection
Detect project language from context:
- If Node.js project → use Node.js libraries
- If Python project → use Python libraries
- If unclear → default to Node.js (wider ecosystem)
- For HTML→PDF → prefer Puppeteer (best fidelity) or weasyprint (Python)
Executable Steps
Generate Mode
Step 1 — Determine Format and Template
Identify:
- Target format (PDF, DOCX, XLSX, PPTX, CSV)
- Content source (markdown, data object, template + data)
- Styling requirements (brand colors, fonts, layout)
- Output path
Step 2 — Select Generation Strategy
| Source | Target | Strategy |
| Markdown → PDF | HTML intermediate | Render MD → HTML → Puppeteer → PDF |
| Markdown → DOCX | Direct conversion | Parse MD → docx library → DOCX |
| Data → XLSX | Direct write | Map data to sheets/cells → ExcelJS |
| Slides → PPTX | Template + data | Build slides from content → pptxgenjs |
| Data → CSV | Direct write | Serialize rows → CSV string → file |
| Any → HTML | Direct render | Template engine → HTML file |
Step 3 — Generate Code
Produce the generation script:
PDF from Markdown:
// Strategy: Markdown → HTML → Puppeteer → PDF
const puppeteer = require('puppeteer');
const { marked } = require('marked');
async function generatePDF(markdownContent, outputPath, options = {}) {
const html = `
<!DOCTYPE html>
<html>
<head><style>${options.css || defaultCSS}</style></head>
<body>${marked(markdownContent)}</body>
</html>
`;
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setContent(html, { waitUntil: 'networkidle0' });
await page.pdf({ path: outputPath, format: 'A4', margin: { top: '1in', bottom: '1in', left: '1in', right: '1in' } });
await browser.close();
}XLSX from Data:
const ExcelJS = require('exceljs');
async function generateXLSX(data, outputPath, options = {}) {
const workbook = new ExcelJS.Workbook();
const sheet = workbook.addWorksheet(options.sheetName || 'Sheet1');
if (data.length > 0) {
sheet.columns = Object.keys(data[0]).map(key => ({ header: key, key, width: 20 }));
data.forEach(row => sheet.addRow(row));
// Style header row
sheet.getRow(1).font = { bold: true };
sheet.getRow(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE0E0E0' } };
}
await workbook.xlsx.writeFile(outputPath);
}PPTX from Slides:
const PptxGenJS = require('pptxgenjs');
function generatePPTX(slides, outputPath, options = {}) {
const pptx = new PptxGenJS();
pptx.author = options.author || 'Generated by Rune';
slides.forEach(slide => {
const s = pptx.addSlide();
if (slide.title) s.addText(slide.title, { x: 0.5, y: 0.5, fontSize: 28, bold: true });
if (slide.body) s.addText(slide.body, { x: 0.5, y: 1.5, fontSize: 16 });
if (slide.bullets) s.addText(slide.bullets.map(b => ({ text: b, options: { bullet: true } })), { x: 0.5, y: 1.5, fontSize: 16 });
});
return pptx.writeFile({ fileName: outputPath });
}Step 4 — Execute and Verify
Run the generation script. Verify:
- Output file exists and is non-empty
- File can be opened (basic format validation)
- Content matches expected structure
Parse Mode
Step 1 — Detect Format
Identify file format from extension and MIME type.
Step 2 — Extract Content
| Format | Extraction Strategy |
| Use the runtime's native document/PDF reader when available; otherwise use a supported PDF parsing library | |
| DOCX | docx library → extract text, tables, images |
| XLSX | ExcelJS → extract sheets, rows, formulas |
| PPTX | pptxgenjs → extract slides, text, notes |
| CSV | Built-in parser → structured data |
Step 3 — Structure Output
Return parsed content as structured data:
{
"format": "xlsx",
"sheets": [
{
"name": "Sheet1",
"headers": ["Name", "Email", "Role"],
"rows": [["Alice", "alice@co.com", "Engineer"], ...],
"rowCount": 100
}
]
}Output Format
Generate Mode Output
- Generated document file at specified output path
- Verification report: file exists, non-empty, format valid
Document Generated:
- Format: [PDF/DOCX/XLSX/PPTX/CSV]
- Path: [output file path]
- Size: [file size]
- Strategy: [e.g., Markdown → HTML → Puppeteer → PDF]
- Status: verified ✓Parse Mode Output
Structured JSON returned to calling skill:
{
"format": "xlsx",
"metadata": { "author": "...", "created": "..." },
"content": {
"sheets": [
{
"name": "Sheet1",
"headers": ["Col1", "Col2"],
"rows": [["val1", "val2"]],
"rowCount": 100
}
]
}
}Format-specific fields: sheets (XLSX), pages (PDF/DOCX), slides (PPTX), rows (CSV).
Constraints
- MUST verify output file exists and is non-empty after generation
- MUST handle missing libraries gracefully — suggest
npm install/pip installif not found - MUST NOT embed secrets or sensitive data in generated documents
- MUST preserve formatting fidelity — generated docs should look professional
- Parse mode MUST handle malformed files gracefully — report errors, don't crash
- MUST use appropriate library for each format — don't force one library for all formats
Sharp Edges
| Failure Mode | Severity | Mitigation |
| Library not installed in project | HIGH | Check package.json/requirements.txt, suggest install command |
| PDF generation fails without headless browser | HIGH | Puppeteer needs chromium — suggest alternative (jsPDF) if unavailable |
| XLSX with formulas not evaluated | MEDIUM | Use ExcelJS formula support, warn if complex formulas |
| Large file generation runs out of memory | MEDIUM | Stream large datasets instead of loading all at once |
| Generated file is empty or corrupt | HIGH | Step 4 verification catches this — retry or report |
Done When
Generate Mode
- Target format and source identified
- Generation strategy selected
- Code produced and executed
- Output file verified (exists, non-empty, valid format)
Parse Mode
- File format detected
- Content extracted to structured data
- Output returned in consistent JSON format
Cost Profile
~1000-3000 tokens input, ~500-2000 tokens output. Sonnet — document processing requires understanding format libraries and generating correct code, but not deep reasoning.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

