commit-own-changes skillA
commit-own-changes is agent-read markdown (skill) from john-walks-slow/rabbit-skills: 基于 git-hunk 提交改动,防止带入其他无关的未提交修改。事关安全,在执行任何 `git add`,`git commit` 命令前 **必须** 使用本技能。例外:若你当前在单独 worktree 中工作,则无需使用本技能。.
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# commit-own-changes
基于 git-hunk 精准选择提交范围,防止带入其他无关的未提交修改。
## 依赖
本技能依赖 [git-hunk](https://github.com/wkentaro/git-hunk)(按 hunk 精选提交范围)。
安装:
```bash
pip install git-hunk
```
安装后 `git-hunk` 命令可用(`git-hunk list` / `git-hunk show <id>` / `git-hunk stage <id>`)。详见 <https://github.com/wkentaro/git-hunk>。
## 工作流程
1. **获取锁**
防止同一时间其他 Agent 进行 Git 操作:
```bash
{skill_dir}/scripts/git-lock.sh acquire <task-id> # Linux/macOS
```
```powershell
{skill_dir}\scripts\git-lock.ps1 -Action acquire -TaskId <task-id> # Windows
```
`<task-id>` 建议用本次任务的极简英文 summary,如 `fix-login-crash`、`add-dark-mode`。获取锁和释放锁时必须使用同一 ID。
**重要:** acquire 会自动等待直到上一个锁释放;请不要设置超时时间,耐心等待。禁止手动检查/删除锁文件。禁止跳过本步骤进行后续操作。
若 acquire 执行失败(输出不包含 `acquired`),立即中止提交,向用户报告异常。
2. **列举修改状态**
确认有哪些 hunk 是需要提交的:
```powershell
git status # 确认仓库状态
git-hunk list # 全部 hunk
git-hunk list <files...> # 或只看特定文件的 hunk
```
可以使用 `show` 确认 hunk 的内容:
```powershell
git-hunk show <hunk_ids...>
```
3. **清除暂存区**
防止过去残留的暂存项干扰本次提交:
```powershell
git restore --staged .
```
4. **暂存**
如果文件的所有改动都属于本轮提交,直接全量暂存:
```powershell
git add <files...>
```
否则用 git-hunk stage 精确选择:
```powershell
git-hunk stage <hunk_ids...>
…Read the whole file at its exact version.
How to install
mdr add john-walks-slow/rabbit-skills/commit-own-changes@git:20260915.c34e588mdr add john-walks-slow/rabbit-skills/commit-own-changes@sha256:999b512ce66a32baPin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
[](https://markdownregistry.com/a/art_y3tt7xpg7xtpv7gl)
1 badge views in 30 days
Versions
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260915.c34e588 latest | 2026-09-15 | c34e588 | 3,992 B | A | view · diff |
| git:20260806.9b7a047 | 2026-08-06 | 9b7a047 | 3,680 B | A | view · diff |
| git:20260731.ddf6a81 | 2026-07-31 | ddf6a81 | 3,585 B | A | view · diff |
| git:20260725.231f8ad | 2026-07-25 | 231f8ad | 2,661 B | A | view · diff |
| git:20260724.eba32ae | 2026-07-24 | eba32ae | 3,585 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (3992 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
john-walks-slow/rabbit-skills · 14 stars · license none · pushed 2026-09-20 · branch master
API
GET https://markdownregistry.com/api/v1/artifacts/art_y3tt7xpg7xtpv7gl GET https://markdownregistry.com/api/v1/resolve?ref=john-walks-slow/rabbit-skills/commit-own-changes GET https://markdownregistry.com/api/v1/blob/999b512ce66a32ba4decd8bef3400c393cd75626b612a6ee770b637b5a29d7a7
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.