Codemod generator
Skill quadrivia-ai/design-system-ops-internal/skills/codemod-generator
Generate codemod scripts plus a migrate.js runner for a mechanical migration (rename a token, swap a deprecated component, replace a banned alias) — emitted as reviewable code that NEVER runs itself and defaults to dry-run. Triggers on 'generate a codemod for X', 'write a migration script to rename the token', 'codemod to swap OldButton for Button', 'automate this migration'. GENERATED CODE ONLY — never executes. Do NOT trigger for PLANNING the deprecation — use deprecation-process. Do NOT trigger for a CI workflow — use cicd-integration.From its SKILL.md
npx -y skills add quadrivia-ai/design-system-ops-internal --skill codemod-generatorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.8 KB, as published. Nobody here has run it
Codemod Generator
Proposal only. Emits code to review; runs nothing. Applying the codemod is a human action, dry-run-first (see human-oversight-framework).
Context
Generates the transform scripts and a migrate.js runner for a mechanical migration. The
output is code the team reviews and runs themselves — it never executes here, and the runner
defaults to dry-run so the first invocation changes nothing.
Configuration
Reads (all optional): the migration spec (old → new); source_globs / ignore_globs;
stack.token_files, stack.component_roots.
Auto-pull integrations
None.
Step 0 — Pin the transform
State exactly what changes: old → new (token name, component import + prop mapping, banned
alias → token). Note cases it can't safely auto-transform (dynamic/computed usage) — those stay
manual and must be listed, not silently skipped.
Step 1 — Generate the codemod
Emit an AST-based transform (preferred over regex for .tsx). Idempotent; leaves unmatched
code untouched; logs every change site.
Step 2 — Generate the runner (dry-run default)
// migrate.js — GENERATED by design-system-ops · REVIEW BEFORE RUNNING
// Default is DRY-RUN: prints changes, writes nothing.
// Apply only after reviewing the dry-run diff: node migrate.js --apply
const APPLY = process.argv.includes("--apply");
// ...glob source files, run the transform, collect diffs...
if (!APPLY) {
console.log(`DRY-RUN: ${changes.length} file(s) would change. Re-run with --apply to write.`);
process.exit(0);
}
console.warn(`APPLYING to ${changes.length} file(s). Ensure a clean git tree first.`);
// ...write files...
Step 3 — State scope and limits
How many files match, which cases are auto-handled, and which need manual follow-up. No silent caps (see output-discipline / human-oversight).
Produce the proposal
## Codemod — <old> → <new>
**Headline.** <N files would change; M manual cases.> Review the dry-run before applying.
### Files
- codemod: `migrations/<name>.codemod.ts` · runner: `migrate.js` (dry-run default)
### Auto-handled
<the patterns the transform covers>
### Manual follow-up (not auto-transformed)
- `src/.../X.tsx:NN` — dynamic usage; change by hand
### How to apply (human steps)
1. Review the generated files.
2. `node migrate.js` (dry-run) — read the diff.
3. Commit a clean tree, then `node migrate.js --apply`.
4. Run lint + tests.
### Scope
- Generated: transform + dry-run runner. Nothing run, nothing written here.
- Assumed: <static usage; dynamic cases listed as manual>
Closing note
The dry-run is not optional ceremony — it's where you catch the manual cases the transform can't see. Never wire this into CI to auto-apply; that's exactly what the human-oversight framework forbids.
Quality checks
- Runner defaults to dry-run;
--applyis explicit and gated. - Review banner present; no execution from the skill.
- Manual/unsafe cases listed, not silently skipped.
- Transform is idempotent and logs change sites.
- Output-discipline self-check passed.