Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 49 additions & 48 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/enforce-worktree.sh"
}
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/enforce-worktree.sh"
},
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/th-curl-hint.sh"
}
]
}
],
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/enforce-pearls-labels.sh"
}
]
}
],
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "BRANCH=$(git -C \"$HOME/dev/smooai/smooth\" symbolic-ref --short HEAD 2>/dev/null); DIR=$(pwd); MAIN=\"$HOME/dev/smooai/smooth\"; if [[ \"$DIR\" == \"$MAIN\" || \"$DIR\" == \"$MAIN/\"* ]] && [[ \"$BRANCH\" == \"main\" ]]; then echo '⚠️ You are in the MAIN worktree (~/dev/smooai/smooth/) on the main branch. Do NOT do feature work here. Create a worktree first: git worktree add ../smooth-SMOODEV-XX-desc -b SMOODEV-XX-desc main'; fi"
}
]
}
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/enforce-worktree.sh"
}
]
}
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/enforce-worktree.sh"
},
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/th-curl-hint.sh"
}
]
}
],
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/enforce-pearls-labels.sh"
}
]
}
],
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "BRANCH=$(git -C \"$HOME/dev/smooai/smooth\" symbolic-ref --short HEAD 2>/dev/null); DIR=$(pwd); MAIN=\"$HOME/dev/smooai/smooth\"; if [[ \"$DIR\" == \"$MAIN\" || \"$DIR\" == \"$MAIN/\"* ]] && [[ \"$BRANCH\" == \"main\" ]]; then echo '⚠️ You are in the MAIN worktree (~/dev/smooai/smooth/) on the main branch. Do NOT do feature work here. Create a worktree first: git worktree add ../smooth-SMOODEV-XX-desc -b SMOODEV-XX-desc main'; fi"
}
]
}
]
},
"enabledPlugins": {}
}
5 changes: 5 additions & 0 deletions .githooks/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
# ── Pearl hooks ──────────────────────────────────────────────────────
if command -v th >/dev/null 2>&1; then
th hooks run post-checkout "$@" || true
fi
5 changes: 5 additions & 0 deletions .githooks/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
# ── Pearl hooks ──────────────────────────────────────────────────────
if command -v th >/dev/null 2>&1; then
th hooks run post-merge "$@" || true
fi
21 changes: 21 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh
set -e

# ── Cargo format check ──────────────────────────────────────────────
echo "pre-commit: cargo fmt --check"
cargo fmt -- --check || {
echo >&2 "pre-commit: formatting issues found. Run 'cargo fmt' and re-stage."
exit 1
}

# ── Cargo clippy ─────────────────────────────────────────────────────
echo "pre-commit: cargo clippy"
cargo clippy --workspace --all-targets -- -D warnings || {
echo >&2 "pre-commit: clippy warnings found. Fix them before committing."
exit 1
}

# ── Pearl hooks ──────────────────────────────────────────────────────
if command -v th >/dev/null 2>&1; then
th hooks run pre-commit "$@" || true
fi
14 changes: 14 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh
set -e

# ── Cargo tests ──────────────────────────────────────────────────────
echo "pre-push: cargo test"
cargo test --workspace || {
echo >&2 "pre-push: tests failed. Fix them before pushing."
exit 1
}

# ── Pearl hooks ──────────────────────────────────────────────────────
if command -v th >/dev/null 2>&1; then
th hooks run pre-push "$@" || true
fi
5 changes: 5 additions & 0 deletions .githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
# ── Pearl hooks ──────────────────────────────────────────────────────
if command -v th >/dev/null 2>&1; then
th hooks run prepare-commit-msg "$@"
fi
Loading
Loading