Make audit-docs safe under Codex while keeping Copilot and Claude Code behaviour - #605
AlexJSully wants to merge 3 commits into
Conversation
Adds an edit-in-place rule and a diff-locality check covering Markdown and source files, narrows Phase 3 to the requested scope (one step out on a pull request, never across a package or workspace), keeps a split document at its path, caps new documentation comments at one sentence by default, and bounds checklist items to files in scope. Adds a Codex `agents/openai.yaml` that turns off implicit invocation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7J7gWb6rCBh4Nd4vfKBxR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7J7gWb6rCBh4Nd4vfKBxR
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved moderate issues affect documentation coverage, fragment-link preservation, procedure counting, and synchronization checks.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Refines audit-docs scope, editing safeguards, documentation guidance, and Codex invocation metadata.
Changes:
- Clarifies scope boundaries and pull-request audit coverage.
- Requires minimal in-place edits and improves documentation-comment guidance.
- Updates supporting documentation, templates, agents, validation notes, and Codex metadata.
| File | Summary | Review findings |
|---|---|---|
.github/prompts/readme.md |
Documents refined scope behavior. | No final comments. |
.github/prompts/audit-docs.prompt.md |
Updates audit, editing, and documentation rules. | Moderate: allow docstrings and preserve or update fragment links (1 vote each). |
.claude/skills/audit-docs/SKILL.md |
Mirrors refined skill rules. | Moderate: allow docstrings and preserve or update fragment links (1 vote each). |
.claude/skills/audit-docs/README.md |
Updates usage and scope guidance. | No final comments. |
.claude/skills/audit-docs/assets/audit-report.template.md |
Updates split-document reporting. | No final comments. |
.claude/skills/audit-docs/agents/surface-auditor.md |
Clarifies comment expectations. | No final comments. |
.claude/skills/audit-docs/agents/openai.yaml |
Disables implicit Codex invocation. | Moderate: update the procedure count to exclude metadata (2 votes). |
.claude/scripts/check-skill-publishability.mjs |
Documents Codex metadata handling. | No final comments. |
.claude/rules/prompt-skill-sync.md |
Documents Codex integration. | Moderate: include agents/openai.yaml in synchronization path globs (1 vote). |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| A skill directory is a plugin root in two ways. In the repository holding it, a `.claude-plugin/plugin.json` inside it makes Claude Code load it as `<name>@skills-dir` on the next session, with no marketplace and no install step, and that manifest is what turns the files in `agents/` into agents a run can delegate to. Everywhere else, the marketplace at [`.claude-plugin/marketplace.json`](../../.claude-plugin/marketplace.json) lists it with a `source` of `./.claude/skills/<name>`, and VS Code and Claude Code install the directory as a plugin whose root `SKILL.md` is its one skill and whose `agents/` they find by default, manifest or not. Without either route the files in `agents/` stay ordinary files, which is what each `SKILL.md` already treats as the default when it tells the run to open one and follow it: `agents/` is a host extension, not part of the Agent Skills specification, which defines `references/`, `assets/`, and `scripts/` and nothing else. | ||
|
|
||
| **Codex reads one file in `agents/`, and it is not an agent.** Codex treats no `agents/*.md` as an agent definition, and reads only `agents/openai.yaml`, for display metadata and invocation policy. [`audit-docs`](../skills/audit-docs/agents/openai.yaml) sets `policy.allow_implicit_invocation: false` there. Codex's skill catalogue tells the model it must use any skill whose description matches the task, and a description as broad as that skill's would otherwise pull a full audit, with its in-code pass, into ordinary feature work. The skill still runs when invoked by name. Claude Code documents an agent as a Markdown file, and `claude plugin validate` passes with the YAML file present. |
There was a problem hiding this comment.
"Codex reads one file in agents/" Source please? Where did you get this from?
There was a problem hiding this comment.
It comes from the openai/codex source on main. OpenAI's docs site was blocked from the session, so I did not use the published docs:
- Codex reads
agents/openai.yaml: the skill loader looks up exactly that folder and file name and parses itsinterface,dependencies, andpolicykeys. Seecodex-rs/ext/skills/src/loader/metadata.rsand the schema inopenai_yaml.md. - Codex does not treat
agents/*.mdas agents: Codex agent roles come only from.tomlfiles under a config folder'sagents/(such as~/.codex/agentsor.codex/agents) and from[agents.<name>]tables inconfig.toml. Seecodex-rs/agent-roles/src/loader.rsanddiscovery.rs. I found no code in the skill loader that reads any other file under a skill'sagents/.
"Reads only" is therefore a statement about the current source, not a documented guarantee. I'll add these links to the paragraph in the next push so the claim carries its own citation.
Generated by Claude Code
| @@ -0,0 +1,3 @@ | |||
| # Read by Codex alone: the skill loads when invoked by name as $audit-docs, never on a description match. | |||
| policy: | |||
| allow_implicit_invocation: false | |||
There was a problem hiding this comment.
What does allow_implicit_invocation do and why is it set to false?
There was a problem hiding this comment.
allow_implicit_invocation controls whether Codex puts the skill into the model's context automatically when a task matches its description. Codex's own schema describes it like this: when false, the skill "is not injected into the model context by default, but can still be invoked explicitly via $skill. Defaults to true." (openai_yaml.md in openai/codex, parsed in loader/metadata.rs).
It is set to false for this reason. With implicit invocation on, Codex's skill catalogue prompt tells the model it "must use that skill for that turn" whenever the task "clearly matches a skill's description". The audit-docs description says to use it "when creating or editing Markdown or docs, after implementing a feature, before merging a pull request", which matches most Codex feature work. So an ordinary task could pull in the full three-phase audit, including the in-code comment pass. Turning it off means the audit runs in Codex only when asked for with $audit-docs.
Only Codex reads this file. Copilot and Claude Code ignore it, so their automatic loading is unchanged. If you'd rather Codex keep loading it automatically, deleting the file restores the default.
Generated by Claude Code
audit-docs safe under Codex while keeping Copilot and Claude Code behaviour
Allows the project's own formatter on edited files and in tables, exempts requested code changes and docstrings from the diff check, covers links to headings a split moves, counts only Markdown files as bundled procedures, and cites the Codex sources for `agents/openai.yaml`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing this PR because I do NOT like the fact that Claude Code is posting comments & PR using my alias AlexJSully. Example: #605 (comment) . All |

Makes the
audit-docsskill and prompt behave under OpenAI Codex (CLI and IDE extension) without changing how they run under GitHub Copilot and Claude Code, which remain the primary targets.Why
Run by a GPT model in Codex,
audit-docsdeleted private Go helper methods, deleted a Markdown file and re-created it under the wrong name with content missing, and wrote overly long comments in a TypeScript file. The same model family under Copilot did not do this. Reading the Codex, Copilot, and OpenAI cookbook sources points to a combination of harness and prompt:apply_patchtool that Codex does.apply_patchcan delete without visible Guardian review and report Delete+Add as Add-only openai/codex#34515, large rewrites become one patch that deletes and re-adds a file. Codex also applies edits directly, with no Keep/Undo review.Key changes
Every rule below is worded identically in the prompt half and the skill half, and says nothing host-specific, so Copilot and Claude Code get the same rules.
agents/openai.yamlsetspolicy.allow_implicit_invocation: false, so Codex loads the skill only when it is invoked as$audit-docs. Copilot and Claude Code do not read this file, andclaude plugin validatepasses with it present.README.md,.github/prompts/readme.mdscope defaults,.claude/rules/prompt-skill-sync.md, and theBUNDLE_DIRScomment in the publishability checker.The prompt stays under its 36,000-character budget by condensing text it repeated. The
prompt-skill-syncsubagent confirmed the halves still match and restored one table rule that was missing from the prompt before this PR.Validation
make -f .claude/Makefile check-skills: pass.make -f .claude/Makefile test-scripts: 104/104 pass.prettier,eslint,tsc,test:jest(92/92),build,lint:markdown, and their check variants: all pass.test:cypress:e2ewas not run: the Cypress binary is not installed in the cloud container.$audit-docsin Codex on a fixture containing a Go file with public and private functions, a TypeScript file with undocumented exports, and a Markdown page mixing overview and reference. Expect no deleted or renamed files, local Markdown hunks only, comment-only Go diffs, and new comments of at most two sentences.Note
Note from @AlexJSully
This PR is purely AI generated. I'm testing out Claude Code cloud sessions with improving the audit-docs skill.