[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7886DJY45PE32XM2WR2PVWY":3,"skill-same:01M7886DJY45PE32XM2WR2PVWY":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7886DJY45PE32XM2WR2PVWY","git-guardrails-claude-code",null,"Install a Claude Code hook that stops destructive git commands (push, reset --hard, clean, branch -D, and friends) before they run. Use when the user wants to guard against dangerous git operations, add git safety hooks, or block git push\u002Freset inside Claude Code.","officialunofficial\u002Fskills","officialunofficial","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F127067914?v=4","01M78827JABEMMN63AC8J1RCXV","Official Unofficial, Inc.","01M78827KC164SFKN4DXTCKK7N",7,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmisc\u002Fgit-guardrails-claude-code\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: git-guardrails-claude-code\ndescription: Install a Claude Code hook that stops destructive git commands (push, reset --hard, clean, branch -D, and friends) before they run. Use when the user wants to guard against dangerous git operations, add git safety hooks, or block git push\u002Freset inside Claude Code.\n---\n\n# Git guardrails for Claude Code\n\nWire up a `PreToolUse` hook that inspects every Bash command Claude is about to run and refuses the destructive git operations before they touch the repository.\n\n## What the guard refuses\n\n- `git push` in any form, including `--force`\n- `git reset --hard`\n- `git clean -f` and `git clean -fd`\n- `git branch -D`\n- `git checkout .` and `git restore .`\n\nWhen a command matches, the hook exits with code 2 and Claude receives a message stating it is not permitted to run that command, so it stops rather than retrying.\n\n## Steps\n\n### 1. Confirm the scope\n\nAsk whether the guard should cover **this project only** (`.claude\u002Fsettings.json`) or **every project** (`~\u002F.claude\u002Fsettings.json`). The answer decides where the script and the hook entry go.\n\n### 2. Place the hook script\n\nThe bundled script lives at [scripts\u002Fblock-dangerous-git.sh](scripts\u002Fblock-dangerous-git.sh). Copy it to match the chosen scope:\n\n- **Project**: `.claude\u002Fhooks\u002Fblock-dangerous-git.sh`\n- **Global**: `~\u002F.claude\u002Fhooks\u002Fblock-dangerous-git.sh`\n\nThen mark it executable with `chmod +x`.\n\n### 3. Register the hook in settings\n\nAdd the hook to the settings file for the chosen scope.\n\n**Project** (`.claude\u002Fsettings.json`):\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"\\\"$CLAUDE_PROJECT_DIR\\\"\u002F.claude\u002Fhooks\u002Fblock-dangerous-git.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n**Global** (`~\u002F.claude\u002Fsettings.json`):\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"~\u002F.claude\u002Fhooks\u002Fblock-dangerous-git.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nWhen the settings file already exists, merge this entry into the existing `hooks.PreToolUse` array and leave the rest of the file untouched.\n\n### 4. Offer to tune the pattern list\n\nAsk whether any patterns should be added or dropped, then edit the `DANGEROUS_PATTERNS` array in the copied script to match.\n\n### 5. Confirm it works\n\nFeed a sample command through the script and check the result:\n\n```bash\necho '{\"tool_input\":{\"command\":\"git push origin main\"}}' | \u003Cpath-to-script>\n```\n\nA working guard exits with code 2 and prints a `BLOCKED` line to stderr.\n","# Git guardrails for Claude Code\n\nWire up a `PreToolUse` hook that inspects every Bash command Claude is about to run and refuses the destructive git operations before they touch the repository.\n\n## What the guard refuses\n\n- `git push` in any form, including `--force`\n- `git reset --hard`\n- `git clean -f` and `git clean -fd`\n- `git branch -D`\n- `git checkout .` and `git restore .`\n\nWhen a command matches, the hook exits with code 2 and Claude receives a message stating it is not permitted to run that command, so it stops rather than retrying.\n\n## Steps\n\n### 1. Confirm the scope\n\nAsk whether the guard should cover **this project only** (`.claude\u002Fsettings.json`) or **every project** (`~\u002F.claude\u002Fsettings.json`). The answer decides where the script and the hook entry go.\n\n### 2. Place the hook script\n\nThe bundled script lives at [scripts\u002Fblock-dangerous-git.sh](scripts\u002Fblock-dangerous-git.sh). Copy it to match the chosen scope:\n\n- **Project**: `.claude\u002Fhooks\u002Fblock-dangerous-git.sh`\n- **Global**: `~\u002F.claude\u002Fhooks\u002Fblock-dangerous-git.sh`\n\nThen mark it executable with `chmod +x`.\n\n### 3. Register the hook in settings\n\nAdd the hook to the settings file for the chosen scope.\n\n**Project** (`.claude\u002Fsettings.json`):\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"\\\"$CLAUDE_PROJECT_DIR\\\"\u002F.claude\u002Fhooks\u002Fblock-dangerous-git.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n**Global** (`~\u002F.claude\u002Fsettings.json`):\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"~\u002F.claude\u002Fhooks\u002Fblock-dangerous-git.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nWhen the settings file already exists, merge this entry into the existing `hooks.PreToolUse` array and leave the rest of the file untouched.\n\n### 4. Offer to tune the pattern list\n\nAsk whether any patterns should be added or dropped, then edit the `DANGEROUS_PATTERNS` array in the copied script to match.\n\n### 5. Confirm it works\n\nFeed a sample command through the script and check the result:\n\n```bash\necho '{\"tool_input\":{\"command\":\"git push origin main\"}}' | \u003Cpath-to-script>\n```\n\nA working guard exits with code 2 and prints a `BLOCKED` line to stderr.\n",{"name":5,"description":7},"main","e1e71e8aa302edca3e052370aefa9272f86d07ee","skills\u002Fmisc\u002Fgit-guardrails-claude-code",0,"https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills","https:\u002F\u002Fgithub.com\u002Fofficialunofficial","officialunofficial.com","2026-11-06 10:07:10",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add officialunofficial\u002Fskills --skill git-guardrails-claude-code",{"tool":38,"command":39},"bunx","bunx skills add officialunofficial\u002Fskills --skill git-guardrails-claude-code",{"tool":41,"command":42},"pnpm","pnpm dlx skills add officialunofficial\u002Fskills --skill git-guardrails-claude-code","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmisc\u002Fgit-guardrails-claude-code\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"scripts\u002Fblock-dangerous-git.sh","SCRIPT","脚本",904,"https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmisc\u002Fgit-guardrails-claude-code\u002Fscripts\u002Fblock-dangerous-git.sh",[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7887BDP2BC5HFHEKCNMBZ4Q","writing-great-skills","Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fwriting-great-skills\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M788772K4QYXCZX3Y2P2AX9V","technical-writing","House style for technical writing — the voice, sentence craft, formatting, and user-facing-copy rules that make docs and product text clear, direct, and consistent. Use when writing or editing a README, docs, a spec, release notes, a changelog, help text, or any error\u002FCLI\u002FUI copy a person reads; when reviewing a diff that touches prose or messages; or when a project needs a writing standard. Reference-heavy mechanics live in REFERENCE.md.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Ftechnical-writing\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M78875087F1XKP7C6VRC49CY","teach","Teach the user a new skill or concept, within this workspace.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fteach\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M78872Z38MACN22AQDY9410P","handoff","Compact the current conversation into a handoff document for another agent to pick up.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fhandoff\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M78870FVRDYRT1WVP9HJ6FQ3","grilling","Interrogate the user's plan or design one decision at a time until you both share the same understanding. Use when the user wants to pressure-test an idea before building it, or reaches for any 'grill' trigger phrase.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fgrilling\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7886XGPEWXZYDA6K310HNYP","grill-me","A relentless, one-decision-at-a-time interview that sharpens a plan or design.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fgrill-me\u002FSKILL.md",[],[]]