refactor-skill

refactor-skill is a skill for Claude Code, Codex from vinta/hal-9000. It costs 59 tokens per session (1,454 once invoked), scanned A, original, MIT.

A workflow for revising an existing coding-agent skill, including its instructions and related files. A skill is a reusable set of instructions that guides an agent through a task.

In plain words
What is it for?
Use it to review or restructure a skill, improve its description, shorten its main instructions, and move supporting detail to referenced files.
Why use it?
It helps remove unnecessary instructions, keep frequently loaded text focused, and make the workflow easier for an agent to follow.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also agents/openai.yaml present. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Claude Code.

Part of the hal-skills plugin — 12 skills shipped together

Good fit Use it to review or restructure a skill, improve its description, shorten its main instructions, and move supporting detail to referenced files.

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

Made for: Claude Code, Codex.

Or install hal-skills, the plugin that ships this one along with the rest of its 12 skills.

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-skill

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/vinta/hal-9000/refactor-skill"><img src="https://agentmods.dev/badge/skills/vinta/hal-9000/refactor-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,454 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 45
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.00059 $0.01454
Opus 5.5 $0.00024 $0.00582
Sonnet 5.5 $0.00012 $0.00291
Haiku 4.5 $0.00006 $0.00145

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

Security

Grade A, and why

refactor-skill 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 today.

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.

skills/refactor-skill/SKILL.md · 43 lines

How it starts

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

Overview

Refactor a skill. A skill spends two budgets. Its description is loaded into every session, so each word there must do triggering work. Its body enters the context on invocation and stays there for the rest of the session, so each line there must guide every path through the skill. Conditional material moves behind a pointer; unnecessary material leaves the skill.

Instructions

Use AskUserQuestion in Claude Code or request_user_input in Codex when available.

  1. Pick the target. If the invocation names one, resolve it to its SKILL.md. Otherwise ask which skill. For a full audit, read SKILL.md and every sibling file in its directory. For a targeted change, read SKILL.md, affected files, and references needed to assess their interactions. That change sets the scope: the verdicts below cover the lines it adds or touches, the rest of the skill stays as it is, and anything noticed there is a follow-up.

  2. Fetch the guides. The platform and model guides below calibrate the delete, demote, and rewrite verdicts.

    • Fetch one model guide, picked by the target skill's model: frontmatter. Unset or inherit means the most capable model of the family running this skill: fable under Claude, gpt-6-astra under a GPT model. Read the matching reference and fetch the pages it lists:
  3. Audit. Give every frontmatter key, body instruction, and sibling file in scope exactly one verdict, judged against its bar below. Done when nothing in scope lacks a verdict.

    • contradiction: conflicts with another instruction, or the frontmatter promises what the body does not deliver, such as a context: fork skill whose body assumes conversation history. Record both sides.
    • delete: fails the no-op test, meaning the model the skill targets would behave the same without it, or the fetched pages say to remove it because it was written for an earlier model's habits. Judge defaults against those pages, not memory. Covers explanations of what the model already knows, emphasis that carries no instruction, and sibling files nothing points to.
    • demote: real content that only some runs of the skill reach. Destinations: a file in the skill directory linked from SKILL.md, one level deep; a script under scripts/ when the steps are deterministic; a separate skill only when it needs its own trigger or another skill must reach it. Name the destination.
    • rewrite: right meaning, phrasing falls short of the fetched pages: a description that names features instead of triggers, a step with no completion criterion, a prohibition with no positive target, a rule shouted in capitals instead of explained. Also a rewrite when the line carries words that fail the no-op test on their own: a duplicate of another line, a definition of a term the model knows, or emphasis; a rationale or example stays, since both steer the model. Among wordings that pass the bar, the shortest wins. Voice follows the system prompt: the body addresses the model as "you" and names the human as "the user", so "I" or "my" for the human, and "Claude" or "the agent" for the model, are rewrites; words quoted as user speech keep their own voice.
    • keep: earns its cost as written, and no shorter wording has the same effect.

Read the full file on GitHub · 43 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. today Changed a2fdcb0f415c
  2. 4d ago Changed a2198e1eb1c8
  3. 7d ago Changed · +2 lines a13f66804fe0
  4. 13d ago Changed a768203b4f7a
  5. 14d ago Changed · -7 tokens per session 6146c6b3b33d
  6. 19d ago Changed · -1 lines 9f0804fa89a7
  7. 22d ago Changed · +2 lines 50cbb123f56c
  8. 1mo ago Changed 32e8049a0e1f
  9. 1mo ago Changed · -7 lines aa7c7bbf1f6b
  10. 1mo ago First seen · 47 lines · 66 tokens per session scan A 82d951bda05e

Subscribe to this mod's changes

refactor-skill is a skill published in the GitHub repository vinta/hal-9000 (139 stars, last pushed today), licensed MIT. It adds 59 tokens to every session and 1,454 once invoked, about $0.0002 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-09-05.

Related

Other skills, from other repositories

jarvis-setup

Use when helping someone install, configure, or debug a fresh clone of JARVIS (this repo) — especially "the mic doesn't work", "JARVIS says his language systems are down", any Firefox/browser question, login/auth failures, or Accessibility permission prompts. Carries facts about this project that were only learned by…

ethanplusai/jarvis · 79 tokens

optimize-python-parallelism

Analyze and, when the task authorizes source optimization, refactor a concrete long-running Python entrypoint containing repeated independent work. Use for explicit Python speedup or parallelization requests and evidence-backed long-running entrypoints; skip ordinary Python edits, test execution alone, short scripts…

cloudguo123/atomlane · 70 tokens

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for…

agentlas-ai/agentlas-desktop · 67 tokens

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use…

agentlas-ai/agentlas-desktop · 76 tokens

scikit-bio

Biological data toolkit. Sequence analysis, alignments, phylogenetic trees, diversity metrics (alpha/beta, UniFrac), ordination (PCoA), PERMANOVA, FASTA/Newick I/O, for microbiome analysis.

agentlas-ai/agentlas-desktop · 54 tokens

simpy

Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.

agentlas-ai/agentlas-desktop · 42 tokens