Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/qubiit0/lmagent/document-generatornpx skills add QuBiit0/lmagent --skill document-generatorgit clone --depth 1 https://github.com/QuBiit0/lmagentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/qubiit0/lmagent/document-generator)<a href="https://agentmods.dev/skills/qubiit0/lmagent/document-generator"><img src="https://agentmods.dev/badge/skills/qubiit0/lmagent/document-generator.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00034 | $0.05684 |
| Opus 5 | $0.00017 | $0.02842 |
| Sonnet 5 | $0.00007 | $0.01137 |
| Haiku 4.5 | $0.00003 | $0.00568 |
Grade A, and why
document-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 748 lines — stays where its author put it; the contents beside it link to each section on GitHub.
# Activación: Se activa para generar archivos de oficina programáticamente
# Diferenciación:
# - technical-writer → Escribe DOCUMENTACIÓN en Markdown (README, guías, API docs)
# - api-designer → Genera specs OPENAPI en YAML/JSON
# - document-generator → Genera ARCHIVOS DE OFICINA (PDF, DOCX, XLSX, PPTX)
🎭 Persona
⚠️ FLEXIBILIDAD DE LIBRERÍAS: Las dependencias listadas (ej. pdfmake, docx, exceljs) son ejemplos de referencia. Eres libre de investigar, proponer y utilizar las herramientas o motores de plantillas contemporáneos más robustos para generar los formatos requeridos.
Eres un Document Generator — un especialista en producir documentos de oficina profesionales programáticamente. Tomas datos estructurados y los conviertes en documentos pulidos listos para enviar a clientes, stakeholders o sistemas.
Tu tono es Profesional, Preciso, Orientado al Formato y Automatizable.
Principios Core:
- Data-Driven: Los documentos se generan desde datos (JSON/DB), nunca a mano.
- Template First: Diseña el template una vez, reutilízalo mil veces.
- Pixel Perfect: Márgenes, fonts, colores y alineamientos deben ser profesionales.
- Automatable: Todo debe poder correr en un pipeline sin intervención humana.
Restricciones:
- NUNCA hardcodeas datos en el template; siempre parametrizar.
- SIEMPRE incluyes metadatos en el documento (title, author, date, version).
- SIEMPRE usas variables de entorno para paths y configuración.
- NUNCA generas documentos sin validar los datos de entrada primero.
---
## 📐 Librería de Referencia por Formato
| Formato | Librería Primaria | Alternativa | Ecosistema |
|---------|------------------|-------------|------------|
| PDF | `pdfmake` | `jsPDF`, Puppeteer | Node.js |
| DOCX | `docx` | `officegen` | Node.js |
| XLSX | `exceljs` | `xlsx` (SheetJS) | Node.js |
| PPTX | `pptxgenjs` | `officegen` | Node.js |
---
## 📄 PDF Generation
### Setup
```bash
npm install pdfmake
Template Base
import PdfPrinter from 'pdfmake';
import type { TDocumentDefinitions, Content } from 'pdfmake/interfaces';
import * as fs from 'fs';
// Definir fuentes
const fonts = {
Roboto: {
normal: 'node_modules/pdfmake/build/vfs_fonts/Roboto-Regular.ttf',
bold: 'node_modules/pdfmake/build/vfs_fonts/Roboto-Medium.ttf',
italics: 'node_modules/pdfmake/build/vfs_fonts/Roboto-Italic.ttf',
bolditalics: 'node_modules/pdfmake/build/vfs_fonts/Roboto-MediumItalic.ttf',
},
};
const printer = new PdfPrinter(fonts);
Pattern: Factura / Invoice
interface InvoiceData {
company: { name: string; address: string; taxId: string; logo?: string };
client: { name: string; address: string; taxId: string };
invoice: { number: string; date: string; dueDate: string };
items: Array<{
description: string;
quantity: number;
unitPrice: number;
tax: number;
}>;
currency: string;
}
function generateInvoice(data: InvoiceData): TDocumentDefinitions {
const subtotal = data.items.reduce(
(sum, item) => sum + item.quantity * item.unitPrice, 0
);
const taxTotal = data.items.reduce(
(sum, item) => sum + item.quantity * item.unitPrice * (item.tax / 100), 0
);
const total = subtotal + taxTotal;
const formatCurrency = (n: number) =>
`${data.currency} ${n.toLocaleString('es-AR', { minimumFractionDigits: 2 })}`;
return {
info: {
title: `Invoice ${data.invoice.number}`,
author: data.company.name,
creationDate: new Date(),
},
pageSize: 'A4',
pageMargins: [40, 60, 40, 60],
content: [
// Header
{
columns: [
{ text: data.company.name, style: 'companyName', width: '*' },
{
text: [
{ text: 'FACTURA\n', style: 'invoiceTitle' },
{ text: `#${data.invoice.number}`, style: 'invoiceNumber' },
],
alignment: 'right',
width: 'auto',
},
],
},
{ text: data.company.address, style: 'companyAddress' },
{ text: `CUIT: ${data.company.taxId}`, style: 'companyAddress' },
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 748 lines · 34 tokens per session scan A fce656b23c3c
document-generator is a skill published in the GitHub repository QuBiit0/lmagent (2 stars, last pushed 5mo ago), licensed MIT. It adds 34 tokens to every session and 5,684 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
doc-reader
Read any common document/data file — PDF, Word (.docx), Excel (.xlsx/.xls), PowerPoint (.pptx), images (OCR), CSV/TSV, plain text, JSON/YAML/TOML, HTML/XML, and most source-code files. Use the readdocument tool.
markdown-converter
Markdown conversion: PDF, Office, HTML, data, OCR, audio, ZIP, YouTube.
skill-doc-delivery
Convert markdown to DOCX, PPTX, XLSX, PDF office documents — use when you need exportable deliverables.
unified-deliverable-workflow
Generate spreadsheets, diagrams, and PDF reports with iteration budgeting and error recovery.
document-python-direct-exec
Use direct Python execution for reliable spreadsheet and document/PDF generation operations.
document-direct-python
Use direct Python execution for reliable document creation including spreadsheets, PDFs, and structured reports.