autoframe: Skill for Claude Code

.claude/skills/refactor/SKILL.md

refactor is a skill for Claude Code from kint4/autoframe. It costs 37 tokens per session (466 once invoked), scanned A, original, MIT.

A cleanup assistant for Playwright tests that reorganizes test code into shared page objects, fixtures, and consistent test sections. Page objects keep page actions and locators in reusable files.

In plain words
What is it for?
Use it on an existing test file or code snippet to extract page objects and fixtures, add Arrange/Act/Assert sections, group cases, and replace raw browser commands.
Why use it?
It removes brittle selectors, repeated code, unclear test structure, and technical test names that make browser tests harder to maintain.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is kint4/autoframe's own configuration. It tells Claude Code how to work on autoframe 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 autoframe configures →

Reuse

Borrowing it

Nothing to install: this file belongs to kint4/autoframe. 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/kint4/autoframe/main/.claude/skills/refactor/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/kint4/autoframe

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 refactor

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kint4/autoframe/refactor"><img src="https://agentmods.dev/badge/skills/kint4/autoframe/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 466 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.00037 $0.00466
Opus 5.5 $0.00015 $0.00186
Sonnet 5.5 $0.00007 $0.00093
Haiku 4.5 $0.00004 $0.00047

Measured 2mo ago against content hash 0ea8ef2b63a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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/refactor/SKILL.md · 46 lines

What it actually says

/refactor — Refactor to Autoframe Conventions

Type: Maintenance Description: Takes existing, messy Playwright tests and restructures them to follow Autoframe conventions — extracting Page Objects, applying AAA, grouping tests, and replacing brittle selectors.


Input Format

  • A path to an existing spec or test file (or a pasted snippet)
  • Optionally, a target feature name

Output Format

The refactored file(s) following Autoframe conventions, plus a short changelog of what was changed and why. May produce a new Page Object and/or fixture as part of the refactor.

Step-by-Step Instructions

  1. Read the target file and any related Page Objects/fixtures.
  2. Read the POM, spec, and fixture conventions in CLAUDE.md.
  3. Diagnose convention violations:
    • Raw locators / page.$() / CSS selectors in tests → extract into a Page Object using semantic locators.
    • Inline locators in Page Object methods → move to the constructor.
    • Missing AAA structure → add Arrange / Act / Assert.
    • Ungrouped tests → wrap in Happy Path / Negative / Edge describe blocks.
    • Technical test names → rewrite in plain language.
    • Raw page where a fixture exists → switch to the custom fixture.
  4. Apply the refactor incrementally, preserving the original test intent and assertions.
  5. Extract a Page Object and fixture if the logic belongs there.
  6. Save files to their correct locations per the folder structure.
  7. Output a changelog: what moved, what was renamed, what was replaced.

Rules

  • Preserve test behavior — never silently drop assertions.
  • Preserving scope may leave Negative/Edge describe groups empty — do not invent coverage the original didn't have. Instead, note the gap in the changelog and hand off to /new-spec to fill it.
  • Never introduce waitForTimeout or CSS selectors during a refactor.
  • Place all new files in their conventional locations.
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. 2mo ago First seen · 46 lines · 37 tokens per session scan A 0ea8ef2b63a9

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository kint4/autoframe (8 stars, last pushed 4mo ago), licensed MIT. It adds 37 tokens to every session and 466 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.