Security & Compliancelow risk

owndiff-pre-commit

Audit OwnDiff changes before committing or releasing by checking scope, generated artifacts, private data, documentation accuracy, version consistency, structured files, tests, and the OwnDiff ownership gate. Use when a user asks to verify, clean up, prepare, commit, publish, or release changes in the OwnDiff repository, especially when documentation or install commands changed.

owndiff/own-your-diff·skills/owndiff-pre-commit/SKILL.md
32/ 100推薦值

匯入這個 Skill

選擇你的 coding agent,複製專案級或個人級安裝指令。

固定至平台收錄的 commit
匯入目前專案.agents/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a codex -y
匯入個人環境~/.agents/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a codex -g -y
手動放置目錄.agents/skills/owndiff-pre-commitOfficial docs ↗
匯入目前專案.claude/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a claude-code -y
匯入個人環境~/.claude/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a claude-code -g -y
手動放置目錄.claude/skills/owndiff-pre-commitOfficial docs ↗
匯入目前專案.agents/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a github-copilot -y
匯入個人環境~/.copilot/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a github-copilot -g -y
手動放置目錄.agents/skills/owndiff-pre-commitOfficial docs ↗
匯入目前專案.agents/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a cursor -y
匯入個人環境~/.cursor/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a cursor -g -y
手動放置目錄.agents/skills/owndiff-pre-commitOfficial docs ↗
匯入目前專案.agents/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a gemini-cli -y
匯入個人環境~/.gemini/skills/owndiff-pre-commit
npx skills add https://github.com/owndiff/own-your-diff/tree/0717bb1b967c0fb305a2cde3643ac124a6b35b49/skills/owndiff-pre-commit -a gemini-cli -g -y
Native Gemini CLIgemini skills install https://github.com/owndiff/own-your-diff.git --scope workspace --path skills/owndiff-pre-commit
手動放置目錄.agents/skills/owndiff-pre-commitOfficial docs ↗
⚠ 安裝指令使用開源 skills CLI。執行前請檢查來源、腳本與權限。
# OwnDiff Pre-Commit

Use this skill to produce a verified commit candidate. Stop before committing or pushing unless the user explicitly authorizes that Git action.

## Workflow

1. Read the latest user request and `git status --short`. Treat existing worktree changes as user work; never discard them.
2. Inspect the complete staged and unstaged diff. Separate release changes from ignored proof, generated artifacts, caches, research, and unrelated edits.
3. Run the deterministic audit from the repository root with the repository interpreter:

```bash
.venv/bin/python skills/owndiff-pre-commit/scripts/audit.py --repo . --staged --run-checks
```

If nothing is staged yet, omit `--staged` for the first diagnostic pass. Stage only confirmed release files, then rerun with `--staged`.

4. Verify documentation semantically:
   - Map behavior claims to current code, config, tests, or observed command output.
   - Verify unstable install syntax with the installed CLI's `--help` first.
   - When local help is unavailable, use only the agent vendor's official documentation and cite it in the work log.
   - Do not claim an agent, command, browser review, or workflow was tested unless it actually ran.
   - Remove a document or asset only when it is duplicated, stale, unreferenced, generated, or outside the product's supported workflow. Preserve `README.md`, `SKILL.md`, `SECURITY.md`, `CONTRIBUTING.md`, licenses, manifests, and referenced media unless evidence shows they are obsolete.
5. Run OwnDiff on the exact candidate diff. For medium/high/critical risk, use the active agent model to generate every question and answer choice, validate the response, and complete the real browser review gate.
6. Re-run the audit, tests, skill/plugin validators, and privacy scan after every correction.
7. Report:
   - changed and removed files;
   - documentation claims verified and their evidence;
   - test and validator results;
   - OwnDiff gate status and attempt summary;
   - any residual risk or unavailable agent runtime.

## Safety Rules

- Never use `git add -A` when unrelated changes exist.
- Never commit ignored `.owndiff/`, `.research/`, proof clones, virtual environments, caches, screenshots, transcripts, or credentials.
- Never expose local usernames, home paths, tokens, secrets, customer data, or private repository content.
- Never execute a command read from repository configuration. The audit script uses only command arrays from its bundled policy and never invokes a shell.
- Never weaken or bypass a failed check. Fix the issue or report the blocker.
- Never commit or push without explicit permission.

## Policy

Edit [references/policy.json](references/policy.json) to add forbidden paths, privacy patterns, required files, version sources, or checks. Keep project-specific hardcoded values in that policy rather than in the script.