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 & Development Environment

  • This machine runs Windows 10 Pro 64-bit (version 10.0.19045, build 19045).
  • Prefer PowerShell 7 (pwsh) and native PowerShell syntax for all shell work. Use cmd.exe or Git Bash only when the task requires them.
  • Do not change user-level or machine-level environment variables, including PATH, unless the user explicitly asks.
ToolVersionLocation / Usage
Node.js24.18.0NVM for Windows; node and npm are on PATH at C:\nvm4w\nodejs\
npm11.16.0On PATH; prefer npm because pnpm is unavailable
Python3.13.13C:\ProgramData\miniconda3\python.exe
conda26.3.2On PATH
pip—C:\ProgramData\miniconda3\Scripts\pip.exe
Git2.55.0.windows.2On PATH
  • py is unavailable; use python or conda run as appropriate.
  • pnpm is not currently available on PATH; use it only after it is explicitly installed and verified.

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
OpenSSHWindows OpenSSHC:\Windows\System32\OpenSSH\ssh.exe
  • If 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.
  • For SSH connections to remote servers, invoke C:\Windows\System32\OpenSSH\ssh.exe explicitly, including key-based connections; do not rely on an ambiguous ssh.exe resolved from PATH.
  • 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覆盖。

  • Routine task authorization does not imply approval for destructive actions. Before actions risking data loss or difficult reversal, state the target, scope, impact, and recovery options, and obtain explicit user approval.
  • For actions requiring approval, ask only if approval is missing or the target, scope, or risk has changed.
  • Assess risk by an action's actual effects, regardless of the command or tool used. Before destructive or otherwise high-impact actions, explain the target, scope, impact, and recovery options, and obtain explicit user approval.
  • Never auto-run high-risk commands: rm -rf, format, dd, mkfs.

Independent Judgment

  • Pause and state doubts if essential information is unverifiable; do not act on guesses.
  • Independently evaluate all user input against facts and objectives; never presume correctness. For ambiguous content, no guesses or unilateral decisions; request human review.
  • Pre-requisite necessity check: Determine whether action is required first. Do not assume action is needed by default.
    • If required: provide a solution.
  • If not required: briefly explain why no action is needed, then stop.

Project Organization

  • Reuse existing directories where practical. When creating new directories, follow the project's existing organization and keep their purposes, naming, and file placement clear and consistent.

Git Worktree Guardrails

  • Use applicable jinprosper workflows for feature development and bug fixes. Use the jinprosper-worktree skill for worktree management; this section's reuse and approval rules take precedence.
  • Prefer reusing an existing worktree suitable for the current work. Before creating a new one, explain why existing worktrees are unsuitable and obtain explicit user approval.
  • After merging into main, keep the worktree and its branch. Obtain explicit user approval before removing either.
  • For read-only queries blocked by Git's dubious ownership check, you may use git -c safe.directory="<exact absolute repository or worktree path>" <read-only subcommand>. The setting applies only to that command.

Code Review Guardrails

  • Report only defects supported by clear evidence that cause incorrect business behavior, crashes, security vulnerabilities, data anomalies, or severe performance problems. Exclude purely stylistic, formatting, or personal-preference issues.
  • For each finding, identify the location, triggering conditions, actual impact, and supporting evidence (code, call paths, or validation results). Do not report unverified speculation as findings.
  • Base findings on current code and actual usage scenarios. Report defects with clear triggering conditions even if they have not occurred. Exclude issues that depend solely on hypothetical architectures or unplanned requirements.
  • Within the agreed scope, systematically review relevant call paths and key edge cases. Report all confirmed defects found during the review together. Do not add findings merely to increase their count or automatically expand the review scope. If no defects are confirmed, state that explicitly.
  • Record out-of-scope issues separately using existing evidence; do not automatically expand investigation or implement fixes. Use jinprosper-plain-talk to explain:
    • Issue: what is known and why it is outside the current scope.
    • Recommendation: the proposed approach, expected scope of impact, and acceptance criteria. Explicitly mark anything not yet determined.

常用提示词

  • For PowerShell commands, prefer launching the exact PowerShell 7 executable through cmd.exe /c: C:\Users\jin\.cache\codex-runtimes\codex-primary-runtime\dependencies\native\powershell\pwsh.exe.
  • Do not resolve or invoke pwsh.exe through PATH; use only the exact executable path above for these tasks.

Plugin

什么是 Plugin

Plugin = 一个可安装的分发包,里面可以装:

  1. Skills(工作流说明书)
  2. MCP 配置(给模型挂新工具)
  3. Connector 声明(连外部系统的授权入口)
  4. Hooks(生命周期钩子)
  5. 元数据(名字、版本、描述、图标等)

常用命令

PS C:\Users\jin> codex plugin list
PS C:\Users\jin> codex plugin remove jinprosper@personal
PS C:\Users\jin> codex plugin add jinprosper@personal
PS C:\Users\jin> codex plugin list

开发Plugin规范参考

  • Registered personal plugin directory: C:\Users\jin\.agents\plugins\jinprosper, registered by C:\Users\jin\.agents\plugins\marketplace.json. This is the local plugin installation/source selected by the personal marketplace.
  • Current Codex session cache: C:\Users\jin\.codex\plugins\cache\personal\jinprosper\0.1.0. This is a materialized runtime snapshot; it is not the canonical development source or the registered plugin directory. A session may continue using stale content until the cache/plugin is refreshed.
  • Deployment test copy: C:\Users\jin\plugins\jinprosper. This is only the destination used by scripts\sync-to-deployment.ps1; it is not the personal marketplace registration and must not be edited by hand.

Program Language

Rust

Windows 上最推荐、最通用的 Rust 工具链

安装
rustup toolchain install stable-x86_64-pc-windows-msvc --force --profile default --component rustfmt,clippy
rustup default stable-x86_64-pc-windows-msvc

验证
rustc --version
cargo --version
rustup show active-toolchain
rustup component list --toolchain stable-x86_64-pc-windows-msvc
What do you think?
0 Reactions
Pick a reaction