[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71P2JK8JWED2EWCE9MPS5AX":3,"skill-same:01M71P2JK8JWED2EWCE9MPS5AX":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M71P2JK8JWED2EWCE9MPS5AX","principle-encode-lessons-in-structure",null,"Apply when you catch yourself writing the same instruction a second time, or notice a recurring correction.","drsh4dow\u002Fpi-setup","drsh4dow","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F45247070?v=4","01M71P068NASGHSWS11VWW416N","Daniel Moretti","01M71P0698BH81N65NP04X9NVN",10,"MIT","https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fprinciple-encode-lessons-in-structure\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"structure","lessons","principle encode lessons in structure","catch","notice","recurring","second","time","writing","false","when","you","apply","2026-11-10 10:56:23",false,"---\nname: principle-encode-lessons-in-structure\ndescription: \"Apply when you catch yourself writing the same instruction a second time, or notice a recurring correction.\"\ndisable-model-invocation: false\nuser-invokable: false\n---\n\n# Encode Lessons in Structure\n\nEncode 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.\n\n**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.\n\n**Pattern:**\nWhen you catch yourself writing the same instruction a second time:\n1. Ask: can this be a lint rule, a metadata flag, a runtime check, or a script?\n2. If yes, encode it. Delete the instruction.\n3. If no (requires judgment), make the instruction more prominent and add an example of the failure mode.\n\n**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.\n\n**Corollary:** If the fix is structural, only use the structural fix. The instruction is the symptom.\n\n**Design gates that hold.**\n- Give every number a mechanism. A number with no command behind it is an aspiration, not a constraint. State the number and the reason together. A threshold without a rationale gets deleted by the next person who hits it.\n- When you have no number, ratchet. Set 80% coverage on a codebase at 62% and you get a red build forever, then a team that learns to ignore red builds. The alternative asks for no decision: record where you are, then refuse to get worse. Every check compares against the recorded value, not an aspiration. When a number improves, update it; when it drops, that's the finding.\n- Unblock with an exception, not a deletion. An exception with an owner and a date unblocks you. Deleting the constraint unblocks everyone forever.\n- Guard the bar itself. Watch for these five moves in the diff: the threshold moved, a test got easier, a checker got silenced, work is unfinished, an exception appeared. A regex-level guard over the diff is enough: it catches the cheap-road-to-green moves agents actually make, not a determined human hiding a change. When the guard can't tell whether a change tightens or loosens, report it; staying quiet is the wrong default.\n\n**Feedback loop:**\n- **Capture every correction.** When the human intervenes or tests fail, decide if it's a one-off or a pattern.\n- **Route to the right layer.** One-off -> brain note. Recurring fix -> skill or lint rule. Systemic issue -> principle.\n- **Close the loop.** Don't just record. Apply now or create a concrete todo.\n- **Log every attempt, including the reverted ones.** Keep a short ledger so a discarded idea stays discarded. What matters is that the next person (or the next agent) reads it before proposing an experiment, and doesn't re-run one that already failed.\n\n**Anti-patterns:**\n- Acknowledging without recording (\"I'll keep that in mind\" does not persist)\n- Recording without routing (a brain note about a lint rule that should exist is wasted unless the lint rule gets implemented)\n- Fixing without generalizing (fixing one instance while leaving the recurring pattern intact)\n","# Encode Lessons in Structure\n\nEncode 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.\n\n**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.\n\n**Pattern:**\nWhen you catch yourself writing the same instruction a second time:\n1. Ask: can this be a lint rule, a metadata flag, a runtime check, or a script?\n2. If yes, encode it. Delete the instruction.\n3. If no (requires judgment), make the instruction more prominent and add an example of the failure mode.\n\n**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.\n\n**Corollary:** If the fix is structural, only use the structural fix. The instruction is the symptom.\n\n**Design gates that hold.**\n- Give every number a mechanism. A number with no command behind it is an aspiration, not a constraint. State the number and the reason together. A threshold without a rationale gets deleted by the next person who hits it.\n- When you have no number, ratchet. Set 80% coverage on a codebase at 62% and you get a red build forever, then a team that learns to ignore red builds. The alternative asks for no decision: record where you are, then refuse to get worse. Every check compares against the recorded value, not an aspiration. When a number improves, update it; when it drops, that's the finding.\n- Unblock with an exception, not a deletion. An exception with an owner and a date unblocks you. Deleting the constraint unblocks everyone forever.\n- Guard the bar itself. Watch for these five moves in the diff: the threshold moved, a test got easier, a checker got silenced, work is unfinished, an exception appeared. A regex-level guard over the diff is enough: it catches the cheap-road-to-green moves agents actually make, not a determined human hiding a change. When the guard can't tell whether a change tightens or loosens, report it; staying quiet is the wrong default.\n\n**Feedback loop:**\n- **Capture every correction.** When the human intervenes or tests fail, decide if it's a one-off or a pattern.\n- **Route to the right layer.** One-off -> brain note. Recurring fix -> skill or lint rule. Systemic issue -> principle.\n- **Close the loop.** Don't just record. Apply now or create a concrete todo.\n- **Log every attempt, including the reverted ones.** Keep a short ledger so a discarded idea stays discarded. What matters is that the next person (or the next agent) reads it before proposing an experiment, and doesn't re-run one that already failed.\n\n**Anti-patterns:**\n- Acknowledging without recording (\"I'll keep that in mind\" does not persist)\n- Recording without routing (a brain note about a lint rule that should exist is wasted unless the lint rule gets implemented)\n- Fixing without generalizing (fixing one instance while leaving the recurring pattern intact)\n",{"name":5,"description":7,"user-invokable":33,"disable-model-invocation":33},"main","f7936596c1ba2e1472dadccc3f111b9d517fa96c","agent\u002Fskills\u002Fprinciple-encode-lessons-in-structure",2,"https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup","https:\u002F\u002Fgithub.com\u002Fdrsh4dow","https:\u002F\u002Fdanielmoretti.com\u002F","Toss A Coin To Your Witcher :pirate_flag: ","2026-11-03 22:13:53",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add drsh4dow\u002Fpi-setup --skill principle-encode-lessons-in-structure",{"tool":52,"command":53},"bunx","bunx skills add drsh4dow\u002Fpi-setup --skill principle-encode-lessons-in-structure",{"tool":55,"command":56},"pnpm","pnpm dlx skills add drsh4dow\u002Fpi-setup --skill principle-encode-lessons-in-structure","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fprinciple-encode-lessons-in-structure\u002FSKILL.md",true,[],[61,82,112,129,150,161],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":32},"01M71P4GPJMBK21BTZBKY9T8EE","changelog","Write the changelog entry for a pull request. Use when a PR changes behavior that users, operators, or integrators can notice.","https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup\u002Fblob\u002Fmain\u002Fevals\u002Fharness-lessons\u002Ffixtures\u002Fchangelog-skill\u002FSKILL.md",[],[63,68,69,23,70,71,72,73,74,75,76,77,78,79,29,80,81],"users","pull","changes","operators","pr","pull request","for","request","behavior","entry","write","use","can","changelog entry",{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":98,"publishedAt":32},"01M71P4E9AZM56JBY227P2G1SC","writing-good-tickets","Write, file, or update an issue or ticket that an agent or a developer can take to one PR. Use when filing a bug or feature, updating an issue, or breaking a plan into tickets.","https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fwriting-good-tickets\u002FSKILL.md",[88,93],{"categoryNo":89,"categoryName":90,"taxonomyType":91,"taxonomyTypeDesc":92},"01JBSEEDCAT000000000000018","写作与文案","SCENARIO","使用场景",{"categoryNo":94,"categoryName":95,"taxonomyType":96,"taxonomyTypeDesc":97},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[99,27,100,101,72,102,103,104,79,28,29,105,106,80,107,108,78,109,110,111],"good","tickets","writing good tickets","feature","filing","ticket","file","one","plan","update","bug","take","issue",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":120,"publishedAt":32},"01M71P4C0B0DXTRRSG9RA6Y687","writing-good-prs","Write or update a pull request title and body that a reviewer can trust and own. Use when opening a PR or editing its description.","https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fwriting-good-prs\u002FSKILL.md",[118,119],{"categoryNo":89,"categoryName":90,"taxonomyType":91,"taxonomyTypeDesc":92},{"categoryNo":94,"categoryName":95,"taxonomyType":96,"taxonomyTypeDesc":97},[99,121,27,122,69,123,72,124,79,28,29,80,125,126,73,75,108,78,127,128],"prs","writing good prs","trust","editing","reviewer","title","opening a pr","body",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":137,"publishedAt":32},"01M71P49D1AG2MR6AYNPMMT34Z","writing-good-commits","Write or reword a git commit message and size the commit it describes. Use when committing, or when reshaping commits during a rebase.","https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fwriting-good-commits\u002FSKILL.md",[135,136],{"categoryNo":89,"categoryName":90,"taxonomyType":91,"taxonomyTypeDesc":92},{"categoryNo":94,"categoryName":95,"taxonomyType":96,"taxonomyTypeDesc":97},[138,99,27,139,140,141,78,142,143,144,79,28,145,146,29,147,148,149],"commits","writing good commits","message","size","git commit message","git","git commit","rebase","commit message","committing","commit","it",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":158,"publishedAt":32},"01M71P480BDE55JMPVVEBCFS7P","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[156,157],{"categoryNo":89,"categoryName":90,"taxonomyType":91,"taxonomyTypeDesc":92},{"categoryNo":94,"categoryName":95,"taxonomyType":96,"taxonomyTypeDesc":97},[159,74,27,124,79,28,160,29],"writing for agents","documents",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":32},"01M71P45SNCD7DDSA6FRVCPA17","wizard","Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.","https:\u002F\u002Fgithub.com\u002Fdrsh4dow\u002Fpi-setup\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fwizard\u002FSKILL.md",[],[163,168,169,74,170,171,172,173,79,174,28,29,175,106,176,80,177,178,179,180],"running","setting","up","ci","provisioning infrastructure","only","invoke","Bash","interactive","credentials","dashboard","generate","human"]