refactor-values
Skill268 starsChanged 9 days agoMITView on GitHub
Use before changing an existing enum member's value or key under enums/** or editing an existing value under test-data/static/**. Not for adding a new enum or member (see `enums`) or a new static set (see `data-strategy`).
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-native-workflowSkill
- api-testingSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- helpersSkill
- page-objectsSkill
- playwright-cliSkill
- pr-reviewerSkill
- selectorsSkill
- skill-creatorSkill
- test-standardsSkill
- type-safetySkill
- ai-native-workflowSkill
- api-testingSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- helpersSkill
- page-objectsSkill
- playwright-cliSkill
- pr-reviewerSkill
- refactor-valuesSkill
- selectorsSkill
- skill-creatorSkill
- test-standardsSkill
- type-safetySkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Before any edit, find all consumers: Search the enum key (Messages.LOGIN_ERROR) and the raw string value ('Invalid email or password') …
- Very specific: line 27
Search both forms and list every hit (rg or grep -rn.
- Very specific: line 35
Run npx tsc --noEmit, npx eslint ., then the affected spec files by path (--grep matches tags and titles, not file names).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Refactor Values
Critical
- Before any edit, find all consumers. Search the enum key (
Messages.LOGIN_ERROR) and the raw string value ('Invalid email or password') across the whole repository; a consumer that bypassed the enum does not follow it. - Every consumer changes in the same commit as the enum member or static entry; no state where the value moved and a consumer still holds the old one.
Never loosen
z.literalorz.enumto a wider type to make a changed value pass; move the literal, or list the valid values.role: z.literal('administrator'), // correct: the literal follows the valuerole: z.string(), // wrong: hides the next driftnpx tsc --noEmit,npx eslint .and the affected tests pass before the refactor is done.- No blind find-and-replace. Inspect every match; hits include
.mddocs and skills, comments and case variants.
Procedure
Search both forms and list every hit (
rgorgrep -rn; skip.jsonreports):rg -n "Messages.LOGIN_ERROR|Invalid email or password" --glob '!*.json' .- Categorise each hit with
references/impact-tables.md; the files that change are the proposal's scope. - Change the source (enum member or
as constentry) and every listed consumer in one pass; a UI message is captured from the live app withplaywright-clifirst (enums). - Run
npx tsc --noEmit,npx eslint ., then the affected spec files by path (--grepmatches tags and titles, not file names); red →debugging.
References
references/impact-tables.md: step 2, the consumer table per change type and the stale-consumer patterns.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

