chore(agents): load AGENTS.md in Claude Code and guard its rules

Claude Code discovers CLAUDE.md but not AGENTS.md, so the contributor
instructions were loading for nobody. The import shim is what our own docs
already recommend to users in docs/edge/en/guides/coding-tools/agents-md.mdx.

The PreToolUse guard enforces only rules already written in CONTRIBUTING.md
and AGENTS.md, so it adds no policy of its own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ASfWmW3RGy4qAQm6s8U9jH
This commit is contained in:
Joao Moura
2026-08-08 16:29:40 -07:00
parent f7ba8e3521
commit 02e4c65239
7 changed files with 365 additions and 1 deletions

View File

@@ -61,6 +61,18 @@ repos:
language: system
pass_filenames: false
stages: [pre-push, manual]
- repo: local
hooks:
- id: agent-guard-hook
name: agent-guard-hook
# --confcutdir keeps the root conftest out: it assumes every test lives
# under lib/<package>/tests/, which these do not.
entry: >-
bash -c 'source .venv/bin/activate && uv run pytest
.claude/hooks/test_guard.py -q --confcutdir=.claude/hooks'
language: system
pass_filenames: false
files: ^\.claude/hooks/
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.10.1
hooks: