迁移 Claude/Codex/Cursor 开发环境与追溯资产

Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Neo
2026-05-02 03:11:39 +08:00
parent d269ee6401
commit 81e41730ec
33 changed files with 3734 additions and 34 deletions

45
.cursor/hooks.json Normal file
View File

@@ -0,0 +1,45 @@
{
"version": 1,
"hooks": {
"preToolUse": [
{
"command": ".venv\\Scripts\\python.exe .cursor\\hooks\\ai_env_guard.py preToolUse",
"matcher": "Read|Glob|Edit|Write|ApplyPatch",
"timeout": 5,
"failClosed": true
}
],
"beforeReadFile": [
{
"command": ".venv\\Scripts\\python.exe .cursor\\hooks\\ai_env_guard.py beforeReadFile",
"matcher": "_archived",
"timeout": 5,
"failClosed": true
}
],
"beforeMCPExecution": [
{
"command": ".venv\\Scripts\\python.exe .cursor\\hooks\\ai_env_guard.py beforeMCPExecution",
"matcher": "pg-etl|pg-app",
"timeout": 5,
"failClosed": false
}
],
"beforeShellExecution": [
{
"command": ".venv\\Scripts\\python.exe .cursor\\hooks\\ai_env_guard.py beforeShellExecution",
"matcher": "git\\s+(reset|checkout)|--no-verify|psql|mcp-postgres|PG_DSN|APP_DB_DSN",
"timeout": 5,
"failClosed": false
}
],
"postToolUse": [
{
"command": ".venv\\Scripts\\python.exe .cursor\\hooks\\ai_env_guard.py postToolUse",
"matcher": "ApplyPatch|Edit|Write",
"timeout": 5,
"failClosed": false
}
]
}
}