From pstack
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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pstack:principle-encode-lessons-in-structureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
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:
Pick the strongest rung. 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: Don't paper over symptoms. If the fix is structural, ONLY use the structural fix. The instruction IS the symptom.
Feedback loop:
Anti-patterns:
npx claudepluginhub kdoroszewicz/cursor-plugins-claude --plugin pstackUse when the same mistake or bad pattern recurs, when a code-review comment is really a convention worth enforcing, or when you catch AI-generated drift/slop and want it to never happen again. Encodes the lesson as a durable rule in golden-rules.md — the feedback-flywheel / harness-layer-learning ratchet — instead of a one-off fix. Generic (language-agnostic).
Detects repetitive user corrections across sessions and converts them into memory entries, validation hooks, enforcement patterns, or skills to automate recurring feedback.
Captures lessons from code reviews and error corrections as persistent rules. Activates on /evolve or when user says 'we should remember this'.