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 從公開儲存庫中收錄這些內容。

檢舉或申請下架