slidebot
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
The system can only edit content within existing slides. It cannot:
- Duplicate slides
- Delete slides
- Reorder slides
- Create new slides from templates
Goal: Map out all the files and relationships that need updating
Key Files in PPTX:
├── [Content_Types].xml # Declares all file types
├── _rels/.rels # Root relationships
├── ppt/
│ ├── presentation.xml # Slide order and references
│ ├── _rels/presentation.xml.rels # Slide file relationships
│ └── slides/
│ ├── slide1.xml # Individual slide content
│ ├── slide2.xml
│ └── slide3.xml
Research Tasks:
- Document exact XML structure for slide references in
presentation.xml - Map relationship IDs in
presentation.xml.rels - Understand slide numbering and ID assignment patterns
- Test what happens when files are missing/extra
Goal: Copy existing slide with all proper relationships
Implementation Strategy:
interface SlideOperation {
type: 'duplicate' | 'delete' | 'reorder';
sourceSlide?: number; // For duplication
targetSlide?: number; // For deletion
insertAfter?: number; // Where to place duplicated slide
modifications?: { // Content changes to make after duplication
textBoxId: string;
content: string;
};
}
Steps for Slide Duplication:
- Copy slide XML file:
slide2.xml→slide4.xml - Update presentation.xml: Add new
<p:sldId>entry with unique ID - Update presentation.xml.rels: Add relationship to new slide file
- Update [Content_Types].xml: Add entry for new slide file
- Renumber subsequent slides: If inserting in middle, update file names
- Apply content modifications: Use existing text box replacement logic
Error Handling:
- Validate all relationship IDs are unique
- Ensure slide numbering is sequential
- Verify all referenced files exist
- Test with PowerPoint to ensure no corruption
Goal: Remove slide and clean up all references
Steps for Slide Deletion:
- Remove slide XML file: Delete
slide3.xml - Update presentation.xml: Remove corresponding
<p:sldId>entry - Update presentation.xml.rels: Remove relationship entry
- Update [Content_Types].xml: Remove slide file entry
- Renumber remaining slides:
slide4.xml→slide3.xml, etc. - Update all relationship references: Fix any broken IDs
Goal: AI can plan and execute structural changes
Enhanced Command Structure:
{ "action": "structural-multi-slide", "operations": [ { "type": "duplicate", "sourceSlide": 2, "insertAfter": 2, "modifications": { "textBoxId": "TB0", "content": "Advanced Tortoise Care" } }, { "type": "edit", "slideNumber": 3, "textBoxId": "TB1", "content": "• Advanced feeding tips\n• Habitat optimization" }, { "type": "delete", "slideNumber": 5 } ] }
AI Prompt Enhancement:
- Recognize when user needs more slides than available
- Suggest slide duplication with content variations
- Plan slide deletion when content is redundant
- Coordinate structural changes with content changes
- Relationship ID conflicts: Duplicate IDs break PowerPoint
- File numbering gaps: Missing slide3.xml with slide4.xml present
- Orphaned references: presentation.xml referencing deleted slides
- XML namespace issues: Malformed relationship XML
- Unit tests: Test each XML modification function
- Integration tests: Full PPTX generation and PowerPoint validation
- Edge cases: Empty slides, complex layouts, embedded media
- Rollback capability: Ability to revert to original file on failure
- Phase 1: Research and documentation (1-2 sessions)
- Phase 2: Slide duplication only (2-3 sessions)
- Phase 3: Slide deletion (1-2 sessions)
- Phase 4: AI integration (1 session)
- Can duplicate any slide without corruption
- Can delete any slide without breaking references
- PowerPoint opens files without repair prompts
- AI can plan multi-slide operations with structural changes
- Comprehensive error handling and rollback capability
- Start with duplication (safer than deletion)
- Test extensively with Mini_template_01.pptx
- Keep detailed logs of all XML modifications
- Consider creating backup before structural operations