refactor

refactor is a skill for Claude Code, Codex from AyushParkara/syntra. It costs 24 tokens per session (214 once invoked), scanned A, original, Apache-2.0.

A method for improving code structure while keeping its behavior unchanged.

In plain words
What is it for?
Use it to remove duplication, clarify names, simplify conditionals, flatten nesting, or delete unused code.
Why use it?
It helps make code easier to understand and maintain without accidentally adding features or changing results.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/ayushparkara/syntra/refactor
Any agent
npx skills add AyushParkara/syntra --skill refactor
Clone the repo
git clone --depth 1 https://github.com/AyushParkara/syntra

Made for: Claude Code, 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 refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayushparkara/syntra/refactor.svg)](https://agentmods.dev/skills/ayushparkara/syntra/refactor)
Your own site
<a href="https://agentmods.dev/skills/ayushparkara/syntra/refactor"><img src="https://agentmods.dev/badge/skills/ayushparkara/syntra/refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 214 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00024 $0.00214
Opus 5 $0.00012 $0.00107
Sonnet 5 $0.00005 $0.00043
Haiku 4.5 $0.00002 $0.00021

Measured 5d ago against content hash 956fff7ee186, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 5d 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.

syntra/skills/refactor/SKILL.md · 28 lines

What it actually says

You are refactoring code. The golden rule: behavior must not change.

Method:

  1. Understand what the code does before changing it.
  2. Preserve all existing behavior, including edge cases.
  3. Improve one thing at a time: naming, structure, duplication, or clarity.
  4. Verify the refactored code is equivalent — same inputs produce same outputs.

Targets:

  • Extract repeated logic into shared functions (DRY).
  • Replace unclear names with descriptive ones.
  • Flatten deep nesting with early returns.
  • Remove dead code and unused variables.
  • Simplify conditionals and boolean logic.

Rules:

  • Don't add features while refactoring.
  • Don't change public APIs unless explicitly asked.
  • If a refactor would change behavior, stop and flag it.

Show the before/after and explain what improved.

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. 5d ago First seen · 28 lines · 24 tokens per session scan A 956fff7ee186

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository AyushParkara/syntra (5 stars, last pushed 25d ago), licensed Apache-2.0. It adds 24 tokens to every session and 214 once invoked, about $0.0001 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

mcp-scripting

Write mcpScript JavaScript for discovering, inspecting, and calling MCP tools.

nicobailon/pi-mcp-adapter · 21 tokens

adr-skill

Create and maintain Architecture Decision Records (ADRs) optimized for agentic coding workflows. Use when you need to propose, write, update, accept/reject, deprecate, or supersede an ADR; bootstrap an adr folder and index; consult existing ADRs before implementing changes; or enforce ADR conventions. This skill uses…

vercel/ai · 89 tokens

add-harness-package

Guide for adding new AI SDK harness packages. Use when creating a new @ai-sdk/harness- package that adapts a coding-agent runtime to HarnessV1.

vercel/ai · 41 tokens

add-provider-package

Guide for adding first-party AI provider packages to the AI SDK. Use when creating a provider package under packages/ to integrate an external AI service.

vercel/ai · 33 tokens

update-provider-models

Add new or remove obsolete model IDs for existing AI SDK providers. Use when adding a model to a provider, removing an obsolete model, or processing a list of model changes from an issue. Triggers on "add model", "remove model", "new model ID", "obsolete model", "update model IDs".

vercel/ai · 68 tokens

migrate-ai-sdk-v6-to-v7

Migrate applications from AI SDK 6.x to AI SDK 7.0. Use when upgrading Vercel AI SDK packages, fixing v7 migration errors, or when the user mentions AI SDK v6, v7, upgrade, migration, breaking changes, system to instructions, fullStream, telemetry, tool context, or finalStep.

vercel/ai · 79 tokens