[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F1MRFJ00Q4DHCJ9A5S2DN5":3,"skill-same:01M6F1MRFJ00Q4DHCJ9A5S2DN5":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":26,"frontMatter":27,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M6F1MRFJ00Q4DHCJ9A5S2DN5","book_chapter.fix_headings",null,"Fix Typst book chapter headings and slide titles to match its .smd source","causify-ai\u002Fhelpers","causify-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121828442?v=4","01M6BZFTHW2MQR7FWK8CDW0DRA","Causify.AI","01M6F1K6CCKKF8YKTBN4ZV509G",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fbook_chapter.fix_headings\u002FSKILL.md",[],[19,20,21,22],"book chapter fix headings","fix","typst","match","2026-11-10 10:12:30",false,"---\ndescription: Fix Typst book chapter headings and slide titles to match its .smd source\nmodel: sonnet\n---\n\n# Goal\n\n- Given a lecture's `.smd` source and the `.typ` book chapter generated from it (by\n  `gen_book_chapter.py --mode typst_aima`), fix the chapter's heading levels and\n  slide-title handling to follow the \"Structural Hierarchy\" rule in\n  `.claude\u002Fskills\u002Ftypst.rules.md`\n- Most of this is mechanical (moving `=`\u002F`==`\u002F`===` markers), but one part is not:\n  a slide title that must become a transition (see Step 3 below) requires rewording\n  a sentence, not just replacing a marker. That is the only text this skill is\n  allowed to change; everything else in the chapter's prose stays untouched\n- This is a fix-up for chapters generated before that rule existed (or that were\n  hand-edited inconsistently): running it on a chapter that already follows the rule\n  is a no-op\n\n# Inputs\n\n- `\u003CSMD_FILE>`: the lecture source\n  - E.g., `msml610\u002Flectures_source\u002FLesson02.1-A_Map_of_Machine_Learning.smd`\n- `\u003CTYP_FILE>`: the generated book chapter for `\u003CSMD_FILE>`\n  - E.g., `msml610\u002Fbook\u002FLesson02.1-A_Map_of_Machine_Learning.typ`\n\n# Workflow\n\n## Classify Every Heading\u002Fslide in `\u003CSMD_FILE>`\n\n- Walk `\u003CSMD_FILE>` top to bottom, collecting every `#`\u002F`##`\u002F`###`(+) heading line\n  and every `* Slide Title` line, in source order, with its line number\n- Track one running flag, `seen_subheading`, starting `False`: flip it to `True` the\n  first time a `##` or deeper heading is seen. Its value _at the point each `_ Slide\n  Title`line is reached* (before any`##` on the same line updates it) is what Step 3\n  needs for that slide\n\n## Locate the Matching Line in `\u003CTYP_FILE>`\n\n- `\u003CTYP_FILE>` carries a\n  ```text\n  \u002F\u002F From: \u003CSMD_FILE>:\u003CLINE_NUMBER> '\u003CMARKER> \u003CTITLE>'\n  \u002F\u002F Slide: \u003CTITLE>\n  ```\n  comment immediately above every heading\u002Fslide it was generated from.\n  Match each Step 1 entry to its block by that comment (line number + marker), not by\n  title text alone -- titles can repeat (e.g. a lesson and its own first slide sharing\n  a name)\n- The heading\u002Ftitle line itself is the next non-comment line after\n  `\u002F\u002F Slide: \u003CTITLE>`: it may currently be `#strong[Title]`, `= Title` \u002F `== Title`\n  \u002F `=== Title`, or missing entirely (the block's paragraph starts right after the\n  comment, no title line at all)\n\n## Apply the Rule From `typst.rules.md`\n\n\u002F\u002F TODO(ai_gp): Make reference to the typst.rules.md instead of this wall of text\nFor each block found in Step 2, make its title line match the `## Structural\nHierarchy` and `## Mandatory Sections` rules in `typst.rules.md`. This is the\nskill-specific decision logic for choosing *which* of those rules applies to\neach block; for what the resulting heading syntax must look like, see the\nrules themselves:\n- **H1** (`#`), title equal to the chapter title already shown by `#chapter(...)`\n  (the common case: one `#` per lesson, and it's the lesson title): delete the title\n  line entirely, keep the `\u002F\u002F From:`\u002F`\u002F\u002F Slide:` comments. If a body-level H1 has\n  _different_ text from the chapter title, check whether any `##`\u002F`###` appears\n  under it before the next `#` (or end of document): if it owns no nested\n  subsections, use `#strong[Title]` instead of deleting it; if it owns nested\n  `##`\u002F`###` subsections (e.g. a lesson combining two topics under one chapter\n  title, each `# Topic` with its own `##` subsections), keep it a real `= Title`\n  heading instead, per `typst.rules.md`'s rule that `#strong` may never stand in\n  for a heading. Cross-check with `extract_toc_from_txt.py -i \u003CSMD_FILE>` vs\n  `grep \"^=\" \u003CTYP_FILE>` if unsure\n- **`##`\u002F`###`\u002Fdeeper**: apply the `## Structural Hierarchy` heading-level\n  mapping. Leave alone if already correct\n- **`* Roadmap`**, **`* Summary`**, **`* References`**: always the mandatory\n  level-1 headings required by `## Mandatory Sections`, regardless of\n  `seen_subheading` or how many slides came before them. These are the\n  mandatory structural sections, not ordinary content slides, so the\n  `seen_subheading` rule below (which governs whether an ordinary slide gets a\n  heading, gets dropped, or becomes a transition) never applies to them\n- **`* Slide Title`** (any other slide):\n  - `seen_subheading` was `False` at this slide -> `= Title`, a real heading (add the\n    line if it's missing, replace it if it's currently `#strong[Title]` or a\n    transitioned-in paragraph)\n  - `seen_subheading` was `True` at this slide, and it is the first slide since that\n    heading last appeared (no other `* Slide Title` block has occurred since) ->\n    drop the title entirely: no `#strong[Title]` line, no added transition. Delete\n    a `#strong[Title]` line if present (and the blank line after it) and leave the\n    paragraph to open with its own first sentence, directly after the `\u002F\u002F Slide:`\n    comment\n  - `seen_subheading` was `True` at this slide, and at least one other slide has\n    already appeared since that heading -> drop the title and make the paragraph\n    transition in from the previous slide's ending instead of restating the title:\n    - Read the previous block's last sentence and this block's first sentence\n    - If the previous sentence already reads as a lead-in (a forward reference,\n      a rhetorical question the next slide answers, a \"this raises the question\n      of X\" close) and the next paragraph's own opening already picks it up\n      naturally, deleting the title line is enough -- no new sentence needed\n    - Otherwise, prepend one short new sentence (or reword the first clause of the\n      existing opening sentence) that connects the two: a callback to the term or\n      claim the previous slide ended on, a contrast (\"beyond X, a second axis\n      is...\"), or an explicit bridge. Keep it to one sentence; do not summarize or\n      repeat content the paragraph itself is about to say\n    - A term the slide is centrally about may still get `#strong[...]`, but inside\n      that transition sentence or the paragraph's own first sentence, never as its\n      own line\n  - Either way, remove the blank line that used to separate the title line from the\n    body: the comment block is followed directly by the paragraph, no gap (see the\n    \"Good\" examples in `typst.rules.md`)\nNever touch a `#strong[...]`\u002F`#emph[...]` occurring elsewhere in the prose\n(mid-paragraph terms, list lead phrases), and never touch any sentence beyond the\nfirst one of a transitioned-in paragraph: only the standalone title lines identified\nin Step 2, and the single opening sentence next to them, are in scope\n\n# Verification\n\n- [ ] Lint the file: `typstyle --inplace --wrap-text -l 85 \u003CTYP_FILE>`\n- [ ] Compile and check the PDF looks right: see\n      `.claude\u002Fskills\u002Fbook.fix_rendered_pdf\u002FSKILL.md`\n- [ ] Confirm no prose beyond the in-scope title lines and their opening\n      sentence was changed\n","# Goal\n\n- Given a lecture's `.smd` source and the `.typ` book chapter generated from it (by\n  `gen_book_chapter.py --mode typst_aima`), fix the chapter's heading levels and\n  slide-title handling to follow the \"Structural Hierarchy\" rule in\n  `.claude\u002Fskills\u002Ftypst.rules.md`\n- Most of this is mechanical (moving `=`\u002F`==`\u002F`===` markers), but one part is not:\n  a slide title that must become a transition (see Step 3 below) requires rewording\n  a sentence, not just replacing a marker. That is the only text this skill is\n  allowed to change; everything else in the chapter's prose stays untouched\n- This is a fix-up for chapters generated before that rule existed (or that were\n  hand-edited inconsistently): running it on a chapter that already follows the rule\n  is a no-op\n\n# Inputs\n\n- `\u003CSMD_FILE>`: the lecture source\n  - E.g., `msml610\u002Flectures_source\u002FLesson02.1-A_Map_of_Machine_Learning.smd`\n- `\u003CTYP_FILE>`: the generated book chapter for `\u003CSMD_FILE>`\n  - E.g., `msml610\u002Fbook\u002FLesson02.1-A_Map_of_Machine_Learning.typ`\n\n# Workflow\n\n## Classify Every Heading\u002Fslide in `\u003CSMD_FILE>`\n\n- Walk `\u003CSMD_FILE>` top to bottom, collecting every `#`\u002F`##`\u002F`###`(+) heading line\n  and every `* Slide Title` line, in source order, with its line number\n- Track one running flag, `seen_subheading`, starting `False`: flip it to `True` the\n  first time a `##` or deeper heading is seen. Its value _at the point each `_ Slide\n  Title`line is reached* (before any`##` on the same line updates it) is what Step 3\n  needs for that slide\n\n## Locate the Matching Line in `\u003CTYP_FILE>`\n\n- `\u003CTYP_FILE>` carries a\n  ```text\n  \u002F\u002F From: \u003CSMD_FILE>:\u003CLINE_NUMBER> '\u003CMARKER> \u003CTITLE>'\n  \u002F\u002F Slide: \u003CTITLE>\n  ```\n  comment immediately above every heading\u002Fslide it was generated from.\n  Match each Step 1 entry to its block by that comment (line number + marker), not by\n  title text alone -- titles can repeat (e.g. a lesson and its own first slide sharing\n  a name)\n- The heading\u002Ftitle line itself is the next non-comment line after\n  `\u002F\u002F Slide: \u003CTITLE>`: it may currently be `#strong[Title]`, `= Title` \u002F `== Title`\n  \u002F `=== Title`, or missing entirely (the block's paragraph starts right after the\n  comment, no title line at all)\n\n## Apply the Rule From `typst.rules.md`\n\n\u002F\u002F TODO(ai_gp): Make reference to the typst.rules.md instead of this wall of text\nFor each block found in Step 2, make its title line match the `## Structural\nHierarchy` and `## Mandatory Sections` rules in `typst.rules.md`. This is the\nskill-specific decision logic for choosing *which* of those rules applies to\neach block; for what the resulting heading syntax must look like, see the\nrules themselves:\n- **H1** (`#`), title equal to the chapter title already shown by `#chapter(...)`\n  (the common case: one `#` per lesson, and it's the lesson title): delete the title\n  line entirely, keep the `\u002F\u002F From:`\u002F`\u002F\u002F Slide:` comments. If a body-level H1 has\n  _different_ text from the chapter title, check whether any `##`\u002F`###` appears\n  under it before the next `#` (or end of document): if it owns no nested\n  subsections, use `#strong[Title]` instead of deleting it; if it owns nested\n  `##`\u002F`###` subsections (e.g. a lesson combining two topics under one chapter\n  title, each `# Topic` with its own `##` subsections), keep it a real `= Title`\n  heading instead, per `typst.rules.md`'s rule that `#strong` may never stand in\n  for a heading. Cross-check with `extract_toc_from_txt.py -i \u003CSMD_FILE>` vs\n  `grep \"^=\" \u003CTYP_FILE>` if unsure\n- **`##`\u002F`###`\u002Fdeeper**: apply the `## Structural Hierarchy` heading-level\n  mapping. Leave alone if already correct\n- **`* Roadmap`**, **`* Summary`**, **`* References`**: always the mandatory\n  level-1 headings required by `## Mandatory Sections`, regardless of\n  `seen_subheading` or how many slides came before them. These are the\n  mandatory structural sections, not ordinary content slides, so the\n  `seen_subheading` rule below (which governs whether an ordinary slide gets a\n  heading, gets dropped, or becomes a transition) never applies to them\n- **`* Slide Title`** (any other slide):\n  - `seen_subheading` was `False` at this slide -> `= Title`, a real heading (add the\n    line if it's missing, replace it if it's currently `#strong[Title]` or a\n    transitioned-in paragraph)\n  - `seen_subheading` was `True` at this slide, and it is the first slide since that\n    heading last appeared (no other `* Slide Title` block has occurred since) ->\n    drop the title entirely: no `#strong[Title]` line, no added transition. Delete\n    a `#strong[Title]` line if present (and the blank line after it) and leave the\n    paragraph to open with its own first sentence, directly after the `\u002F\u002F Slide:`\n    comment\n  - `seen_subheading` was `True` at this slide, and at least one other slide has\n    already appeared since that heading -> drop the title and make the paragraph\n    transition in from the previous slide's ending instead of restating the title:\n    - Read the previous block's last sentence and this block's first sentence\n    - If the previous sentence already reads as a lead-in (a forward reference,\n      a rhetorical question the next slide answers, a \"this raises the question\n      of X\" close) and the next paragraph's own opening already picks it up\n      naturally, deleting the title line is enough -- no new sentence needed\n    - Otherwise, prepend one short new sentence (or reword the first clause of the\n      existing opening sentence) that connects the two: a callback to the term or\n      claim the previous slide ended on, a contrast (\"beyond X, a second axis\n      is...\"), or an explicit bridge. Keep it to one sentence; do not summarize or\n      repeat content the paragraph itself is about to say\n    - A term the slide is centrally about may still get `#strong[...]`, but inside\n      that transition sentence or the paragraph's own first sentence, never as its\n      own line\n  - Either way, remove the blank line that used to separate the title line from the\n    body: the comment block is followed directly by the paragraph, no gap (see the\n    \"Good\" examples in `typst.rules.md`)\nNever touch a `#strong[...]`\u002F`#emph[...]` occurring elsewhere in the prose\n(mid-paragraph terms, list lead phrases), and never touch any sentence beyond the\nfirst one of a transitioned-in paragraph: only the standalone title lines identified\nin Step 2, and the single opening sentence next to them, are in scope\n\n# Verification\n\n- [ ] Lint the file: `typstyle --inplace --wrap-text -l 85 \u003CTYP_FILE>`\n- [ ] Compile and check the PDF looks right: see\n      `.claude\u002Fskills\u002Fbook.fix_rendered_pdf\u002FSKILL.md`\n- [ ] Confirm no prose beyond the in-scope title lines and their opening\n      sentence was changed\n",{"model":28,"description":7},"sonnet","master","804ae3e928c04740cec553be0eb28c8d06ff420e",".claude\u002Fskills\u002Fbook_chapter.fix_headings",1,"https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers","https:\u002F\u002Fcausify-ai.github.io\u002Fhelpers\u002F","https:\u002F\u002Fgithub.com\u002Fcausify-ai","2026-11-02 21:54:29",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add causify-ai\u002Fhelpers --skill book_chapter.fix_headings",{"tool":43,"command":44},"bunx","bunx skills add causify-ai\u002Fhelpers --skill book_chapter.fix_headings",{"tool":46,"command":47},"pnpm","pnpm dlx skills add causify-ai\u002Fhelpers --skill book_chapter.fix_headings","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fbook_chapter.fix_headings\u002FSKILL.md",true,[],[52,73,91,103,112,126],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":63,"publishedAt":23},"01M6F209RASRBEK7GBNG5M00K0","tutorial_in_60_mins.propagate_docker_changes","Sync tutorial and class-project Docker files to match project_template","https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Ftutorial_in_60_mins.propagate_docker_changes\u002FSKILL.md",[58],{"categoryNo":59,"categoryName":60,"taxonomyType":61,"taxonomyTypeDesc":62},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[64,65,66,67,68,69,70,71,72,22],"docker","tutorial","tutorial in 60 mins propagate docker changes","propagate","template","sync","haiku","files","project",{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":82,"publishedAt":23},"01M6F207XZ5YDAJ0KNDRE6EN0R","tutorial_in_60_mins.merge_markdown","Merge the content of a markdown file into a Jupyter notebook","https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Ftutorial_in_60_mins.merge_markdown\u002FSKILL.md",[79],{"categoryNo":80,"categoryName":81,"taxonomyType":61,"taxonomyTypeDesc":62},"01JBSEEDCAT000000000000002","文档处理",[83,84,65,85,86,87,70,88,89,90],"markdown","merge","tutorial in 60 mins merge markdown","notebook","jupyter","file","jupyter notebook","content",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":23},"01M6F2059X95Q1A13HD67E9JRF","tutorial_in_60_mins.format","Format a directory to follow the \"Learn X in 60 Minutes\" tutorial conventions","https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Ftutorial_in_60_mins.format\u002FSKILL.md",[],[98,65,99,100,101,70,102],"tutorial in 60 mins format","format","directory","learn","conventions",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":23},"01M6F202MDHMNYD5S1YHG2PKZD","tutorial_in_60_mins.create","Create a tutorial directory for the Learn X in 60 Minutes conventions","https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Ftutorial_in_60_mins.create\u002FSKILL.md",[],[110,65,111,101,100,102],"tutorial in 60 mins create","create",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":23},"01M6F2004BW13GQ59N3RGSAYVN","todo.reorg_in_progress","Reorganize ai_task_queue.md so in-progress tasks, not-started tasks, and mislabeled topic headers sit under the right H1 stage","https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Ftodo.reorg_in_progress\u002FSKILL.md",[],[119,120,121,122,123,124,125],"progress","todo","todo reorg in progress","tasks","queue","task","stage",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":23},"01M6F1ZXN0G6HBD08GT8HE5FYA","todo.reorg_headers","Reorganize ai_task_queue.md .md so every H2 topic matches ALL TOPICS and every H3 task sits under the right topic, keeping its H1 stage","https:\u002F\u002Fgithub.com\u002Fcausify-ai\u002Fhelpers\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Ftodo.reorg_headers\u002FSKILL.md",[],[133,120,123,124,125],"todo reorg headers"]