Assume there are problems. Your job is to find them.
Your first render is almost never correct. Approach QA as a bug hunt, not a confirmation step. If you found zero issues on first inspection, you weren't looking hard enough.
The QA process should be executed by a separate subagent (not the same agent that created the slides). The creating agent is biased toward confirming its own work. A fresh subagent with no prior context will catch issues that the creator overlooks.
Spawn a subagent with:
The subagent should return a structured pass/fail report. If any check fails, the creating agent fixes the issues and re-runs QA (via the same or a new subagent).
python -m markitdown output.pptx
Check for missing content, typos, wrong order.
Check for leftover placeholder text:
python -m markitdown output.pptx | grep -iE "xxxx|lorem|ipsum|placeholder|this.*(page|slide).*layout"
If grep returns results, fix them before declaring success.
When the deck is derived from external source material (paper, article, report, brief), verify content fidelity:
When imitating a template's visual style, verify:
python -m markitdown output.pptx -> Review contentDo not declare success until you've completed at least one fix-and-verify cycle.
python -m markitdown slide-XX-preview.pptx
Check for missing content, placeholder text, missing page number badge.
margin: 0 on the text box or offset the shape to account for paddingopacity property instead// WRONG - compile.js won't await
async function createSlide(pres, theme) { ... }
// CORRECT
function createSlide(pres, theme) { ... }
color: "FF0000" // CORRECT
color: "#FF0000" // CORRUPTS FILE
shadow: { color: "00000020" } // CORRUPTS FILE
shadow: { color: "000000", opacity: 0.12 } // CORRECT
// Use fit:'shrink' for long titles
slide.addText("Long Title Here", {
x: 0.5, y: 2, w: 9, h: 1,
fontSize: 48, fit: "shrink"
});
// WRONG
const shadow = { type: "outer", blur: 6, offset: 2, color: "000000", opacity: 0.15 };
slide.addShape(pres.shapes.RECTANGLE, { shadow, ... });
slide.addShape(pres.shapes.RECTANGLE, { shadow, ... });
// CORRECT - factory function
const makeShadow = () => ({ type: "outer", blur: 6, offset: 2, color: "000000", opacity: 0.15 });
slide.addShape(pres.shapes.RECTANGLE, { shadow: makeShadow(), ... });
slide.addShape(pres.shapes.RECTANGLE, { shadow: makeShadow(), ... });
Chinese quotes (\u201c \u201d \u2018 \u2019), full-width punctuation, and other non-ASCII
characters in JS source files cause node to throw syntax errors at compile time. This is the
#1 cause of compile failures — it triggers cascading fix attempts that waste 10+ tool calls.
Common sources of non-ASCII contamination:
\u201c\u201d instead of " — the most frequent offender\uff1a instead of :\uff08\uff09 instead of ()\u2014 instead of --\u00a0 instead of regular spaceRules:
"Chinese text here" is correct.Use the pre-compile lint (see below) before every node compile.js invocation.
// WRONG — Chinese smart quotes break compilation
slide.addText("\u201c\u667a\u80fd\u52a9\u624b\u201d\u7684\u6838\u5fc3\u4ef7\u503c", { ... });
// CORRECT — ASCII quotes only in JS source
slide.addText('"\u667a\u80fd\u52a9\u624b"\u7684\u6838\u5fc3\u4ef7\u503c', { ... });
Run this before every node compile.js. It catches non-ASCII quote issues before they
cascade into 10+ fix attempts.
# One-liner: scan all slide JS files for non-ASCII quotes and full-width punctuation
node -e "
const fs = require('fs');
const files = fs.readdirSync('./slides').filter(f => f.endsWith('.js'));
let ok = true;
const BAD = /[\u201c\u201d\u2018\u2019\u3001\u3002\uff0c\uff1b\uff1a\uff01\uff1f\uff08\uff09\u2014\u2013\u2026\u00a0]/g;
for (const f of files) {
const src = fs.readFileSync('./slides/' + f, 'utf8');
const lines = src.split('\n');
for (let i = 0; i < lines.length; i++) {
const m = lines[i].match(BAD);
if (m) {
console.error('NON-ASCII in slides/' + f + ':' + (i+1) + ' -> ' + JSON.stringify(m));
ok = false;
}
}
}
if (!ok) { console.error('FIX non-ASCII characters before compiling!'); process.exit(1); }
else { console.log('Pre-compile lint passed.'); }
"
If the lint fails, replace all flagged characters with their ASCII equivalents before proceeding. Do not attempt to compile until the lint passes.