code-consolidation

code-consolidation is a skill for Claude Code from parisgroup-ai/imersao-ia-setup. It costs 79 tokens per session (1,864 once invoked), scanned A, original, MIT.

A codebase analysis workflow for finding responsibilities that are spread across multiple files and could be consolidated into one source of truth. A source of truth is the single place that should define a rule or piece of data.

In plain words
What is it for?
It is for analyzing duplication, mapping which files own which responsibilities, and creating a consolidation plan before a refactor or architecture review.
Why use it?
It helps expose duplicated types, utilities, configurations, errors, and factories before they cause inconsistent behavior or make refactoring harder.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is │ └── index.ts # export * from '../auth'; export * from '../crypto';.

Part of the imersao plugin — 51 skills, 7 commands shipped together

Good fit It is for analyzing duplication, mapping which files own which responsibilities, and creating a consolidation plan before a refactor or architecture review.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/parisgroup-ai/imersao-ia-setup
agentmods
npx agentmods add skills/parisgroup-ai/imersao-ia-setup/code-consolidation

Made for: Claude Code.

Or install imersao, the plugin that ships this one along with the rest of its 51 skills, 7 commands.

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 code-consolidation

README.md
[![agentmods](https://agentmods.dev/badge/skills/parisgroup-ai/imersao-ia-setup/code-consolidation/github.svg)](https://agentmods.dev/skills/parisgroup-ai/imersao-ia-setup/code-consolidation)
Your own site
<a href="https://agentmods.dev/skills/parisgroup-ai/imersao-ia-setup/code-consolidation"><img src="https://agentmods.dev/badge/skills/parisgroup-ai/imersao-ia-setup/code-consolidation/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 code-consolidation

Your own site · 80×15
<a href="https://agentmods.dev/skills/parisgroup-ai/imersao-ia-setup/code-consolidation"><img src="https://agentmods.dev/badge/skills/parisgroup-ai/imersao-ia-setup/code-consolidation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,864 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.00079 $0.01864
Opus 5 $0.00039 $0.00932
Sonnet 5 $0.00016 $0.00373
Haiku 4.5 $0.00008 $0.00186

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

Security

Grade A, and why

code-consolidation 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/find-duplicates.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/imersao/skills/code-consolidation/SKILL.md · 273 lines

How it starts

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

Code Consolidation Mapper

Analyze codebases to identify responsibilities scattered across multiple files that should be consolidated into single sources of truth.

Purpose

Map fragmented code responsibilities and generate actionable consolidation plans. Detect:

  • Duplicate type definitions
  • Scattered utility functions
  • Repeated configuration patterns
  • Fragmented error hierarchies
  • Inconsistent factory implementations

When to Use

  • Before major refactoring efforts
  • When onboarding to brownfield codebases
  • During architecture reviews
  • When code smells indicate duplication
  • Planning consolidation sprints

Analysis Process

Phase 1: Pattern Detection

Scan for common duplication patterns using targeted searches:

# Type definitions scattered
grep -rn "export (type|interface) " --include="*.ts" | sort | uniq -d

# Similar function names in different files
grep -rn "export function \w+" --include="*.ts" | awk -F: '{print $3}' | sort | uniq -c | sort -rn

# Duplicate class definitions
grep -rn "class \w+Error" --include="*.ts" --include="*.py"

# Configuration objects with same structure
grep -rn "STATUS_CONFIG\|VARIANT_CONFIG" --include="*.ts"

# Factory patterns repeated
grep -rn "create.*Factory\|.*Factory\(" --include="*.ts"

Phase 2: Responsibility Mapping

For each detected pattern, classify by category:

Category Detection Pattern Consolidation Target
Types Same interface in 2+ packages packages/types/
Validators Duplicate Zod schemas packages/validators/
Errors Scattered error classes app/errors/ or lib/errors/
Config Repeated status/variant configs lib/{domain}-config-factory.ts
Utils Similar functions across files lib/utils/{domain}.ts
Constants Duplicate magic values lib/constants/{domain}.ts

Phase 3: Impact Analysis

For each consolidation opportunity, assess:

  1. File Count: How many files contain the duplicate?
  2. Line Count: Estimated lines of code affected
  3. Import Depth: How many consumers import from scattered locations?
  4. Breaking Risk: Will consolidation break existing APIs?

Read the full file on GitHub · 273 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 273 lines · 79 tokens per session scan A 06b286dd8cd0

Subscribe to this mod's changes

code-consolidation is a skill published in the GitHub repository parisgroup-ai/imersao-ia-setup (1 stars, last pushed 28d ago), licensed MIT. It adds 79 tokens to every session and 1,864 once invoked, about $0.0004 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-31.

Related

Other skills, from other repositories

finding-duplicate-functions

Use when auditing a codebase for semantic duplication — functions that do the same thing but have different names or implementations, especially common in LLM-generated codebases.

bobmatnyc/claude-mpm · 36 tokens

explain-back

Use before trusting, merging, or building on top of code you (or an agent) just wrote or are about to change. The agent explains the code back in plain language — what it does, why it exists, what breaks if it's wrong — and refuses to proceed until the mental model is confirmed. Use when a diff looks fine but nobody…

mikestangdevs/craft-skills · 103 tokens

boyscout

Use when touching an existing file to make a change, so you leave it slightly cleaner than you found it without derailing into a giant refactor. Identifies small, safe, in-scope improvements adjacent to the change you're already making — a better name, a deleted dead line, an extracted helper, a clarified condition …

mikestangdevs/craft-skills · 107 tokens

why-comments

Use when a file is littered with comments that narrate what the code already says (// increment the counter), when load-bearing code has no explanation of why it exists, or when reviewing AI-generated code (agents pad output with narration and never record the why). Deletes comments that restate the code, keeps and…

mikestangdevs/craft-skills · 130 tokens

everywhere-else

Use immediately after fixing a bug or improving a pattern in one place — before reporting done. Asks the question agents never ask themselves: 'did you do that anywhere else?' Enumerates the full population of sibling sites (other templates, scenarios, endpoints, components, fixtures, configs that share the same…

mikestangdevs/craft-skills · 134 tokens

prove-every-number

Use whenever code contains a numeric constant, threshold, default, rate, capacity, tolerance, or coefficient — especially one the agent just introduced. Enforces the rule: every number is either derived (from real data or first principles, traceably) or cited (to a spec, datasheet, standard, or documented decision) …

mikestangdevs/craft-skills · 153 tokens