Principle Encode Lessons In Structure

作者 cursorccb5507cec15无许可证10K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Apply when you catch yourself writing the same instruction a second time, or notice a recurring correction. Encode the rule as a lint, metadata flag, runtime check, or script instead of more text.

仅含说明AI & Agents
AI 生成的概览

把反复出现的纠正转化为结构性机制,例如 lint 规则、元数据标记、运行时检查或脚本,而不是重复写说明。

功能
该技能引导智能体在发现同一条说明或纠正反复出现时,把规则编码进机制,而不是继续增加文字说明。它给出选择最强可用机制、把修复路由到合适层级并闭合反馈回路的步骤。产出是决策与具体行动,例如添加 lint 规则、元数据标记、运行时检查或脚本;当需要判断时,则让说明更醒目并补充失败示例。它仅为说明文档,不附带脚本。
适用场景
当你发现自己第二次写下同一条说明、某个纠正反复出现,或某项修复应由工具强制而非依赖读者记住时使用。它也适用于判断一次纠正是一次性问题还是模式,以及该模式应归属哪一层。
运行要求
不需要任何工具、软件包、运行时、凭据或网络访问;仅为说明文档,不附带脚本。

Encode Lessons in Structure

Encode recurring fixes in mechanisms (tools, code, metadata, automation) instead of textual instructions. Every error, human correction, and unexpected outcome is a learning signal. Capture it, route it, and close the loop.

Why: Textual instructions are easy to miss. They require the reader to notice, remember, and comply. Structural mechanisms (lint rules, metadata flags, runtime checks, automation scripts) enforce the rule without cooperation.

Pattern: When you catch yourself writing the same instruction a second time:

  1. Ask: can this be a lint rule, a metadata flag, a runtime check, or a script?
  2. If yes, encode it. Delete the instruction
  3. If no (requires judgment), make the instruction more prominent and add an example of the failure mode

Pick the strongest mechanism. When more than one mechanism would work, choose the strongest the situation allows (an unrepresentable state that cannot compile, then a lint or banned API that fails CI, then a canonical helper, then a runtime check), because agents copy whatever the surrounding code already does and a weaker guard becomes the next template.

Corollary: If the fix is structural, only use the structural fix. The instruction is the symptom.

Feedback loop:

  • Capture every correction. When the human intervenes or tests fail, decide if it's a one-off or a pattern.
  • Route to the right layer. One-off -> brain note. Recurring fix -> skill or lint rule. Systemic issue -> principle.
  • Close the loop. Don't just record. Apply now or create a concrete todo.

Anti-patterns:

  • Acknowledging without recording ("I'll keep that in mind" does not persist)
  • Recording without routing (a brain note about a lint rule that should exist is wasted unless the lint rule gets implemented)
  • Fixing without generalizing (fixing one instance while leaving the recurring pattern intact)

来源与署名

来源:cursor/plugins位于pstack/skills/principle-encode-lessons-in-structure提交ccb5507

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架