Skip to content

feat(codex): add user-global Codex CLI instructions#135

Merged
kurone-kito merged 1 commit into
masterfrom
issue/131-feat-codex-add-user-global-codex-cli
May 19, 2026
Merged

feat(codex): add user-global Codex CLI instructions#135
kurone-kito merged 1 commit into
masterfrom
issue/131-feat-codex-add-user-global-codex-cli

Conversation

@kurone-kito
Copy link
Copy Markdown
Owner

@kurone-kito kurone-kito commented May 19, 2026

Summary

Adds home/dot_codex/AGENTS.md so chezmoi deploys a user-global
Codex CLI instructions file at ~/.codex/AGENTS.md, bringing
Codex CLI to parity with the already-deployed Copilot CLI
user-global file (home/dot_copilot/copilot-instructions.md
~/.copilot/copilot-instructions.md).

The new file preserves the same five sections used by the
canonical Copilot user-global file — repository-precedence
preamble, Conversation, Commit rules (with the full P/C/A/U
signing fallback ladder), Coding standards, and Guardrails — and
adapts the wording for Codex CLI's interaction model (intent-based
pause/continue wording rather than Copilot's product-specific
"Agent mode" / "Plan mode" terms).

Closes #131
Roadmap #130

Test plan

  • npx markdownlint-cli2 "home/dot_codex/AGENTS.md" — 0 errors
  • npx cspell home/dot_codex/AGENTS.md — 0 issues
  • tests/bash/helpers/bats-core/bin/bats tests/bash/ — 212 / 212
  • pwsh -c "Invoke-Pester tests/powershell/ -Output Detailed" — Linux baseline: 182 passed, 0 failed, 33 skipped (Windows-only scopes auto-skipped)
  • Lint workflow on this PR — green
  • Test workflow on this PR — green
  • After merge, chezmoi diff shows ~/.codex/AGENTS.md will be added

Signing path

GPG was attempted first (configured default; key
DFC46A0ADEE2FC635163CD5431D6D754C1D839D1) and failed with
category (P) pinentryPINENTRY_LAUNCHED was emitted, then
gpg reported signing failed: タイムアウトです (Timeout).
Category (P) prohibits the gpg-agent restart step, so the commit
was routed straight to the project-blessed git commit-ssh alias
(SSH key ~/.ssh/id_ed25519-kito.pub, transient
gpg.format=ssh invocation). GitHub may show the commit as
Unverified if that SSH key is not registered as a signing
key on the maintainer's GitHub profile; that is expected
best-effort behavior for SSH signing.

Out-of-scope

Summary by CodeRabbit

  • Chores
    • Added internal development guidelines documentation for code maintainers and AI agents.

Note: This release contains no end-user-visible changes. Updates are limited to internal development standards and processes.

Review Change Stack

This repository already deploys a user-global Copilot CLI instruction
file (`home/dot_copilot/copilot-instructions.md` →
`~/.copilot/copilot-instructions.md`), but the parallel layer for
Codex CLI was missing — only `~/.codex/config.toml` was deployed.
Without a user-global `AGENTS.md`, Codex sessions in repositories
that lack a project-level `AGENTS.md` fall back to model defaults
for the conversation language policy, Conventional Commits style,
and the bounded signing fallback ladder.

Add `home/dot_codex/AGENTS.md` modeled on the canonical Copilot
user-global file, adapted for Codex CLI's interaction model
(intent-based pause/continue wording instead of Copilot's product-
specific "Agent mode" / "Plan mode" terms). The file preserves the
same five sections — deferral preamble, Conversation, Commit rules
with the full P/C/A/U signing fallback ladder (configured GPG →
optional gpg-agent restart → SSH fallback with three-step key
discovery → unsigned), Coding standards, and Guardrails — so
behavioral parity holds without a byte-identical copy.

Track A under the symmetrization roadmap; sibling tracks land
`home/dot_claude/CLAUDE.md` (#132), `home/dot_gemini/GEMINI.md`
(#133), and the documentation update in `docs/ai-strategy.md`
(#134) independently.

Refs #131
Roadmap #130

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 19, 2026 00:02
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 356d4a9a-ac6a-41df-8db8-b37688cef4f5

📥 Commits

Reviewing files that changed from the base of the PR and between e4b8ca9 and 9b0ed84.

📒 Files selected for processing (1)
  • home/dot_codex/AGENTS.md

📝 Walkthrough

Walkthrough

This PR adds home/dot_codex/AGENTS.md, a new configuration file that provides repository-wide default instructions for Codex AI agent sessions. The file establishes global guidelines for conversation language, commit message formatting, commit signing with a bounded fallback ladder, coding standards, and operational safety constraints.

Changes

Codex AI Agent Instructions

Layer / File(s) Summary
User-global agent guidelines
home/dot_codex/AGENTS.md
New file defining default behaviors for Codex CLI agents: defers to repository-specific instructions; specifies conversation language (match user's language, English for code/docs); Conventional Commits rules with atomic, lowercase imperative subjects; commit signing with bounded GPG attempt, classification-based gpg-agent restart, SSH fallback with key discovery, and unsigned final fallback; coding standards (LF line endings, no trailing whitespace, final newline, lowercase-hyphenated filenames); guardrails (no unauthorized community-doc edits, no false test success claims).

Possibly related issues

  • #131 (feat: add user-global Codex CLI instructions) — This PR directly implements the objectives outlined in issue #131, adding the complete home/dot_codex/AGENTS.md file with all required sections, signing fallback ladder, and guardrails as specified.
  • #130 (dotfiles-roadmap: user-global-ai-symmetrization) — This PR is part of the parent roadmap that tracks parity between user-global AI agent instruction files.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A codex of codes for our AI friend,
Clear signals and rules from start to end,
Commits signed with care, standards so bright,
The dotfiles now guide the agent just right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title is concise and directly describes the main change: adding a user-global Codex CLI instructions file, aligning with the PR's core objective.
Description check ✅ Passed PR description is comprehensive with clear summary, test plan results, signing path explanation, and scope clarification, exceeding template requirements.
Linked Issues check ✅ Passed PR successfully addresses all requirements from issue #131: AGENTS.md file created with repository-precedence preamble, Conversation, Commit rules with full signing fallback ladder, Coding standards, and Guardrails sections adapted for Codex CLI.
Out of Scope Changes check ✅ Passed PR adds only the required home/dot_codex/AGENTS.md file and intentionally leaves home/dot_codex/config.toml untouched; no out-of-scope changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue/131-feat-codex-add-user-global-codex-cli

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a user-global Codex CLI instructions file so Codex picks up consistent defaults (conversation language, Conventional Commits, signing fallback ladder, coding standards, guardrails) across repositories that lack their own AGENTS.md. It mirrors the existing Copilot CLI user-global file for parity.

Changes:

  • Add home/dot_codex/AGENTS.md deployed by chezmoi to ~/.codex/AGENTS.md.
  • Adapt Copilot-specific "Agent mode" / "Plan mode" wording to intent-based phrasing for Codex CLI.

@kurone-kito
Copy link
Copy Markdown
Owner Author

claude-code-8e8ebc52: review triage snapshot — IDD automation marker. Do not edit.

@kurone-kito
Copy link
Copy Markdown
Owner Author

Acknowledged — recording the auto-no-action review for the IDD pre-merge unreplied-comment evidence check.

@kurone-kito
Copy link
Copy Markdown
Owner Author

E6 dispositions — PATH B (advisory)

Both items in ReviewItems_snapshot for head 9b0ed84 carry no actionable feedback and are recorded as PATH B advisory rejections so the F2 disposition-evidence gate is satisfied.

  • copilot-pull-request-reviewer review at 2026-05-19T00:03:41Z: Rejected — review body is a pull-request overview only; no actionable findings, no change requests, no inline suggestions.
  • coderabbitai comment at 2026-05-19T00:02:51Z: Rejected — body explicitly states "No actionable comments were generated in the recent review."

E2 critique pass on the same snapshot returned 0 additional findings (acceptance criteria of #131 satisfied; required CI checks all green; no scope drift).

@kurone-kito
Copy link
Copy Markdown
Owner Author

claude-code-8e8ebc52: review triage snapshot (refreshed post-disposition) — IDD automation marker. Do not edit.

@kurone-kito kurone-kito merged commit cac548d into master May 19, 2026
11 of 13 checks passed
@kurone-kito kurone-kito deleted the issue/131-feat-codex-add-user-global-codex-cli branch May 19, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(codex): add user-global Codex CLI instructions

2 participants