Manages slide additions/deletions in markdown presentations with auto-renumbering, middle-gap fixing via Python script, and git-aware file operations.
From slidevnpx claudepluginhub rhuss/cc-slidev --plugin slidevThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Manage slide additions and deletions with automatic renumbering. The system handles file renaming, updates slides.md, and uses git-aware operations for tracked files.
This skill provides an interactive workflow for:
git mv for tracked files, regular mv for untracked filesUse Bash to find slides.md:
find . -name "slides.md" -type f -not -path "*/node_modules/*" | head -1
Then use Read tool on slides.md and parse all slide entries.
CRITICAL - Gap Detection: After parsing slides, check for gaps in slide numbering:
Display current presentation structure to user:
š Current Presentation Structure (N slides)
Position 1 ā Slide 1: Title Slide
slides/01-title.md
Position 2 ā Slide 5: Introduction
slides/05-introduction.md
Position 3 ā Slide 6: Main Topic
slides/06-main-topic.md
... (show all slides with BOTH position and slide number)
CRITICAL - Always show both:
If gaps are detected in the middle, add a warning:
ā ļø Numbering gaps detected in middle: [7, 8]
(Note: Gap at beginning preserved - typically title at 1, content starts at 5+)
You can fix middle gaps with the renumber operation.
Important: The renumber operation:
Use AskUserQuestion to ask the user what they want to do.
IMPORTANT: Dynamically build the options list based on whether gaps exist:
If gaps detected, offer 4 options:
- question: "What would you like to do with the slides?"
- header: "Action"
- multiSelect: false
- options:
1. label: "Fix gaps"
description: "Close middle gaps (preserves beginning gap like 1ā5 for title separation)"
2. label: "Add slide"
description: "Insert a new slide at any position"
3. label: "Delete slide"
description: "Remove a slide"
4. label: "View only"
description: "Just browsing the current structure"
If no gaps detected, offer 3 options:
- question: "What would you like to do with the slides?"
- header: "Action"
- multiSelect: false
- options:
1. label: "Add slide"
description: "Insert a new slide at any position with automatic renumbering"
2. label: "Delete slide"
description: "Remove a slide and renumber remaining slides"
3. label: "View only"
description: "Just browsing the current structure"
If user chooses "View only", end the skill.
If user chooses "Fix gaps", go to Step 2b.
Display what will happen:
š§ Fix Numbering Gaps
Current middle gaps: [7, 8]
Beginning gap: 1 ā 5 (preserved)
This will close middle gaps while preserving the beginning gap:
- Slide 1 ā Slide 1 (no change - title)
- Slide 5 ā Slide 5 (no change - beginning gap preserved)
- Slide 6 ā Slide 6 (no change)
- Slide 9 ā Slide 7 (gap closed)
- Slide 10 ā Slide 8 (gap closed)
... (show all renumbering)
Result: Slides will be 1, 5-N with no middle gaps
Ask for confirmation:
- question: "Proceed with renumbering?"
- header: "Confirm"
- multiSelect: false
- options:
1. label: "Yes, fix gaps"
description: "Renumber all slides to be sequential"
2. label: "Cancel"
description: "Keep current numbering"
If user cancels, return to Step 2.
Use Bash to execute:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/manage-slides.py renumber
Capture both stdout and stderr, check exit code.
If successful:
ā
Gaps Fixed Successfully
Renumbered slides:
- Slide 9 ā Slide 7 (slides/07-advanced.md)
- Slide 10 ā Slide 8 (slides/08-conclusion.md)
... (show all renumbered)
Beginning gap preserved: Slide 1 ā Slide 5
Total slides: N (numbered 1, 5-N with no middle gaps)
Then offer next action:
- question: "What would you like to do next?"
- header: "Next"
- multiSelect: false
- options:
1. label: "Add slide"
description: "Insert a new slide"
2. label: "Delete slide"
description: "Remove a slide"
3. label: "Done"
description: "Finish managing slides"
CRITICAL - Slide Number vs Position:
Generate options dynamically from the slide list you parsed. For each slide, create an option showing BOTH:
- question: "Which slide would you like to delete?"
- header: "Slide"
- multiSelect: false
- options:
[Generate options for each slide. Use position as label, show slide number and title:]
label: "1"
description: "Slide 1: Title Slide (slides/01-title.md)"
label: "2"
description: "Slide 5: Architecture Overview (slides/05-architecture-overview.md)"
label: "3"
description: "Slide 6: Main Topic (slides/06-main-topic.md)"
Store the mapping: When user selects an option, the label gives you the POSITION to pass to the script.
Ask if user wants to renumber after deletion:
- question: "Should remaining slides be renumbered to close gaps?"
- header: "Renumber"
- multiSelect: false
- options:
1. label: "Yes, renumber"
description: "Make slides sequential (1, 2, 3, ...) with no gaps"
2. label: "No, leave gaps"
description: "Keep slide numbers unchanged (may create gaps)"
CRITICAL: User selected a position. Look up the slide at that position to get its slide number.
Calculate and show the impact based on renumber choice:
If renumbering:
ā ļø Confirm Deletion
Deleting: Position [P] ā Slide [N]: [Title]
File: slides/0N-[slug].md
Impact (with renumbering):
- All slides after position [P] will be renumbered sequentially
- All slides will be sequential (1, 2, 3, ...) with no gaps
- Affects [X] slides total
If not renumbering:
ā ļø Confirm Deletion
Deleting: Position [P] ā Slide [N]: [Title]
File: slides/0N-[slug].md
Impact (without renumbering):
- Slide will be removed
- Remaining slides keep their current numbers
- This may create or enlarge a gap in numbering
Then ask for confirmation:
- question: "Proceed with deletion?"
- header: "Confirm"
- multiSelect: false
- options:
1. label: "Yes, delete"
description: "Remove slide [with/without renumbering]"
2. label: "Cancel"
description: "Keep all slides unchanged"
If user cancels, return to Step 2.
CRITICAL: The script expects POSITION (1-indexed position in list), NOT slide number!
Use Bash to execute the Python script with the POSITION:
If renumbering:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/manage-slides.py delete [POSITION] --renumber
If not renumbering:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/manage-slides.py delete [POSITION]
Where [POSITION] is the position the user selected (from the label in step 3a.1).
Capture both stdout and stderr.
Check exit code:
If successful, show summary:
ā
Slide Deleted Successfully
Removed:
- Slide [N]: [Title]
- File: slides/0N-[slug].md
Renumbered:
- Slide [N+1] ā Slide [N]
- Slide [N+2] ā Slide [N+1]
... (show all renumbered slides)
Total slides: [M-1] (was [M])
If error, show error message and offer to retry or cancel.
Then offer next action:
- question: "What would you like to do next?"
- header: "Next"
- multiSelect: false
- options:
1. label: "Delete another"
description: "Remove another slide"
2. label: "Add slide"
description: "Insert a new slide"
3. label: "Done"
description: "Finish managing slides"
CRITICAL - Position vs Slide Number:
Generate position options (1 through N+1):
- question: "Where should the new slide be inserted?"
- header: "Position"
- multiSelect: false
- options:
[Generate options for all valid positions, showing current slide at each:]
label: "1"
description: "At beginning (before current position 1 ā Slide 1: Title)"
label: "2"
description: "After position 1 (before current position 2 ā Slide 5: Introduction)"
label: "3"
description: "After position 2 (before current position 3 ā Slide 6: Main Topic)"
...
label: "[N+1]"
description: "At end (after last slide)"
The user selects a POSITION, which is what the script expects.
Ask for both title and layout in one question set:
Question 1:
- question: "What should the slide title be?"
- header: "Title"
- multiSelect: false
- options:
1. label: "Enter custom title"
description: "Type your slide title in the Other field"
(User will use "Other" option to enter their custom title)
Question 2:
- question: "Which layout should the slide use?"
- header: "Layout"
- multiSelect: false
- options:
1. label: "default"
description: "Standard layout"
2. label: "center"
description: "Centered content"
3. label: "two-cols"
description: "Two columns side by side"
4. label: "image-right"
description: "Content on left, image on right"
5. label: "quote"
description: "Large quote display"
6. label: "cover"
description: "Cover/title slide style"
Extract the custom title from the "Other" response.
Ask if user wants to renumber after addition:
- question: "Should all slides be renumbered to be sequential?"
- header: "Renumber"
- multiSelect: false
- options:
1. label: "Yes, renumber"
description: "Make all slides sequential (1, 2, 3, ...) with no gaps"
2. label: "No, use gaps"
description: "Insert at position, may create or use existing gaps"
Generate slug from title (lowercase, hyphens, max 40 chars) and show preview based on renumber choice:
If renumbering:
š New Slide Preview
Position: [N]
Title: [User's title]
Layout: [Selected layout]
Filename: slides/0N-[generated-slug].md
Impact (with renumbering):
- New slide will be inserted at position [N]
- Current slides [N] through [M] will become [N+1] through [M+1]
- All slides will be sequential (1, 2, 3, ...) with no gaps
- Affects [X] slides
If not renumbering:
š New Slide Preview
Position: [N]
Title: [User's title]
Layout: [Selected layout]
Filename: slides/0N-[generated-slug].md
Impact (without renumbering):
- New slide will be inserted at position [N]
- Slide number will fit into existing sequence/gaps
- May create or use existing gaps in numbering
Ask for confirmation:
- question: "Create this slide?"
- header: "Confirm"
- multiSelect: false
- options:
1. label: "Yes, create"
description: "Add slide [with/without renumbering]"
2. label: "Cancel"
description: "Don't make changes"
If cancelled, return to Step 2.
CRITICAL: The script expects POSITION (1-indexed position in list), NOT slide number!
Use Bash to execute with the POSITION from step 3b.1:
If renumbering:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/manage-slides.py add [POSITION] \
--title "[User's title]" \
--layout [layout] \
--renumber
If not renumbering:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/manage-slides.py add [POSITION] \
--title "[User's title]" \
--layout [layout]
Where [POSITION] is the position the user selected (from the label in step 3b.1).
Capture output and check exit code.
If successful:
ā
Slide Created Successfully
Added:
- Slide [N]: [Title]
- File: slides/0N-[slug].md
- Layout: [layout]
Renumbered:
- Old Slide [N] ā Slide [N+1]
- Old Slide [N+1] ā Slide [N+2]
... (show renumbered slides)
Total slides: [M+1] (was [M])
Then offer next actions:
- question: "What would you like to do next?"
- header: "Next"
- multiSelect: false
- options:
1. label: "Edit new slide"
description: "Open slide [N] for editing with /slidev:edit"
2. label: "Add another"
description: "Add another slide"
3. label: "Done"
description: "Finish managing slides"
If user chooses "Edit new slide", invoke the edit command:
Use SlashCommand tool: "/slidev:edit [N]"
When the Python script returns a non-zero exit code:
ā Operation Failed
Error: [Parsed error message]
Details: [Technical details if helpful]
Then ask:
- question: "How should we proceed?"
- header: "Action"
- multiSelect: false
- options:
1. label: "Try again"
description: "Retry the operation"
2. label: "Cancel"
description: "Return to main menu"
3. label: "Show full error"
description: "Display complete error output for debugging"
CRITICAL - Position vs Slide Number:
Gap handling:
Git awareness: The script automatically detects git-tracked files and uses git mv for them
Rollback on error: If any operation fails, all changes are automatically rolled back
Validation: Position ranges are validated before execution
Atomic operations: Backup is created before any changes, restored on error
Deleting slide 1:
Adding at end (position N+1):
Number overflow (>99):
Example 1: Add slide with sequential numbering
User invokes skill:
š Current Presentation Structure (5 slides)
Position 1 ā Slide 1: Title Slide
slides/01-title.md
Position 2 ā Slide 2: Introduction
slides/02-introduction.md
Position 3 ā Slide 3: Main Topic
slides/03-main-topic.md
Position 4 ā Slide 4: Examples
slides/04-examples.md
Position 5 ā Slide 5: Conclusion
slides/05-conclusion.md
What would you like to do?
> User chooses: "Add slide"
Where should the new slide be inserted?
> User chooses: label "3" (description: "After position 2, before position 3 ā Slide 3: Main Topic")
What should the slide title be?
> User enters: "Architecture Overview"
Which layout?
> User chooses: "two-cols"
Should all slides be renumbered?
> User chooses: "Yes, renumber"
š New Slide Preview
Position: 3
Title: Architecture Overview
Layout: two-cols
Filename: slides/03-architecture-overview.md
Impact (with renumbering):
- New slide will be inserted at position 3
- Current slides 3-5 will become 4-6
- All slides will be sequential with no gaps
- Affects 3 slides
Create this slide?
> User confirms: "Yes, create"
[Script executes: python3 manage-slides.py add 3 --title "Architecture Overview" --layout two-cols --renumber]
ā
Slide Created Successfully
Added:
- Slide 3: Architecture Overview
- File: slides/03-architecture-overview.md
- Layout: two-cols
Renumbered:
- Old Slide 3 (Main Topic) ā Slide 4
- Old Slide 4 (Examples) ā Slide 5
- Old Slide 5 (Conclusion) ā Slide 6
Total slides: 6 (was 5)
What next?
> User chooses: "Edit new slide"
[Invokes /slidev:edit 3]
Example 2: Delete slide with gaps
User invokes skill:
š Current Presentation Structure (4 slides)
Position 1 ā Slide 1: Title
slides/01-title.md
Position 2 ā Slide 5: Introduction
slides/05-introduction.md
Position 3 ā Slide 6: Main Topic
slides/06-main-topic.md
Position 4 ā Slide 7: Conclusion
slides/07-conclusion.md
ā ļø Numbering gaps detected in middle: [none]
(Note: Gap between slide 1 and 5 is preserved - typically title then content)
What would you like to do?
> User chooses: "Delete slide"
Which slide would you like to delete?
> User chooses: label "3" (description: "Slide 6: Main Topic (slides/06-main-topic.md)")
Should remaining slides be renumbered to close gaps?
> User chooses: "No, leave gaps"
ā ļø Confirm Deletion
Deleting: Position 3 ā Slide 6: Main Topic
File: slides/06-main-topic.md
Impact (without renumbering):
- Slide will be removed
- Remaining slides keep their current numbers
- This may create or enlarge a gap in numbering
Proceed with deletion?
> User confirms: "Yes, delete"
[Script executes: python3 manage-slides.py delete 3]
ā
Slide Deleted Successfully
Removed:
- Position 3 ā Slide 6: Main Topic
- File: slides/06-main-topic.md
Current slides:
- Position 1 ā Slide 1: Title
- Position 2 ā Slide 5: Introduction
- Position 3 ā Slide 7: Conclusion
ā ļø Numbering gaps detected in middle: [6]
Total slides: 3 (was 4)
Use this skill whenever users need to reorganize, add, or remove slides from their presentation. The automatic renumbering ensures the presentation structure remains clean and sequential.