chore: add CLAUDE.md and .claude config

This commit is contained in:
Justin Gu
2026-05-21 13:02:27 +08:00
parent 604f7cdf57
commit ace1099ab0
4 changed files with 100 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "python scripts/ruff_hook.py",
"timeout": 30
}
]
}
]
}
}
+14
View File
@@ -0,0 +1,14 @@
{
"permissions": {
"allow": [
"Skill(update-config)",
"Bash(echo '{\"tool_name\":\"Edit\",\"tool_input\":{\"file_path\":\"D:\\\\\\\\python\\\\\\\\xmtdx\\\\\\\\src\\\\\\\\xmtdx\\\\\\\\__init__.py\"}}')",
"Bash(python -c \"import sys,json,subprocess;d=json.load\\(sys.stdin\\);f=d.get\\('tool_input',{}\\).get\\('file_path',''\\);exec\\('' if not f.endswith\\(\\\\\\\\'.py\\\\\\\\'\\) else 'subprocess.run\\([\\\\\\\\'ruff\\\\\\\\',\\\\\\\\'check\\\\\\\\',\\\\\\\\'--fix\\\\\\\\',f],capture_output=True\\);subprocess.run\\([\\\\\\\\'ruff\\\\\\\\',\\\\\\\\'format\\\\\\\\',f],capture_output=True\\)'\\);print\\(f'done: {f}'\\)\")",
"Bash(python *)",
"Bash(ruff check *)",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git push *)"
]
}
}
+16
View File
@@ -0,0 +1,16 @@
---
name: verify
description: Run full offline verification suite (pytest unit tests + mypy + ruff) before committing changes.
disable-model-invocation: true
---
# Verify
Run the full offline verification pipeline:
1. Run `python -m pytest tests/unit/ -v` — all unit tests must pass.
2. Run `mypy src/` — strict type checking must pass with zero errors.
3. Run `ruff check src/ tests/` — no lint errors.
4. Run `ruff format --check src/ tests/` — formatting must be clean.
If any step fails, fix the issues and re-run. Do not report completion until all four steps pass.