Repository navigation
chore: add the agent setup (AGENTS.md, CLAUDE.md, .claude) - #24
Merged
Merged
Conversation
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.
Adds the repository's agent setup, plus a test for the one piece of behaviour it brings (the post-edit hook). No code or workflow changes.
What was added
AGENTS.md(93 lines): layout, the exact commandstests.ymlruns with theBRIDGE_TOKENrequirement, the rules by pointing toCONTRIBUTING.mdanddocs/testing.md, and the working rules (one purpose per branch, tested before merged, reviews are text and commits are changes, no AI attribution).CLAUDE.md:@AGENTS.mdplus the Claude-specific lines..claude/rules/php-client.md,worker.md,mcp-server.md: path-scoped rules for the three parts that differ (strict types, no mbstring and warnings as failures; stdlib-only worker path with model dependencies imported inside the ONNX functions; the tool list as a literal andBACKENDSequal toMODEL_NAMES)..claude/skills/check/SKILL.md:/checkruns the deterministic gate's steps in order..claude/hooks/repo-rules.shand its PostToolUse wiring: after an edit, a PHP file undersrc/,examples/ortests/phpmust declare strict types and use spaces, and aworker/ai_bridgemodule must not import a model dependency at module level.tests/python/test_repo_rules_hook.pycovers it (nine cases: clean files, each violation, imports inside functions and look-alike names, files outside the scope, empty or malformed input, a missing file, a JSON-escaped Windows path, a relative path)..claude/settings.json: allows the exact compose commands CI runs and read-only git and gh; asks beforegh workflow run,gh pr create,gh pr mergeand the modelfetcher; denies force pushes, pushes tomain,gh pr merge --auto/--admin,gh release, tags, the git flags that run commands or write or read arbitrary files (grep -O,--output,diff --no-index), and reads of.env, keys and credentials. Every Bash rule has a PowerShell twin. Attribution lines are off..gitignore:CLAUDE.local.mdand.claude/settings.local.json..gitattributes: hook scripts forced to LF.Tests run
The twelve steps of the new
/checkskill, in order, locally on the default PHP 8.5 image (Docker 29.8.2, Compose v5.5.1), all passing on the first draft of the branch:--profile test configpython-tests: 128 tests, OKphp-tests: 101 contract checksphp -loversrc,examples,tests/php: 12 files, no syntax errorsup -d worker frankenphp fault-worker hostile, thenphp-integration(134 checks including HTTP failure cases) andintegration(12 concurrent jobs through the reused FrankenPHP worker, top_k, embedding, redaction, invalid and missing-job cases)--profile test downmcp-fetcher, thenmcp-tests: 119 tests, OK;--profile mcp --profile mcp-fetch downAfter the review fixes below, which touched only Markdown, the settings, the hook and its new test:
python-testsagain inside compose, 137 tests, OK (the 128 plus the nine hook cases), and the hook test suite on the host under Git Bash'ssh. The--profile mcp --profile mcp-fetch --profile mcp-model configstep the review added was not rerun locally; CI runs it. PHP 8.2, 8.3 and 8.4 are left to CI's matrix. The model smoke tests were not run: nothing on theirpaths:list changed.Review
An independent read of the branch before this PR found five blocking items, all fixed in the one commit:
docker compose ... run *andup *inallowlet a prompt-free command add-v,-u 0or--entrypointand so escape the compose sandbox, andup fetcherreached the network-enabled fetcher. Replaced by the exact commands CI runs; everything else prompts.--profile mcp --profile mcp-fetch --profile mcp-model configstep was missing from/checkand AGENTS.md. Added.tests/php/run.phpandintegration.phpwere described as "HTTP against fakes" and "through FrankenPHP";run.phpis offline,integration.phpdrives the real worker and broken peers directly, and FrankenPHP istests/integration.py. Reworded in AGENTS.md and the PHP rule.Settingsfield injobs.py; the body size isMAX_BODYinserver.pyand the field limits areMAX_*intasks.py. Reworded.Non-blocking findings also taken: the "read-only" git allow rules could execute or read anything through
grep -O,--outputanddiff --no-index(denied now); the hook missed an indented or comma-list import and a lower-case drive letter (handled, with tests); a PostToolUse hook reports rather than refuses (wording fixed in CLAUDE.md and the rules); theconfigsteps print the token (noted in the skill). Left as an issue: the push-to-main denies still missgit push origin refs/heads/mainand a baregit pushwhile onmain(a push-guard hook would close that). The CI runner routing for a public repository is a separate branch already in progress.