用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/laicluse/agent-fieldkit --skill disable-git命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Use when corrective work, migrations, living docs, or temporary diagnostic tests leave superseded residue, or before handoff.
Use when corrective work, migrations, living docs, or temporary diagnostic tests leave superseded residue, or before handoff.
Reference for git-discipline commit bodies, trailers, hook denials, examples, and escape hatches.
正在显示 SKILL.md
| name | disable-git |
| user-invocable | true |
| description | Explicit /git-discipline:disable-git: make the current repo read-only for git write commands. |
| disable-model-invocation | true |
| argument-hint | <reason> |
Set a per-repo lock that puts git write commands out of reach for a while. Read-only inspection keeps working (status, log, diff, show, blame, rev-parse, branch list, tag list, etc.). Anything that mutates working directory, index, refs, or remote (commit, checkout, switch, restore, reset, merge, rebase, cherry-pick, revert, push, pull, fetch, add, rm, mv, stash, clean, branch -d, tag v0.1, ...) is blocked.
The lock is a sentinel file at .git/git-discipline-deny inside the repo (or
the main worktree's .git/ when invoked from a linked worktree). It is
per-repo, never committed, and not visible in git status.
A lock outlives the session that set it, so the command refuses a bare invocation: pass the reason as the argument. It is stored in the sentinel with the date, and both are quoted back on every denied git command. Locks written by earlier versions carry no reason and keep denying without one.
Whoever meets the lock may never have seen the deny message: a fresh agent session, a colleague in a plain terminal, you weeks later. So the sentinel is written with a comment header naming the plugin that set it, what it blocks, and that lifting it is the operator's call. The deny messages say the same, and they tell an agent it cannot lift the lock itself rather than handing it a command that is operator-invoked only.
The lock is not Claude-specific, and its reach depends on the caller.
/git-discipline:install-hooks is active in the repo, the git-native
commit-msg and pre-push hooks read the same sentinel, so git commit
and git push are rejected no matter who runs them. Other write commands
(git reset, git checkout, ...) have no git-native hook to carry the
check, so they stay available to a shell and to agents without the
PreToolUse guard.repo-deny PreToolUse guard covers every
mutating subcommand, not just commit and push.The plugin's UserPromptExpansion hook handles this command at the keystroke
itself: it writes the sentinel, reports the result, and blocks the expansion,
so this file's content never reaches the model.
Reading this text means the hook did not run. Report that instead of writing
the sentinel: the sentinel-protect guard denies agent-driven writes in any
case, with no escape. Likely causes are a plugin installed without its hooks,
or a host that does not implement UserPromptExpansion.
status, log, diff, show,
blame, rev-parse, rev-list, name-rev, describe, reflog,
shortlog, cat-file, ls-files, ls-tree, ls-remote,
for-each-ref, grep, whatchanged, merge-base,
symbolic-ref, var, version, help, remote -v,
config --get, branch / tag in list form,
bisect view / bisect log, worktree list,
submodule status / summary, stash list / show,
notes list / show./git-discipline:enable-git removes the sentinel.