Skip to content
Back to skills

claude-reasoning

ASecurity

Use when a question is open-ended, has competing approaches, involves architecture or debugging trade-offs, or follows repeated failed fixes. Structurally adaptive reasoning (Path A closed-form, Path B open-ended) with claim-gated verification and dual-source enforcement. Zero MCP dependencies.

  • 2 stars
  • 0 votes
  • 1 copy
  • 21 views
  • Added September 5, 2026
ai-agentstypescriptgoshellbashnodeawstestingdebugginggitbackend

Works with

  • terminal
  • cli
  • mcp

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add okokjai/claude-reasoning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of claude-reasoning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for claude-reasoning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/okokjai-claude-reasoning/badge)](https://www.skillsdirectory.com/skills/okokjai-claude-reasoning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: claude-reasoning
version: 3.3.4
description: "Use when a question is open-ended, has competing approaches, involves architecture or debugging trade-offs, or follows repeated failed fixes. Structurally adaptive reasoning (Path A closed-form, Path B open-ended) with claim-gated verification and dual-source enforcement. Zero MCP dependencies."
---

# claude-reasoning 3.3.4

Reasoning cost is allocated by **problem structure**, not by fixed frameworks or keyword routing.

State machine: `scripts/think.ts` (TypeScript, runs on `bun` or `npx tsx`). Persistent state: `scripts/.think_state.json`. No MCP server required.

---

## Step -2: Calibrate clock

Before the first thought, run `bun scripts/think.ts --status`. Its output carries
`today` — the script's local calendar date as `YYYY-MM-DD`. That value is the **only**
date source for this session: every freshness judgement (Gate 3's six-month
window, `--claimDate` comparisons, the card's "as of" line) references it, never
a date inferred from search results, a source page, or memory. When a query needs
recency, carry the current month; when the window returns nothing, report
"no result in window" rather than substituting an older date.

---

## Step -1: Load Contract (Path B)

Load these before the first Path B thought — the state machine cannot check that
they were read, so this is the one ordering the model must enforce on itself:

| Read | Before |
|---|---|
| `references/critical-lenses.md` | choosing `--recordLens` names |
| `references/source-tiers.md` | any `--claimStatus verified` |
| `references/hallucination-gates.md` | the termination audit (gates 6–11) |
| `references/conclusion-card.md` | writing the final delivery |

Reading them late (or not at all) is the failure this checklist exists to prevent:
the references are cited throughout the Path B steps below, and by the time the
step that needs one is reached the context has usually been diluted by other work.

---

## Step 0: Structural Classifier

Classify by **the structure of the question**, never by topic keywords (finance / tech / career / health). Keyword routing misclassifies — decide by asking: *is there a unique objectively verifiable answer within bounded rules?*

| Structure | Route | Signal |
|---|---|---|
| **Closed-form** | Path A | Unique verifiable answer; bounded rules; derivation or enumeration settles it |
| **Open-ended** | Path B | Requires judgment, trade-offs, design, critique, or real-world facts |

Announce the classification in Thought 1 so the routing is inspectable. Pass it as `--mode path-a` or `--mode path-b` on the first thought; the state machine rejects a first thought without `--mode`, and the mode is immutable for the rest of the session (changing it requires `--reset`).

---

## Path A: Closed-Form Lean Verification

**3–5 thoughts. Never pad to fill a framework.**

1. **Thought 1** — Restate the problem. Surface hidden or ambiguous definitions, boundary conditions, and the trap the question is actually testing.
2. **Thought 2** — Execute the primary derivation.
3. **Thought 3** — **Independently cross-validate with a different method**: reverse deduction, extreme-value substitution, set/complement enumeration, or brute-force state space.
4. **Thoughts 4–5** — Only when Steps 2 and 3 disagree. Resolve the conflict, then terminate immediately.

**Prohibited in Path A**: `--registerClaim`, `--verifyClaim`, `--registerHypothesis`, `--resolveHypothesis`, `--addCriterion`, `--checkCriterion`, `--recordLens`, `--analyze`, `--kind`, any external search, depth expansion beyond 5. All eight side-commands (`--registerClaim`, `--verifyClaim`, `--registerHypothesis`, `--resolveHypothesis`, `--addCriterion`, `--checkCriterion`, `--recordLens`, `--analyze`) are rejected with a Path A error — criteria (`--addCriterion`/`--checkCriterion`), lens records (`--recordLens`), and computed lens analyses (`--analyze`) are Path B constructs.

Terminate as soon as the two independent methods agree: `--nextThoughtNeeded false`.

Rationale, measured: closed-form logic questions that were run through a fixed 11-node framework produced 6 of 6 trail entries with zero captured insight. Depth must be earned by disagreement, not scheduled.

---

## Path B: Open-Ended Adaptive Reasoning

**No fixed round count. Converge when a round yields no new insight.**

Do not send the first Path B thought until the four reference files in **Step -1** are read.

1. **Decompose** — Split into essential sub-questions. Discard sub-questions that cannot change the decision.
2. **Competing hypotheses** — For each load-bearing sub-question, state **≥ 2 mutually competing** hypotheses or options. A single option is not reasoning. Register each via `--registerHypothesis "<statement>" --falsification "<condition>"` (both flags required) and resolve each before terminating (`selected`, `rejected`, `synthesized`, or `merged`). Path B termination is rejected while fewer than 2 hypotheses are registered, any remains `pending`, merges leave fewer than 2 distinct surviving hypotheses, or **every resolved hypothesis is `rejected`** — at least one must be `selected` or `synthesized` to conclude. Terminal resolutions (`selected`/`rejected`/`synthesized`) **require `--hypothesisNotes <why>` and `--falsificationResult "<evidence/outcome>"`** (concrete description of whether the falsification condition held or broke). Use `merged` (with `--mergedInto…
3. **Critical lenses** — Choose **2–4** that the task actually needs from `references/critical-lenses.md` (the full 11-lens catalog is also printed by `--listLenses`); record via `--recordLens --lens "<name>" --finding "<residual uncertainty>"`. Path B termination blocks with fewer than 2 distinct lens names recorded (Gate 8). When the first thought declares `--kind <kind>` (one of `diagnostic`, `decision`, `design`, `optimization`, `innovation`, `planning`), `pending`/`next` guidance names that kind's core lenses until they are covered; computed lenses (`sensitivity`, `pareto`, `ach`) may also be produced deterministically via `--analyze <kind> --data '<json>'`:
   - **First Principles & Constraint Reduction** (lens-1) — reduce to irreducible constraints.
   - **Pre-Mortem & Active Red Team** (lens-2) — assume catastrophic failure 12 months out; identify what killed it.
   - **Contrarian & Worst-Option Defense** (lens-3) — argue the strongest case for the initially worst-ranked option.
   - **Reversal & Assumption Inversion** (lens-4) — invert the central load-bearing assumption.
   - **Scale & Boundary Stress** (lens-5, 0.01× / 100×) — evaluate non-linear cliffs at degenerate extremes.
   - **Sensitivity Analysis** (lens-6, ±20% perturbation, `computed` via `--analyze sensitivity`) — perturb key numerical or capacity assumptions; check if rankings flip.
   - **Pareto Frontier** (lens-7, `computed` via `--analyze pareto`) — make sacrifice explicit; identify non-dominated options.
   - **Differential Elimination / ACH** (lens-8, `computed` via `--analyze ach`) — systematically rule out hypotheses contradicted by verified facts.
   - **Second-Order & Incentive Effects** (lens-9) — downstream behaviors and perverse incentives once a choice is active.
   - **Reversibility & One-Way Doors** (lens-10) — Type 1 vs Type 2 classification and unwind cost.
   - **Blast Radius & Degraded Mode** (lens-11) — failure containment when dependencies crash.
   - **External verification** — **condition-gated, see below.**
4. **Acceptance criteria** — Add target requirements via `--addCriterion "<text>"`. Check them as met or unmet via `--checkCriterion crit-N --met true|false [--criterionNotes "..."]`. Gate 6 blocks termination with no criterion registered or any unchecked criterion; Gate 7 blocks termination with an unmet criterion unless followed by a revision thought or explicit `--newInsightNotes` justification.
5. **Anti-Hallucination Semantic Gates** — Before concluding, audit findings against the 5 P0 gates in `references/hallucination-gates.md`:
   - Entity & metric grounding (no unsourced prices or numbers).
   - Dual-source independence (no syndicated echo-chambers).
   - Temporal currency (verify version and recency).
   - **Negative search & disconfirmation** (actively query for counter-evidence via `--negativeQuery` and `--negativeFinding`).
   - Honest tool absence reporting.
6. **Standardized Conclusion Card** — Output final delivery using the calibrated structure from `references/conclusion-card.md` with explicit tags (`[Confirmed]`, `[Probable]`, `[Plausible]`, `[Contested]`, `[Unverified]`), qualitative confidence, and residual uncertainty. Never emit numeric scores. The card **must contain the Reasoning Trace**: after terminating, run `--export` and paste its `## Reasoning Trace` tables (hypotheses, lenses, criteria) verbatim — do not summarize them away. Session termination auto-emits the `buildLintReport` card summary.

---

## External Verification Contract

### Trigger (must be true, all of it)
- The task is **Path B** — never Path A.
- The argument depends on a **real-world factual claim**: a price, a statistic, a company fact, a release date, a support-matrix entry, or "does X still hold".
- The claim is **load-bearing**: if it flipped, the conclusion would change.

If the open-ended sub-questions are purely internal (design taste, team fit, architectural preference), the module **must not fire**.

### Protocol

1. **Pre-register before searching.**
   ```bash
   bun scripts/think.ts --registerClaim "AWS Bedrock supports prompt caching for Claude <model>" --supports hyp-1
   ```
   `--supports <hyp-id>` links the claim to the hypothesis it bears on; registering without it (or naming a nonexistent hypothesis) exits 1. Registration happens *before* any search call. Formulating a claim after seeing results is post-hoc rationalization and is prohibited by this contract.

   **Quoting:** any `--thought`, `--registerClaim`, `--claimNotes`, or `--hypothesisNotes` value containing `$`, a backtick, or `\` must use **single quotes** (`'...'`). Inside double quotes, bash silently expands `$<digit>` as a positional parameter — `$53K` arrives as `3K` with no warning and no error. Values without those characters may keep double quotes, as in the examples below.

   **Leading dash:** a value that starts with `-` must be bound with `=`. `--thought "--reset wipes state"` is rejected with `Option '--thought' argument is ambiguous` (exit 1); `--thought="--reset wipes state"` is accepted. The same applies to every string flag.

2. **Probe the session's real capabilities.**
   Use only search/fetch tools that are actually present in the current environment — whatever the session's native web search, URL fetch, browser, or installed MCP fetch tool happens to be (names differ per runtime; probe, don't assume). If none is available:
   ```bash
   bun scripts/think.ts --verifyClaim claim-1 --claimStatus unverified --claimNotes "No search or fetch tool available in this session"
   ```
   Never emit a search call that cannot run, and never describe a source you did not retrieve.

   If every available provider fails on the same query, switch to a different retrieval tool in the session (a second search backend, an MCP fetch/search tool, or a browser). Do not retry the same tool with rephrased queries — a full-provider failure is a tool problem, not a phrasing problem.

3. **Dual independent sources & Source Tiers.**
   - Consult `references/source-tiers.md` to classify sources into Tier 1 (primary/official), Tier 2 (reputable media/papers), Tier 3 (community blogs), or Tier 4 (disallowed AI summaries/farms).
   - `verified` — requires **≥ 2 independent sources** from Tier 1 or Tier 2 (different root domains, not syndicated), plus a `--claimTier <1-4>` per `--claimSource` classifying it against `references/source-tiers.md`, plus the evidence trio: a verbatim `--claimQuote`, the `--negativeQuery` you ran against the claim, and its `--negativeFinding`. The state machine rejects `verified` with fewer than 2 `--claimSource` values, with sources sharing the same root domain, with fewer than 2 sources at Tier 1/2 (multiple Tier 3/4 sources cannot elevate a claim), when `--claimTier` is missing, out of 1-4, or not one-per-`--claimSource`, or with any trio field missing.
     ```bash
     bun scripts/think.ts --verifyClaim claim-1 --claimStatus verified \
       --claimSource "https://docs.aws.amazon.com/bedrock/..." \
       --claimSource "https://docs.anthropic.com/en/docs/..." \
       --claimTier 1 --claimTier 1 \
       --claimQuote "Prompt caching is available on Amazon Bedrock" \
       --negativeQuery "bedrock prompt caching unsupported" \
       --negativeFinding "None found; docs confirm support."
     ```
   - `single_source` — exactly one reliable source. Must be carried into the final answer with its uncertainty intact. `--claimNotes` is **required** for `single_source`, `unverified`, and `not_found` — the state machine rejects negative resolutions without a recorded caveat.
     ```bash
     bun scripts/think.ts --verifyClaim claim-2 --claimStatus single_source \
       --claimSource "https://example.com/blog/..." --claimNotes "Only one third-party blog; no official confirmation"
     ```

   **`verified` is self-attested.** `think.ts` never fetches a source. It enforces source *count*, root-domain independence, and the caller-declared `--claimTier` (a Tier 1/2 floor) and nothing else — whether a URL actually supports the claim it is attached to is the model's assertion, unverifiable from state.

   **Coverage is not a gate.** The script enforces the resolution of *registered* claims; it cannot know which load-bearing propositions *should* have been registered. A surviving hypothesis with no linked claim is reported as `link-status: No external coverage` and listed `[Uncovered]` in the lint card's Blind Spots — but termination still succeeds. To close the gap deliberately: give every surviving hypothesis at least one supporting claim, **or** mark its `--hypothesisNotes` with the token `[INFERENCE]` when the conclusion rests on reasoning rather than retrieval. A marked hypothesis is reported as `[Inference]` instead of `[Uncovered]`. Either way the omission leaves a machine-readable trace; an unmarked, uncovered hypothesis is the exact signature of a confidently-asserted-but-unretrieved claim.

4. **Negative Search Query (Active Falsification).**
   Before confirming a major factual proposition, perform at least one search query targeting counter-evidence or known failure modes (e.g. `"<subject> limitations known bugs issue"`). Record any discovered caveats.

5. **A negative result is a legitimate result.**
   `not_found` and `unverified` are successful verification outcomes. Report them as such. Never trade a precise "could not verify" for vague authoritative-sounding prose.
   ```bash
   bun scripts/think.ts --verifyClaim claim-3 --claimStatus not_found --claimNotes "Queried 3 phrasings; no public record"
   ```

6. **Termination is gated.**
   `--nextThoughtNeeded false` fails while any claim is still `pending`. Every pre-registered claim must reach an explicit resolution before the session can close. In Path B, termination additionally requires **≥ 2 prior thoughts** (at least one decompose and one synthesis round) and is rejected if the immediately preceding thought set `--needsMoreThoughts` — you cannot flag depth expansion and then conclude without another round.

   **Coverage caveat.** Termination gates track *registered* claims only. Registering a weak but verifiable claim is not a substitute for covering the hypothesis's actual load-bearing proposition — the script cannot check relevance (`--supports` validates only that the target hypothesis exists). Zero-claim Path B sessions terminate successfully; they are reported as unverified coverage, not blocked.

   ### Termination gates 6–11 (Path B)

   | # | Gate name | Blocks termination while… |
   |---|---|---|
   | 6 | `criteria` | no `--addCriterion` entry exists, or any criterion is unchecked |
   | 7 | `criteriaRevision` | a criterion is `met=false` with no later `--isRevision` thought and the terminating thought carries no `--newInsightNotes` |
   | 8 | `lenses` | fewer than 2 distinct `--lens` names recorded via `--recordLens` |
   | 9 | `convergence` | the terminating thought does not declare `--newInsight false` **with a non-empty `--newInsightNotes`** and history has no revision/branch |
   | 10 | `falsificationResult` | any resolved (non-`merged`) hypothesis lacks a non-empty `--falsificationResult` |
   | 11 | `branchClosure` | a branch was opened but no non-branch thought followed it before termination |

   These six gates are switchable for evaluation ablation: `THINK_GATES_OFF` accepts a comma-separated list of gate names or `all`. A disabled gate's would-be violation is recorded and surfaced as a `[WARN]` line in the lint report instead of failing. The earlier gates (pending claims/hypotheses, minimum thought count, `--needsMoreThoughts`) are always on and cannot be disabled.

---

## CLI Reference

```bash
# Start a session (run before every new task)
bun scripts/think.ts --reset

# Submit a thought (--mode required on the first thought of a session;
# --kind <kind> optional on the first Path B thought only, immutable thereafter)
bun scripts/think.ts \
  --mode path-b \
  --kind decision \
  --thought "analysis for this step" \
  --thoughtNumber 1 --totalThoughts 5 --nextThoughtNeeded true

# Print the 11-lens catalog (optionally ordered so a kind's core lenses come first)
bun scripts/think.ts --listLenses [--kind decision]

# Revise an earlier thought (original is retained)
bun scripts/think.ts --thought "corrected analysis" \
  --thoughtNumber 3 --totalThoughts 5 --nextThoughtNeeded true \
  --isRevision --revisesThought 1

# Branch into an alternative line
bun scripts/think.ts --thought "alternative path" \
  --thoughtNumber 4 --totalThoughts 7 --nextThoughtNeeded true \
  --branchFromThought 2 --branchId alt-approach

# Expand depth beyond the original estimate
bun scripts/think.ts --thought "scope is larger than estimated" \
  --thoughtNumber 6 --totalThoughts 8 --nextThoughtNeeded true --needsMoreThoughts

# Hypothesis lifecycle (Path B)
bun scripts/think.ts --registerHypothesis "<competing option or hypothesis>" --falsification "<condition that would falsify it>"
bun scripts/think.ts --resolveHypothesis hyp-1 --hypothesisStatus selected \
  --hypothesisNotes "wins on latency and ops cost" \
  --falsificationResult "survived: no lag evidence found" \
  --flipIf "Bedrock matches feature parity within one release cycle"

# Acceptance criteria and lenses (termination gates 6-8; convergence 9-11 checked at the end)
bun scripts/think.ts --addCriterion "<target requirement>"
bun scripts/think.ts --checkCriterion crit-1 --met true --criterionNotes "backed by two sources"
bun scripts/think.ts --recordLens --lens "<lens name>" --finding "<residual uncertainty>"

# Computed lenses (deterministic; persist as computed lens findings)
bun scripts/think.ts --analyze sensitivity --data '{"candidates":[...],"criteria":[...]}'
bun scripts/think.ts --analyze pareto      --data '{"candidates":[...],"objectives":[...]}'
bun scripts/think.ts --analyze ach         --data '{"hypotheses":[...],"evidence":[...]}'

# Claim lifecycle — --supports links each claim to a hypothesis
bun scripts/think.ts --registerClaim "<pre-registered factual statement>" --supports hyp-1
bun scripts/think.ts --verifyClaim claim-1 --claimStatus verified \
  --claimSource "https://a.example" --claimSource "https://b.example" \
  --claimTier 1 --claimTier 1 \
  --claimQuote "<verbatim quote>" --negativeQuery "<counter-evidence query>" \
  --negativeFinding "<counter-evidence result>"

bun scripts/think.ts --verifyClaim claim-2 --claimStatus single_source \
  --claimSource "https://c.example" --claimNotes "only one source"
bun scripts/think.ts --verifyClaim claim-3 --claimStatus not_found --claimNotes "no public record"
bun scripts/think.ts --verifyClaim claim-4 --claimStatus unverified --claimNotes "no search tool in session"

# Converge and terminate (gate 9: --newInsight false + non-empty --newInsightNotes)
bun scripts/think.ts --thought "<synthesis>" --thoughtNumber 5 --totalThoughts 5 \
  --nextThoughtNeeded false --newInsight false --newInsightNotes "<why exploration is complete>"
# Ablation: disable gates 6-11 for evaluation runs
# THINK_GATES_OFF=criteria,lenses  or  THINK_GATES_OFF=all

# Inspect full state (thoughts, branches, claims)
bun scripts/think.ts --status
```

Status line returned after each thought:

```
[3/7] history=3 mode=path-b branches=alt-approach claims=claim-1,claim-2 next=true ready=no blockers=4 today=<YYYY-MM-DD>
```

`ready=<yes|no>` reports whether every termination prerequisite is currently met; `blockers=<n>` counts the pending items; `today=<YYYY-MM-DD>` echoes the session's calibrated clock date (Step -2). Side-command JSON carries the same guidance as `next: string[]`, and `--status` JSON as `pending: string[]`.

### Flag reference

| Flag | Type | Notes |
|---|---|---|
| `--mode` | enum | `path-a` \| `path-b` — **required on the first thought**; immutable for the session |
| `--kind` | enum | `diagnostic` \| `decision` \| `design` \| `optimization` \| `innovation` \| `planning` — optional on the **first Path B thought only**; immutable thereafter; Path A rejects it. Drives `pending`/`next` guidance for that kind's core lenses |
| `--thought` | string | Thought content; a value starting with `-` needs `--thought=<value>`. **Standalone**: cannot be combined with any side-command (`--recordLens`, `--resolveHypothesis`, `--status`, …) — the thought would be silently discarded, so the combination exits 1 |
| `--thoughtNumber` | int ≥ 1 | Current index; non-revisions must exceed every prior non-revision number (no repeats, no going backwards). A `--isRevision` thought may reuse the number it revises, and may carry any number — its position is `historyIndex`, not `thoughtNumber`; the next non-revision still has to exceed every prior non-revision |
| `--totalThoughts` | int ≥ 1 | Estimate; auto-raised when `thoughtNumber` exceeds it (emits a `totalThoughts adjusted N->M` notice on stderr) |
| `--nextThoughtNeeded` | `true`\|`false` | `false` terminates — blocked while claims are pending or termination gates fail; any other value (e.g. `ture`, `yes`) exits 1 |
| `--isRevision` | flag | Marks this thought as a revision; requires `--revisesThought` |
| `--revisesThought` | int | Target thought index to revise; **requires `--isRevision`**; must exist in history |
| `--branchFromThought` | int | Target thought index to branch from; requires `--branchId`; must exist in history |
| `--branchId` | string | Branch label; **requires `--branchFromThought`** |
| `--needsMoreThoughts` | flag | Signals depth expansion |
| `--newInsight` | `true`\|`false` | Path B convergence gate 9: declaring `false` **requires a non-empty `--newInsightNotes`** — together they declare convergence, unless history already contains a revision or a branch (then `--newInsightNotes` is optional) |
| `--newInsightNotes` | string | Rationale for convergence or absence of new insight |
| `--registerHypothesis` | string | Registers a competing hypothesis; assigns `hyp-N`, status `pending`; **requires `--falsification`** |
| `--falsification` | string | Concrete condition that would falsify the hypothesis; **requires `--registerHypothesis`** |
| `--resolveHypothesis` | string | Target hypothesis id |
| `--hypothesisStatus` | enum | `pending` \| `selected` \| `rejected` \| `synthesized` \| `merged`; **requires `--resolveHypothesis`** |
| `--hypothesisNotes` | string | Rationale recorded on the hypothesis; **requires `--resolveHypothesis`**; **required** for terminal resolutions (`selected`/`rejected`/`synthesized`) and `merged` |
| `--falsificationResult` | string | Outcome of the falsification test — convention: prefix `survived:` or `falsified:` (contradictions like `selected` + `falsified:` or `rejected` + `survived:` without `[PREFERENCE]` in notes surface as lint WARNs); **requires `--resolveHypothesis`**; **required** for terminal resolutions (`selected`/`rejected`/`synthesized`); **rejected** on `merged` — a merge is documented by `--mergedInto` alone, and a stale value is cleared when a resolved node is re-resolved to `merged` |
| `--flipIf` | string | Observable condition that would overturn a `selected`/`synthesized` hypothesis; **requires `--resolveHypothesis`**; a missing value on a surviving hypothesis emits a lint WARN asking what evidence would overturn the choice |
| `--addCriterion` | string | Registers an acceptance criterion for the session (assigns `crit-N`) |
| `--checkCriterion` | string | Criterion id to mark |
| `--met` | `true`\|`false` | Mark criterion as met or unmet; **requires `--checkCriterion`** |
| `--criterionNotes` | string | Context/notes for the criterion check; **requires `--checkCriterion`** |
| `--recordLens` | flag | Records a critical evaluation lens; requires `--lens` and `--finding` |
| `--listLenses` | flag | Prints the 11-entry `LENS_CATALOG` as JSON (`id`, `name`, `type`, `kinds`, `requiredArtifact`); with `--kind <kind>` the kind's core lenses sort first. Must run alone |
| `--analyze` | enum | `sensitivity` \| `pareto` \| `ach` — computes a deterministic lens analysis from `--data` JSON and records it as a `computed` lens finding (`analyze:<kind>`); **requires `--data`**; Path B only |
| `--data` | string | JSON input payload for `--analyze`: `sensitivity` takes `{candidates:[{id,scores}],criteria:[{name,weight,direction}]}`, `pareto` takes `{candidates:[{id,metrics}],objectives:[{name,direction}]}`, `ach` takes `{hypotheses:[{id}],evidence:[{id,matrix:{hypId:"C"|"I"|"N"}}]}`; **requires `--analyze`** |
| `--lens` | string | Lens name (e.g. `pre-mortem`, `devil's advocate`); **requires `--recordLens`** |
| `--finding` | string | Key finding/residual uncertainty from applying the lens; **requires `--recordLens`** |
| `--registerClaim` | string | Pre-registration; assigns `claim-N`, status `pending`; **requires `--supports <hyp-id>`** in Path B |
| `--supports` | string | Target hypothesis id this claim provides evidence for; **requires `--registerClaim`** (required on registration in Path B) |
| `--polarity` | `supports`\|`refutes` | Optional on `--registerClaim`; specifies bearing on the linked hypothesis (default `supports`) |
| `--claimStatus` | enum | `pending` \| `verified` \| `single_source` \| `unverified` \| `not_found`; **requires `--verifyClaim`** — `verified` claims are final; re-verification to any other status is rejected |
| `--claimSource` | string, repeatable | **Requires `--verifyClaim`**; ≥ 2 from distinct root domains (eTLD+1) required **only** for `verified`; IP literals compare by full address; loopback/reserved hosts (`localhost`, `*.localhost`, `127.x.x.x`, `::1`, `*.invalid`, `*.test`) collapse to one origin and can never satisfy the 2-domain rule; a trailing root dot is normalised (`example.com.` = `example.com`); each value must be an http(s) URL or a bare `host/path` that names a domain (a `file:///`/`data:`/`foo/file`/single-label value is rejected); recorded `sources` are kept on a `pending` re-verify unless new ones are supplied |
| `--claimTier` | int 1-4, repeatable | **Requires `--verifyClaim`**; **required** for `verified`, one per `--claimSource` in the same order: the i-th tier classifies the i-th source against `references/source-tiers.md`. `verified` needs ≥ 2 sources at Tier 1/2 (multiple Tier 3/4 sources cannot elevate a claim). Optional for `single_source` / `unverified` / `not_found`, but whenever supplied it must be a canonical integer `1`–`4` (digits only — `1e0`/`0x1`/`+1`/`01` rejected) and one per `--claimSource` — a malformed vector exits 1 rather than being persisted; on a `pending` re-verify the recorded tiers are cleared |
| `--claimQuote` | string | Verbatim quote from source (required for `verified`); **requires `--verifyClaim`**; cleared on a `pending` re-verify |
| `--negativeQuery` | string | Search query targeting counter-evidence (required for `verified`); **requires `--verifyClaim`**; cleared on a `pending` re-verify |
| `--negativeFinding` | string | Caveats/contradictions found or statement of none (required for `verified`); **requires `--verifyClaim`**; cleared on a `pending` re-verify. Record it as two lines — `--negativeFinding "<command>\n<output>"` — so the search is auditable; the lint report flags single-line values, but only checks for the newline, it cannot verify a command ran |
| `--claimNotes` | string | **Requires `--verifyClaim`**; **required** for `single_source` / `unverified` / `not_found`; optional for `verified`; cleared on a `pending` re-verify |
| `--claimDate` | string, repeatable | **Requires `--verifyClaim`**; one per `--claimSource` in the same order: the i-th date is the i-th source's publish date as `YYYY-MM-DD` (digits-only ISO; a value after `today` exits 1; count must match `--claimSource`, else exit 1). Recorded as `claimDates[]`. The lint report warns when a `verified` claim's newest source is older than 180 days, and notes when dates were never recorded |
| `--status` | flag | Full JSON state. Must run alone — combining with any other operation exits 1 |
| `--export` | flag | Prints a **lint report / fact sheet** (`buildLintReport`) derived from persisted state (CRIT/WARN/INFO sections, residuals, trace shape, evidence). Must run alone. Also auto-emitted after status line on termination |
| `--reset` | flag | Clears state for a new session; **must run alone** — combined with any other flag it exits 1 |
| `--help` | flag | Prints CLI usage summary and exits 0 |

**Verification-only flags require `--verifyClaim`.** `--claimStatus`, `--claimSource`, `--claimTier`, `--claimDate`, `--claimQuote`, `--negativeQuery`, `--negativeFinding`, and `--claimNotes` only have meaning inside the claim-verification branch; supplying any of them without `--verifyClaim` exits 1 rather than being parsed and ignored.

---

## Ground Rules

1. **No pseudo-quantitative scoring.** Never "confidence 8/10", "severity 3/3", "score 11/15". Numbers of that kind impersonate evidence. State the concrete fact or the concrete doubt in prose.
2. **No keyword/domain routing.** Classification is structural. A pure logic puzzle is Path A regardless of whether it mentions money or careers.
3. **No fixed framework quota.** Path A stops at agreement; Path B stops at the first round without new insight.
4. **No fabricated capabilities.** Use only tools demonstrably present in the session. A missing tool is reported, not simulated.
5. **No unbacked claims in documentation.** This skill's docs describe what `think.ts` and the tests actually do. They are not benchmarked or eval-scored.
6. **Dates come from the script.** The only "today" is the `today` field emitted by `--status` / `--reset` (local calendar date). Never date a claim from a page's last-modified stamp, a search snippet, or memory; source publication dates are passed explicitly as `--claimDate`. A missing date is reported as missing, not guessed.


---

## Examples

- `references/example-path-a.md` — closed-form kinship trap, 3 thoughts, zero claims.
- `references/example-path-b-verify.md` — open-ended architecture decision with pre-registration and mixed verification outcomes.

## State file

`scripts/.think_state.json` — append-only `thoughtHistory`, `branches` keyed by branch id, `claims` keyed by claim id, and `auditTrail` recording every side-command (`registerClaim`, `verifyClaim`, `registerHypothesis`, `resolveHypothesis`, `addCriterion`, `checkCriterion`, `recordLens`, `analyze`) in invocation order. Survives across invocations; `--reset` clears it. `--status` exposes `auditTrail` alongside `fullHistory`, `branchDetails`, `claimDetails`, and `hypothesisDetails`.

**Schema `v3`.** `ThoughtData` carries `historyIndex` — the 1-based position of the thought in the *timeline*, which is distinct from the caller-supplied `thoughtNumber` (revisions re-enter the history without renumbering it, so the two diverge). `AcceptanceCriterion` carries `checkedAtHistoryIndex`, the timeline position at which it was last checked. Any state file whose `schemaVersion` differs from the current `SCHEMA_VERSION` (v1 or v2) is migrated automatically on load and written back in the current form; the version is stored in the file as `schemaVersion`.

Two guards protect the file itself:

- **Terminated sessions are immutable.** Once a thought is recorded with `--nextThoughtNeeded false`, any further thought submission or side-command (`--registerClaim`, `--verifyClaim`, `--registerHypothesis`, `--resolveHypothesis`) exits 1 — restart with `--reset`. The machine cannot be driven past its own conclusion.
- **Corrupt state is never silently swallowed.** If the file is not valid JSON, the machine warns on stderr, renames it to `scripts/.think_state.json.bak` (forensics, best-effort) and starts a fresh session — the same contract as "no state file".

### Command Chaining

To minimize CLI roundtrips, multiple `think.ts` commands can be chained using `&&` in a single shell execution. Execution stops immediately if any command in the chain fails:

```sh
bun scripts/think.ts --registerHypothesis "Hypothesis A" --falsification "breaks if X" && \
bun scripts/think.ts --registerHypothesis "Hypothesis B" --falsification "breaks if Y" && \
bun scripts/think.ts --addCriterion "Latency under 50ms"
```

*(Note: Chaining examples use ````sh```` code blocks to preserve replay test assertions that validate ````bash```` command counts against recorded traces).*

One path, shared by everything: the state file lives at one fixed location next to the script — it is not per-task or per-session. Concurrent reasoning tasks (or two sessions working in the same checkout) interleave into the same file, so `--reset` before each new task. `THINK_STATE_FILE` overrides the path when a session needs isolation; `THINK_LOCK_STALE_MS` (default `30000`) and `THINK_LOCK_WAIT_MS` (default `40000`, must exceed `THINK_LOCK_STALE_MS`) override the state-lock stale and wait timeouts.

Files in this skill

  • CHANGELOG.md12.7 KB
  • SKILL.md8 KB
  • agents.md4.3 KB
  • architecture.md8.7 KB
  • config.yaml2.1 KB
  • contracts/A0.md3.1 KB
  • contracts/A1.md1.3 KB
  • contracts/A2.md4.8 KB
  • contracts/A3.md4.7 KB
  • contracts/A4.md4.5 KB
  • contracts/C0.md1.1 KB
  • contracts/C1.md2.9 KB
  • contracts/C2.md8.6 KB
  • docs/release-manifest.md3.6 KB
  • mcp-toolchain.md3.1 KB
  • memory-integration.md1 KB
  • modes/decision.md1 KB
  • modes/design.md1.1 KB
  • modes/diagnostic.md1 KB
  • modes/innovation.md1.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.