agentleFS
CodeForBreakfastCodeForBreakfast/beady-eye/.claude/skills/effect-model-audit/SKILL.md

effect-model-audit

Skill27 starsChanged 5 days agoApache-2.0View on GitHub

Use when asked to audit the type modelling of beady-eye's Claude Code plugin — whether its domain types are honest, whether they can represent illegal states, or for a periodic model-level type review. Triggers on "audit our type modelling", "are our types honest", "can our types represent illegal states", "model-level type review", "audit our domain types". The judgement sibling to effect-native-audit: a workflow-driven reasoning sweep over the plugin's domain types, not an anchored regression net and not the Effect language service.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. CodeForBreakfast/commy★ 210% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    L3 Role coherence: Do all the type's construction sites and read sites mean the same thing by it, or does it serve two roles under one name?

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Effect-model type audit

This skill sweeps the domain types of the plugin under plugin/ for model-level dishonesty. A type is dishonest when its shape lets a caller build a value the domain does not mean, or forces a caller to fake one. The question is whether the type's value space matches the domain's, and whether all its producers and consumers mean the same thing by it.

Four lenses ask about the value space, each against each family of types:

  • L1 Illegal-representable. Can the type represent a value that is invalid in the domain? A combination of fields, an optional that should be required, a bare primitive admitting an out-of-domain string, or a pair of booleans with a meaningless fourth corner. Invalid state must be unrepresentable.
  • L2 Under-expressive. Is there a legal domain state the type cannot represent? The missing case shows up as a sentinel, a placeholder, an impossible branch, or a comment apologising for a field that is "always absent here".
  • L3 Role coherence. Do all the type's construction sites and read sites mean the same thing by it, or does it serve two roles under one name? An address a caller supplies and an observation the outside world hands back are the usual pair. The tell is a producer that can legally build a value that is illegal for some consumer's role.
  • L4 Boundary honesty. At a trust boundary, does the type's role demand a parsed-once strong representation that it lacks? Examples are a Schema.Struct with required fields, branded members, or a refinement decoded once. Parse at boundaries, trust inside.

What it catches that the other checks cannot

Three checks cover the plugin's Effect code, and none re-reports another's findings:

CheckDriven byCostCatches
Effect language service and the Biome rules in plugin/biome-plugins/a rule per line, in the plugin typecheck and lintfree, every nix flake checkwhat one line shows, such as a floating Effect or instanceof Error
effect-native-audita grep pattern per findercheap, frequenthand-rolled helpers, imperative spines, representation smells a pattern can find
effect-model-audita type family and its census, reasoned aboutexpensive, periodicdishonesty with no lexical anchor, such as one type serving two roles

How it works

effect-model-audit.workflow.js runs four phases.

  1. Discover. One agent runs a grep that lists every top-level type declaration in plugin/src and plugin/hooks, exported or not, and returns the names. Tests and the shared test helper test-watcher.ts are left out. A Schema constant counts as the type it decodes to. A second agent groups those names into families and gives each family its census: every site that builds or decodes a member, and every site that reads one.

    The families must partition the enumerated names exactly, and assertPartition checks that. Because the list comes from one agent and the grouping from another, the check compares the grouping with a list its author did not write. If the check fails, the workflow repairs the partition and puts anything left over into an unassigned family, so no type escapes the audit.

  2. Reason. One agent per family and lens reads the type definitions and the census sites and reasons about the value space. No findings is a valid result.
  3. Verify. Each finding goes to one adversarial refuter as soon as its finder returns. The refuter cuts any finding without the evidence its lens demands:

    • L1 needs a named illegal value.
    • L2 needs a named missing legal state and the workaround it forces.
    • L3 needs a disagreeing producer and consumer, both sites named.
    • L4 needs the specific boundary.

    Whether a remodelling is worth its blast radius is never grounds for refuting it. A verifier that errors keeps the finding, marked unverified.

  4. Synthesise. An agent writes the report, merging findings that describe the same defect. L1 and L3 overlap by design. The confirmed and low-confidence lists the workflow returns come from splitSurvivors, not from the agent. It groups the findings at each file:line without dropping any, and confirms a site when any finding there is high-confidence.

Each surviving finding carries its evidence, a proposed remodelling, and its blast radius: every producer and consumer the remodelling would touch.

Running it

  1. Install the plugin's dependencies if plugin/node_modules is absent, so agents can check an API against the pinned Effect:

    cd plugin && bun install --frozen-lockfile
  2. Get today's date with date +%F.
  3. Launch the workflow with the date:

    Workflow({
      scriptPath: '.claude/skills/effect-model-audit/effect-model-audit.workflow.js',
      args: { date: '<YYYY-MM-DD>' },
    })

    It runs in the background, and you are notified when it finishes. To run one lens alone, pass args: { date, lenses: ['L3'] }.

  4. The workflow writes its report to target/effect-model-audit-<date>.md, which git ignores, and returns { confirmed[], lowConfidence[], survivors[], refutedCount, coverage, partitionOk }.

The workflow reports findings and changes no code.

Notes

  • domains.md holds the lens catalogue, the modelling principles the lenses rest on, and where L4 ends and effect-native-audit begins.
  • The pinned Effect is the authority on its API. plugin/package.json pins Effect 4. An agent names only an API that the installed copy under plugin/node_modules/effect exports.
  • The LENSES array in the workflow is the authoritative lens catalogue, because the workflow cannot read files. domains.md mirrors it for people, so change the two together.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.