返回提示词目录第 1387 页

排查并修复智能体指令失效

分析规则被忽略的加载、冲突与措辞原因,给出指令改写、自动约束和新会话验证方案。

完整提示词

<context>
When an agent ignores a written rule, adding capitals or "IMPORTANT" rarely helps. The common causes are different and need different fixes. The rule is buried in a long file among generic lines. Another line, or the existing code, says the opposite, and the agent copies the pattern it sees in the code. The rule is vague ("be careful with migrations") or only negative ("don't use moment") with no alternative to do instead. The file is not loaded at all: wrong file name for the tool, a scoped file whose path or glob does not match, or the agent working from another directory. In long sessions the rule was summarised away when context was compacted. Or the user's own prompt contradicts it. A rule that must never be broken is better enforced by something deterministic (a lint rule, a hook, a permission deny, a CI check) than by asking.
</context>

<task>
Diagnose and fix this ignored rule.
<rule>
{{rule}}
</rule>
<behaviour>
{{behaviour}}
</behaviour>
{{#instructions_file}}
<instructions_file>
{{instructions_file}}
</instructions_file>
{{/instructions_file}}

1. Check each cause against the evidence: position and file length, conflicts with other lines (quote them), conflict with existing code patterns the behaviour suggests, vagueness, negative-only wording, loading (file name, scope, working directory), timing (only after long sessions points to compaction), and prompt contradiction. Rank the likely causes; say what evidence would confirm each.
2. Give the fix for the top causes: move the rule up or into the right scoped file, resolve the conflict, rewrite it, or fix the file name or scope.
3. Rewrite the rule as a specific positive instruction with the reason and an example path or snippet ("Use date-fns for dates; moment is being removed (see src/lib/dates.ts)").
4. Decide whether it should be enforced rather than asked: if breaking it causes damage or it is mechanical, propose the deterministic check (lint rule, hook that blocks the action, permission deny, CI step) and what it should catch.
5. Give a quick way to confirm the fix: a fresh session with a prompt that would tempt the old behaviour.
</task>

<constraints>
- Do not recommend more emphasis (capitals, repetition, threats) as the fix.
- Without the instruction file, say which causes you could not check.
- Do not invent tool-specific file names or loading rules; mark them "check against the tool's documentation".
</constraints>

<output_format>
## Likely causes
Ranked list, each with evidence and what would confirm it.
## Fix
Concrete changes to files, placement or scope.
## Rewritten rule
A fenced block with the new wording.
## Enforcement
The deterministic check to add, or why asking is enough.
## How to confirm
The test prompt and the expected behaviour.
</output_format>

可替换内容

  • {{rule}}
  • {{behaviour}}
  • {{#instructions_file}}
  • {{instructions_file}}
  • {{/instructions_file}}

分类与标签

编程开发、智能体配置、指令调试、自动化检查、规则改写

前往 AI 图片创作