Agent skill

Bidirectional Differential

by jszmajda in jszmajda/lid

Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then…

MITAuto-check passedAI & LLM Engineering

Install Bidirectional Differential

skills CLI
$ npx skills add jszmajda/lid --skill bidirectional-differential -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jszmajda/lid bidirectional-differential --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jszmajda/lid.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/lid-experimental/skills/bidirectional-differential .claude/skills/bidirectional-differential && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bidirectional-differential
GitHub stars
105
Token cost
~2.9k tokens
SKILL.md length
1,384 words
Files
6 (incl. references)
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then…

  • Works in 6 steps: Resolve inputs. EARS text resolved by… → Strip leaky identifiers from the code… → Spawn N A-direction sessions in parallel… → …
  • The user invokes /differential-audit
  • SKILL.md covers When to act, Hard precondition —…, Scoping and Audit protocol, plus 7 more sections
  • Calls claude

What it does

Bidirectional Differential is an agent skill from jszmajda/lid. Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then classifies the drift between them. Use when the user invokes /differential-audit, asks to audit EARS-to-code drift for a feature or segment, wants a differential round-trip on a specific spec, or reaches Phase 6 code-complete in linked-intent-dev with arrow-maintenance overlay present and a touched-EARS set to consider…

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `evals/evals.json`, `references/audit-protocol.md` and `references/audit-report-template.md`).

It sits in AI & LLM Engineering. It works with Anthropic API. The repository describes itself as: Linked-Intent Development - a SDD methodology for agentic coding. The licence is MIT.

When your agent uses it

  • The user invokes /differential-audit
  • Asks to audit EARS-to-code drift for a feature
  • Wants a differential round-trip on a specific spec
  • Reaches Phase 6 code-complete in linked-intent-dev with arrow-maintenance overlay present and a touched-EARS set to consider

Example prompts

  • “/bidirectional-differential”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Resolve inputs. EARS text resolved by grepping the ID across the project's *-specs.md files; implementing code from regions annotated with…
  2. Strip leaky identifiers from the code before the B-direction receives it — @spec annotations, EARS ID mentions, vocabulary-echoing…
  3. Spawn N A-direction sessions in parallel via claude -p. Each gets only the EARS text + a one-line codebase description. Task: produce…
  4. Spawn N B-direction sessions in parallel via claude -p, concurrent with A-direction. Each gets only the stripped code + a one-line…
  5. Compare and classify. Within-direction variance first (do A-runs agree with each other; do B-runs agree with each other)…
  6. Write the per-EARS audit record to docs/arrows/_experiments/bidirectional-differential/{segment-name}/{EARS-ID}.md using the template in…

What it can do on your machine

Read from SKILL.md and the folder at commit 831c195. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bidirectional Differential loads about 2.9k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 203 tokens; SKILL.md has 1,384 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~203
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jszmajda/lid at commit 831c195, republished under its MIT licence (© jszmajda). 1,384 words, ~2,873 tokens.

Download SKILL.mdSave it as .claude/skills/bidirectional-differential/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
bidirectional-differential
description
Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then classifies the drift between them. Use when the user invokes /differential-audit, asks to audit EARS-to-code drift for a feature or segment, wants a differential round-trip on a specific spec, or reaches Phase 6 code-complete in linked-intent-dev with arrow-maintenance overlay present and a touched-EARS set to consider. Surfaces intent that the code encodes but the EARS doesn't state, and requirements the EARS states but the code under-pins. Requires docs/arrows/ overlay. Heavy per-EARS cost in subprocess spawns and Anthropic API spend; scope via the opening conversation before running.

Bidirectional Differential

This skill runs a bidirectional differential audit on EARS↔code pairs. The audit is advisory — findings concentrate human review on specific cases, and acting on findings is always user-judged. When the audit surfaces drift, the recommended repair path walks the whole arrow: validate intent with the user, then cascade EARS → Tests → Code.

When to act

Command mode — user invokes /differential-audit:

  • No arguments → open the scoping conversation (see §Scoping).
  • One or more EARS IDs as arguments → audit them directly with configured defaults; skip the scoping conversation.

Ambient mode — at linked-intent-dev's Phase 6 boundary (code is complete for a change) in a project where arrow-maintenance's overlay exists and ambient triggering is not disabled. Emit one batched prompt listing every EARS the change touched, offering all, none, a comma-separated subset, or skip-arrow. If ambient is disabled in the project's CLAUDE.md (see §Configuration), do not fire.

Ambient mode is advisory: declining, skipping, or any classification outcome MUST NOT block Phase 6 completion.

Hard precondition — arrow-maintenance overlay

Before spawning any blind sessions in either mode, verify the arrow-maintenance overlay exists:

  • docs/arrows/index.yaml present, and
  • at least one per-arrow overlay file under docs/arrows/.

If absent, abort with:

Bidirectional differential audits attach to the arrow-maintenance overlay. Run /update-lid and then /arrow-maintenance first to establish the arrow surface this skill extends.

Do not spawn any claude -p sessions and do not write any files when the overlay is absent. This skill is heavier maintenance than arrow-maintenance; a project without the lighter layer in place will not act on this skill's findings either.

Scoping

The scoping conversation is the first user-facing moment. The audit itself runs without further input once scope is fixed. Full script in references/scoping-conversation.md.

Users describe what they want audited in natural terms — "the login flow", "the billing pipeline", "the scoring rules" — more often than in arrow or LLD names. The scoping conversation interprets those descriptions, maps them to arrows/LLDs in the overlay, and confirms the mapping with the user before moving to EARS-level scope. Then it captures the final EARS set and the runs-per-direction (default 3) and shows a cost estimate before spawning anything.

Do not auto-select EARS. The skill does not have a reliable heuristic for picking which EARS to audit within a chosen arrow — that choice is the user's, and the scoping conversation exists precisely to surface it.

Audit protocol

For each scoped EARS, execute the six-step protocol in references/audit-protocol.md. Summary:

  1. Resolve inputs. EARS text resolved by grepping the ID across the project's *-specs.md files; implementing code from regions annotated with @spec {EARS-ID}. If no @spec points at the EARS, surface a coverage-gap entry and skip this EARS.
  2. Strip leaky identifiers from the code before the B-direction receives it — @spec annotations, EARS ID mentions, vocabulary-echoing identifiers, comments paraphrasing the EARS, test describe/it strings that echo EARS phrasing. See references/audit-protocol.md §Stripping rules. The B-direction session must not be able to reconstruct the EARS by reading it back out of the code.
  3. Spawn N A-direction sessions in parallel via claude -p. Each gets only the EARS text + a one-line codebase description. Task: produce naive implementation.
  4. Spawn N B-direction sessions in parallel via claude -p, concurrent with A-direction. Each gets only the stripped code + a one-line EARS-syntax reminder. Task: reconstruct the EARS.
  5. Compare and classify. Within-direction variance first (do A-runs agree with each other; do B-runs agree with each other); between-direction alignment second (does A's diff against real code correspond to B's diff against real EARS). Pick one of the six codes:
    • BD-COHERENT, A-ONLY-DRIFT, B-ONLY-DRIFT, BIDIRECTIONAL-DRIFT, INCONSISTENT-BLIND — see references/classification-codes.md for decision rules and worked examples.
    • UNANNOTATABLE — signpost for negative requirements with no production sink (see §Unwanted below).
  6. Write the per-EARS audit record to docs/arrows/_experiments/bidirectional-differential/{segment-name}/{EARS-ID}.md using the template in references/audit-report-template.md. Re-running replaces the file (mutation, not accumulation — commit the old audit before re-running if before/after comparison matters).

Default N=3. If within-direction runs split 2-vs-1 on the classification-relevant dimension, re-run the affected direction at N=5 and classify on the majority. If the 5-run result still splits or the split shape changes between runs, classify INCONSISTENT-BLIND — don't force a code.

After per-EARS records are written, produce a user summary with per-arrow classification counts, top-priority drift findings across the audited scope, and recommended next steps per §Repair path.

Output location

Audit records live in a reserved sibling subtree under arrow-maintenance's root:

docs/arrows/_experiments/bidirectional-differential/{segment-name}/{EARS-ID}.md

Do not mutate existing per-arrow overlay files (docs/arrows/{segment}.md, docs/arrows/index.yaml). Experiment artifacts stay in the reserved subtree so arrow-maintenance's audit loop can ignore them. Retirement of this experiment is rm -rf docs/arrows/_experiments/bidirectional-differential/; promotion is a single move to a core namespace.

Show full SKILL.md (627 more words)Show less

Repair path — cascade through the arrow

LID's arrow is HLD → LLD → EARS → Tests → Code. When the audit surfaces drift, the recommended repair path walks the arrow in order. Every reconciliation recommendation in the audit record (and every finding in the user summary) takes this shape:

  1. Validate the discovered intent with the user. The B-direction's reconstructed EARS or the A-direction's divergent implementations represent candidate intent. The user decides which version matches what was actually meant. No edit happens before this confirmation.
  2. Check LLD coherence. Does the current LLD reflect the validated intent, or does the LLD itself need updating? An LLD that already captures the invariant makes the EARS edit mechanical; an LLD that does not is a cascade starting point.
  3. Update the EARS. Reword the spec to cite the validated invariants, or add a companion unwanted-behavior EARS where the original is under-specified in a way a single rewrite can't capture.
  4. Update the tests. The updated EARS needs tests that assert it. If the test suite does not currently cover the validated invariant, adding test coverage is the next step, not an afterthought — this is LID's tests-first discipline applied retroactively.
  5. Adjust the code only if needed. If the validated intent matches current behavior, steps 1–4 leave the code untouched. If the validated intent differs (a real bug), the code change comes last, after the EARS and tests are updated to describe and assert the intended behavior.

The default Action in the audit record (reconcile-EARS, reconcile-code, etc.) names which layer the cascade starts with — but the cascade always walks LLD → EARS → Tests → Code in order, not just the named layer.

Unwanted-condition handling

  • Overlay absent → abort with the §Hard precondition message. No sessions, no files.
  • No @spec annotation for a scoped EARS → emit a coverage-gap entry in the summary; do not spawn blind sessions for that EARS.
  • Negative requirement with no production sink (e.g., shall NOT mutate the input) → emit UNANNOTATABLE with a signpost recommending either (a) pair with an unwanted-behavior EARS and a test that asserts the negation — the test carries the @spec, and future audits target the test file — or (b) defer to a sibling absence-audit skill if one exists. Do not force a coherence classification code for such EARS.
  • B-direction reconstruction word-overlap > ~70% with the real EARS → flag as a suspected stripping-rule failure. Surface the spot-check in the audit record rather than silently emitting BD-COHERENT. A false coherent from leaked identifiers is this skill's most dangerous failure mode; the spot-check is the mitigation.

Configuration

Project-level overrides live in CLAUDE.md:

## LID Experimental
bidirectional-differential:
  ambient: false           # disable the Phase-6 ambient hook for this project
  default-runs: 5          # override N=3

Absent keys use skill defaults. --runs=N on the command line overrides both per-run.

Coordination with other LID skills

ConcernOwner
Arrow overlay presence, per-segment arrow docs, index.yamlarrow-maintenance
EARS authoring, @spec annotation placement, phase cascadelinked-intent-dev
Phase 6 ambient trigger surface (this skill emits the prompt; linked-intent-dev sets the phase boundary)bidirectional-differential (this skill)
Audit record files under docs/arrows/_experiments/bidirectional-differential/bidirectional-differential (this skill)
Reconciliation cascade (validate → LLD → EARS → Tests → Code)linked-intent-dev's phase workflow, triggered by the user after reviewing audit records

Subprocess invocation pattern

Blind sessions run via claude -p. The Bash tool invocation pattern:

bash
claude -p --output-format json "<prompt-with-only-EARS-or-only-stripped-code>" < /dev/null

< /dev/null prevents inherited stdin hangs when spawning in parallel. Parse the JSON output for the assistant message body. Run A-direction and B-direction sessions concurrently via multiple background invocations.

Each session is fresh context. Do not pass additional tools, MCP servers, or project files into the subprocess — the audit depends on the session seeing only what was given.

Reference files

  • references/audit-protocol.md — full six-step protocol, stripping rule categories, split-result rule with examples.
  • references/classification-codes.md — decision rules and worked examples for each code; Classification → Action mapping.
  • references/scoping-conversation.md — conversation script: interpreting user descriptions, mapping to arrows, capturing scope and N.
  • references/audit-report-template.md — per-EARS audit-record output template.

Test fixtures (3 baseline, more pending) live in evals/evals.json.

© jszmajda, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in plugins/lid-experimental/skills/bidirectional-differential of jszmajda/lid.

  • SKILL.md
  • evals/evals.json
  • references/audit-protocol.md
  • references/audit-report-template.md
  • references/classification-codes.md
  • references/scoping-conversation.md

Open the folder on GitHubat commit 831c195

Compare with similar skills

Bidirectional Differential next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bidirectional Differential compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bidirectional Differential this skilljszmajda/lid105—~2.9kAutomated safety check: PassMIT
Spec Kitty Charter Doctrinespec-kitty/spec-kitty1.7k—~8.5kAutomated safety check: PassMIT
Provider Healthnyldn/claude-octopus4.2k1 repos~491Automated safety check: PassMIT
Claude APIterrense/LilBot-agent121—~155Automated safety check: PassNone
Darwinian EvolverLuciole-Studio/Misaka-Agent1392 repos~2.1kAutomated safety check: WarnMIT
Reference SDKparcadei/Continuous-Claude-v33.9k2 repos~376Automated safety check: PassMIT

Similar skills

  • Spec Kitty Charter Doctrine

    spec-kitty/spec-kitty

    Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x.

    1.7k GitHub stars~8.5k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Provider Health

    nyldn/claude-octopus

    Starter: one-screen provider health summary — availability, auth method, version drift, and cost posture for every seatable provider

    4.2k GitHub starsUsed in 1 repo~491 tokens
    AI & LLM EngineeringAuto-check passed
  • Claude API

    terrense/LilBot-agent

    Help with Claude/LLM API usage, models, and integration patterns.

    121 GitHub stars~155 tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Darwinian Evolver

    Luciole-Studio/Misaka-Agent

    Evolve prompts/regex/SQL/code with Imbue's evolution loop. An agent skill from Luciole-Studio/Misaka-Agent.

    139 GitHub starsUsed in 2 repos~2.1k tokens
    AI & LLM EngineeringAuto-check: warnings
  • Reference SDK

    parcadei/Continuous-Claude-v3

    Check reference SDK implementations using btca ask. An agent skill from parcadei/Continuous-Claude-v3.

    3.9k GitHub starsUsed in 2 repos~376 tokens
    AI & LLM EngineeringAuto-check passed
  • Token Optimization

    cwinvestments/memstack

    A skill your agent uses when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity.

    423 GitHub stars~1.4k tokensUpdated 12 days ago
    AI & LLM EngineeringAuto-check passed

More from jszmajda/lid

  • Arrow Maintenance

    jszmajda/lid

    Navigation and audit overlay for linked-intent development. An agent skill from jszmajda/lid.

    105 GitHub stars~3.5k tokensUpdated 2 days ago
    Auto-check passed
  • Map Codebase

    jszmajda/lid

    Bootstrap LID in an existing (brownfield) codebase. An agent skill from jszmajda/lid.

    105 GitHub stars~3.4k tokensUpdated 2 days ago
    Auto-check passed
  • Update Lid

    jszmajda/lid

    Configure or reconcile a project for linked-intent development (LID).

    105 GitHub stars~4.2k tokensUpdated 2 days ago
    Auto-check passed
  • Lid Coach

    jszmajda/lid

    Review a project's current linked-intent-development (LID) usage against LID's own principles and produce a prioritized report of recommendations for getting more out of the methodology.

    105 GitHub stars~13k tokensUpdated 2 days ago
    Auto-check passed
  • Linked Intent Dev

    jszmajda/lid

    Guide for linked-intent development (LID). An agent skill from jszmajda/lid.

    105 GitHub stars~5.3k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about Bidirectional Differential

What does Bidirectional Differential do?

Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then…. Bidirectional Differential is an agent skill from jszmajda/lid. Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then classifies the drift between them.

When should I use Bidirectional Differential?

Bidirectional Differential fits situations like: the user invokes /differential-audit; asks to audit EARS-to-code drift for a feature; wants a differential round-trip on a specific spec; reaches Phase 6 code-complete in linked-intent-dev with arrow-maintenance overlay present and a touched-EARS set to consider.

How do I install Bidirectional Differential in Claude Code?

Run `npx skills add jszmajda/lid --skill bidirectional-differential -a claude-code`. Or copy the skill folder (plugins/lid-experimental/skills/bidirectional-differential in jszmajda/lid) into .claude/skills/bidirectional-differential in your project. Claude Code loads it when a task matches its description.

How do I install Bidirectional Differential in Codex?

Run `npx skills add jszmajda/lid --skill bidirectional-differential -a codex`. Or copy the skill folder (plugins/lid-experimental/skills/bidirectional-differential in jszmajda/lid) into .agents/skills/bidirectional-differential in your project. Codex loads it when a task matches its description.

Can I use Bidirectional Differential in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jszmajda/lid --skill bidirectional-differential -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bidirectional-differential, .gemini/skills/bidirectional-differential, .github/skills/bidirectional-differential and .opencode/skills/bidirectional-differential in your project.

What does Bidirectional Differential need to run?

Going by SKILL.md and its folder, Bidirectional Differential needs the command-line tools its instructions call (claude).

Does Bidirectional Differential access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bidirectional Differential safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bidirectional Differential use?

Bidirectional Differential is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bidirectional Differential use?

About 2.9k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.8k tokens, read only when the agent opens those files.

What are the alternatives to Bidirectional Differential?

Skills that share tags, products or a category with Bidirectional Differential: Spec Kitty Charter Doctrine (spec-kitty/spec-kitty, 1.7k stars), Provider Health (nyldn/claude-octopus, 4.2k stars), Claude API (terrense/LilBot-agent, 121 stars) and Darwinian Evolver (Luciole-Studio/Misaka-Agent, 139 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bidirectional Differential?

jszmajda (a GitHub user) maintains it in jszmajda/lid, which has 105 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 6, 2026.

Source: jszmajda/lid on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.