Slide layout gate

From 5throck/ai-workspace-standards · View interactive version

Slide layout gate is an AI agent skill from the GitHub repository 5throck/ai-workspace-standards. Slide content conformance gate. Runs estimate-layout.ts --lint to check every slide in slidedata.json against the merged 4-layer spec's content_constraints (per slide type: title/subtitle/desc chars, bullet count, body chars). Exit 1 blocks PDF export. Responds to "layout gate", "lint slides", "chec

How to use this skill

Skill file

Context

The deck pipeline had two content-discipline points with nothing between them and

the renderer: theme.json content_rules disciplines storyline at creation time

(Stage 2), and the PDF renderer lays out whatever it receives. A deck edited after

storyline — or a storyline miss — produced overflowing titles and bullet walls

that only surfaced as clipped PDF output. This gate closes that gap: it checks

the built deck (slidedata.json) against the render-time bounds the merged

layout spec actually declares, using the exact 4-layer merge

(layout_base.json → theme pdf_layout_spec.json → style pdf_color_spec.json

→ lecture-profile.md layout_overrides) that gen-slides-pdf.ts renders with.

When to Use

Execution Steps

  1. Run the gate:

```bash

bun scripts/co-deck/estimate-layout.ts --project deliverables/<project> --lint

```

(composes with --sample: lint runs first; a FAIL blocks the sample too)

  1. Read the verdict table — one row per slide: # | Type | Check | Actual | Limit | Verdict
  2. Exit 0 → gate passed; proceed to pdf-export
  3. Exit 1 → blocked; apply the remediation ladder below, then re-run until pass

Output Format

| Output | Destination | Format |

|--------|-------------|--------|

| Verdict table | console (stdout) | per-slide check rows: # \| Type \| Check \| Actual \| Limit \| Verdict |

| Violation summary + remediation ladder | console (stderr on FAIL) | N check(s) passed, M failed, K slide(s) unconstrained (WARN) |

| Layout summary | deliverables/<project>/layout_summary.md | unchanged prep-pdf artifact (written on every run) |

Verdict Semantics

| Verdict | Meaning | Action |

|---------|---------|--------|

| PASS | within a declared constraint | none |

| FAIL | exceeds a declared constraint, or the slide's type is not in the merged slide_types (no CSS layout exists — it would break rendering) | blocked — remediate |

| WARN | slide type is valid but declares no content_constraints in the spec (e.g. title, profile, contact) | allowed through; if these slides overflow in practice, declare bounds in the theme's pdf_layout_spec.json |

Checks

| Check | Slidedata field(s) | Constraint key |

|-------|--------------------|----------------|

| title chars | title | max_title_chars |

| subtitle chars | subtitle (fallback sub) | max_subtitle_chars |

| desc chars | sub (fallback text) | max_desc_chars |

| bullet count | bullets.length | max_bullets |

| body chars | joined bullet text, or text when no bullets | max_body_chars |

A constraint key absent for a slide type means that check is skipped for that type

(the gate enforces only what the spec declares). Example — pitch-enhanced:

standard max_bullets=4 / max_title_chars=28 / max_body_chars=100;

divider max_title_chars=28 / max_desc_chars=80; punchline max_title_chars=40.

Remediation Ladder (in order)

  1. Cut content — trim title/subtitle, tighten or merge bullets (preferred)
  2. Split the slide into two standard slides
  3. Reclassify the slide type (Uniform Layout Principle, context.md Content Rules — content slides stay standard)
  4. Record a justified layout_overrides entry in lecture-profile.md (last resort — requires a design note stating why the declared bound is wrong for this deck)

Relationship to content_rules

theme.json content_rules (Stage 2, storyline) is the stricter creation-time

discipline applied while composing slide_deck.md. This gate is the render-time

bound from the merged spec's content_constraints, checked against the built

deck. A compliant storyline that is edited afterwards can still fail the gate;

a deck failing both was non-compliant at creation.

Related Skills

Video-Slide Bullet Policy (U-20261116-007)

Video slides are skipped by the lint's layout probes but the THEME rule (min 3

bullets per slide) still applies to their bullet fields: video-slide bullets

count and are linted like any other slide; the layout probes (which need a

rendered box) remain skipped. A video slide with fewer than the theme minimum

bullets is a real violation, not a probe skip.

Calibrated Bounds (U-20261116-007)

zen ships max_body_chars 600 (DEC-20261114-04 calibration — the 80-char bound

failed 40+/47 slides of normal lecture decks and buried real violations). The

bound is advisory; bullet-count min, title length and structure checks are

blocking. A deck overriding a calibrated bound needs a PM decision record.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.