Slide Generator: Validate Graphics Step
Validate that image descriptions in the presentation are concrete and specific enough for AI image generation. Identifies vague descriptions and rewrites them to be generation-ready.
Pre-loaded Context
Working directory:
!pwd
Available presentation files:
!ls -la *.md 2>/dev/null | grep -i pres || echo "No presentation files found"
Prerequisites
- Preflight:
sg --versionmust succeed before proceeding — ifsgis missing, stop and tell the user this requires the privatedavistroy/slide-generatorengine (owner-only; see ADR-0008) slide-generatorpackage installedANTHROPIC_API_KEYset in environment- A
presentation.mdfile with graphics description fields
Input Validation
Required:
<presentation.md>- Path to presentation markdown file
Instructions
- Verify input: Confirm the presentation markdown exists and has graphics description fields
- Run validation:
sg validate-graphics presentation.md - Review results: Check which descriptions passed/failed validation
- Report: Show pass/fail count and any descriptions that were rewritten
How It Works
The validator checks each graphics description for:
- Specificity: Does it describe a concrete visual (not just "a diagram")?
- Actionability: Can an image generator produce this without guessing?
- Completeness: Does it specify composition, style, colors, and subject matter?
- Chunk-scoped replacement: Fixes are scoped per-slide to prevent cross-contamination
Descriptions that fail are automatically rewritten to be more concrete while preserving intent.
Error Handling
| Error | Cause | Fix |
|---|---|---|
No graphics descriptions found |
Presentation lacks image fields | Re-run draft step |
All descriptions failed |
Content too abstract | Consider manual description writing |
Output
The validation step updates presentation.md in-place with:
- Validated (or rewritten) graphics descriptions
- A
.graphics_validatedmarker file indicating completion
Next Step
After validation completes, run image generation:
sg generate-images presentation.md --resolution high
Or use /sg-generate-images to continue the pipeline.