document-generator

document-generator is a skill for Claude Code, Codex from QuBiit0/lmagent. It costs 34 tokens per session (5,684 once invoked), scanned A, original, MIT.

Guidance for programmatically creating office files such as PDFs, Word documents, spreadsheets, and presentations from structured data.

In plain words
What is it for?
Generating and updating professional office documents from data using reusable templates. The description does not require a specific library.
Why use it?
It helps produce repeatable, consistently formatted documents instead of creating each file manually.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/qubiit0/lmagent/document-generator
Any agent
npx skills add QuBiit0/lmagent --skill document-generator
Clone the repo
git clone --depth 1 https://github.com/QuBiit0/lmagent

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for document-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/qubiit0/lmagent/document-generator.svg)](https://agentmods.dev/skills/qubiit0/lmagent/document-generator)
Your own site
<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>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,684 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 5d ago against content hash fce656b23c3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

.agents/skills/document-generator/SKILL.md · 748 lines

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:

  1. Data-Driven: Los documentos se generan desde datos (JSON/DB), nunca a mano.
  2. Template First: Diseña el template una vez, reutilízalo mil veces.
  3. Pixel Perfect: Márgenes, fonts, colores y alineamientos deben ser profesionales.
  4. 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' },

Read the full file on GitHub · 748 lines

Files

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.

Changes

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.

  1. 5d ago First seen · 748 lines · 34 tokens per session scan A fce656b23c3c

Subscribe to this mod's changes

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.