agents-introspection
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgents Introspection
Agent自省
This skill is coordination-exempt: skip the ai-coord gate for its declared work.
本技能无需协调:其指定工作可跳过ai-coord审核环节。
Supported Chat Hosts
支持的聊天宿主
Before doing any work, identify the current chat host. If it is not Claude Code or Codex CLI, stop with this error:
This skill only works in Claude Code or Codex CLI.If these instructions are already present in the conversation from a slash or dollar invocation, follow them directly;
do not invoke this skill again through a skill tool.
Determine whether prior Codex and Claude Code work in the current project establishes a recurrence risk for the user's
task, then recommend the smallest durable intervention justified by the evidence.
Success means the report identifies transcript coverage, separates observed behavior from inference, applies a
consistent evidence bar, and either proposes a concrete prevention step or explains why no durable change is justified.
开展任何工作前,请确认当前聊天宿主。若不是Claude Code或Codex CLI,终止操作并返回以下错误:
This skill only works in Claude Code or Codex CLI.如果对话中已通过斜杠或美元符号调用给出了这些指令,请直接遵循;不要通过技能工具再次调用本技能。
判断当前项目中过往的Codex和Claude Code工作是否为用户任务带来复发风险,然后根据证据推荐最小化的长效干预措施。
成功的标准是:报告明确对话记录覆盖范围,区分观察到的行为与推断内容,采用一致的证据标准,要么提出具体的预防步骤,要么解释为何无需进行长效变更。
Input
输入
- (required): the task, decision, incident, or workflow to evaluate. If omitted but the current conversation states it clearly, use that task; otherwise ask for the missing task.
<task>
- (必填):待评估的任务、决策、事件或工作流。若未提供但当前对话中已明确说明,则使用该任务;否则请用户补充缺失的任务信息。
<task>
Scope and Authority
范围与权限
- Inspect Codex and Claude Code transcripts whose metadata or cwd resolves to the current project and any other local project materially relevant to the user's task. You are authorized to read relevant other-project sessions without asking the user. Establish relevance from task context, explicit project or path references, a shared change or workflow, or session metadata; do not scan another project's history solely because it shares a basename or keyword.
- Treat current-project transcripts as internal working evidence. Include direct excerpts when they materially improve the report; do not summarize or redact solely because the model provider can see them. Never expose credentials, security secrets, or personal wallet addresses.
- Inspect and report by default. Edit AGENTS.md or skills only when the user explicitly asks to apply or implement fixes, then make the smallest in-scope local change and validate it.
- Never modify transcript stores. Before placing transcript evidence in a public or third-party artifact, perform an external-disclosure review and remove unrelated personal or customer data, unsuitable private paths or repository names, and unrelated transcript material. Perform external writes only when authorized.
- 检查元数据或当前工作目录(cwd)指向当前项目的Codex和Claude Code对话记录,以及与用户任务密切相关的其他本地项目对话记录。您有权读取相关的其他项目会话,无需询问用户。根据任务上下文、明确的项目或路径引用、共享的变更或工作流,或会话元数据确定关联性;不要仅因项目名称或关键字相同就扫描其他项目的历史记录。
- 将当前项目的对话记录视为内部工作证据。当对话摘录能显著提升报告质量时,可直接引用;不要仅因模型提供商可查看就进行总结或编辑。绝对不要泄露凭据、安全机密或个人钱包地址。
- 默认仅进行检查和报告。仅当用户明确要求应用或实施修复时,才可编辑AGENTS.md或skills,然后进行最小范围内的本地变更并验证。
- 绝对不要修改对话记录存储。在将对话记录证据放入公开或第三方工件前,需进行外部披露审查,移除无关的个人或客户数据、不合适的私有路径或仓库名称,以及无关的对话内容。仅在获得授权后才可进行外部写入操作。
Bounded Retrieval
受限检索
Read , resolve the current project with , identify any other task-relevant
local projects, and choose 3–6 short, discriminative keywords from relevant filenames, commands, tools, errors, package
names, issue IDs, and skill names.
references/transcript-sources.mdpwd -PIn a Codex read-only sandbox, or whenever cannot write its cache, skip the helper and go directly to the Manual
Fallback below; do not retry .
uvuv run- Run the bundled miner for the current project and each task-relevant local project, unarchived sessions only, with
the chosen keywords, ,
--since 60d, and--excerpts. Encode synonyms as one OR-group keyword (--max-sessions 8) rather than separate--keyword 'a|b'flags.--keyword - Treat source ownership as a miner invariant: every candidate is assigned once from source-native cwd, directory, and
history metadata, never from transcript content. Review ; reject a candidate only when fallback ownership such as
ownershipremains materially ambiguous for the task. The miner excludes conflicting ownership evidence and the live session by default.turn_context.cwd - Treat miner scores, themes, correction, failure, verification, tool, or counts, redacted
privacy_gaps, andexcerptstimestamps only as candidate-ranking and triage signals. They are heuristic and are never evidence by themselves. Inspect up to five highest-relevance transcript bodies through the bundled inspector digest (modified) first; open raw bodies only when the digest is insufficient, stopping earlier when the evidence bar is met. Include a comparable successful session when available.scripts/transcript-inspect.py - If evidence is insufficient, retry once with broader or OR-grouped keywords. If still weak, retry once with removed. If unarchived history still lacks signal, retry once with
--since.--include-archived - Exceed these bounds only to resolve contradictory evidence or satisfy an explicitly exhaustive request. If the helper fails, use one project-scoped manual fallback from the reference.
Stop and report the coverage gap when the bounded fallbacks still lack useful evidence. Absence of evidence is not
evidence that a failure never occurred.
For unusually long searches, send sparse progress updates only when a retrieval fallback begins, a finding changes the
likely intervention, or the search reaches its explicit bound. Use an outcome-first line such as
or
. Ground counts and coverage claims in
miner/tool output; do not narrate routine transcript reads.
🔎 Broadening transcript search — <verified reason and bound>⏳ Checking archived sessions — <verified unarchived/archived coverage>阅读,通过确定当前项目,识别任何与任务相关的其他本地项目,并从相关文件名、命令、工具、错误、包名、问题ID和技能名称中选择3–6个简短且具有区分度的关键字。
references/transcript-sources.mdpwd -P在Codex只读沙箱中,或当无法写入其缓存时,跳过辅助工具直接进入下方的手动回退流程;不要重试。
uvuv run- 为当前项目和每个与任务相关的本地项目运行捆绑的挖掘工具,仅处理未归档的会话,使用选定的关键字、、
--since 60d和--excerpts参数。将同义词编码为一个OR组关键字(--max-sessions 8),而非单独的--keyword 'a|b'标志。--keyword - 将来源归属视为挖掘工具的不变规则:每个候选记录仅根据来源原生的cwd、目录和历史元数据分配归属,绝不根据对话内容分配。检查字段;仅当回退归属(如
ownership)对任务仍存在实质性歧义时,才拒绝该候选记录。挖掘工具默认排除冲突的归属证据和当前会话。turn_context.cwd - 仅将挖掘工具的分数、主题、修正、失败、验证、工具或计数、编辑后的
privacy_gaps以及excerpts时间戳视为候选记录排序和分类的信号。这些是启发式信息,本身不能作为证据。首先通过捆绑的检查器摘要(modified)检查最多5条相关性最高的对话记录主体;仅当摘要信息不足时才查看原始主体,一旦满足证据标准就提前停止。若有可用的成功会话,需纳入对比。scripts/transcript-inspect.py - 若证据不足,使用更宽泛的关键字或OR组关键字重试一次。若证据仍薄弱,移除参数重试一次。若未归档历史仍无有效信号,添加
--since参数重试一次。--include-archived - 仅在解决矛盾证据或满足明确的 exhaustive 请求时,才可超出上述限制。若辅助工具失败,使用参考文档中提供的一个项目范围的手动回退方案。
当受限回退仍缺乏有用证据时,停止操作并报告覆盖缺口。没有证据并不代表从未发生过失败。
对于耗时较长的搜索,仅在检索回退开始、发现改变了可能的干预措施或搜索达到明确限制时,发送简洁的进度更新。采用结果优先的表述方式,例如:
或
。基于挖掘工具/工具输出统计数量和覆盖情况;不要叙述常规的对话记录读取过程。
🔎 扩大对话记录搜索范围 — <已验证的原因和限制>⏳ 检查归档会话 — <已验证的未归档/归档覆盖情况>Evidence Contract
证据约定
Evaluate historical behavior against the AGENTS.md and skill instructions available to that session when recoverable. Do
not infer that an agent ignored or misapplied a rule solely because the current source tree or installed copies under
or contain it. If the transcript does not establish the historical version or
availability, mark it unknown and qualify the attribution.
~/.agents/skills~/.claude/skillsFor each relevant session, record only concise, auditable observations about:
- ignored or misread AGENTS.md or skill instructions;
- wrong cwd, project root, source path, or path encoding;
- over-broad edits, unrelated churn, overwritten user work, or destructive commands;
- tooling, shell, parsing, retry, or verification mistakes;
- invented claims, vague reports, or missing tests and checks;
- successful patterns that prevented mistakes.
Connect each observation to the current task and label any causal or recurrence claim as inference. State conflicts and
weak coverage rather than averaging them away.
Use these confidence levels:
- High: at least two independent relevant sessions directly support the same pattern and its relevance to the current task.
- Medium: one unambiguous relevant session supports the finding, or multiple sessions provide mixed support.
- Low: only indirect, ambiguous, or heuristic signals exist. Do not recommend a durable repository change from low-confidence evidence.
A durable change requires either the same failure in at least two independent sessions or one unambiguous high-impact
failure that exposes a missing stable invariant. Treat lower-impact one-offs as manual guardrails.
根据会话可恢复的AGENTS.md和技能指令,评估历史行为。不要仅因当前源码树或、下的已安装副本包含某规则,就推断Agent忽略或错误应用了该规则。若对话记录无法确定历史版本或可用性,标记为未知并对归因进行限定。
~/.agents/skills~/.claude/skills对于每个相关会话,仅记录简洁、可审计的观察结果,包括:
- 忽略或误读AGENTS.md或技能指令;
- 错误的cwd、项目根目录、源路径或路径编码;
- 过度宽泛的编辑、无关的变更、覆盖用户工作或破坏性命令;
- 工具、shell、解析、重试或验证错误;
- 虚构声明、模糊报告或缺失测试与检查;
- 防止错误发生的成功模式。
将每个观察结果与当前任务关联,并将任何因果或复发声明标记为推断内容。说明冲突和覆盖不足的情况,而非进行平均处理。
采用以下置信度等级:
- 高:至少两个独立的相关会话直接支持同一模式及其与当前任务的相关性。
- 中:一个明确的相关会话支持该发现,或多个会话提供混合支持。
- 低:仅存在间接、模糊或启发式信号。不要基于低置信度证据推荐持久化仓库变更。
长效变更需要满足以下条件之一:至少两个独立会话中出现相同故障,或一个明确的高影响故障暴露了缺失的稳定不变量。将影响较小的一次性错误视为手动防护措施。
Choose the Smallest Intervention
选择最小化干预措施
- Update AGENTS.md when the lesson is stable, project-wide, and useful to agents working in that scope.
- Update an existing skill when the failure belongs clearly inside its current workflow.
- Propose a new skill only for a repeated, reusable procedure that spans projects or repositories.
- Add a script only when deterministic discovery, parsing, or validation would otherwise be reimplemented.
- Recommend no durable change for one-off mistakes, weak evidence, or rules already stated clearly; report the risk and manual guardrail instead.
- 当经验教训稳定、适用于整个项目且对该范围内工作的Agent有用时,更新AGENTS.md。
- 当故障明确属于现有技能的当前工作流时,更新现有技能。
- 仅针对跨项目或仓库的重复、可重用流程,才提议创建新技能。
- 仅当确定性发现、解析或验证无法通过其他方式实现时,才添加脚本。
- 对于一次性错误、薄弱证据或已明确说明的规则,建议不进行长效变更;改为报告风险和手动防护措施。
Report and Stop
报告并终止
Lead with for read-only work or
when explicitly requested fixes were written, then report only:
### 🔎 Introspection complete — <intervention or coverage-gap outcome>### ✅ Introspection fixes applied — <outcome>- : project paths, sources checked, fallbacks used, and sessions inspected.
🗂 Historical coverage - : a compact table with confidence, observed evidence, inference, relevance, and intervention. Keep confidence visibly separate from severity or impact.
🔎 Findings - : apply now, consider later, or no change, with the target and prevention mechanism.
🛡 Durable recommendations - : commands run, checks performed, external-disclosure constraints, and missing evidence.
🧪 Validation and gaps
When fixes were explicitly requested, include exact files changed and validation outcomes. Stop after the current task
has an evidence-backed recommendation or an explicit coverage gap; do not mine additional history merely to add examples
or strengthen prose. Keep transcript references, paths, counters, redactions, and miner JSON exact and undecorated.
对于只读工作,以开头;当明确要求的修复已完成时,以开头,然后仅报告以下内容:
### 🔎 自省完成 — <干预措施或覆盖缺口结果>### ✅ 自省修复已应用 — <结果>- :项目路径、检查的来源、使用的回退方案以及检查的会话。
🗂 历史覆盖范围 - :一个简洁的表格,包含置信度、观察到的证据、推断内容、相关性和干预措施。确保置信度与严重性或影响明显区分。
🔎 发现结果 - :立即应用、稍后考虑或无需变更,说明目标和预防机制。
🛡 长效建议 - :运行的命令、执行的检查、外部披露约束以及缺失的证据。
🧪 验证与缺口
当明确要求进行修复时,需包含确切的变更文件和验证结果。当前任务获得有证据支持的建议或明确的覆盖缺口后,立即终止操作;不要仅为添加示例或优化措辞而挖掘更多历史记录。保持对话记录引用、路径、计数器、编辑内容和挖掘工具JSON的准确性,不添加额外修饰。