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.
git clone --depth 1 https://github.com/parisgroup-ai/imersao-ia-setupnpx agentmods add skills/parisgroup-ai/imersao-ia-setup/code-consolidationWrote 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.
[](https://agentmods.dev/skills/parisgroup-ai/imersao-ia-setup/code-consolidation)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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:
- File Count: How many files contain the duplicate?
- Line Count: Estimated lines of code affected
- Import Depth: How many consumers import from scattered locations?
- Breaking Risk: Will consolidation break existing APIs?
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.
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.
- 10d ago First seen · 273 lines · 79 tokens per session scan A 06b286dd8cd0
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.
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.
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…
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 …
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…
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…
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) …