meta: Skill for Claude Code

.claude/skills/before-refactor/SKILL.md

before-refactor is a skill for Claude Code from gitkb/meta. It costs 19 tokens per session (778 once invoked), scanned A, original, MIT.

A safety check for refactoring that shows callers, callees, and the likely impact of a change. Refactoring changes code structure without intending to change its behaviour; callers use a function, while callees are functions it uses.

In plain words
What is it for?
Use it before refactoring to trace dependencies and assess the change's impact.
Why use it?
It reveals code that may be affected before a structural change is made.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is gitkb/meta's own configuration. It tells Claude Code how to work on meta itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything meta configures →

View source ↗ gitkb/meta
Reuse

Borrowing it

Nothing to install: this file belongs to gitkb/meta. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/gitkb/meta/main/.claude/skills/before-refactor/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/gitkb/meta

Made for: Claude Code.

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 before-refactor

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/gitkb/meta/before-refactor"><img src="https://agentmods.dev/badge/skills/gitkb/meta/before-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 778 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.00019 $0.00778
Opus 5.5 $0.00008 $0.00311
Sonnet 5.5 $0.00004 $0.00156
Haiku 4.5 $0.00002 $0.00078

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

Security

Grade A, and why

before-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 15d 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.

.claude/skills/before-refactor/SKILL.md · 130 lines

How it starts

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

/before-refactor

Safety check before modifying a function, method, or type. Shows all call sites that would need updates if you change the signature, plus impact analysis.

When to Use

  • Before changing a function signature
  • Before renaming a public symbol
  • Before modifying an interface or type's fields
  • Before any change that could break callers

Steps

  1. Find the symbol and its location:

    kb_symbols with search: "<symbol-name>"
    
  2. Get all callers (who would break if you change the signature):

    kb_callers with symbol: "<full-symbol-id>"
    
  3. Get callees (what this function depends on):

    kb_callees with symbol: "<full-symbol-id>"
    
  4. Run impact analysis on the file:

    kb_impact with file_path: "<file-path>"
    
  5. Check for related documents:

    kb_symbol_refs with symbol: "<full-symbol-id>"
    

Output Format

## Refactor Safety Check: `symbolName()`

### Location
- File: src/services/auth.ts:45-67
- Kind: function
- Signature: `async function symbolName(param: Type): Promise<Result>`

### Direct Callers (5)
These will break if you change the signature:
  - src/routes/auth.ts:45 -> handleRequest()
  - src/routes/auth.ts:89 -> handleRefresh()
  - src/middleware/auth.ts:22 -> authenticate()
  - tests/auth.test.ts:15 -> testLogin()
  - tests/integration.test.ts:88 -> testFullFlow()

### Transitive Impact
- 12 symbols transitively depend on this
- Affects 4 files

### What This Calls
  - src/db/users.ts::findUser()
  - src/crypto/tokens.ts::generateToken()

### Related Documents
  - tasks/my-task (Related Task)

### Recommendation

[LOW|MEDIUM|HIGH] impact refactor:
- LOW: 0-2 callers, all in same module
- MEDIUM: 3-10 callers, multiple modules
- HIGH: 10+ callers or public API surface

Files that need updates if signature changes:
1. src/routes/auth.ts
2. src/middleware/auth.ts
3. tests/auth.test.ts
4. tests/integration.test.ts

Example

Input: /before-refactor login

Read the full file on GitHub · 130 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. 15d ago First seen · 130 lines · 19 tokens per session scan A dcd8f4dcd0e5

Subscribe to this mod's changes

before-refactor is a skill published in the GitHub repository gitkb/meta (20 stars, last pushed 8d ago), licensed MIT. It adds 19 tokens to every session and 778 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-11-15.

Related

before-refactor compared with skills from other repositories

before-refactor next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
before-refactorgitkb/metaSkill208d agoMITA19Claude Code
sync-bridgechromium/chromiumSkill25ktodayBSD-3-ClauseA109Claude Code, Codex
sync-model-processorchromium/chromiumSkill25ktodayBSD-3-ClauseA98Claude Code, Codex
adversarial-revieweremdash-cms/emdashSkill15ktodayMITA72Claude Code, Codex
gsd-ns-reviewopen-gsd/gsd-coreSkill12ktodayMITA16Claude Code
gitnexushashgraph-online/awesome-codex-pluginsSkill1.6k2d agoApache-2.0A58Codex
issuejeremylongshore/tons-of-skills-marketplaceSkill3.0ktodayMITA115Claude Code