forked from lei.chen/myxce
Add python3 + pycapnp/pyyaml/jsonschema/click/pytest/ruff (+pip) to the nix dev shell, wire a new `xceadmin` case into xce-build.sh (schema sync from src/schema/ and src/configs/schema/, pip install by profile, pytest), package-data config so bundled schemas survive a non-editable install, xce-build SKILL.md docs, and ruff format/check hooks matching this repo's stdin-JSON hook convention (not brief.md's env-var sketch, which would have silently no-op'd). Verified live end-to-end inside `nix develop ./src` for both the default (editable) and release (pinned) profiles; found and fixed 3 real bugs along the way (missing pip, PEP 668 externally-managed- environment, missing package-data for release-profile bundling) — logged as bug-1458/1459/1460. Requirements: 5.5, 8.1, 8.2, 8.6
94 lines
2.4 KiB
JSON
94 lines
2.4 KiB
JSON
{
|
|
"hooks": {
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "Edit|Write|Bash",
|
|
"hooks": []
|
|
},
|
|
{
|
|
"matcher": "Read",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"$CLAUDE_PROJECT_DIR/.wolf/hooks/post-read.js\"",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "Write|Edit|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"$CLAUDE_PROJECT_DIR/.wolf/hooks/post-write.js\"",
|
|
"timeout": 10
|
|
},
|
|
{
|
|
"type": "command",
|
|
"command": "FILE_PATH=$(python3 -c \"import json,sys; d=json.load(sys.stdin); print(d.get('tool_input',{}).get('file_path') or d.get('tool_input',{}).get('path') or '')\" 2>/dev/null); [[ \"$FILE_PATH\" == *.py ]] && ruff format --quiet \"$FILE_PATH\" 2>/dev/null; true",
|
|
"timeout": 10
|
|
},
|
|
{
|
|
"type": "command",
|
|
"command": "FILE_PATH=$(python3 -c \"import json,sys; d=json.load(sys.stdin); print(d.get('tool_input',{}).get('file_path') or d.get('tool_input',{}).get('path') or '')\" 2>/dev/null); [[ \"$FILE_PATH\" == *.py ]] && ruff check --quiet \"$FILE_PATH\" 2>/dev/null; true",
|
|
"timeout": 10
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"SessionStart": [
|
|
{
|
|
"matcher": "",
|
|
"hooks": []
|
|
},
|
|
{
|
|
"matcher": "",
|
|
"hooks": []
|
|
},
|
|
{
|
|
"matcher": "",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"$CLAUDE_PROJECT_DIR/.wolf/hooks/session-start.js\"",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Read",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"$CLAUDE_PROJECT_DIR/.wolf/hooks/pre-read.js\"",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "Write|Edit|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"$CLAUDE_PROJECT_DIR/.wolf/hooks/pre-write.js\"",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"Stop": [
|
|
{
|
|
"matcher": "",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"$CLAUDE_PROJECT_DIR/.wolf/hooks/stop.js\"",
|
|
"timeout": 10
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|