Chuyển đến nội dung
Skillpedia
Lập trình chung91k · #1320

principle-encode-lessons-in-structure

Skill này làm gì

Skill này hướng dẫn AI ngừng lặp lại cùng một lời sửa trong ghi chú. Nó biến bài học thành một quy tắc lint, một kiểm tra hoặc một script để thực thi. Skill dành cho các đội muốn ít lỗi lặp lại hơn.

Khi nào nên dùng

  • ✓Khi cùng một chỉ dẫn đã được viết ra hai lần trở lên.
  • ✓Khi một lời sửa lặp đi lặp lại từ người review cứ quay lại.
  • ✓Khi một lỗi test cho thấy một mẫu có thể kiểm tra tự động.

Liên kết skill

https://github.com/storybookjs/storybook/blob/next/.agents/skills/principle-encode-lessons-in-structure/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/storybookjs/storybook/blob/next/.agents/skills/principle-encode-lessons-in-structure/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chúng tôi cứ mắc cùng một lỗi trong các lần review code. Hãy biến quy tắc đó thành một kiểm tra tự động thay vì thêm một lời nhắc nữa.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI hỏi liệu quy tắc có thể được thực thi bằng quy tắc lint, cờ metadata, kiểm tra lúc chạy hoặc script không. Nó ưu tiên cơ chế mạnh nhất có sẵn và bỏ lời nhắc bằng văn bản khi kiểm tra đã tồn tại.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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)
Câu hỏi thường gặp

Vì sao không chỉ viết một lời nhắc tốt hơn?

Skill nói lời nhắc dễ bị bỏ sót, còn kiểm tra tự động thực thi quy tắc mà không ai phải nhớ.

Nếu quy tắc cần phán đoán của con người thì sao?

Skill nói nên làm chỉ dẫn nổi bật hơn và thêm một ví dụ về lỗi.

Cơ chế nào được ưu tiên?

Cơ chế mạnh nhất mà tình huống cho phép, như một quy tắc làm lỗi không thể xảy ra hoặc làm build thất bại.

Chi tiết

Mô tả gốc của tác giả

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.

repo: storybookjs/storybook

Độ phổ biến

Sao GitHub
91k
Vị trí xếp hạng
#1320
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự