Skip to content
Skill

Principle encode lessons in structure

Guides the agent to turn repeated corrections into lints, checks or scripts

Principle encode lessons in structure is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
5.1K
Last commit
License
MIT
Listing updated

Similar skills

About Principle encode lessons in structure

This skill tells the agent to stop answering a recurring correction with another line of instructions. When it notices it is writing the same rule a second time, it should instead move the rule into the project's structure, such as a lint rule, a metadata flag, a runtime check or a script.

The guidance is short and opinionated. If a lesson can be enforced mechanically, the agent should use only the structural fix and treat the written instruction as a symptom. When a lesson depends on judgment and cannot be encoded, the skill says to make the instruction more prominent and include an example of the failure it is meant to prevent.

The skill is a single SKILL.md with a supporting file and no bundled scripts. It is written for the Claude Code plugin marketplace and is not tied to any particular language or toolchain.

When your agent uses it

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.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 2 files (592 bytes) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the pstack plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude

Or copy only this skill to ~/.claude/skills/principle-encode-lessons-in-structure:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/principle-encode-lessons-in-structure &&
cp -R "$tmp/plugins/pstack/skills/principle-encode-lessons-in-structure" ~/.claude/skills/principle-encode-lessons-in-structure &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/principle-encode-lessons-in-structure inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/principle-encode-lessons-in-structure to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/principle-encode-lessons-in-structure &&
cp -R "$tmp/plugins/pstack/skills/principle-encode-lessons-in-structure" ~/.agents/skills/principle-encode-lessons-in-structure &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/principle-encode-lessons-in-structure inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/principle-encode-lessons-in-structure to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/principle-encode-lessons-in-structure &&
cp -R "$tmp/plugins/pstack/skills/principle-encode-lessons-in-structure" ~/.cursor/skills/principle-encode-lessons-in-structure &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/principle-encode-lessons-in-structure inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/principle-encode-lessons-in-structure

Or copy the folder to ~/.gemini/skills/principle-encode-lessons-in-structure yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/principle-encode-lessons-in-structure:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/principle-encode-lessons-in-structure &&
cp -R "$tmp/plugins/pstack/skills/principle-encode-lessons-in-structure" ~/.copilot/skills/principle-encode-lessons-in-structure &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/principle-encode-lessons-in-structure inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git

Then copy pstack-claude/plugins/pstack/skills/principle-encode-lessons-in-structure into your agent's skills folder as principle-encode-lessons-in-structure. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Repeated instruction detection
Triggers when the agent notices it is writing the same guidance again or a correction keeps recurring.
Structural enforcement choices
Points the agent toward lints, metadata flags, runtime checks or scripts instead of more prose.
Judgment fallback
For lessons that cannot be encoded, suggests a more prominent instruction with a failure example.
Single-fix rule
When a structural fix exists, use only that fix rather than layering text on top of it.

Good for

  • Turn a repeated code review comment into a lint rule
  • Replace a reminder in project docs with a runtime validation check
  • Add a metadata flag so a recurring mistake is caught automatically
  • Write a script that enforces a convention the agent keeps forgetting

Principle encode lessons in structure FAQ

When does Principle encode lessons in structure trigger?

It applies when the agent catches itself writing the same instruction a second time or notices a recurring correction.

What does Principle encode lessons in structure change in the project?

The skill itself only guides the agent's choice. It asks the agent to encode a repeated rule as a lint, metadata flag, runtime check or script rather than adding more text.

What if the lesson needs judgment?

The skill says to make the instruction more prominent and add an example of the failure mode, since the rule cannot be encoded.

How do I install Principle encode lessons in structure in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/principle-encode-lessons-in-structure to use it in all your projects, or to .claude/skills/principle-encode-lessons-in-structure in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.

Does Principle encode lessons in structure run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Principle encode lessons in structure?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Principle encode lessons in structure?

The closest alternatives to Principle encode lessons in structure are Writing rules, Correct, Principle never block on the human, Rules and Principle fix root causes.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from michael-denyer/pstack-claude

  1. Makes the agent read pstack's poteto-mode skill first and follow its routing

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  2. Has the agent restate your goals and the problem you're solving in its own words

    • Open source
    • 5.1K GitHub stars
    • Productivity
  3. Sketches types, signatures and module layout before the agent writes code

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  4. Runs parallel candidate attempts at a task, then merges the best parts into one artifact

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  5. Drafts a personal working-style skill from your past agent conversations

    • Open source
    • 5.1K GitHub stars
    • Developer tools