fix-types

fix-types is a skill for Claude Code, Codex from Kevin-Liu-01/Agent-Machines. It costs 68 tokens per session (1,016 once invoked), scanned A, original, MIT.

A code-review guide for replacing generic values, such as strings and numbers, with types that represent their actual meaning. It also covers checked conversions, explicit choices instead of true/false flags, and documented database or protocol value rules.

In plain words
What is it for?
Use it when designing data structures, reviewing database or network-protocol code, or checking functions with several parameters of the same basic type.
Why use it?
Generic values can be passed to the wrong parameter or accept invalid data while still compiling. This guide helps make those mistakes visible to the type checker.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing data structures, reviewing database or network-protocol code, or checking functions with several parameters of the same basic type.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kevin-liu-01/agent-machines/fix-types
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Kevin-Liu-01/Agent-Machines --skill fix-types
Clone the repo
git clone --depth 1 https://github.com/Kevin-Liu-01/Agent-Machines

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-types

README.md
[![agentmods](https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/fix-types/github.svg)](https://agentmods.dev/skills/kevin-liu-01/agent-machines/fix-types)
Your own site
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/fix-types"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/fix-types/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fix-types

Your own site · 80×15
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/fix-types"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/fix-types.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,016 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.01016
Opus 5 $0.00034 $0.00508
Sonnet 5 $0.00014 $0.00203
Haiku 4.5 $0.00007 $0.00102

Measured 10d ago against content hash b6c0997d0f16, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

fix-types scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

knowledge/skills/fix-types/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix Types

Make invalid states unrepresentable. All possible types and states should be defined upfront ahead of time. Every bare primitive that carries domain meaning is a bug waiting for a call site to swap two arguments of the same type. The compiler/type-checker is free; runtime debugging is not!

1. Newtypes / branded types over bare primitives

If a value means different things in different parameters of the same function, wrap each in a distinct type.

Rust:

struct AccountId(u64);
struct Cents(u64);
fn transfer(from: AccountId, to: AccountId, amount: Cents);

TypeScript:

type AccountId = string & { readonly __brand: "AccountId" };
type Cents = number & { readonly __brand: "Cents" };
function transfer(from: AccountId, to: AccountId, amount: Cents): void;

Python:

from typing import NewType
AccountId = NewType("AccountId", int)
Cents = NewType("Cents", int)
def transfer(from_: AccountId, to: AccountId, amount: Cents) -> None: ...

Go:

type AccountId uint64
type Cents uint64
func Transfer(from, to AccountId, amount Cents) error

Apply when a bare primitive appears in 3+ function signatures with different semantics. Common candidates: identifiers, indices, offsets, sizes, timestamps, currency amounts, ports, sequence numbers.

2. Checked casts at trust boundaries

When converting between signed/unsigned or narrowing width, validate at the boundary where untrusted data enters. Silent truncation or wraparound is a corruption vector.

// Bad: silent wraparound on corrupt input.
let id = row.get::<_, i64>(0)? as u64;

// Good: fails loud on negative.
let id = u64::try_from(raw).map_err(|_| Error::Corrupt(raw))?;
# Bad: silently wraps on overflow.
port = int(raw_value) & 0xFFFF

# Good: explicit bounds check.
port = int(raw_value)
if not (0 <= port <= 65535):
    raise ValueError(f"port out of range: {port}")
// Bad: silent truncation.
port := uint16(rawPort)

// Good: bounds check.
if rawPort < 0 || rawPort > math.MaxUint16 {
    return fmt.Errorf("port out of range: %d", rawPort)
}

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 138 lines · 68 tokens per session scan A b6c0997d0f16

Subscribe to this mod's changes

fix-types is a skill published in the GitHub repository Kevin-Liu-01/Agent-Machines (27 stars, last pushed today), licensed MIT. It adds 68 tokens to every session and 1,016 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

dx-roaster

Brutally honest developer-experience audit for a GitHub repo. Scores 10 DX dimensions (time-to-first-success, README clarity, visual proof, install, quick-start, docs, examples, community, trust, marketing), writes a shareable roast in the requested tone (brutal/honest/kind), produces a prioritized action plan ranked…

Varnan-Tech/opendirectory · 130 tokens

mcp-review

Review MCP server specifications and updates for compliance, security, and quality. Use when evaluating server.json files, PRs adding/updating servers, or assessing MCP server changes. NOT for creating new entries (use add-mcp-server instead).

stacklok/toolhive-catalog · 51 tokens

code-review

When the user wants a thorough code review of changes, a PR, a file, or a feature branch. Use when the user says "review this," "code review," "check my code," "what's wrong with this," "review my PR," "look over this," "critique this," "review before merge," or when submitting code for quality assessment. Performs…

ggg123124/vrchat-assistant · 96 tokens

holix-cron

Schedule recurring agent tasks via Holix built-in gateway cron (not crontab or custom scripts).

javded-itres/Holix · 25 tokens

quick-review

Review a code diff or file for correctness bugs, security issues, and clear simplifications. One finding per line, severity-tagged. Use when user wants fast, focused code review.

gyuch-an02/claude-omakase · 40 tokens

review-guidelines

Additional code review guidelines specific to this codebase. Auto-loaded by the review agent during PR reviews to enforce project conventions.

youdotcom-oss/dx-toolkit · 28 tokens