gpsaggese/helpers / .claude/skills/slides.update_from_source
slides.update_from_source
VerifiedUpdate slides to match changes in the source slides they cite
Goal
-
Given a slides file
<TARGET>(.smd) whose slides cite their source slides with// From: <SOURCE>:<LINE> '<source line>'comments, find what changed in each<SOURCE>and incorporate it into the citing slide of<TARGET> -
Optionally, the user passes a scope (a slide title or a line range in
<TARGET>). Then process only the slides in that scope
Workflow
- Read the conventions in
.claude/skills/slides.rules.md, especially## Source Attribution (// From: ...)
List the Citations
- Extract every
// From:line of<TARGET>with its line number> grep -n "^// From:" <TARGET> - Attach each citation to the nearest preceding
* <slide title>line - Skip a bare
// From: ...(nothing after the colon). It marks a slide with no identified source. Do not guess a source and do not drop the line - Group the citations by
<SOURCE>file, so each<SOURCE>is read once
Resolve Each Source Slide
- Check that
<SOURCE>exists. If it does not, report it and go to the next citation - Find the current position of the cited line in
<SOURCE>- Search for the verbatim
'<source line>'text, including its leading marker (*,#,##,###).<LINE>drifts whenever<SOURCE>is edited above it> grep -nF -- '<source line>' <SOURCE> - If several lines match, pick the one closest to the recorded
<LINE> - If nothing matches, the source slide was renamed, moved, or deleted
- Search for the title text without its marker, and for a close variant
- If a single clear candidate exists, use it and record the new text in the
// From:line - If no candidate exists, report "source missing", leave the slide and its
// From:line unchanged, and go to the next citation
- Search for the verbatim
- Extract the source content
- For a
* <slide title>line: the lines up to the next*slide or#header line - For a
#,##,###header line: the lines up to the next header of the same or higher level. Only the part matching the citing slide's topic is relevant - For a
- [P<NNN>]or- [B<NNN>]entry inrelated_papers.mdorrelated_books.md: the entry itself. Compare only its text (authors, title, year, link) with the reference used in the slide
- For a
Find What Changed
- The optional
<BASE>(a Git hash) is the version of<SOURCE>the slide was last synced with- If the user passes it, use it
- Otherwise, use the last commit that touched
<TARGET>:> git log -1 --format=%H -- <TARGET>
- Get the diff of
<SOURCE>once per file, not once per slide:> git diff <BASE> -- <SOURCE>- Use the diff as a hint to find the changed slides fast
- Always compare the current source text with the citing slide text too,
because a slide may have been synced from an older version than
<BASE>
- Compare the source content with the citing slide and classify each difference
- Substantive (incorporate it)
- A new or changed definition, claim, number, equation, or example
- A new bullet that adds an idea absent from the slide
- A retracted or corrected fact
- A changed
graphviz,mermaid,tikzcode block or image link
- Cosmetic (ignore it)
- Rewording, reordering, or formatting that the slide already adapted
- Tag, bold, or punctuation changes that only follow
slides.rules.md
- Substantive (incorporate it)
Incorporate Changes
- Edit the citing slide of
<TARGET>to reflect every substantive change - Keep the slide as an adaptation, not a copy
- Keep the slide title, the structure, and the wording the author already adapted
- Rename the slide only if the change renames the concept
- Do not paste the source text over the slide
- When a slide cites several sources, reconcile each
// From:line in turn- Keep the content that comes from the other sources
- Remove content only if its own source dropped or retracted it
- Do not delete slide content only because the source has no counterpart. The slide may combine several sources or add its own material. Remove content only when the diff shows the fact or example was changed or retracted, not moved
- Write the new text following
.claude/skills/slides.rules.md- E.g., semantic tags, 80 columns, no back-reference to other lessons, no dashes as punctuation
- If a change needs a decision from the user (e.g., the source restructured one slide into three), do not guess. Leave the slide unchanged and report the question
Update the // From: Lines
- Rewrite each resolved
// From:line to the current position and text of its source line// From: <SOURCE>:<NEW_LINE> '<NEW_SOURCE_LINE>'<NEW_LINE>is the current line number of the source line in<SOURCE><NEW_SOURCE_LINE>is that line verbatim, including its leading marker
- Do this for every resolved citation, including those with no content change, since an edit above the source slide shifts its line number
- Do not touch a bare
// From: ...line or a source-missing citation - Keep one
// From:line per source, stacked directly under the slide title, in the original order
Report
- Print one line per citation with one status
updated: content changed, with a short list of what changedunchanged: content in sync (line number possibly refreshed)source missing: the source file or slide was not foundneeds decision: a change that needs the user
- Do not commit. The user reviews the diff of
<TARGET>first
Conventions
- Follow the slide conventions in
.claude/skills/slides.rules.md - The related skill
.claude/skills/book.update_from_source/SKILL.mddoes the same synchronization for a book chapter (.typ,.tex,.md) instead of.smdslides
Constraints
- Never modify
<SOURCE> - Never change a slide that has no
// From:line or only a bare// From: ... - Never invent a source, a line number, or a source line text: copy them from
<SOURCE> - Never commit
Verification
- Every non-bare
// From: <SOURCE>:<LINE> '<source line>'in<TARGET>points at a line that exists in<SOURCE>, and that line matches the quoted text> sed -n '<LINE>p' <SOURCE> - Every substantive change found in the diff of
<SOURCE>is reflected in the citing slide, or listed asneeds decisionin the report - No slide lost content that its source still supports
- The edited slides still follow
.claude/skills/slides.rules.md- For a full check, run
.claude/skills/slides.lint/SKILL.mdon<TARGET>
- For a full check, run
-
git diff <TARGET>shows only the intended slide and// From:changes
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: 196k | 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: 196k | 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: 196k | 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: 196k | Updated | Claude CodeCodex | Verified | Install |