Skip to content
Merged
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
15 changes: 7 additions & 8 deletions .claude/hooks/post-edit-format.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
#!/bin/bash
# Post-edit hook: apply license headers and format with deno fmt
# Runs after Edit or Write tool use to ensure consistent formatting
# Post-edit hook: auto-fix license headers, formatting, and linting
# Runs after Edit or Write tool use — only does auto-fixable operations

set -euo pipefail

INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')

# Format TypeScript/TSX files and apply license headers
# Auto-fix TypeScript/TSX files
if [[ "$FILE_PATH" == *.ts || "$FILE_PATH" == *.tsx ]]; then
cd "$CLAUDE_PROJECT_DIR"
deno run license-headers 2>/dev/null
deno fmt "$FILE_PATH" 2>/dev/null
deno lint "$FILE_PATH" 2>/dev/null
deno check "$FILE_PATH" 2>/dev/null
deno run license-headers
deno fmt "$FILE_PATH"
deno lint --fix "$FILE_PATH"
# Format Markdown files
elif [[ "$FILE_PATH" == *.md ]]; then
cd "$CLAUDE_PROJECT_DIR"
deno fmt "$FILE_PATH" 2>/dev/null
deno fmt "$FILE_PATH"
fi

exit 0
6 changes: 3 additions & 3 deletions .claude/hooks/stop-verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ cd "$CLAUDE_PROJECT_DIR"

ERRORS=""

if ! deno check 2>&1; then
if ! deno task check 2>&1; then
ERRORS="${ERRORS}deno check failed\n"
fi

if ! deno lint 2>&1; then
ERRORS="${ERRORS}deno lint failed\n"
fi

if ! deno run test 2>&1; then
ERRORS="${ERRORS}deno run test failed\n"
if ! deno task test 2>&1; then
ERRORS="${ERRORS}deno test failed\n"
fi

if [ -n "$ERRORS" ]; then
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ jobs:
- name: Run deno fmt --check
run: deno fmt --check

- name: Run deno check
run: deno task check

- name: Run deno test
run: deno test --unstable-bundle --allow-read --allow-write --allow-env --allow-run --allow-net --allow-sys
run: deno task test

- name: Compile binary
run: deno run compile
run: deno task compile

deps-audit:
name: Dependency Audit
Expand Down
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ When creating or updating `swamp-*` skills in `.claude/skills/`, follow the
Changes should only touch what's necessary — don't refactor adjacent code that
isn't part of the task. Keep the blast radius small.

Post-edit hooks in `.claude/hooks/` automatically enforce license headers,
`deno fmt`, `deno lint`, and `deno check` on each changed file.
Post-edit hooks in `.claude/hooks/` automatically run license headers,
`deno fmt`, and `deno lint --fix` on each changed file.

## Commands

Expand Down Expand Up @@ -57,8 +57,8 @@ Use `deno run` to get a complete list of custom tasks.

## Verification

Post-edit hooks in `.claude/hooks/` automatically enforce license headers,
`deno fmt`, `deno lint`, and `deno check` on each changed file. A Stop hook in
Post-edit hooks in `.claude/hooks/` automatically run license headers,
`deno fmt`, and `deno lint --fix` on each changed file. A Stop hook in
`.claude/hooks/stop-verify.sh` runs project-wide `deno check`, `deno lint`, and
`deno run test` before completion — blocking until all pass. After completing
all work, run `deno run compile` to recompile the binary.
Expand Down
Loading