chore: agent brief, Codex hook bridge and cross-agent rules sync - #24
Merged
Conversation
PR #22 was produced with Codex, which never saw the project rules kept in .claude/rules and .cursor/rules: Codex reads only a root AGENTS.md and has no glob-based rule attachment. Contributors without an agent had no visible checklist either. - AGENTS.md as the canonical top-level brief, CLAUDE.md symlinked to it - .codex/hooks.json + .codex/hooks/attach_rules.py (verbatim from the rpa-gen-rules skill) deliver .cursor/rules/*.mdc to Codex sessions; .codex/rules.md is the index - .cursor/rules globs unquoted: the bridge parser reads them literally - workflow rule: README triggers cover auth/header handling and spec loading; Rules sync spans Cursor, Claude, Codex and AGENTS.md - architecture rule: spec download headers documented, stale note about a generated version.ts removed - .github/pull_request_template.md with the same checklist for humans Co-Authored-By: Claude Fable 5.1 <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.
Why
#22 was produced with Codex and shipped without a README update and with a
jest.mock("axios")that the repo's testing rules forbid. Codex never saw those rules: it reads only a rootAGENTS.md(absent until now) and has no glob-based rule attachment, so.claude/rulesand.cursor/ruleswere invisible to it. Contributors working without an agent had no visible checklist either. This PR closes both gaps following therpa-gen-ruleslayout.What
AGENTS.mdis the canonical top-level brief: commands, the TDD and docs workflow that must not be skipped, easy-to-miss conventions, rule index.CLAUDE.mdis a symlink to it, so Claude Code, Codex, Cursor and OpenCode read the same text..codex/hooks.jsonand.codex/hooks/attach_rules.py, copied verbatim from the skill, inject everyalwaysApply: trueCursor rule atSessionStartand the glob-matched rules before eachapply_patch/Edit/Write, once per rule per session..codex/rules.mdis the human-readable index..cursor/rules/*.mdc:globsare now unquoted. The bridge parser reads the value literally, soglobs: "src/**/*.ts"never matched anything; verified with the probe below.workflowrule, both trees: README triggers now include authentication and header handling and spec loading and caching, and a change counts even when it adds no flag. The Rules sync section covers Codex,AGENTS.mdand theCLAUDE.mdsymlink and ends with a checklist.architecturerule, both trees: the loader description mentions the profile headers on spec download (behavior from fix: send profile auth headers when fetching the OpenAPI spec (supersedes #22) #23), and the stale claim about a generatedversion.tsis gone..github/pull_request_template.md: the same checklist for humans..gitignore:__pycache__/, since the hook is Python.Verification
Probe without a Codex session (
echo '<event json>' | python3 .codex/hooks/attach_rules.py):SessionStartattaches architecture, code-style, testing and workflow, about 17k characters, under the 8000-token ceiling set inhooks.jsonPreToolUseonsrc/openapi-loader.tsattaches implementation-order only; a second patch in the same session attaches nothingPreToolUseonREADME.mdattaches nothingnpm test140 passed,npm run buildclean; no source files change here.After merge
Merge after #23 (the architecture rule describes its behavior). Run
/hooksonce in Codex per clone to trust the bridge, and again after any edit to the two hook files.🤖 Generated with Claude Code