Skip to content

chore: port cortexdj#48 — agent-config consolidation, Codex compat, lint/guard hooks#48

Merged
LukeMainwaring merged 4 commits into
mainfrom
LukeMainwaring/apply-cortexdj-pr48-refactor
May 15, 2026
Merged

chore: port cortexdj#48 — agent-config consolidation, Codex compat, lint/guard hooks#48
LukeMainwaring merged 4 commits into
mainfrom
LukeMainwaring/apply-cortexdj-pr48-refactor

Conversation

@LukeMainwaring

Copy link
Copy Markdown
Owner

Summary

Ports the agent-config + tooling improvements from cortexdj#48 to SampleSpace, adapted for terminology, the test layout, and frontend architecture differences. Four commits:

  • d2f898b — pre-commit bump: ruff v0.14.10v0.15.13, mypy v1.19.1v2.1.0. The pinned hook versions were below the backend/pyproject.toml floors (ruff>=0.15.12, mypy>=2.1.0); this realigns them. pre-commit run --all-files passes — the mypy v1→v2 major bump introduced no new strict-mode errors.
  • 17afbbbAGENTS.md is now the tool-neutral canonical agent-instructions file (Claude Code, Codex, etc.). CLAUDE.md → symlink → AGENTS.md; .agents/skills → symlink → ../.claude/skills so Codex picks up the same skills. The @README.md/@DEVELOPMENT.md import syntax was dropped for plain prose (Codex cannot expand it).
  • 8b1abba — new Claude Code hooks: backend-ruff.py + frontend-lint.py (PostToolUse), block-generated-edits.py (PreToolUse guard for frontend/api/generated/, fails closed when it can't determine a target path), wired in .claude/settings.json. Claude-Code-only by design — git pre-commit still covers backend lint on commit; these fill the inline + frontend + generated-guard gap for agent sessions.
  • 4f7a881 — prompt/skill polish: code-reviewer.md (general first-pass framing, .claude/rules/ as single source of truth, new Tests dimension), vercel-chatbot-template.md (live tree discovery, version-compat check, scope constraints, re-adapted to SampleSpace's architecture), updating-deps/SKILL.md (concrete diff before commit, skip empty-diff).

Changes

  • .pre-commit-config.yaml — ruff/mypy version bump
  • AGENTS.md (new, canonical) / CLAUDE.md (→ symlink) / .agents/skills (→ symlink)
  • .claude/hooks/{backend-ruff,frontend-lint,block-generated-edits}.py (new) + .claude/settings.json (hooks wired)
  • .claude/agents/code-reviewer.md — deferred lint nits to hooks/pre-commit; dropped cortexdj's modal.md pointer (no Modal here); Tests dimension references the eval-marked suite in backend/tests/evals/
  • .claude/agents/vercel-chatbot-template.md — re-adapted to SampleSpace's data-<name> DataPartRenderer architecture (not cortexdj's tool-<name> switch)
  • .claude/skills/updating-deps/SKILL.md — commit section now shows a concrete diff and skips empty-diff runs

Caveats

  • Intended behavior change: dropping the @README.md/@DEVELOPMENT.md imports means Claude Code no longer auto-injects those files; the agent reads them on demand. This is the cost of AGENTS.md tool-neutrality (same call cortexdj made).
  • Symlinks are git-tracked as mode 120000 and degrade to plain text on a Windows checkout without core.symlinks. Accepted — macOS target environment.

Test Plan

  • uv run --directory backend pre-commit run --all-files passes with bumped ruff + mypy
  • CLAUDE.md resolves to AGENTS.md; .agents/skills resolves to .claude/skills (both tracked as mode 120000)
  • All 3 hooks compile; block-generated-edits.py verified across 6 payload shapes (generated → block, normal → allow, no-path → fail-closed block, unparseable → allow)
  • .claude/settings.json is valid JSON
  • Sanity-check in a fresh Claude Code session that the PostToolUse hooks fire on a backend/frontend edit and the generated-edits guard blocks
  • Spot-check Codex picks up AGENTS.md + .agents/skills

🤖 Generated with Claude Code

LukeMainwaring and others added 4 commits May 15, 2026 11:18
ruff v0.14.10 -> v0.15.13, mypy v1.19.1 -> v2.1.0. The pinned hook
versions were below the backend/pyproject.toml floors (ruff>=0.15.12,
mypy>=2.1.0); this realigns them. pre-commit run --all-files passes
(mypy v2 introduced no new strict-mode errors).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AGENTS.md is now the tool-neutral canonical agent-instructions file
(Claude Code, Codex, etc.). CLAUDE.md -> symlink -> AGENTS.md;
.agents/skills -> symlink -> ../.claude/skills so Codex picks up the
same skills. Dropped the @README.md/@DEVELOPMENT.md import syntax for
plain prose since Codex cannot expand it.

Caveat: symlinks are git-tracked as mode 120000 and degrade to plain
text on a Windows checkout without core.symlinks. Accepted -- macOS
target environment.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
backend-ruff.py + frontend-lint.py (PostToolUse formatters/linters
mirroring pre-commit scope) and block-generated-edits.py (PreToolUse
guard for frontend/api/generated/, fails closed when it cannot
determine the target path), wired in .claude/settings.json. Fills the
inline + frontend + generated-guard gap for agent sessions; git
pre-commit still covers backend lint on commit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
code-reviewer.md: general first-pass framing, .claude/rules/ as single
source of truth (no modal.md), new Tests dimension referencing the
eval-marked suite, lint nits deferred to hooks/pre-commit.
vercel-chatbot-template.md: live tree discovery, version-compat check,
vercel/chatbot-only scope, Core/DB/auth out of scope, re-adapted to
SampleSpace's data-<name> DataPartRenderer architecture.
updating-deps: show concrete diff before commit, skip empty-diff,
git add -A.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@LukeMainwaring LukeMainwaring merged commit 08d8d1a into main May 15, 2026
3 checks passed
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