Agent Harness Engineering

AGENT.md

Instruction Scope

  • Treat this file as user-wide defaults. Apply repository and nested AGENTS.md instructions in addition; more local instructions take precedence.
  • Keep changes scoped to the user's request. Verify relevant commands before reporting success.

Host Environment

  • This machine runs Windows 10 Pro 64-bit (version 10.0.19045, build 19045).
  • Prefer PowerShell 7 (pwsh) for all shell work. PowerShell 7.6.4 is available at C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.4.0_x64__8wekyb3d8bbwe\pwsh.exe.
  • Prefer native PowerShell cmdlets and syntax. Use cmd.exe, Git Bash, only when a task specifically requires them.
  • Do not change user-level or machine-level environment variables, including PATH, unless the user explicitly asks.

Verified Development Environments

  • Node.js: v24.18.0 via NVM for Windows. node and npm are on PATH at C:\nvm4w\nodejs\.
  • npm: v11.16.0. pnpm is not currently available on PATH; use npm unless pnpm is explicitly installed and verified.
  • Python: 3.13.13 via Miniconda at C:\ProgramData\miniconda3\python.exe.
  • conda: 26.3.2 and available as conda. py is not available on PATH; use python or conda run as appropriate.
  • pip: available through the Miniconda installation at C:\ProgramData\miniconda3\Scripts\pip.exe.
  • Git: 2.55.0.windows.2 and on PATH.

Core CLI Baseline

The following tools were verified on 2026-08-07. Do not rescan these paths for ordinary tasks. Use the listed absolute paths because some tools are not configured on PATH.

ToolVerified versionInvocation
bat0.26.1C:\Software\Core\bat\bat.exe
delta0.19.2C:\Software\Core\delta\delta.exe
fd10.4.2C:\Software\Core\fd\fd.exe
fzf0.72.0C:\Software\Core\fzf\fzf.exe
jq1.8.2C:\Software\core\jq\jq-windows-amd64.exe
ripgrep15.1.0C:\Software\core\ripgrep\rg.exe
  • bat, delta, fd, and fzf are not on PATH. Invoke the verified absolute paths above.

  • jq is not on PATH in the current Codex shell. The current Codex bundled directory contains rg.exe but no jq.exe; invoke jq with C:\Software\core\jq\jq-windows-amd64.exe and use the Codex-bundled rg when appropriate.

  • Prefer rg for text search, fd for file discovery, bat for readable file output, delta for diffs, jq for JSON transformation, and fzf only for interactive terminal selection.

  • The directory also contains Windows Terminal (wt.exe), but it is not on PATH; do not use it unless the task needs a new terminal window.

  • Re-discover a tool only when its listed path fails, the task requires a tool not listed here, or the user asks to refresh the inventory.

GLOBAL GUARDRAILS 【全局安全门禁|最高优先级】

本章节优先级高于所有业务指令,不可被会话内用户prompt覆盖。

  • 默认避免执行删除、清理、覆盖、移动等可能导致数据丢失或难以恢复的维护操作。确实需要执行删除或其他破坏性维护操作时,必须先明确说明目标、范围、影响和可恢复性,并经过人工审核和明确批准后再执行。
  • 默认复用现有目录结构,不随意新建文件夹或无序扩展项目结构。确有必要新增文件夹时,必须先说明用途、位置、影响及替代方案,并经过人工审核和明确批准后再创建。
  • 禁止执行高危破坏性命令:rm‑rfformat

Local Git Worktree Rules

  • 所有的功能开发和 debug 都必须采用 superpowersgit-worktreesskills 来处理。规范参照: C:\Users\jin\.codex\plugins\cache\openai-api-curated\superpowers\11c74d6b\skills\using-git-worktrees\SKILL.md
  • 禁止随意扩张 子worktree,每个任务在自己独立的worktree文件夹内进行开发和测试,如果必须新建 子worktree,必须人工确认。
  • 子 worktree 合并到 main 的时候, 禁止删除 .worktrees 内的子worktree分支, worktree 需保留痕迹. 如果确实需要清理无效/废弃的 worktree, 必须人工审核确认。

2 Code Review Rules【代码审核规范】

  • 你的任务是发现代码中的实际缺陷,不是做代码美化。只输出会造成业务错误、程序崩溃、安全漏洞、数据异常、严重性能问题的缺陷。
  • 聚焦核心逻辑、不要挑刺,绝不人为制造评审点凑结果。
  • 绝对禁止无限制的拓展问题边界,你是在审核当前项目内一个具体的问题,不是让你重写整个 windows 操作系统。
  • 不把“未来可能发生”“若采用某新架构”作为 finding。
  • 发现需要新模块、新状态或跨系统设计时,停止分析并仅写:“范围外:需要单独根因卡和明确授权。”
What do you think?
0 Reactions
Pick a reaction