{"id":"f8ed42ba-4776-445c-aa17-4edaae015abd","shortId":"CqKmZ5","kind":"skill","title":"lovstudio:skill-optimizer","tagline":"Audit and automatically optimize a lovstudio skill against repo conventions and official Anthropic skill-creator best practices, then bump the semver version and append a CHANGELOG entry. Checks SKILL.md frontmatter/trigger quality, script CLI hygiene, directory naming, README ba","description":"# skill-optimizer — 自动优化 lovstudio skill 并维护版本与 changelog\n\nRuns a lint → fix → bump → changelog pipeline on an existing skill in this\nrepo. Fully automatic — no interactive prompts. Every run produces a concrete\nversion bump and a new CHANGELOG.md entry so optimization history is traceable.\n\n## When to Use\n\n- User mentioned a concrete problem with an existing skill in this conversation\n  (wrong trigger phrases, stale CLI flags, missing README badge, etc.) and\n  wants it fixed.\n- User asks to \"audit\", \"polish\", \"refine\", \"刷一遍\" an existing skill.\n- User explicitly asks to bump a skill's version or update its changelog.\n- Proactively after another skill has been modified meaningfully — run this to\n  record the change with a version bump.\n\n## Workflow (MANDATORY, fully automatic)\n\n**Do not ask the user for options. Infer everything from (a) the target skill\nname and (b) any optimization notes mentioned in the current conversation.**\n\n### Step 1: Identify target & context\n\nFrom the user's message, extract:\n\n1. **Target skill name** — e.g. `any2pdf`, `lovstudio-any2pdf`, or `lovstudio:any2pdf`.\n   Normalize to the bare name (strip prefix). If the user did not name a skill\n   explicitly, infer it from recent conversation context (the skill they were\n   just working on). If still ambiguous, ask one targeted question.\n2. **Context-driven fix list** — scan the current conversation for issues the\n   user raised about this skill: wrong flags, trigger misfires, broken CJK\n   rendering, missing options, confusing README, etc. This list is the\n   **primary driver**. The generic lint only supplements it.\n\n### Step 2: Lint\n\n```bash\npython3 skills/lovstudio-skill-optimizer/scripts/lint_skill.py <name> --json\n```\n\nParse the JSON findings. Combine with the context-driven fix list from Step 1.\nPrioritize in this order:\n\n1. Fixes the user explicitly mentioned in conversation (highest priority)\n2. Lint `error` findings\n3. Lint `warn` findings\n4. Lint `info` findings — apply only if cheap and safe\n\n### Step 3: Apply fixes directly\n\nEdit `SKILL.md`, `README.md`, `scripts/*.py` with the `Edit` tool based on the\nprioritized fix list. Guidelines:\n\n- **SKILL.md frontmatter description**: make sure it covers what + when +\n  concrete trigger phrases (中文 + English). Don't bloat it; keep under ~800 chars.\n- **CLI args in scripts**: if the user hit a bug with a specific flag, fix the\n  root cause — don't paper over it.\n- **Progressive disclosure**: if SKILL.md body > 500 lines, split the largest\n  section to `references/<topic>.md`.\n- **Don't write tests or docs that weren't asked for.** The CHANGELOG entry IS\n  the documentation of the change.\n- **Don't add emojis** unless the original file already uses them consistently.\n\n### Step 4: Decide bump type\n\nChoose semver bump based on the fixes applied:\n\n| Bump    | Use when                                                           |\n|---------|--------------------------------------------------------------------|\n| `patch` | bug fix, wording fix, frontmatter tweak, CJK rendering fix         |\n| `minor` | new CLI flag, new option, new reference doc, expanded scope        |\n| `major` | breaking CLI change, removed option, renamed skill                 |\n\nStay in 0.x unless explicitly told otherwise — per repo release conventions.\n\n### Step 5: Bump version + write changelog\n\n```bash\npython3 skills/lovstudio-skill-optimizer/scripts/bump_version.py <name> \\\n  --type <patch|minor|major> \\\n  --message \"<one-line summary of the biggest change>\" \\\n  --change \"<additional bullet>\" \\\n  --change \"<additional bullet>\"\n```\n\nThis updates:\n- `README.md` version badge (source of truth)\n- `SKILL.md` frontmatter `metadata.version` (kept in sync if present)\n- `CHANGELOG.md` — prepends a new entry with today's date (creates the file if missing)\n\n### Step 6: Re-lint & report\n\n```bash\npython3 skills/lovstudio-skill-optimizer/scripts/lint_skill.py <name>\n```\n\nReport to the user, in this exact shape and nothing more:\n\n```\noptimized: lovstudio-<name>\nversion:   <old> → <new>\nfixes:\n  - <bullet 1>\n  - <bullet 2>\nremaining lint warnings: <count>  (or \"none\")\n```\n\n**Do not** print a trailing summary, self-congratulation, or next-step suggestions.\nThe diff speaks for itself.\n\n### Step 7: Commit, push & sync all locations\n\nSkills live in three locations that must stay in sync:\n\n```\nsource (edit here):  ~/projects/lovstudio-skills/        → lovstudio/skills\nclaude reads from:   ~/.claude/skills/*                   → symlinks to source\ndistribution repo:   ~/projects/lovstudio-pro-skills/     → lovstudio/pro-skills\n```\n\n**7a. Commit & push to source repo:**\n\n```bash\ncd ~/projects/lovstudio-skills\ngit add skills/lovstudio-<name>/\ngit commit -m \"fix(<name>): <one-line summary>\"\ngit push\n```\n\n- Commit message follows repo convention: `fix|feat|docs(<skill-name>): <summary>`\n- Use `fix` for patch, `feat` for minor, `feat!` for major\n\n**7b. Sync to pro-skills distribution repo:**\n\nThe two repos have independent git histories (not forkable), so sync via\nfile copy:\n\n```bash\nSRC=~/projects/lovstudio-skills/skills/lovstudio-<name>\nDST=~/projects/lovstudio-pro-skills/skills/lovstudio-<name>\nrsync -av --delete \"$SRC/\" \"$DST/\"\ncd ~/projects/lovstudio-pro-skills\ngit add skills/lovstudio-<name>/\ngit commit -m \"sync(<name>): <version> from lovstudio/skills\"\ngit push origin main\n```\n\n`~/.claude/skills/` is already up-to-date via symlinks — no action needed.\n\n**If any step fails**, report the sync state to the user rather than silently\nskipping. A partial sync (source updated but pro-skills stale) is the exact\nproblem this step exists to prevent.\n\n## CLI Reference\n\n### `lint_skill.py`\n\n| Argument | Default | Description |\n|----------|---------|-------------|\n| `<name>` | — | Skill name (with or without `lovstudio-` prefix) |\n| `--path` | — | Absolute path to skill dir (overrides name) |\n| `--json` | off | Emit findings as JSON |\n\nExit code: `2` if any `error`-severity finding, `0` otherwise.\n\n### `bump_version.py`\n\n| Argument | Default | Description |\n|----------|---------|-------------|\n| `<name>` | — | Skill name |\n| `--path` | — | Absolute path to skill dir (overrides name) |\n| `--type` | — | `patch` \\| `minor` \\| `major` (mutually exclusive with `--set`) |\n| `--set` | — | Explicit version e.g. `0.2.0` |\n| `--message`, `-m` | required | Primary changelog bullet |\n| `--change`, `-c` | — | Additional bullet (repeatable) |\n| `--dry-run` | off | Show what would change without writing |\n\n## Dependencies\n\nPython 3.8+ (stdlib only, no `pip install` needed).","tags":["skill","optimizer","skills","lovstudio","agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"capabilities":["skill","source-lovstudio","skill-skill-optimizer","topic-agent-skills","topic-ai-coding-assistant","topic-cjk","topic-claude-code","topic-cursor","topic-gemini-cli","topic-markdown-to-docx","topic-markdown-to-pdf"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/lovstudio/skills/skill-optimizer","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add lovstudio/skills","source_repo":"https://github.com/lovstudio/skills","install_from":"skills.sh"}},"qualityScore":"0.469","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 39 github stars · SKILL.md body (6,540 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-21T01:36:52.514Z","embedding":null,"createdAt":"2026-04-18T22:19:08.508Z","updatedAt":"2026-04-21T01:36:52.514Z","lastSeenAt":"2026-04-21T01:36:52.514Z","tsv":"'/.claude/skills':630,721 '/projects/lovstudio-pro-skills':636,707 '/projects/lovstudio-pro-skills/skills/lovstudio-':700 '/projects/lovstudio-skills':625,646 '/projects/lovstudio-skills/skills/lovstudio-':698 '0':501,802 '0.2.0':830 '1':188,198,309,314 '2':246,289,324,796 '3':328,343 '3.8':854 '4':332,455 '5':512 '500':413 '6':558 '7':606 '7a':638 '7b':674 '800':383 'absolut':781,811 'action':731 'add':444,648,709 'addit':839 'alreadi':450,723 'ambigu':241 'anoth':142 'anthrop':17 'any2pdf':203,206,209 'append':29 'appli':336,344,466 'arg':386 'argument':770,805 'ask':118,129,164,242,431 'audit':5,120 'automat':7,67,161 'av':702 'b':178 'ba':43 'badg':111,531 'bare':213 'base':356,462 'bash':291,517,563,644,696 'best':21 'bloat':379 'bodi':412 'break':492 'broken':268 'bug':394,471 'bullet':836,840 'bump':24,56,77,131,157,457,461,467,513 'bump_version.py':804 'c':838 'caus':402 'cd':645,706 'chang':153,441,494,525,526,837,849 'changelog':31,51,57,139,434,516,835 'changelog.md':81,543 'char':384 'cheap':339 'check':33 'choos':459 'cjk':269,477 'claud':627 'cli':38,107,385,482,493,767 'code':795 'combin':299 'commit':607,639,651,656,712 'concret':75,94,372 'confus':273 'congratul':594 'consist':453 'context':191,231,248,303 'context-driven':247,302 'convent':14,510,660 'convers':102,186,230,255,321 'copi':695 'cover':369 'creat':552 'creator':20 'current':185,254 'date':551,727 'decid':456 'default':771,806 'delet':703 'depend':852 'descript':365,772,807 'diff':601 'dir':785,815 'direct':346 'directori':40 'disclosur':409 'distribut':634,680 'doc':427,488,663 'document':438 'dri':843 'driven':249,304 'driver':281 'dry-run':842 'dst':699,705 'e.g':202,829 'edit':347,354,623 'emit':790 'emoji':445 'english':376 'entri':32,82,435,547 'error':326,799 'etc':112,275 'everi':71 'everyth':170 'exact':572,760 'exclus':823 'exist':61,98,125,764 'exit':794 'expand':489 'explicit':128,225,318,504,827 'extract':197 'fail':736 'feat':662,668,671 'file':449,554,694 'find':298,327,331,335,791,801 'fix':55,116,250,305,315,345,360,399,465,472,474,479,580,653,661,665 'flag':108,265,398,483 'follow':658 'forkabl':690 'frontmatt':364,475,536 'frontmatter/trigger':35 'fulli':66,160 'generic':283 'git':647,650,654,687,708,711,717 'guidelin':362 'highest':322 'histori':85,688 'hit':392 'hygien':39 'identifi':189 'independ':686 'infer':169,226 'info':334 'instal':859 'interact':69 'issu':257 'json':294,297,788,793 'keep':381 'kept':538 'largest':417 'line':414 'lint':54,284,290,325,329,333,561,582 'lint_skill.py':769 'list':251,277,306,361 'live':613 'locat':611,616 'lovstudio':1,10,48,205,208,578,778 'lovstudio-any2pdf':204 'lovstudio/pro-skills':637 'lovstudio/skills':626,716 'm':652,713,832 'main':720 'major':491,523,673,821 'make':366 'mandatori':159 'md':421 'meaning':147 'mention':92,182,319 'messag':196,524,657,831 'metadata.version':537 'minor':480,522,670,820 'misfir':267 'miss':109,271,556 'modifi':146 'must':618 'mutual':822 'name':41,176,201,214,222,774,787,809,817 'need':732,860 'new':80,481,484,486,546 'next':597 'next-step':596 'none':585 'normal':210 'note':181 'noth':575 'offici':16 'one':243 'optim':4,8,46,84,180,577 'option':168,272,485,496 'order':313 'origin':448,719 'otherwis':506,803 'overrid':786,816 'paper':405 'pars':295 'partial':749 'patch':470,521,667,819 'path':780,782,810,812 'per':507 'phrase':105,374 'pip':858 'pipelin':58 'polish':121 'practic':22 'prefix':216,779 'prepend':544 'present':542 'prevent':766 'primari':280,834 'print':588 'priorit':310,359 'prioriti':323 'pro':678,755 'pro-skil':677,754 'proactiv':140 'problem':95,761 'produc':73 'progress':408 'prompt':70 'push':608,640,655,718 'py':351 'python':853 'python3':292,518,564 'qualiti':36 'question':245 'rais':260 'rather':744 're':560 're-lint':559 'read':628 'readm':42,110,274 'readme.md':349,529 'recent':229 'record':151 'refer':420,487,768 'refin':122 'releas':509 'remain':581 'remov':495 'renam':497 'render':270,478 'repeat':841 'repo':13,65,508,635,643,659,681,684 'report':562,566,737 'requir':833 'root':401 'rsync':701 'run':52,72,148,844 'safe':341 'scan':252 'scope':490 'script':37,350,388 'section':418 'self':593 'self-congratul':592 'semver':26,460 'set':825,826 'sever':800 'shape':573 'show':846 'silent':746 'skill':3,11,19,45,49,62,99,126,133,143,175,200,224,233,263,498,612,679,756,773,784,808,814 'skill-creat':18 'skill-optim':2,44 'skill-skill-optimizer' 'skill.md':34,348,363,411,535 'skills/lovstudio-':649,710 'skills/lovstudio-skill-optimizer/scripts/bump_version.py':519 'skills/lovstudio-skill-optimizer/scripts/lint_skill.py':293,565 'skip':747 'sourc':532,622,633,642,751 'source-lovstudio' 'speak':602 'specif':397 'split':415 'src':697,704 'stale':106,757 'state':740 'stay':499,619 'stdlib':855 'step':187,288,308,342,454,511,557,598,605,735,763 'still':240 'strip':215 'suggest':599 'summari':591 'supplement':286 'sure':367 'symlink':631,729 'sync':540,609,621,675,692,714,739,750 'target':174,190,199,244 'test':425 'three':615 'today':549 'told':505 'tool':355 'topic-agent-skills' 'topic-ai-coding-assistant' 'topic-cjk' 'topic-claude-code' 'topic-cursor' 'topic-gemini-cli' 'topic-markdown-to-docx' 'topic-markdown-to-pdf' 'traceabl':87 'trail':590 'trigger':104,266,373 'truth':534 'tweak':476 'two':683 'type':458,520,818 'unless':446,503 'up-to-d':724 'updat':137,528,752 'use':90,451,468,664 'user':91,117,127,166,194,219,259,317,391,569,743 'version':27,76,135,156,514,530,579,828 'via':693,728 'want':114 'warn':330,583 'weren':429 'without':777,850 'word':473 'work':237 'workflow':158 'would':848 'write':424,515,851 'wrong':103,264 'x':502 '中文':375 '刷一遍':123 '并维护版本与':50 '自动优化':47","prices":[{"id":"dc170ef7-7ad3-43a4-a4af-564b0b9a668b","listingId":"f8ed42ba-4776-445c-aa17-4edaae015abd","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"lovstudio","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:19:08.508Z"}],"sources":[{"listingId":"f8ed42ba-4776-445c-aa17-4edaae015abd","source":"github","sourceId":"lovstudio/skills/skill-optimizer","sourceUrl":"https://github.com/lovstudio/skills/tree/main/skills/skill-optimizer","isPrimary":false,"firstSeenAt":"2026-04-18T22:19:08.508Z","lastSeenAt":"2026-04-21T01:36:52.514Z"}],"details":{"listingId":"f8ed42ba-4776-445c-aa17-4edaae015abd","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"lovstudio","slug":"skill-optimizer","github":{"repo":"lovstudio/skills","stars":39,"topics":["agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"license":"mit","html_url":"https://github.com/lovstudio/skills","pushed_at":"2026-04-20T21:40:57Z","description":"Agent skills for AI coding assistants — Markdown to PDF/DOCX with 14 themes, CJK support","skill_md_sha":"ce1ee2c25831ae2dbe0c1cac4148e2ae712e4f7b","skill_md_path":"skills/skill-optimizer/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/lovstudio/skills/tree/main/skills/skill-optimizer"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"lovstudio:skill-optimizer","license":"MIT","description":"Audit and automatically optimize a lovstudio skill against repo conventions and official Anthropic skill-creator best practices, then bump the semver version and append a CHANGELOG entry. Checks SKILL.md frontmatter/trigger quality, script CLI hygiene, directory naming, README badge, and progressive disclosure structure. Prioritizes issues raised in the current conversation (e.g. bugs the user just hit) over a generic sweep. Use when the user asks to \"optimize\", \"refine\", \"audit\", or \"polish\" an existing skill, or when they say \"bump version\", \"update changelog\", or \"fix this skill\". Also trigger when the user mentions \"优化 skill\", \"skill 审计\", \"刷一遍 skill\", \"skill-optimizer\", \"bump skill version\", \"update skill changelog\".","compatibility":"Requires Python 3.8+ (stdlib only, no external dependencies). Must be run inside the lovstudio-skills repo (auto-detects repo root)."},"skills_sh_url":"https://skills.sh/lovstudio/skills/skill-optimizer"},"updatedAt":"2026-04-21T01:36:52.514Z"}}