agentleFS
Fadi88Fadi88/one-man-startup/.cursor/rules/skill-twin-check.mdc

one-man-startup / rules

Cursor rule16 starsChanged 2 days agoMITView on GitHub

Guard important business arithmetic with an independent, dependency-free reference implementation checked against the production code's real output. Use for prices, billing, quotas, scores, forecasts - any figure where a wrong answer still looks like an answer.

We split this skill-twin-check.mdc into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Put the twin under tools/twins/, in plain Python with no libraries that do the hard part for it (a twin that calls the same library proves …

    line 16
  2. Distinctive:

    Read constants from the production source rather than retyping them, so a changed constant cannot hide.

    line 18
  3. Distinctive:

    Use it where it pays. Most code does not need a twin.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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-twin-check.mdc
---
description: "Guard important business arithmetic with an independent, dependency-free reference implementation checked against the production code's real output. Use for prices, billing, quotas, scores, forecasts - any figure where a wrong answer still looks like an answer."
alwaysApply: false
---

<!-- Generated by tools/sync_adapters.py from skills/twin-check/SKILL.md. Edit the source, not this file. -->

# Twin check

Some bugs produce a number that is wrong and looks right. Tests written by the same mind that
wrote the code tend to share its mistakes. A twin is a second implementation, written plainly,
in a different form, and compared against the real code on real inputs.

## How

- Put the twin under `tools/twins/`, in plain Python with no libraries that do the hard part for
  it (a twin that calls the same library proves the library works, not your code).
- Read constants from the production source rather than retyping them, so a changed constant
  cannot hide.
- Have the production test suite dump its outputs for a fixed set of inputs, and a check under
  `tools/checks/` compare twin and dump field by field, with a stated tolerance.
- A missing dump is a loud SKIP, never a pass.
- The twin's header lists the cases where a wrong answer would still look plausible, and the
  check covers each.

Use it where it pays. Most code does not need a twin; money and anything the founder makes
decisions from usually does.

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.