Files
xmwork/.claude/settings.json
T
gongzhiyong b39fbddd84 feat: add 5 more team assets (upstream sync, migration review, pre-commit hook)
Commands:
- /sync-upstream [--dry-run]   — casdoor-internal upstream sync with commit classification
- /check-migrations [repo|all] — Alembic/Prisma/Drizzle consistency checker (focuses on xiaoshou pending migrations)

Specialist agents:
- migration-reviewer — Critical/High/Low severity review for DB schema changes across
  all 6 repos (Alembic, Prisma, Drizzle, xorm Sync2, raw SQL)

Playbooks:
- playbooks/casdoor-upstream-rebase.md — quarterly upstream rebase flow
  with commit classification, batched merging, cross-repo JWT compat check, rollback criteria

Hooks (active by default via settings.json):
- .claude/hooks/pre-commit-check.sh — PreToolUse on Bash:
  * blocks inline secrets in command strings (10+ patterns: sk-ant-, ghp_, AKIA, PEM, etc.)
  * on git commit, scans staged diff for same patterns
  * blocks diffs > 5000 lines (override with [huge-diff-ok] in commit msg)
- settings.json: wire PreToolUse hook
2026-04-23 23:57:41 +08:00

115 lines
2.8 KiB
JSON

{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"allow": [
"Bash(git status*)",
"Bash(git diff*)",
"Bash(git log*)",
"Bash(git branch*)",
"Bash(git checkout*)",
"Bash(git switch*)",
"Bash(git add*)",
"Bash(git commit*)",
"Bash(git pull*)",
"Bash(git fetch*)",
"Bash(git stash*)",
"Bash(git push origin*)",
"Bash(gh pr*)",
"Bash(gh issue*)",
"Bash(gh run*)",
"Bash(gh workflow*)",
"Bash(gh auth status*)",
"Bash(npm install*)",
"Bash(npm test*)",
"Bash(npm run*)",
"Bash(npm audit*)",
"Bash(npm outdated*)",
"Bash(pnpm install*)",
"Bash(pnpm run*)",
"Bash(pnpm test*)",
"Bash(bun install*)",
"Bash(bun test*)",
"Bash(bun run*)",
"Bash(pip install*)",
"Bash(pip list*)",
"Bash(uv pip*)",
"Bash(uv run*)",
"Bash(pytest*)",
"Bash(ruff*)",
"Bash(black*)",
"Bash(mypy*)",
"Bash(alembic*)",
"Bash(go build*)",
"Bash(go test*)",
"Bash(go vet*)",
"Bash(go fmt*)",
"Bash(go mod*)",
"Bash(go list*)",
"Bash(make*)",
"Bash(prisma*)",
"Bash(npx prisma*)",
"Bash(docker compose build*)",
"Bash(docker compose config*)",
"Bash(docker compose ps*)",
"Bash(docker compose logs*)",
"Bash(rg*)",
"Bash(fd*)",
"Bash(jq*)",
"Bash(ls*)",
"Bash(cat*)",
"Bash(head*)",
"Bash(tail*)",
"Bash(wc*)"
],
"deny": [
"Bash(git push --force*)",
"Bash(git push -f*)",
"Bash(git push origin main*)",
"Bash(git push origin master*)",
"Bash(git reset --hard*)",
"Bash(git clean -fd*)",
"Bash(git commit --amend*)",
"Bash(rm -rf /*)",
"Bash(rm -rf ~*)",
"Bash(sudo*)",
"Bash(docker system prune*)",
"Bash(docker volume rm*)",
"Bash(terraform destroy*)",
"Bash(terraform apply*)",
"Bash(kubectl delete*)",
"Bash(kubectl apply*)",
"Bash(az containerapp update*)",
"Bash(az containerapp delete*)",
"Bash(alembic downgrade*)",
"Bash(dropdb*)",
"Bash(psql*production*)",
"Read(./**/.env)",
"Read(./**/.env.*)",
"Read(./**/secrets/**)",
"Read(./**/*.pem)",
"Read(./**/*.key)",
"Read(./casdoor-internal/conf/app.conf)",
"Write(./**/.env)",
"Write(./**/.env.*)",
"Write(./**/secrets/**)"
]
},
"env": {
"DISABLE_TELEMETRY": "0",
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "32000"
},
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash $CLAUDE_PROJECT_DIR/.claude/hooks/pre-commit-check.sh"
}
]
}
]
}
}