codemeridian-refactor

codemeridian-refactor is a skill for Codex from Driftya/code-meridian. It costs 34 tokens per session (2,234 once invoked), scanned A, original, MIT.

A safer planning process for changing existing code with CodeMeridian, a tool that maps relationships between code symbols and files. It checks callers, dependencies, tests, duplicate code, and architecture risks before edits begin.

In plain words
What is it for?
Use it to plan refactors such as splitting classes, extracting services, removing duplication, simplifying flows, or reducing coupling.
Why use it?
It reduces the chance that a rename, move, deletion, or cleanup silently breaks other parts of the project. It also checks whether the relationship map matches the current working files.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to plan refactors such as splitting classes, extracting services, removing duplication, simplifying flows, or reducing coupling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/driftya/code-meridian/codemeridian-refactor
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 Driftya/code-meridian --skill codemeridian-refactor
Clone the repo
git clone --depth 1 https://github.com/Driftya/code-meridian

Made for: 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 codemeridian-refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/driftya/code-meridian/codemeridian-refactor/github.svg)](https://agentmods.dev/skills/driftya/code-meridian/codemeridian-refactor)
Your own site
<a href="https://agentmods.dev/skills/driftya/code-meridian/codemeridian-refactor"><img src="https://agentmods.dev/badge/skills/driftya/code-meridian/codemeridian-refactor/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 codemeridian-refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/driftya/code-meridian/codemeridian-refactor"><img src="https://agentmods.dev/badge/skills/driftya/code-meridian/codemeridian-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,234 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.00034 $0.02234
Opus 5.5 $0.00014 $0.00894
Sonnet 5.5 $0.00007 $0.00447
Haiku 4.5 $0.00003 $0.00223

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

Security

Grade A, and why

codemeridian-refactor 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 11d 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.

docs/agent-capabilities/skills/codemeridian-refactor/SKILL.md · 356 lines

How it starts

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

CodeMeridian Refactor Skill

Use this skill when working in a repository indexed by CodeMeridian and the user asks to refactor, rename, split, extract, move, simplify, deduplicate, delete, or replace code.

The goal is to make refactoring safer by using graph context before changing files.

Target Scope

Resolve each supplied file/directory from its own location, including external paths. Find its Git/worktree or configured solution root and the nearest applicable ancestor meridian.json (project), stopping at the owning root; nested configs can define distinct index roots. Honor explicit user/index-invocation context. Current-repository/global/environment defaults do not prove external ownership. Missing config makes solution (.sln/.slnx), workspace, package and folder names candidates requiring a bounded known-file/symbol graph lookup. Report unresolved scope instead of guessing.

Keep target -> index root -> project context and freshness; use paths relative to that root and returned canonical IDs. Build-project/framework scope is distinct from repository context. Start new paths at their nearest existing parent. Keep relevant unindexed external source as labeled evidence. Read supplied external context without expanding edit/build/index scope, and discover through ancestors rather than scanning sibling repositories.

Before extracting, renaming or changing a shared API, inspect find_cross_project_dependencies for relevant contexts and resolve producer/consumer endpoints separately. Check exact connections, impact and test shields. Preserve installed package version/framework and source status: verified source edges support normal traversal; current-source associations identify potential consumers and require compatibility consideration, not a claim about the installed implementation. Ambiguous, missing and pending links are unresolved risk, not permission to delete or proof of no consumers.

SQL Schema Refactors

For SQL table/column/view/function renames or removals, resolve the target root/project context and its dialect, logical databaseScope, source-pattern rule and searchPath. The opt-in SQL indexer currently supports offline PostgreSQL; generic query_codebase / resolve_exact_symbol, freshness, bounded edit context, find_impact, find_downstream and find_connection expose its facts. Follow file-owned declaration/reference sites to source; shared object IDs are not file ownership. Include readers/writers, ALTER targets, views and explicit foreign keys. Joins are structural associations, not calls.

Read the full file on GitHub · 356 lines

Files

What ships with it

1 file 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. 11d ago Changed · +16 lines 10f1e25f14e7
  2. 23d ago Changed · +11 lines e8e746e181e0
  3. 1mo ago First seen · 329 lines · 34 tokens per session scan A 21cb8623a368

Subscribe to this mod's changes

codemeridian-refactor is a skill published in the GitHub repository Driftya/code-meridian (5 stars, last pushed 7d ago), licensed MIT. It adds 34 tokens to every session and 2,234 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-31.

Related

Other skills, from other repositories

memtrace-style-fingerprint

Pull the codebase's empirical style norm from Memtrace and match it when writing or editing source code in an indexed repo. Use when choosing between competing idioms (ternary vs if-else, arrow vs function declaration, const vs let, await vs .then, early-return vs nested-return), matching naming case, or when the user…

syncable-dev/memtrace-public · 111 tokens

memtrace-refactoring-guide

Build a phased, risk-scored refactoring plan from Memtrace complexity, dead-code, bridge, impact analysis, and Cortex decision-memory constraints. Use when the user wants to refactor source code, reduce complexity, clean technical debt, delete dead code, split large functions, extract modules, reorganize code, or…

syncable-dev/memtrace-public · 100 tokens

memtrace-code-review

Review GitHub pull requests with Memtrace's local graph-backed review engine. Use when the user asks to review a GitHub pull request, run Memtrace code review, post Memtrace review comments, create a PR with a review step, or publish local graph-backed review findings to GitHub. Prefer the reviewgithubpr MCP tool over…

syncable-dev/memtrace-public · 110 tokens

memtrace-quality

Find dead code, complexity hotspots, and refactoring candidates in indexed source code. Use when the user asks about source-code quality, dead code, unused functions, zero callers, complexity, cyclomatic complexity, hotspots, refactoring candidates, or code smell questions. Do not use Grep, Glob, rg, or manual…

syncable-dev/memtrace-public · 84 tokens

graph

Whole-codebase structural map of the codanna index as one self-contained HTML disc. Wedges per top-level module, concentric rings with hubs at the centre, hover or click a symbol to light its edge web, search, hide or highlight modules, brush a date range on the ribbon timeline (symbols dated by git blame), heatmap of…

bartolli/codanna · 131 tokens

x-ray

Deep codebase exploration using semantic search and relationship mapping. Use when you need to understand the current codebase.

bartolli/codanna · 25 tokens