{
 "schema": "aiblocks-page/1",
 "id": "agency-engineering-universal-document-compiler",
 "type": "agent",
 "name": "Document layout engine designer",
 "summary": "Plan how YAML or JSON data becomes a paged PDF. Get a layout for each section, page-break rules and checks that no field is dropped or split.",
 "headline": "Document layout engine designer",
 "subhead": "Paste a YAML or JSON file, or describe its shape, and name the page size. It picks a layout for each section, plans the page breaks and lists the checks that no field gets lost. Built for developers who make resumes, invoices and reports from data.",
 "job": {
  "id": "work-with-files",
  "name": "Make documents, sheets and slides"
 },
 "level": "intermediate",
 "thinking": "high",
 "tested": true,
 "updated": "2026-11-03",
 "first_published": "2026-10-26",
 "inputs": [
  {
   "type": "question",
   "required": true,
   "label": "Question",
   "what": "the problem, decision or piece of work you want help with, and what a good outcome looks like"
  },
  {
   "type": "dataset",
   "required": false,
   "label": "Dataset",
   "what": "data files to process or analyse, such as a CSV or JSON export, logs, lab or sensor files, with their format and where they came from"
  }
 ],
 "outputs": [
  {
   "type": "plan",
   "required": true,
   "label": "Plan",
   "what": "a dated plan: what to do, in what order, with a decision rule for each step"
  },
  {
   "type": "audit_report",
   "required": true,
   "label": "Audit report",
   "what": "findings with evidence, severity, missing inputs and next actions"
  }
 ],
 "you_give": [
  "The data file, or a sample of it, in YAML, JSON or Markdown front matter",
  "The page size, such as A4 or US Letter",
  "The kind of document, such as a resume, invoice, spec or proposal",
  "The tools you build with, such as React or Node (optional)",
  "Fields you must always show, and any layout you already like (optional)"
 ],
 "you_get": [
  "A layout choice for each section of your data, with the reason",
  "A plan that keeps every field, including ones no template knew about",
  "Page-break rules, so headings and cards stay whole",
  "A small layout settings file kept apart from your data",
  "Checks to run, and the questions still open"
 ],
 "use_when": [
  "You build a resume, invoice or report maker and users add fields your template does not know.",
  "You have one YAML or JSON file and want it to become a clean, paged document.",
  "Your editor and your preview must stay in step, and edits keep wiping comments or the cursor.",
  "Long sections split across pages and you want rules to stop it."
 ],
 "skip_when": [
  "You want one PDF from text or a sheet with no code. Use the PDF maker and reader or the JSON document file generator.",
  "Your problem is blank pages or blurry text in a web-page PDF. Use the PDF layout designer.",
  "You need a Word, slide or Excel file. Use the Document generation planner.",
  "You need a final contract, medical or financial report. Have a qualified person sign it off, even if this agent plans the layout."
 ],
 "output_sample": {
  "input": [
   "A YAML or JSON data file, or a sample of it",
   "The page size and kind of document",
   "Your tools, such as React or Node (optional)",
   "Fields that must always show (optional)"
  ],
  "prerequisites": [
   "A developer who can run code and test a PDF",
   "Claude, ChatGPT or Gemini, or an agent such as Claude Code that can read your files"
  ],
  "output": [
   {
    "name": "Document type and page",
    "contains": "The kind of document and the page size the plan is built for."
   },
   {
    "name": "Field map",
    "contains": "Each section of your data, the layout chosen, the reason and how sure the AI is."
   },
   {
    "name": "Unknown or extra fields",
    "contains": "Fields no template covers, with the layout picked so none are dropped."
   },
   {
    "name": "Layout settings file",
    "contains": "Sizes, colours and overrides kept apart from your data, matched by section name."
   },
   {
    "name": "Page-break rules",
    "contains": "Rules that keep headings with their text and stop cards splitting."
   },
   {
    "name": "Checks",
    "contains": "Tests for missing fields and bad page ends, each marked NOT RUN until you run it."
   },
   {
    "name": "Open questions",
    "contains": "Decisions only you can make, such as which fields to hide."
   }
  ]
 },
 "output_shape": "DOCUMENT TYPE AND PAGE\n  Type: <resume, invoice, spec or other> | Page: <size>\n\nFIELD MAP\n  <path in your data> | <layout> | <why> | <confidence>\n\nUNKNOWN OR EXTRA FIELDS\n  <path> | <layout chosen> | <shown or hidden by you>\n\nLAYOUT SETTINGS FILE\n  <section name> | <override, such as font size or columns>\n\nPAGE-BREAK RULES\n  <element> | <rule> | <what happens if it is too long>\n\nCHECKS\n  <check> | <how to run it> | <pass, fail or NOT RUN>\n\nOPEN QUESTIONS\n  <question> | <what changes the answer>",
 "how_to_use": [
  "Download the pack from this page and add it to your AI as a skill. If you cannot, paste SKILL.md into a new chat, then paste references/source-agent.md after it.",
  "Paste a sample of your data. Say the page size and the kind of document.",
  "Type \"Plan the layout for each section of this data\" or \"Find fields this template would drop\".",
  "Read the layout table first. Fix any section where the AI chose a layout that does not suit it.",
  "Run the checks on a real PDF from your own code. The AI cannot render one for you. Ask a developer to review any code before use."
 ],
 "checks": [
  "The result addresses your actual task and cites the evidence used.",
  "Examples, role-play experience and targets are kept separate from verified results.",
  "Claims of tests, memory, tool access or completed actions match what actually happened."
 ],
 "next": [
  {
   "name": "PDF maker and reader",
   "url": "https://useaiblocks.com/skills/pdf-maker-and-reader",
   "why": "PDF maker and reader"
  },
  {
   "name": "JSON document file generator",
   "url": "https://useaiblocks.com/skills/document-file-generator",
   "why": "JSON document file generator"
  }
 ],
 "source": {
  "by": "Michael Sitarzewski and Agency Agents contributors",
  "repo": "msitarzewski/agency-agents",
  "url": "https://github.com/msitarzewski/agency-agents/blob/b37b5bb33b78f2c1d6567d98e25ca818e3259219/engineering/engineering-universal-document-compiler.md",
  "licence": "MIT",
  "original_name": "Universal Document Compiler",
  "commit": "b37b5bb33b78f2c1d6567d98e25ca818e3259219"
 },
 "credits": [
  {
   "title": "Universal Document Compiler",
   "by": "Michael Sitarzewski and Agency Agents contributors",
   "url": "https://github.com/msitarzewski/agency-agents/blob/b37b5bb33b78f2c1d6567d98e25ca818e3259219/engineering/engineering-universal-document-compiler.md",
   "used": "Original agent profile, preserved in references/source-agent.md; AI Blocks adds setup and review instructions."
  }
 ],
 "files": [
  "LICENSE",
  "references/source-agent.md",
  "SETUP.md",
  "source.json"
 ],
 "links": {
  "page": "https://useaiblocks.com/agents/agency-engineering-universal-document-compiler",
  "markdown": "https://useaiblocks.com/agents/agency-engineering-universal-document-compiler.md",
  "json": "https://useaiblocks.com/agents/agency-engineering-universal-document-compiler.json",
  "instructions": "https://useaiblocks.com/skills/agency-engineering-universal-document-compiler/SKILL.md",
  "download": "https://useaiblocks.com/skills/agency-engineering-universal-document-compiler.zip",
  "api_item": "https://useaiblocks.com/api/v1/items/agency-engineering-universal-document-compiler",
  "api_document": "https://useaiblocks.com/api/v1/documents/agent/agency-engineering-universal-document-compiler",
  "mcp": "https://useaiblocks.com/mcp"
 }
}
