principle-encode-lessons-in-structure
できること
このスキルは、メモの中で同じ訂正を繰り返さないようAIを導きます。その教訓を、リントルール、チェック、またはそれを強制するスクリプトに変えます。ミスを減らしたいチーム向けです。
使う場面
- ✓同じ指示が2回以上書き留められているとき。
- ✓レビュアーからの同じ訂正が繰り返し戻ってくるとき。
- ✓テストの失敗が、自動的にチェックできるパターンを明らかにしたとき。
スキルのリンク
https://github.com/storybookjs/storybook/blob/next/.agents/skills/principle-encode-lessons-in-structure/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“コードレビューでいつも同じ間違いをしています。そのルールを、もう一度の注意書きではなく、自動チェックに変えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、そのルールがリントルール、メタデータのフラグ、実行時チェック、スクリプトで強制できるかを尋ねます。利用可能な最も強い仕組みを優先し、チェックができたら文章のリマインダーを取り除きます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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:
- Ask: can this be a lint rule, a metadata flag, a runtime check, or a script?
- If yes, encode it. Delete the instruction
- 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)
よくある質問
より良いリマインダーを書けばよいのでは?
リマインダーは見落とされやすいのに対し、自動チェックは誰も覚えておかなくてもルールを強制するとスキルは述べています。
ルールに人間の判断が必要な場合は?
指示をより目立たせ、失敗の例を加えるようスキルは述べています。
どの仕組みが好まれますか?
状況が許す中で最も強いもので、例えばその間違いを不可能にする、またはビルドを失敗させるルールです。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 91k
- ランキング
- #1320
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
handle-pr-comments
91kエージェントが、GitHubのプルリクエストのレビューコメントを1つずつ処理できるよう支援します。修正案を提示し、あなたの選択を適用して、スレッドを解決済みにします。
storybook-startup-benchmark
91kエージェントが、Storybookが起動して最初のストーリーを表示するまでの時間を測り、公平な比較のために繰り返し実行できるよう支援します。
storybook-upgrade
91kエージェントが、プロジェクト内のすべてのStorybookパッケージを、選んだバージョンに一度に1つのメジャーバージョンずつ、アップグレードする方法を示します。
update-pr-description
91kエージェントが、プルリクエストのタイトルと説明が、まだコードの変更と合っているかを確認し、正確な更新を提案できるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。