chore: port cortexdj#48 — agent-config consolidation, Codex compat, lint/guard hooks#48
Merged
LukeMainwaring merged 4 commits intoMay 15, 2026
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: ruffv0.14.10→v0.15.13, mypyv1.19.1→v2.1.0. The pinned hook versions were below thebackend/pyproject.tomlfloors (ruff>=0.15.12,mypy>=2.1.0); this realigns them.pre-commit run --all-filespasses — the mypy v1→v2 major bump introduced no new strict-mode errors.17afbbb—AGENTS.mdis now the tool-neutral canonical agent-instructions file (Claude Code, Codex, etc.).CLAUDE.md→ symlink →AGENTS.md;.agents/skills→ symlink →../.claude/skillsso Codex picks up the same skills. The@README.md/@DEVELOPMENT.mdimport 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 forfrontend/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 bumpAGENTS.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'smodal.mdpointer (no Modal here); Tests dimension references theeval-marked suite inbackend/tests/evals/.claude/agents/vercel-chatbot-template.md— re-adapted to SampleSpace'sdata-<name>DataPartRendererarchitecture (not cortexdj'stool-<name>switch).claude/skills/updating-deps/SKILL.md— commit section now shows a concrete diff and skips empty-diff runsCaveats
@README.md/@DEVELOPMENT.mdimports 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).120000and degrade to plain text on a Windows checkout withoutcore.symlinks. Accepted — macOS target environment.Test Plan
uv run --directory backend pre-commit run --all-filespasses with bumped ruff + mypyCLAUDE.mdresolves toAGENTS.md;.agents/skillsresolves to.claude/skills(both tracked as mode120000)block-generated-edits.pyverified across 6 payload shapes (generated → block, normal → allow, no-path → fail-closed block, unparseable → allow).claude/settings.jsonis valid JSONAGENTS.md+.agents/skills🤖 Generated with Claude Code