From f574c0da478d1e595aac4e23a5534a240d4ba4be Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sat, 4 Oct 2025 23:40:34 +0800 Subject: [PATCH] feat: Add Codex CLI optimization requirements to AGENTS.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add system optimization section with performance and compatibility improvements: - Direct binary execution to avoid shell wrapper overhead - apply_patch tool priority for efficient text editing - Windows UTF-8 encoding configuration for Chinese character support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .codex/AGENTS.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.codex/AGENTS.md b/.codex/AGENTS.md index b3953cb2..1c70cb42 100644 --- a/.codex/AGENTS.md +++ b/.codex/AGENTS.md @@ -46,6 +46,30 @@ RULES: Build on previous subtask, maintain consistency ## Execution Requirements +### System Optimization + +**Hard Requirement**: Call binaries directly in `functions.shell`, always set `workdir`, and avoid shell wrappers such as `bash -lc`, `sh -lc`, `zsh -lc`, `cmd /c`, `pwsh.exe -NoLogo -NoProfile -Command`, and `powershell.exe -NoLogo -NoProfile -Command`. + +**Text Editing Priority**: Use the `apply_patch` tool for all routine text edits; fall back to `sed` for single-line substitutions only if `apply_patch` is unavailable, and avoid `python` editing scripts unless both options fail. + +**`apply_patch` Usage**: Invoke `apply_patch` with the patch payload as the second element in the command array (no shell-style flags). Provide `workdir` and, when helpful, a short `justification` alongside the command. + +**Example invocation**: +```json +{ + "command": ["apply_patch", "*** Begin Patch\n*** Update File: path/to/file\n@@\n- old\n+ new\n*** End Patch\n"], + "workdir": "", + "justification": "Brief reason for the change" +} +``` + +**Windows UTF-8 Encoding**: Before executing commands on Windows systems, ensure proper UTF-8 encoding by running: +```powershell +[Console]::InputEncoding = [Text.UTF8Encoding]::new($false) +[Console]::OutputEncoding = [Text.UTF8Encoding]::new($false) +chcp 65001 > $null +``` + ### ALWAYS - **Parse all fields** - Understand PURPOSE, TASK, MODE, CONTEXT, EXPECTED, RULES @@ -58,6 +82,9 @@ RULES: Build on previous subtask, maintain consistency - **Match project style** - Follow existing patterns exactly - **Validate EXPECTED** - Ensure all deliverables are met - **Report context** (subtasks) - Summarize key info for next subtask +- **Use direct binary calls** - Avoid shell wrappers for efficiency +- **Prefer apply_patch** - Use for text edits over Python scripts +- **Configure Windows encoding** - Set UTF-8 for Chinese character support ### NEVER @@ -335,6 +362,10 @@ Subtask 3: Add authentication (resume --last) --- -**Version**: 2.1.0 +**Version**: 2.2.0 **Last Updated**: 2025-10-04 -**Changes**: Added multi-step task execution support with resume mechanism +**Changes**: +- Added system optimization requirements for direct binary calls +- Added apply_patch tool priority for text editing +- Added Windows UTF-8 encoding configuration for Chinese character support +- Previous: Multi-step task execution support with resume mechanism