inceptyon-labs/tenet-skills/tenet-correctness

Claude Code and agent skill by inceptyon-labs/tenet-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Tenet correctness dimension: finds confirmed logic bugs (off-by-one, inverted conditions, wrong-variable copy-paste, unawaited async, races, null paths) on reachable critical paths.

Install

npx vskill@latest install inceptyon-labs/tenet-skills/tenet-correctness

SKILL.md

The same SKILL.md was published earlier as inceptyon-labs/tenet-skills/tenet-correctness.

Tenet Correctness

Reads the code asking one question the other dimensions never ask: does this actually do what it means to do?

Purpose

The other Tenet dimensions check shape and hygiene — tenet-complexity measures how tangled code is, tenet-errors checks that errors are handled, tenet-solid checks design. None of them read a function and ask whether its logic is correct. This dimension is the code review: it traces real data through the highest-risk code paths and looks for the bugs that ship — off-by-one errors, inverted conditions, the wrong variable used after a copy-paste, an await that's missing so the wrong value returns, a check that runs after the action it was supposed to guard.

Correctness bugs cannot be found by grep, and they cannot be found by skimming. This skill works by selecting a bounded set of high-risk code and reading it deliberately, tracing concrete inputs. A single run does not attempt to read the whole repo — it spends its attention where a bug hurts most. Coverage accumulates across runs: each run records what it reviewed, and the next one spends its budget on code that is new, changed, or not yet read (Step 2).

Two passes reach past the review set, because some bugs cannot be seen one function at a time: the invariant pass (Step 3b) checks every write to a money value or status field against the rules it must obey, and the variant sweep (Step 5b) takes each confirmed bug and looks for the same mistake everywhere else.

What counts as a bug here — read first

A correctness finding is code that, given input or state this system can actually receive, produces a wrong result, a crash, or corrupted data. Every one must be stated as:

"With input X, line N does Y. Y is wrong because Z."

Filled in from the code in front of you, not from a story about what might happen. If you cannot fill it in, there is no finding. Specifically, these are not correctness bugs and must not be reported at any severity, including info:

  • Code that cannot execute: unreferenced functions, branches behind constants, dead flags.
  • Input that an upstream validator, schema, type, or DB constraint already stops.
  • Unusual behavior that the callers, tests, or docstring show is intended.
  • Hypotheticals about future changes, scale the app does not have, or callers that do not exist.
  • Anything you refuted while checking it.

Zero findings is a normal result. Most well-tested functions you read will be correct. The checklist in Step 3 is a set of lenses to read through, not a quota; do not produce one candidate per lens to show you looked. Do not overthink it. Read the function, read its callers, decide. If confirming a candidate requires more than a few minutes of speculation, it is not confirmed. Drop it and move on.

There are two opposite failure modes and both cost the same: skimming (declaring a function fine without tracing an input through it) and inventing (dressing a suspicion up as a bug to have something to report). These protocols guard both:

  • `shared/scan-discipline.md` — grep hygiene, the worklog, read every file in the selected

set, systemic grouping, and §2a "report only issues that actually exist".

  • `shared/entry-points.md` — the entry-point inventory feeds path selection (Step 2).
  • `shared/verification.md` — every bug must be traced to a concrete failing input and

survive a refutation pass before it ships (Step 5). Candidates from the invariant pass (Step 3b), the variant sweep (Step 5b) and the previous run's report get no shortcut.

Language Support Matrix

yaml
support:
native: [typescript, javascript, python]
tree_sitter: [go, rust, java, ruby, swift, kotlin, dart]
heuristic: [php, csharp, cpp, c]
skip: [markdown, css, json, yaml]
note: "This skill reads code in any language. Native means idiom-aware tracing (async/await, Promises, nil handling); others are read carefully but with less idiom awareness."

Toolchain Inputs

FileUsed For
.healthcheck/toolchain/language-census.jsonScope + language mix (required)
.healthcheck/toolchain/semgrep.jsonImport correctness-adjacent rules (e.g. == vs is, unreachable code) if present; set confidence: deterministic
.healthcheck/toolchain/eslint.jsonImport no-unsafe-optional-chaining, no-fallthrough, no-self-compare, require-await, no-constant-condition, etc.

This dimension is primarily read-based — the toolchain is a supplement, not the driver.

Procedure

Step 1: Applicability

If the repo has no application source code (docs/config/assets only), set applicable: false, score: null, and stop. Otherwise proceed.

Step 2: Select the Review Set (bounded — do NOT read everything)

You have limited attention. Spend it where bugs are most likely and most costly. Build the review set from the union of:

  1. Critical paths — anything touching auth, sessions, payments/billing, purchases and

entitlements, money/quantity math, data mutation (writes/deletes/migrations), sync and merge, access control, and permission checks. Find them: ```bash git grep -ciE "password|login|session|token|auth|permission|role|charge|payment|invoice|price|refund|balance|checkout|order|transfer|purchase|entitlement|subscription|receipt|credit|quota|migrat" \ -- '.ts' '.tsx' '.js' '.jsx' '.mjs' '.svelte' '.vue' '.py' '.go' '.rs' '.java' '.kt' '.swift' '.dart' '.rb' '.php' '.cs' \ ':!.test.' ':!.spec.' ':!_test.*' ':!/__tests__/' ':!/test/' ':!/tests/' \

`` Output is file:hits, densest first. These are substring matches (order also hits border), so a file with one or two hits is usually noise; the top of the list is the signal. The keyword list is a starting point, not the definition: add the repo's own domain words (the nouns in its README and schema, plus sync/merge` logic where the app has it) before trusting the result.

  1. Churn hotspots — the source files changed most often are where bugs cluster:

```bash git log --since="6 months ago" --name-only --pretty=format: 2>/dev/null \

grep -E '\.(tstsxjsjsxmjssveltevuepygorsjavaktswiftdartrbphpcs)$' \
grep -vE '(\.test\.\.spec\._test\./__tests__//tests?/)' \
sortuniq -csort -rnhead -30

```

  1. Entry-point handlers — from shared/entry-points.md, the functions that process external

input.

  1. Complex functions — if .healthcheck/reports/complexity.json exists, its high-complexity

functions (branchy code hides logic bugs).

Use what earlier runs already covered. Two files from the previous run may be on disk; read them before they are overwritten:

  • .healthcheck/reports/correctness.json — its unsuppressed findings are carried forward as

candidates. Each one is re-verified in Step 5 against the current code. A finding nobody fixed must not vanish from the report because this run looked elsewhere.

  • .healthcheck/state/correctness-coverage.json — maps each file to the commit it was last

reviewed at. A file is covered when it has not changed since that commit: ```bash mkdir -p .healthcheck/tmp jq -r '.files | to_entries[] | "\(.value) \(.key)"' .healthcheck/state/correctness-coverage.json 2>/dev/null \

if [ -f "$f" ] && git diff --quiet "$sha" -- "$f" 2>/dev/null; then echo "$f"; fi done > .healthcheck/tmp/correctness-covered.txt ``` No coverage file, or a commit git no longer knows, means not covered.

Fill the budget in this order, cutting from the bottom when it runs out:

  1. Critical-path units that are not covered (never reviewed, or changed since).
  2. Entry-point handlers that are not covered.
  3. Churn hotspots and high-complexity functions that are not covered.
  4. Any other source file that is not covered, largest first. This tier is what walks the rest of

the repo over successive runs.

  1. Covered critical-path units, oldest review first, only if budget remains.

For a unit that changed since its last review, also read its callers: a change that is correct in isolation can break an assumption a caller still holds (Step 4).

Cap the set to a reviewable size (roughly 25–40 functions/files for a normal run; scale with repo size). Record in `notes` exactly which files/paths were reviewed and which were not — a single run does not claim whole-repo coverage, so state the scope honestly. When tiers 1–4 are empty, every source file has been reviewed at its current content: say so in notes.

Step 3: Read Each Selected Unit Deliberately

For every function in the review set, actually read it, trace one realistic input through it, and read it through the lenses below. Append candidates to .healthcheck/tmp/correctness-worklog.md as you find them, each with its one-sentence "input X → line N does Y → wrong because Z". A function that passes every lens gets a one-line "read, OK" entry in the worklog and nothing else.

a. Trace one concrete input end-to-end. Pick a realistic input (and an empty one, and a boundary one) and mentally execute the function. Does the returned/written value match the function's stated intent (name, doc, caller expectation)?

b. Boundary & off-by-one. Empty collection, single element, max/last index, zero, negative, exactly-at-limit. Look for <= where < is meant (and vice versa), length vs length - 1, slice/substring bounds, pagination offsets, inclusive/exclusive range mismatches.

c. Inverted / wrong conditions. if (!user) vs if (user), && where || is meant, negation errors, a guard that returns/throws on the valid case, De Morgan mistakes, an early return that fires on the wrong branch.

d. Wrong variable / copy-paste. After a duplicated block, is the second copy still using the first block's variable (a.x used where b.x was meant)? Loop body referencing the wrong index or the outer loop's variable. Same value assigned to two fields.

e. Async ordering & missing await. A missing await so a Promise (not its value) is used, returned, or truthiness-checked. Work done after the response is sent. await inside a loop that should be parallel, or Promise.all where order matters. forEach with an async callback (fires and forgets). Return value read before the async write completes.

f. Race conditions & TOCTOU. Check-then-act on shared/persistent state (check balance → charge; check exists → create) with no transaction/lock/atomic op — two concurrent calls double-spend or double-create. Non-atomic read-modify-write on a counter.

g. Null / undefined / optional paths. A value that can be null/undefined/absent used without a guard; optional chaining that short-circuits to undefined then flows into math or a required arg; a default that masks a real missing value; JSON.parse of possibly-empty input.

h. Type coercion & comparison. JS == surprises, NaN comparisons, 0/""/false falsy-collision in a truthiness check that should be an explicit === undefined, Python is vs ==, integer division truncation, float money math (should be integer cents/decimal).

i. Error handling that changes the result. A catch that returns a default the caller can't distinguish from success (see tenet-errors, but here focus on correctness impact: does swallowing produce a wrong answer silently?).

j. State & mutation bugs. Mutating a shared/default argument, mutating an array while iterating it, a cache never invalidated, a memoization key that misses an input, stale closure capturing an old value.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/inceptyon-labs/tenet-skills/tenet-correctness/badge)](https://verified-skill.com/skills/inceptyon-labs/tenet-skills/tenet-correctness)

Something wrong with this skill or its page? Tell us.