24111999/claude-skills / slide-studio
slide-studio
UnverifiedCreate and modify PowerPoint presentations (PPTX) through direct XML manipulation. Use this skill when: (1) Creating presentations from scratch, (2) Adding/editing/deleting slides, (3) Inserting images or custom shapes, (4) Applying POTX templates for consistent branding, (5) Editing existing PPTX files, (6) Working with slide layouts and placeholders, (7) User asks to make a "presentation", "slides", "deck", or mentions ".pptx". Supports all 11 standard Office slide layouts.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.3 KB |
| assets/base.pptx | binary | 17.6 KB |
| assets/claude-skills-v1.5.zip | binary | 1.3 MB |
| package-lock.json | manifest | 4.5 KB |
| package.json | manifest | 422 B |
| references/ooxml-reference.md | markdown | 4.5 KB |
| references/slide-patterns.md | markdown | 5.2 KB |
| scripts/add-image.js | script | 7.0 KB |
| scripts/add-shape.js | script | 7.9 KB |
| scripts/add-slide.js | script | 9.2 KB |
| scripts/apply-potx.js | script | 9.0 KB |
| scripts/clone-slide.js | script | 5.3 KB |
| scripts/create-base.js | script | 16.0 KB |
| scripts/delete-slide.js | script | 3.2 KB |
| scripts/edit-text.js | script | 5.8 KB |
| scripts/generate-base.js | script | 24.7 KB |
| scripts/lib/constants.js | script | 3.2 KB |
| scripts/lib/content-types.js | script | 3.8 KB |
| scripts/lib/relationships.js | script | 3.9 KB |
| scripts/lib/xml-utils.js | script | 4.6 KB |
| scripts/list-layouts.js | script | 2.2 KB |
| scripts/list-slides.js | script | 3.4 KB |
| scripts/pack.js | script | 3.0 KB |
| scripts/skills_claude_poetship.zip | binary | 498.2 KB |
| scripts/unpack.js | script | 1.6 KB |
| scripts/visualize-slide.js | script | 6.0 KB |
scripts/clone-slide.js
View on GitHub#!/usr/bin/env node
/**
* Duplicates an existing slide
* Usage: node clone-slide.js <working-directory> --source <position> [--position <pos>]
*/
const fs = require('fs');
const path = require('path');
const { parseRelationships, generateRelationships, addRelationship } = require('./lib/relationships');
const { parseContentTypes, generateContentTypes, addSlideContentType } = require('./lib/content-types');
const { REL_TYPES } = require('./lib/constants');
const { listSlides } = require('./list-slides');
function parseArgs(args) {
const result = { source: null, position: null };
for (let i = 0; i < args.length; i++) {
if (args[i] === '--source' && args[i + 1]) {
result.source = parseInt(args[i + 1], 10);
i++;
} else if (args[i] === '--position' && args[i + 1]) {
result.position = parseInt(args[i + 1], 10);
i++;
}
}
return result;
}
function getNextSlideNumber(slidesDir) {
const files = fs.readdirSync(slidesDir).filter(f => f.match(/^slide\d+\.xml$/));
if (files.length === 0) return 1;
const nums = files.map(f => parseInt(f.match(/\d+/)[0], 10));
return Math.max(...nums) + 1;
}
function getNextSlideId(presentationXml) {
const ids = [];
const pattern = /<p:sldId[^>]*id="(\d+)"/g;
let match;
while ((match = pattern.exec(presentationXml)) !== null) {
ids.push(parseInt(match[1], 10));
}
return ids.length > 0 ? Math.max(...ids) + 1 : 256;
}
function updateSlideIds(slideXml, offset) {
// Update all id attributes to be unique
return slideXml.replace(/(\bid\s*=\s*["'])(\d+)(["'])/g, (match, before, id, after) => {
return before + (parseInt(id, 10) + offset) + after;
});
}
function cloneSlide(workDir, sourcePosition, targetPosition = null) {
const absWork = path.resolve(workDir);
const slidesDir = path.join(absWork, 'ppt', 'slides');
const slideRelsDir = path.join(absWork, 'ppt', 'slides', '_rels');
const presentationPath = path.join(absWork, 'ppt', 'presentation.xml');
const presentationRelsPath = path.join(absWork, 'ppt', '_rels', 'presentation.xml.rels');
const contentTypesPath = path.join(absWork, '[Content_Types].xml');
// Get source slide info
const slides = listSlides(workDir);
const sourceSlide = slides.find(s => s.position === sourcePosition);
if (!sourceSlide) {
throw new Error(`Source slide at position ${sourcePosition} not found`);
}
const sourceNum = sourceSlide.slideNum;
const newNum = getNextSlideNumber(slidesDir);
// Copy slide XML
const sourceSlideXml = fs.readFileSync(path.join(slidesDir, `slide${sourceNum}.xml`), 'utf-8');
const newSlideXml = updateSlideIds(sourceSlideXml, 1000 + newNum * 100); // Offset IDs to avoid conflicts
fs.writeFileSync(path.join(slidesDir, `slide${newNum}.xml`), newSlideXml);
// Copy slide relationships
const sourceRelsPath = path.join(slideRelsDir, `slide${sourceNum}.xml.rels`);
if (fs.existsSync(sourceRelsPath)) {
const sourceRelsXml = fs.readFileSync(sourceRelsPath, 'utf-8');
fs.writeFileSync(path.join(slideRelsDir, `slide${newNum}.xml.rels`), sourceRelsXml);
}
// Update presentation.xml.rels
const presRelsXml = fs.readFileSync(presentationRelsPath, 'utf-8');
const presRels = parseRelationships(presRelsXml);
const slideRId = addRelationship(presRels, REL_TYPES.slide, `slides/slide${newNum}.xml`);
fs.writeFileSync(presentationRelsPath, generateRelationships(presRels));
// Update presentation.xml
let presXml = fs.readFileSync(presentationPath, 'utf-8');
const slideId = getNextSlideId(presXml);
const sldIdEntry = `<p:sldId id="${slideId}" r:id="${slideRId}"/>`;
if (targetPosition !== null) {
const sldIdPattern = /<p:sldId[^>]*\/>/g;
const matches = [...presXml.matchAll(sldIdPattern)];
if (targetPosition <= 1 || matches.length === 0) {
presXml = presXml.replace(/<p:sldIdLst>/, `<p:sldIdLst>\n ${sldIdEntry}`);
} else if (targetPosition > matches.length) {
presXml = presXml.replace(/<\/p:sldIdLst>/, ` ${sldIdEntry}\n </p:sldIdLst>`);
} else {
const targetMatch = matches[targetPosition - 1];
presXml = presXml.slice(0, targetMatch.index) + sldIdEntry + '\n ' + presXml.slice(targetMatch.index);
}
} else {
presXml = presXml.replace(/<\/p:sldIdLst>/, ` ${sldIdEntry}\n </p:sldIdLst>`);
}
fs.writeFileSync(presentationPath, presXml);
// Update [Content_Types].xml
const ctXml = fs.readFileSync(contentTypesPath, 'utf-8');
const ct = parseContentTypes(ctXml);
addSlideContentType(ct, newNum);
fs.writeFileSync(contentTypesPath, generateContentTypes(ct));
console.log(`Cloned slide ${sourcePosition} to new slide ${newNum}`);
return { slideNum: newNum, slideId, rId: slideRId };
}
// CLI execution
if (require.main === module) {
const args = process.argv.slice(2);
const workDir = args[0];
if (!workDir || workDir.startsWith('--')) {
console.error('Usage: node clone-slide.js <working-directory> --source <position> [--position <pos>]');
process.exit(1);
}
const options = parseArgs(args.slice(1));
if (options.source === null) {
console.error('Error: --source <position> is required');
process.exit(1);
}
try {
cloneSlide(workDir, options.source, options.position);
} catch (err) {
console.error('Error:', err.message);
process.exit(1);
}
}
module.exports = { cloneSlide };
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |