Skip to content

chore: consolidate agent config via symlinks + add Claude Code lint/guard hooks#48

Merged
LukeMainwaring merged 7 commits into
mainfrom
chore/agent-config-symlinks
May 15, 2026
Merged

chore: consolidate agent config via symlinks + add Claude Code lint/guard hooks#48
LukeMainwaring merged 7 commits into
mainfrom
chore/agent-config-symlinks

Conversation

@LukeMainwaring

Copy link
Copy Markdown
Owner

Summary

Consolidates duplicated agent config to single sources of truth and adds Claude Code automation hooks. Four commits:

  • 12430fcAGENTS.md is now the canonical agent-instructions file (tool-neutral, AGENTS.md standard). CLAUDE.md → symlink → AGENTS.md; .agents/skills → symlink → ../.claude/skills. Eliminates the hand-mirroring that had already drifted (AGENTS.md was missing 4 rules pointers; a mirrored skill referenced a broken .Codex/ path). .claude/rules/ was already shared; .claude/agents/ and settings stay Claude-specific by design.
  • 484bde9 — pre-commit bump: ruff v0.14.10v0.15.13, mypy v1.19.1v2.1.0 (matches backend/pyproject.toml floors).
  • fdb376f — new Claude Code hooks: backend-ruff.py + frontend-lint.py (PostToolUse formatters), block-generated-edits.py (PreToolUse guard for frontend/api/generated/), wired in .claude/settings.json. Claude-Code-only by design — git pre-commit covers backend lint; these fill the frontend/generated-guard gap for agent sessions.
  • d0b33b5 — review fix: the generated-file guard now fails closed (blocks) when it can't determine a target path, instead of silently allowing the edit.

Review

Reviewed pre-PR via the code-reviewer subagent → fix-and-ship. Symlink consolidation verified (mode 120000, resolves correctly, no stale .Codex/ refs). The one substantive finding (guard fail-open) is addressed in d0b33b5; the reviewer's MultiEdit-specific premise was inaccurate (MultiEdit does carry file_path), but the fail-closed hardening is the correct defense-in-depth regardless. Guard behavior verified across 5 payload shapes (generated/normal/notebook/no-path/unparseable).

Caveat

Symlinks are git-tracked as mode 120000; they degrade to plain text files on a Windows checkout without core.symlinks. Accepted — macOS target environment.

🤖 Generated with Claude Code

LukeMainwaring and others added 7 commits May 15, 2026 09:02
Replace hand-mirrored duplicate agent config with single sources of truth:

- AGENTS.md is now canonical (tool-neutral wording, AGENTS.md standard)
- CLAUDE.md is a symlink -> AGENTS.md (Claude Code resolves it)
- .agents/skills is a symlink -> ../.claude/skills
- Drop the tool-specific attribution line in updating-deps-auto

The previous per-commit mirroring had already drifted (AGENTS.md was
missing 4 rules pointers; a mirrored skill referenced a broken .Codex/
path). Symlinks give zero drift with one place to edit. .claude/rules/
was already shared; .claude/agents/ and settings stay Claude-specific.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Aligns pinned pre-commit hook versions with backend deps (ruff>=0.15.12, mypy>=2.1.0).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ooks

Adds .claude/hooks/ scripts wired through settings.json: PreToolUse blocks hand-edits to frontend/api/generated/; PostToolUse runs ultracite check on changed frontend files (report-only) and ruff --fix + format on changed backend src/tests Python (mirrors .pre-commit-config.yaml; mypy left to pre-commit/CI). Codex hook sync intentionally skipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pre-PR code review flagged that block-generated-edits.py returned 0
(allow) on any falsy file_path. For a security guard, fail open on an
unexpected payload shape is the wrong default. Now: accept file_path or
notebook_path, and if neither is present, block (exit 2) with a clear
message. Lint hooks keep failing open by design (best-effort
formatters). Unparseable stdin still returns 0 (no tool context).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Generic boilerplate skill bulk-added in 5d9d900; not project-aware,
redundant with IDE/tree, and emits an untracked codebase-map.html
artifact on each run. No code or docs reference it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…oded list

Phase 8 enumerated 6 fixed paths to `git add`, which drifts as the
project evolves and implies docs must change every run. Replace with a
git-status-driven flow: show the diff before the approval gate, skip the
commit when nothing changed (no empty-commit error), then `git add -A`.
The run is on its own update-deps/<date> branch with no auto-fixes, so
committing everything that changed is correct and safe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant