Book Chapter.Fix Headings
БесплатноБез исполняемых скриптовНе проверенFix Typst book chapter headings and slide titles to match its .smd source
от gpsaggese★ 158 звёзд на GitHubОб этом скилле
Goal
- Given a lecture's
.smdsource and its generated.typbook chapter (fromgen_book_chapter.py --mode typst_aima), fix the heading levels and slide-title handling to follow the "Structural Hierarchy" rule in.claude/skills/typst.rules.md - Mostly mechanical (moving
=/==/===markers). A slide title that must become a transition (see Step 3) needs one reworded sentence. That is the only text this skill may change. The rest of the prose stays untouched - A fix-up for chapters generated before that rule existed, or hand-edited inconsistently. On a chapter that already follows the rule, it is a no-op
Inputs
<SMD_FILE>: the lecture source- E.g.,
msml610/lectures_source/Lesson02.1-A_Map_of_Machine_Learning.smd
- E.g.,
<TYP_FILE>: the generated book chapter for<SMD_FILE>- E.g.,
msml610/book/Lesson02.1-A_Map_of_Machine_Learning.typ
- E.g.,
Workflow
Classify Every Heading/slide in <SMD_FILE>
- Walk
<SMD_FILE>top to bottom, collecting every#/##/###(+) heading line and every* Slide Titleline, in source order, with its line number - Track one running flag,
seen_subheading, startingFalse: flip it toTruethe first time a##or deeper heading is seen. Its value when each* Slide Titleline is reached (before any##on the same line updates it) is what Step 3 needs for that slide
Locate the Matching Line in <TYP_FILE>
<TYP_FILE>carries a
comment immediately above every heading/slide it was generated from. Match each Step 1 entry by line number + marker, not by title alone, since titles can repeat (e.g., a lesson and its own first slide sharing a name)// From: <SMD_FILE>:<LINE_NUMBER> '<MARKER> <TITLE>' // Slide: <TITLE>- The heading/title line itself is the next non-comment line after
// Slide: <TITLE>: it may currently be#strong[Title],= Title/== Title/=== Title, or missing entirely (the block's paragraph starts right after the comment, no title line at all)
Apply the Rule From typst.rules.md
// TODO(ai_gp): Make reference to the typst.rules.md instead of this wall of text
For each block from Step 2, make its title line match the ## Structural Hierarchy
and ## Mandatory Sections rules in typst.rules.md. This skill decides which
rule applies to each block. The rules define the heading syntax:
- H1 (
#), title equal to the chapter title in#chapter(...)(the common case: one#per lesson): delete the title line, keep the// From:/// Slide:comments. If a body-level H1 has different text, check for##/###under it before the next#(or end of document). With no nested subsections, use#strong[Title]instead of deleting it. With nested##/###subsections (e.g., a lesson combining two topics, each# Topicwith its own##subsections), keep a real= Titleheading, sincetypst.rules.mdforbids#strongin place of a heading. If unsure, cross-checkextract_toc_from_txt.py -i <SMD_FILE>vsgrep "^=" <TYP_FILE> ##/###/deeper: apply the## Structural Hierarchyheading-level mapping. Leave alone if already correct* Roadmap,* Summary,* References: always the mandatory level-1 headings per## Mandatory Sections, whateverseen_subheadingis. Theseen_subheadingrule below covers ordinary slides only and never applies to them* Slide Title(any other slide):seen_subheadingwasFalse->= Title, a real heading (add the line if missing, replace#strong[Title]or a transitioned-in paragraph)seen_subheadingwasTrue, and this is the first slide since that heading (no other* Slide Titleblock since) -> drop the title: no#strong[Title]line, no added transition. Delete a#strong[Title]line if present (and the blank line after it). The paragraph opens with its own first sentence, directly after the// Slide:commentseen_subheadingwasTrue, and at least one other slide appeared since that heading -> drop the title and transition in from the previous slide's ending instead of restating the title:- Read the previous block's last sentence and this block's first sentence
- If the previous sentence already works as a lead-in (a forward reference, a rhetorical question, a "this raises the question of X" close) and the paragraph's opening picks it up, deleting the title line is enough
- Otherwise, prepend one short sentence (or reword the first clause of the opening sentence) that connects the two: a callback to the previous slide's last term or claim, a contrast ("beyond X, a second axis is..."), or an explicit bridge. Keep it to one sentence. Do not summarize or repeat what the paragraph says next
- A slide's central term may get
#strong[...]inside the transition or the first sentence, never on its own line
- Either way, remove the blank line betwe
Установить Book Chapter.Fix Headings в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Book Chapter.Fix Headings?
Fix Typst book chapter headings and slide titles to match its .smd source
Как установить скилл Book Chapter.Fix Headings?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Book Chapter.Fix Headings запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic