From 8d6f9dbad6e44ad5b1e6b8d130c93fad77c3adbc Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Wed, 10 Jun 2026 09:35:10 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=20docs/superpowers?= =?UTF-8?q?=20=E6=8F=90=E4=BA=A4=E9=98=B2=E6=8A=A4=E5=92=8C=20git=20?= =?UTF-8?q?=E5=BC=BA=E5=88=B6=E6=93=8D=E4=BD=9C=E6=9D=83=E9=99=90=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/pre-commit | 4 ++++ opencode.json | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 00a9d3c..114bd21 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,5 @@ +if git diff --cached --name-only | grep -q "^docs/superpowers/"; then + echo "错误: 禁止提交 docs/superpowers/ 目录下的文件" >&2 + exit 1 +fi bun lint-staged diff --git a/opencode.json b/opencode.json index cc684f6..1604431 100644 --- a/opencode.json +++ b/opencode.json @@ -1,4 +1,17 @@ { "$schema": "https://opencode.ai/config.json", - "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"] + "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"], + "permission": { + "bash": { + "git add -f *": "deny", + "git add --force *": "deny", + "git push * --force *": "deny", + "git push * -f *": "deny", + "git push --force-with-lease *": "deny", + "git reset --hard *": "deny", + "git clean -f *": "deny", + "git checkout -- *": "deny", + "git restore --staged *": "deny" + } + } }