Home/Catalog/Quality
Quality — does it work?
Brief 99

Type-Safety Audit

Where the type system has been defeated or never engaged — the casts, anys, and untyped boundaries where the compiler stops protecting you.

TYPES.md4 phases7 lenses~2.7k chars

Free & open · no signup · read-only — it ends by asking · nothing leaves your machine

What it does

You are working inside this repo. Mission: find the places the type system has been switched off or was never turned on — the escape hatches and untyped boundaries where a whole class of bugs walks in unchecked. In dynamically typed code, read this as runtime validation at boundaries.

Read-only pass. Read the type/strictness config and the boundaries where external data enters; change nothing but the report file.

What it looks for

7 lenses it looks through

Phase 2 sweeps the codebase through every one of these, citing file and line for each finding.

1

Escape hatches

any, unchecked casts, as, ignore comments, reflection that drops types

2

Untyped boundaries

API responses, JSON, env, and DB rows trusted without validation

3

Nullability

optionals unwrapped without handling the null/undefined case

4

Weak modeling

primitives where a type would prevent misuse (stringly-typed ids, magic strings)

5

Unsafe generics

over-broad type params; casts inside generic code that lie to callers

6

Config strictness

compiler or linter strictness disabled; warnings that should be errors

7

Runtime validation

where a schema check is needed because types cannot reach the data

The deliverable

What lands in your repo

One structured report at the repo root — or in reports/, if you keep one — the same shape every time, ready for a teammate — or the optional Studio — to act on.

TYPES.md
1
Posture
current strictness and the biggest holes it leaves
2
Findings
each: location · the defeated check · the bug it invites · the fix
3
Boundary validation
where to add schema checks so external data is typed on arrival
4
Strictness plan
the settings to enable and the order to adopt them without a flood
One file. Evidence-backed. It ends by asking before touching anything.
How it works

What it makes the agent do

Every Goal Prompt follows the same four steps, so results are consistent and repeatable — no matter which one you run.

1
Phase 1

Learn the type posture

Note the language's type strictness settings and which are relaxed.

2
Phase 2

Audit through 7 lenses

Cite file and line for every finding.

3
Phase 3

Curate

Rank by the bug each invites and how hot the path is.

4
Phase 4

Report

Create TYPES.md at repo root.

Get started

Three ways to run this Goal Prompt

01 · COPY

Paste it in

Copy it and paste it into your agent inside the repo you want checked.

02 · INSTALL

As a slash command

Install the goal plugin once — two commands — then just type /goal:type-safety.

1/plugin marketplace add GhostlyGawd/goal-prompts
2/plugin install goal@goal-prompts

Or install only this Goal Prompt as /goal-type-safety:

curl -fsSL https://goal-prompts.vercel.app/install | BRIEF=99 sh
03 · AGENT

From an agent (MCP)

Let an agent fetch it mid-conversation, or pull the raw Goal Prompt by URL.

https://goal-prompts.vercel.app/raw/99.md
Transparency

The exact prompt

Nothing hidden — this is the whole Goal Prompt, verbatim. Read it in a minute, edit it, or copy it as-is.

Read the full brief (2,744 characters)
# Goal: Type-Safety Audit

You are working inside this repo. Mission: find the places the type system has been switched off or was never turned on — the escape hatches and untyped boundaries where a whole class of bugs walks in unchecked. In dynamically typed code, read this as runtime validation at boundaries.

Read-only pass. Read the type/strictness config and the boundaries where external data enters; change nothing but the report file.

## Phase 1 — Learn the type posture
- Note the language's type strictness settings and which are relaxed.
- Find the boundaries where untyped data enters: API responses, JSON, env vars, database rows.
- Scan for the escape hatches the codebase leans on.

## Phase 2 — Audit through 7 lenses
Cite file and line for every finding.
1. **Escape hatches** — `any`, unchecked casts, `as`, ignore comments, reflection that drops types
2. **Untyped boundaries** — API responses, JSON, env, and DB rows trusted without validation
3. **Nullability** — optionals unwrapped without handling the null/undefined case
4. **Weak modeling** — primitives where a type would prevent misuse (stringly-typed ids, magic strings)
5. **Unsafe generics** — over-broad type params; casts inside generic code that lie to callers
6. **Config strictness** — compiler or linter strictness disabled; warnings that should be errors
7. **Runtime validation** — where a schema check is needed because types cannot reach the data

## Phase 3 — Curate
- Rank by the bug each invites and how hot the path is: an unvalidated payment payload outranks a test cast.
- For each, give the safer type or the validation to add at the boundary.
- Separate "turn on strictness" from "model this better"; both reduce whole classes.

## Phase 4 — Report
Create `TYPES.md` at repo root:
1. **Posture** — current strictness and the biggest holes it leaves
2. **Findings** — each: location · the defeated check · the bug it invites · the fix
3. **Boundary validation** — where to add schema checks so external data is typed on arrival
4. **Strictness plan** — the settings to enable and the order to adopt them without a flood

Start the report with today's date. If `TYPES.md` already exists from a previous run, read it first and lead with what changed since.

## Rules
- A type asserted with a cast is a comment, not a guarantee
- Validate at the boundary; inside it, let types do the work
- No typed language surface in this repo? Say so in a one-paragraph null report and stop — a null result is a valid finding.
- If a `reports/` directory exists at the repo root, write the report there instead of the root.
- Before asking, present the top findings as a ranked list in plain words
- Report only — end by asking which type holes to close first

House rules for this Goal Prompt

  • A type asserted with a cast is a comment, not a guarantee
  • Validate at the boundary; inside it, let types do the work
  • No typed language surface in this repo? Say so in a one-paragraph null report and stop — a null result is a valid finding.
  • If a reports/ directory exists at the repo root, write the report there instead of the root.
  • Before asking, present the top findings as a ranked list in plain words
  • Report only — end by asking which type holes to close first
Keep exploring

More Quality briefs