type-consolidator

type-consolidator is an agent for Claude Code from luongnv89/skills. It costs 20 tokens per session (906 once invoked), scanned A, original, MIT.

A code-review agent that finds duplicate definitions of data shapes, such as TypeScript interfaces, Python classes, or Go structs, and identifies which ones can be shared.

In plain words
What is it for?
Use it to locate duplicate or near-duplicate types and move genuinely shared definitions into common modules, with type-checking details and earlier review reports as input.
Why use it?
Repeated definitions can drift apart and make a codebase harder to maintain, while similar-looking types may represent different concepts and should remain separate.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the lstack plugin — 45 skills, 22 agents shipped together

Good fit Use it to locate duplicate or near-duplicate types and move genuinely shared definitions into common modules, with type-checking details and earlier review reports as input.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/luongnv89/skills/type-consolidator
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.

Clone the repo
git clone --depth 1 https://github.com/luongnv89/skills

Made for: Claude Code.

Or install lstack, the plugin that ships this one along with the rest of its 45 skills, 22 agents.

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 type-consolidator

README.md
[![agentmods](https://agentmods.dev/badge/agents/luongnv89/skills/type-consolidator/github.svg)](https://agentmods.dev/agents/luongnv89/skills/type-consolidator)
Your own site
<a href="https://agentmods.dev/agents/luongnv89/skills/type-consolidator"><img src="https://agentmods.dev/badge/agents/luongnv89/skills/type-consolidator/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 type-consolidator

Your own site · 80×15
<a href="https://agentmods.dev/agents/luongnv89/skills/type-consolidator"><img src="https://agentmods.dev/badge/agents/luongnv89/skills/type-consolidator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 906 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.
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.00020 $0.00906
Opus 5.5 $0.00008 $0.00362
Sonnet 5.5 $0.00004 $0.00181
Haiku 4.5 $0.00002 $0.00091

Measured 1mo ago against content hash bb6fd831a660, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

type-consolidator 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 1mo 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.

skills/code-review/agents/type-consolidator.md · 91 lines

How it starts

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

Type Consolidator Subagent

Find type definitions that have been redeclared across the codebase and move the truly shared ones into shared type modules. Keep the ones that only look similar but represent independent domain concepts.

Input

{
  "repo_path": "/abs/path",
  "stack": {"language": "ts|py|go|rust|java|...", "typecheck_cmd": "..."},
  "wave_1_reports": [".slop-cleanup/wave-1/*.md"],
  "output_report": ".slop-cleanup/wave-2/type-consolidator.md"
}

Detection

Enumerate all type definitions in the project. Source depends on the stack:

  • TS/JS: interface X, type X =, class X, zod/yup/io-ts schemas
  • Python: class X(BaseModel), @dataclass class X, TypedDict, NamedTuple, Protocol
  • Go: type X struct, type X interface
  • Rust: struct X, enum X, trait X
  • Java/Kotlin: class, interface, record, data class

Then look for:

  1. Structural duplicates — same fields, same semantics, different declaration sites. These are the clearest wins.
  2. Near-duplicates that should be one type — e.g., UserDTO and UserResponse with identical fields representing the same concept.
  3. Duplicates that shouldn't merge — UserForm (create payload) vs User (persisted entity). They may share fields but represent different lifecycle stages. Do not merge.

The Merge Decision

A type is a candidate for consolidation when:

  • The fields represent the same real-world entity at the same lifecycle stage
  • Merging would not force one caller to carry unused fields it doesn't need
  • The name accurately describes the merged shape

A type should stay separate when:

  • It represents a different lifecycle/boundary (request vs. stored vs. response)
  • It carries different invariants (validated input vs. raw input)
  • It's in a different bounded context where the concept is genuinely different (a User in billing vs. User in auth)

Write down the lifecycle/bounded-context reasoning when you decide to merge — this protects against future confusion.

Read the full file on GitHub · 91 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. 1mo ago First seen · 91 lines · 20 tokens per session scan A bb6fd831a660

Subscribe to this mod's changes

type-consolidator is an agent published in the GitHub repository luongnv89/skills (133 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 906 once invoked, about $0.0001 per session on Opus 5.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 agents, from other repositories

cf-reviewer

Code reviewer. Reviews a scoped diff itself across five layers — project rules, plan alignment, correctness, security, and test coverage — with depth set by the review mode it is given. Dispatched by cf-review for thorough review before merge. Trigger this agent when the user asks to review code changes — e.g. "review…

dinhanhthi/coding-friend · 208 tokens

cf-reviewer-security

Security review specialist. Performs deep security analysis of code changes including input validation, auth, secrets/crypto, code execution, data exposure, and prompt injection. In DEEP mode, dispatched directly by the review skill in parallel with the generalist reviewer as an extra security perspective. Includes…

dinhanhthi/coding-friend · 81 tokens

cf-reviewer-quality

Code quality review specialist. Checks naming, complexity, duplication, error handling, edge cases, and slop detection (AI over-generation). Directly callable; cf-review and cf-reviewer do not dispatch it by default.

dinhanhthi/coding-friend · 49 tokens

cf-reviewer-plan

Plan alignment review specialist. Checks whether code changes match the implementation plan. Directly callable; cf-review and cf-reviewer do not dispatch it by default. Flags unexpected out-of-scope changes, missing planned items, and plan deviations.

dinhanhthi/coding-friend · 52 tokens

cf-reviewer-reducer

Review reducer agent. Deduplicates and severity-ranks findings from multiple specialist review agents into a single unified report. Dispatched by cf-plan-review to merge external reviews; cf-review merges inline and does not dispatch it.

dinhanhthi/coding-friend · 50 tokens

cf-reviewer-rules

Project rules compliance specialist. Checks code changes against AGENTS.md project rules. Only flags violations of rules with MUST/SHOULD/ALWAYS/NEVER language. Directly callable; cf-review and cf-reviewer do not dispatch it by default.

dinhanhthi/coding-friend · 57 tokens