Source of truth preflight

From Kastalien-Research/thoughtbox · View interactive version

Source of truth preflight is an AI agent skill from the GitHub repository Kastalien-Research/thoughtbox. Use this skill before implementing features, lifecycle changes, runtime boundaries, persistence contracts, or architectural work where the codebase may already contain canonical domain models. It prevents duplicate abstractions, illegal representable states, and plans built on the wrong source of tr

How to use this skill

Skill file

Source Of Truth Preflight

Run this skill before editing code for non-trivial feature work, especially

when the task touches domain models, state machines, runtime providers,

repository contracts, schema migrations, or existing subsystem boundaries.

This is a short gate, not a design ceremony. Produce the report before coding.

If the report cannot identify the canonical model or enforcement points, pause

instead of implementing.

Trigger Conditions

Use this skill when any of these are true:

Preflight Steps

1. Identify The Unit

State the requested unit in one sentence. Name explicit non-goals.

2. Inventory Existing Models

Search before designing. Prefer rg:

rg -n "export (interface|type|class|const) .*<Concept>|<Concept>Schema|type <Concept>|interface <Concept>" src apps .specs .adr docs
rg -n "from ['\"].*<concept>.*['\"]|<Concept>" src apps

Record:

3. Choose The Canonical Source Of Truth

Name the model the implementation will build on. If there are multiple live

models, classify each as one of:

If the choice is not obvious, pause and ask for a decision.

4. Illegal-State Pass

List the states that should be impossible. Check whether current types make

them impossible.

Look for:

discriminated union

For each illegal state, decide whether to:

5. Acceptance-To-Enforcement Map

For each acceptance criterion, name the enforcing artifact:

If an acceptance item maps only to prose or a broad test, mark it as weak.

6. Reuse Challenge

Before adding a new service/type/schema, answer:

Why does the existing model/engine/repository not own this?

Proceed only when the answer is concrete. Good answers include:

Weak answers include:

7. Surprise Gate

After two unexpected findings, stop and write:

Do not debug process/tooling or migrate workflow systems inside the feature

session unless that is the explicit unit of work.

Required Report

Produce this before code edits:

Source Of Truth Preflight

Unit:
Non-goals:

Canonical model:
Legacy/competing models:
Control-plane models:
Adapters needed:

Illegal states currently representable:
Acceptance-to-enforcement map:
New types/services proposed:
Reuse decision:

Surprises:
Proceed / pause:

Use file references for every model claim.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.