git-precommit

A pre-commit workflow for checking code and research-project changes before creating a Git commit. A Git commit is a saved set of project changes, and a pre-commit check runs just before that save.

In plain words
What is it for?
Use it when committing, submitting, or finishing work. It checks documentation, architecture, project integrity, paper-related files, workspace state, and Git status, while reporting issues instead of automatically changing files.
Why use it?
It reminds developers to synchronize project memory, update relevant documentation, inspect structural changes, and check whether work is committed and pushed.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/u9401066/med-paper-assistant/git-precommit
Any agent
npx skills add u9401066/med-paper-assistant --skill git-precommit
Clone the repo
git clone --depth 1 https://github.com/u9401066/med-paper-assistant

Made for: Claude Code, Codex.

Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,892 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00063 $0.01892
Opus 5 $0.00032 $0.00946
Sonnet 5 $0.00013 $0.00378
Haiku 4.5 $0.00006 $0.00189

Measured 2d ago against content hash 1c5227ddc1fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

git-precommit scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Enumerates other installed skillsmediumAgent snooping

Other skills' SKILL.md files reveal prompts, capabilities and secrets that should be invisible to peers.

| G6.2 | Skill 數量 | `ls -d .claude/skills/*/` vs AGENTS.md | ⚠️ WARN |
.claude/skills/git-precommit/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git 提交前工作流(編排器 + Pre-Commit Hooks)

Copilot Hooks(寫作時即時修正)定義於 auto-paper/SKILL.md。 Pre-Commit Hooks(本檔,git commit 前最終把關)只報告不自動修改。

觸發:「commit」「推送」「做完了」「收工」「快速 commit」


Step 0: 偵測變更範圍

get_changed_files()git diff --cached --name-only。 論文檔案模式:projects/*/drafts/*, projects/*/concept.md, projects/*/references/*, projects/*/.memory/* → 匹配時觸發 Paper Hooks。


通用 Hooks(每次觸發)

Hook 條件 動作 MCP Tools
G1 memory-sync 必要 更新 Memory Bank + workspace state memory_bank_update_progress, workspace_state_action(action="sync")
G2 readme-update 新功能/API 變更 更新 README read_file, replace_string_in_file
G3 changelog-update 版本/重要修改 更新 CHANGELOG 同上
G4 roadmap-update 里程碑完成 更新 ROADMAP 同上
G5 arch-check 結構性變更 檢查架構文檔 grep_search, list_dir
G6 project-integrity SKILL/AGENTS/src 變更 專案一致性審計 見下方
G7 vsx-integrity skills/prompts/vsx 變更 VSX Extension 同步 見下方
G8 doc-update-reminder 任何程式/設定變更 提醒需更新的文檔 scripts/check-doc-updates.py (pre-commit hook)
G9 git-status-check 必要 偵測未 commit/未 push(Code-Enforced) run_quality_checks(action="writing_hooks", hooks="G9")

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 122 lines · 63 tokens per session scan B 1c5227ddc1fa

Subscribe to this mod's changes

git-precommit is a skill published in the GitHub repository u9401066/med-paper-assistant (11 stars, last pushed 16d ago), licensed Apache-2.0. It adds 63 tokens to every session and 1,892 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (enumerates other installed skills). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.