Write git commit messages in Classical Chinese (文言文). Use when the user asks for a commit message 用文言文, 文言, 古文, classical chinese, or mentions 雅驯/骈俪 style fo...
--- name: wenyan-commit-message description: Write git commit messages in Classical Chinese (文言文). Use when the user asks for a commit message 用文言文, 文言, 古文, classical chinese, or mentions 雅驯/骈俪 style for commits. Do NOT use for regular Conventional Commits or English messages. --- # 文言文 Commit Message 把 `git diff` 里的改动,翻译成一句合于文言语法的 commit message。 ## 触发条件 仅当用户明确要求以下任一情形时启用: - 「用文言文写 commit」「文言 commit message」 - 「古文写一下这条提交」 - 「骈文 / 雅驯 / 文言 / 古汉语」风格的 commit - 用户在 `.gitmessage` 模板里声明偏好文言风格 其余情形(常规英文、Conventional Commits、中文白话)**一律不要触发本 skill**。 ## 撰写规范 ### 结构 一行标题(subject),≤ 50 字(中文字符计);需要时空一行后接正文(body),每行 ≤ 72 字符。 标题需形成一个完整短句,不得是白话词组硬译。 ### 用字原则 1. **单字动词优先**:增、删、改、补、正、修、葺、革、易、徙、迁、黜、黜去、并、析、缀、辑。 2. **避免白话词**:不要用「修复」「添加」「更新」「优化」。改用「修」「增」「更」「葺」。 3. **介宾倒装合理**:「于 X 增 Y」「以 A 代 B」皆可。 4. **禁用现代标点冗余**:标题不使用句号,可用「,」分句。 5. **专有名词保留**:`API`、`README`、变量名、文件名等原样保留,不做汉化。 6. **数字**:可用汉字(一、二、三),也可保留阿拉伯数字;版本号如 `1.2.0` 原样。 ### 对照样例 | 白话意图 | 文言 commit | |---|---| | fix: resolve login redirect bug | 修 login 跳转之讹 | | feat: add user avatar upload | 增头像上传之功 | | refactor: extract auth middleware | 析 auth 中间件而别立之 | | docs: update README installation section | 葺 README 安装一节 | | chore: bump dependency versions | 升诸依赖之版 | | perf: cache database query results | 缓数据库之问,以速其应 | | test: add edge cases for date parser | 补日期解析之畸例 | | revert: undo accidental config change | 复前误改之 config | | style: rename variable `data` to `payload` | 易 `data` 之名曰 `payload` | | remove deprecated legacy export | 黜旧 export,去其赘 | ### 正文(可选) 若改动复杂,body 宜以「凡」「盖」「先」「后」「其一」「其二」领起: ``` 增头像上传之功 凡用户得于设置页上传其像,限 png、jpg,不逾 2MB。 先经前端压缩,后送 API,存之于 S3。 其二,若上传不遂,复其旧像以安其心。 ``` ### 禁忌 - 勿强加「之」「者」「也」于每句末尾,否则成佶屈之文。 - 勿音译英文技术词(例:不要把 `cache` 写作「喀什」)。 - 勿造生僻字或通假字;疑似用字以《古代汉语词典》常见义为准。 - 勿将 commit type 前缀(`feat:` / `fix:`)强塞入文言句中——要么去掉,要么单独置于行首以冒号断开:`修: 修 login 跳转之讹`。 ## 工作流 1. 读取当前 staged diff:`git diff --cached`(若空则读 `git diff`)。 2. 概括主干改动(一句话能讲清的事);若横跨多个主题,建议用户拆分 commit,而非勉强并入一句。 3. 按上表风格撰写 subject;必要时附 body。 4. 仅输出 commit message 文本,不附解释,不加 markdown 包裹,便于用户直接管道入 `git commit -F -`。 ## 产出示例 ``` 葺 README 之安装一节,正 node 版本之讹 ``` ``` 析 auth 中间件而别立之 凡鉴权之事,旧混于路由之中,今别为一层。 先过此层,方入业务;其不验者,驳以 401。 ```
don't have the plugin yet? install it then click "run inline in claude" again.
converted raw clawhub skill into implexa six-component format with explicit decision points, input/output contracts, procedure steps with clear i/o, outcome signals, and edge case handling (empty diffs, multi-topic commits, character limits, proper noun preservation).
write git commit messages in classical chinese (文言文) using authentic literary syntax and historical vocabulary. use this skill only when the user explicitly requests classical chinese style, mentions terms like 文言, 古文, 骈文, 雅驯, or references classical chinese preferences in git config. do not trigger for regular english commits, conventional commits, or modern chinese prose.
git diff --cached, or unstaged from git diff if nothing is stagedno external api calls, auth tokens, or network dependencies required.
identify trigger: confirm user explicitly requested classical chinese style via keywords (文言文, 古文, 骈文, etc.) or .gitmessage template declaration. if unclear or user asks for regular commit, do not proceed.
extract change summary: run git diff --cached to get staged changes. if empty, use git diff for unstaged changes. parse the diff to identify what was modified (files, functions, features, bugs).
identify commit type: map the change to one category: fix (修), feature (增), refactor (析), docs (葺), chore (升), perf (缓), test (补), revert (复), style (易), remove/deprecate (黜).
draft subject line: compose a single classical chinese sentence (≤ 50 chinese characters). use single-character verbs (增, 删, 改, 补, 正, 修, 葺, 革, 易, 徙, 迁, 黜, 并, 析, 缀, 辑). preserve proper nouns (api names, file paths, variable names) unchanged. avoid modern colloquialisms (修复, 添加, 更新, 优化). favor construction patterns like "增 X 之 Y" or "以 A 代 B" where natural.
compose body if needed: if changes span multiple concerns or require explanation, add body text after blank line. each line ≤ 72 characters. use classical discourse markers (凡, 盖, 先, 后, 其一, 其二) to organize paragraphs.
validate syntax and tone: check that subject forms a complete short sentence, not a white-paper phrase list. confirm no excessive 之者也 particles tacked onto every clause. verify no phonetic transliterations of english terms (e.g., do not write 喀什 for cache). cross-reference unfamiliar characters against classical dictionaries.
format output: output only the commit message text, no markdown wrapping, no explanations, no code blocks. format ready for git commit -F - pipe-in or direct paste.
if user explicitly requests classical chinese style (文言文, 文言, 古文, 骈文, 雅驯, or .gitmessage template declares wenyan), proceed with this skill.
else (user asks for regular english, conventional commits, or modern chinese), do not use this skill. defer to standard commit conventions.
if git diff is empty (nothing staged), check unstaged diff via git diff. if still empty, inform user there are no changes to commit.
else (diff has content), parse and summarize.
if changes span multiple unrelated topics (e.g., both auth refactor and readme typo fix), recommend user split into separate commits rather than force both into one classical sentence.
else (changes form a coherent unit), proceed with single subject line and optional body.
if subject line exceeds 50 chinese characters, trim or restructure to fit. do not remove meaning; rephrase more concisely.
if proper nouns or api names are unclear, preserve them as-is (do not sinicize). example: keep login, API, S3, version numbers like 1.2.0 unchanged.
if tone or syntax seems forced or archaic to the point of obscurity, reconsider phrasing. aim for readable classical chinese, not affected ornamentation.
format: plain text, no markdown, no code fences.
structure:
examples:
修 login 跳转之讹
增头像上传之功
凡用户得于设置页上传其像,限 png、jpg,不逾 2MB。
先经前端压缩,后送 API,存之于 S3。
其二,若上传不遂,复其旧像以安其心。
析 auth 中间件而别立之
凡鉴权之事,旧混于路由之中,今别为一层。
先过此层,方入业务;其不验者,驳以 401。
output location: stdout, ready to pipe into git commit -F - or paste into editor.
user successfully pastes the classical chinese commit message into their git commit, runs git log, and sees the wenyan message appear in commit history with correct formatting and authentic classical syntax. subject line reads as a coherent historical sentence. no modern colloquialisms or phonetic english mangling present. user confirms the message accurately describes the code change and feels natural to read aloud in classical register.