epistemic-protocols: Skill for Claude Code

.claude/skills/rederive/SKILL.md

rederive is a skill for Claude Code from jongwony/epistemic-protocols. It costs 109 tokens per session (4,974 once invoked), scanned A, original, MIT.

A project-specific process for reviewing and re-deriving a protocol contract in Lean, a system for proving that software rules are mathematically correct. It reads the existing design, decisions and translated code before merging the result.

In plain words
What is it for?
Use it when a named protocol's Lean contract pull request needs review, re-derivation and completion of its project tracking chart.
Why use it?
Formal protocol work can lose requirements when a design is translated into proof code. This process provides a defined way to find missing obligations and check the result against the project's agreed foundation.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions AGENTS.md.

This is jongwony/epistemic-protocols's own configuration. It tells Claude Code how to work on epistemic-protocols itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything epistemic-protocols configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jongwony/epistemic-protocols. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jongwony/epistemic-protocols/main/.claude/skills/rederive/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/jongwony/epistemic-protocols

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rederive

README.md
[![agentmods](https://agentmods.dev/badge/skills/jongwony/epistemic-protocols/rederive/github.svg)](https://agentmods.dev/skills/jongwony/epistemic-protocols/rederive)
Your own site
<a href="https://agentmods.dev/skills/jongwony/epistemic-protocols/rederive"><img src="https://agentmods.dev/badge/skills/jongwony/epistemic-protocols/rederive/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rederive

Your own site · 80×15
<a href="https://agentmods.dev/skills/jongwony/epistemic-protocols/rederive"><img src="https://agentmods.dev/badge/skills/jongwony/epistemic-protocols/rederive.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,974 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00109 $0.04974
Opus 5.5 $0.00044 $0.01990
Sonnet 5.5 $0.00022 $0.00995
Haiku 4.5 $0.00011 $0.00497

Measured today against content hash 86e2727c8657, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rederive scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/rederive/SKILL.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Re-derive a protocol contract

One skill per run, whose formal block is Lean or becomes Lean in the run: a core protocol in scripts/load-protocols.js CANONICAL_PROTOCOL_SET, or a utility skill in LEAN_CONTRACT_UTILITIES there, which a utility still carrying a text-DSL block enters in its run. Below, the protocol names that skill whichever kind it is. The object is the protocol itself — its SKILL.md on origin/main; an open PR whose branch carries the chart id, where one exists, is one more piece of material, never the anchor. Anchor chart: the protocol's own ROO-* chart, which for a utility may be one chart several skills' runs share; suite-wide ground: ROO-67.

What a re-derivation answers to. The target is the morphism that the AGENTS.md Northstar and the premise axiom Context and Utterance as First-Class Ground (premise/recognition-and-authority.md) admit, in the form lean/EpistemicProtocols/Ground.lean fixes: the fused context — turns bound to who sent them — and the person's utterance are the ground; the structure fixes only what the harness knows; everything else is the model's inference, declared as a documented judgment inside the types. The solution is derived from the gathered pre-understanding and taken at the fusion gate before the current contract is read; the pre-Lean DSL, the current block, any open PR and earlier decides are evidence read against that solution, never the target.

Steps

  1. Trigger — a contributor names the protocol. Resolve its chart; where the protocol's earlier chart is Done, open a new chart linked to it and to ROO-67 (ROO-67 decide 5e64392d). The order across protocols is the contributor's and session-local; nothing here fixes it.
  2. Gather the pre-understanding — afresh every run, since what it holds moves between runs:
    • Ground: the Northstar, the premise axiom above, Ground.lean, and the protocol's declared deficit and resolution type — its Type line and Definition only, not the formal block; the fusion gate may revise them.
    • Decide coordinates: both charts' decide comments, the protocol chart's Open questions and its related issues; a later decide that supersedes an earlier one says so (ROO-67 decide 78e615b4).
    • Literature: delegate to a subagent — primary sources on the cognitive deficit this protocol takes and the resolution it yields; where a source's setting differs from the one the protocol runs in, the claim names that transfer. Every claim carries its verification strength and names the weakest link (AGENTS.md §Settled Directions, Academic grounding).
    • Definition history: for each suite-level definition the protocol's contract leans on — the COMPOSITION operator, a GROUND term, a convention another surface states for it — the commit that introduced it and each later commit that narrowed or widened it, in the definition itself and at the places this contract uses it (git log -L on the definition, git blame, git log -S on its terms at each use site), read as the intent the current text carries forward.
    • Real use: ~/.claude/projects/*/*.jsonl sessions where the skill ran — typed by the contributor or invoked through its delivery path (exclude -private-tmp*); what the deficit looked like there, and where the run went wrong or right. Where the skill runs rarely by nature, its sessions leave little; the commit history of the artifact its deficit is resolved in — each time that deficit came up and was resolved, by this skill or another route — is the real use read instead.
  3. Derive the solution — the protocol's epistemic solution, from the gathered material, not from the current block: deficit → resolution, first stated as its solution sentence, one sentence of what the person can then say or recognize — the repair direction every later finding is read against; the coordinates only the person fills, the closure kinds, the domain boundary — what the transformation itself carries and what lies past its hand-off, which the contract names at its delegation point and does not prescribe (ROO-67 decide dad26302) —, and the conditions that hold only where a ground carries them — Northstar, premise, literature, the contributor's utterance, a decide, or observed use; any other morphism step is scaffolding, carried as guidance on a documented judgment (ROO-67 decide 0d3b1e3b). Each part names what grounds it. A shape carried from a sibling protocol's re-derivation is pre-understanding: each carried clause, constructor, or slot is tested against this protocol's deficit and governing surfaces before it enters the solution.
    • Independent derivation: /codex-plus:codex with an English prompt carrying the locations of the gathered material, the literature findings as a file, and the question this step answers — never this session's solution; it may read beyond the list. Compare the two derivations part by part.
  4. Fusion gate — present the derived solution beside the ground of each part, its domain boundary among them, where the independent derivation agrees and splits, the real-use reading, the contrary grounds and live alternatives with their consequences, and the limits of what was searched. Branches:
    • the contributor takes it → write the solution decide on the protocol chart (/unfold decide) and go to the reading step;
    • the contributor corrects or replaces part of it → fuse the utterance and derive again;
    • the correction moves the pre-understanding (a source, a decide, a reading of use) → gather again where it moved, then derive;
    • the contributor stops → the run ends; what was gathered and derived is recorded on the protocol chart;
    • no utterance → nothing is taken as a decide; whether the run waits or goes on past the gate is judged from its context, and going on follows Without the contributor below.

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed 86e2727c8657
  2. yesterday Changed 53871238ecce
  3. 2d ago Changed f905538eb7c2
  4. 3d ago Changed df037a0bd21b
  5. 4d ago Changed · +1 lines 346fc0b37396
  6. 5d ago Changed 659e02e2d469
  7. 6d ago Changed · +15 tokens per session 650ec60e0403
  8. 7d ago Changed 2f2d8085889f
  9. 9d ago Changed ebd486cd58d2
  10. 10d ago First seen · 71 lines · 94 tokens per session scan A 46694f7473d2

Subscribe to this mod's changes

rederive is a skill published in the GitHub repository jongwony/epistemic-protocols (173 stars, last pushed today), licensed MIT. It adds 109 tokens to every session and 4,974 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-26.

Related

Other skills, from other repositories

flow-next-impl-review

Carmack-level implementation review of changes via the configured backend. Use when asked to review code or a diff in a flow-next repo.

gmickel/flow-next · 34 tokens

flow-next-spec-completion-review

Verify that a spec's completed tasks fully implement the spec requirements. Use at spec completion before close.

gmickel/flow-next · 27 tokens

flow-next-worktree-kit

Manage git worktrees (create/list/switch/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees.

gmickel/flow-next · 43 tokens

pr

Comprehensive PR/issue review - analyzes architecture, tests, identifies unrelated changes mixed in, drafts review comment or issue comment. Use when user asks to review a PR, check a PR, look at PR changes, or comment on an issue.

umputun/cc-thingz · 51 tokens

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

sip

After you create or change an artifact or skill, taste-test it with our own skills instead of trusting your in-session judgment — recursive self-improvement, made automatic. Use right after writing or editing anything, before calling it done, committing, or handing it off.

LilMGenius/paperthin · 55 tokens