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" + } + } }