AGENT SKILL

doc-to-md

Convert documents (PDF, Office, HTML, EPUB, images, audio, etc.) to faithful Markdown saved beside the source: markitdown and markdownlint, then refine structure and strip extraction noise against the source without rewriting text.

License 许可
MIT
所属仓库
JinsYin/skills
最近更新
2026-11-09
Stars
★ 1
Forks
0

01 前言 Front Matter

model
sonnet
description
Update slides to match changes in the source slides they cite

02 资源文件 3

03 SKILL.md 正文

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>): 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 slide it sits under, i.e., 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 exist, 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), since <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 it as "source missing", leave the slide and its // From: line unchanged, and go to the next citation
  • 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 that matches the topic of the citing slide is relevant
    • For a - [P<NNN>] or - [B<NNN>] entry in related_papers.md or related_books.md: the entry itself. Compare only its text (authors, title, year, link) with the reference used in the slide

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, tikz code 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

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 that 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 no longer has a counterpart: the slide may combine several sources or add material of its own. Remove content only when the diff shows that the fact or example was changed or retracted, not merely 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 cannot be applied without 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 the ones 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 changed
    • unchanged: content in sync (line number possibly refreshed)
    • source missing: the source file or slide was not found
    • needs 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.md does the same synchronization for a book chapter (.typ, .tex, .md) instead of .smd slides

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 as needs decision in 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.md on <TARGET>
  • [ ] git diff <TARGET> shows only the intended slide and // From: changes

04 同仓库更多 Skills

JinsYin
JinsYin/skills

write-great-skill

Workflow and quality bar for agent skills: draft, polish, compress, verify, ship. Use whenever creating or editing a skill (`SKILL.md`, `references/`, `rules/`), or when project conventions route root `CLAUDE.md`/`AGENTS.md` edits here, even if the user only says “改一下这个 skill”.

★ 1
JinsYin
JinsYin/skills

write-fspec

Derive the 功能规格说明书 (functional spec) from the product prototype and keep it versioned under products/fspec/: Flyway-style V files plus a merged CURRENT.md. Use when a prototype is finalized, changed or backfilled, when a draft V is confirmed or CURRENT.md lags, or when the user mentions 功能规格, 功能规格说明书 or fspec. Not for the feature spec (.scratch/*/spec.md) or DESIGN.md.

★ 1
JinsYin
JinsYin/skills

version-release

Cut a SemVer release — bump every module's version in lockstep, promote CHANGELOG.md, commit, tag, push to origin. Args `major|minor|patch|<x.y.z>`; none → level inferred from `[Unreleased]`, confirmed with user. Invoke only on explicit request: the user, another skill, or a project convention asking for a release.

★ 1
JinsYin
JinsYin/skills

ui-ux-best-practices

UI/UX rules for Chinese-language React/Vue admin consoles and their product/design specs. Use when designing, building, reviewing, or refactoring forms, lists, modals/drawers, destructive actions, copy, formats, or console layout.

★ 1
JinsYin
JinsYin/skills

spring-boot-best-practices

Spring Boot 3 + Java 21 + MyBatis Plus 项目的编码规范与架构纪律。涵盖分层依赖、国密 SM2/SM3/SM4、MyBatis Plus 实体与主键策略、多方言数据库迁移、R/RList/RPage 响应包装、DTO 职责边界、鉴权框架选型(Spring Security / Sa-Token)与声明式权限校验、命名约定、模块 README 文档要求。在编写、审查或重构 Spring Boot 后端代码时使用——尤其是新增 Controller/Service/Mapper、定义 Entity 或 DTO、写数据库迁移、处理加解密与签名、设计 API 契约、或接入鉴权与权限校验时。

★ 1
JinsYin
JinsYin/skills

setup-rules

Conduct an interactive interview, then install selected agent conventions, adapters, `skillsw`, and sensitive-file read restrictions into a project; `update` refreshes installed items without prompting. Use when the user asks to set up agent rules, or run `update` after `setup-rules` conventions change (e.g. Skill Workflow sync). Not for reviewing or hand-editing `CLAUDE.local.md`.

★ 1