component-rename

Renames component identities and parameters across JSON and TypeScript with save-file migrations.

9|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/timcsy/semorphe --skill component-rename-timcsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-rename
Source: https://github.com/timcsy/semorphe/tree/main/knowledge/skills/component-rename
Command: npx skills add https://github.com/timcsy/semorphe --skill component-rename-timcsy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large-scale renaming of component identities or parameter names touches thousands of references across JSON and TypeScript files, and a single missed key or an unsegmented change leaves hundreds of failing tests that cannot be attributed to any specific edit. This Skill provides a battle-proven procedure for executing such renames with guardrails, staged verification, and mandatory save-file migrations so user data never silently breaks. ## Core Features & Use Cases - Staged, verifiable renaming: Splits the work into segments cut by what can verify them (not by type), requiring each stage to end green and mandating full revert of a red stage instead of patching on top. - Asymmetric JSON/TS strategy: Uses an explicit allowlist of keys for JSON edits (componentId, id, blockType, etc.) and a denylist approach for TypeScript, with text-level regex edits to avoid reformatting churn. - Frozen migration tables: Pairs every rename with a save-version bump and a frozen, explicit migration table placed on the package side, plus an end-to-end migration test from the oldest save version to the newest. - Silent-failure sweeps: Greps for shape-based name judgments (startsWith, endsWith, regex matches) and debug escape hatches like __app that type checking cannot see. - Use Case: When renaming 153 block types or migrating a component namespace across 6,000+ references, follow this procedure to keep every stage attributable, preserve old user save files, and catch consumers that pattern-match on name shapes. ## Quick Start Ask the AI to rename a component identity or parameter across the codebase following the component-rename procedure, starting with guardrails that fail first and ending with a frozen migration table and end-to-end migration test.

Frequently Asked Questions about component-rename

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rename identifiers across thousands of files safely?

Split the rename into stages cut by what can verify each stage, not by file type. Build guardrail tests that fail before you start, run one stage at a time, and revert the entire stage if tests go red rather than patching on top of failures.

How to rename JSON keys without reformatting every file?

Use text-level regex substitution like re.sub on the specific key pattern instead of parse-then-dump. Parsing and re-serializing with json.dumps reformats indentation across hundreds of untouched files, destroying reviewability.

Should JSON and TypeScript renames use the same strategy?

No. JSON needs an allowlist of named keys because values contain natural-language labels and code snippets, while TypeScript needs a denylist approach because identities flow through variables that AST classifiers undercount.

Why do tests pass but features silently break after a rename?

Consumers that judge names by shape, such as startsWith prefixes or regex suffixes, fail silently when naming conventions change. Grep for startsWith, endsWith, includes, and regex patterns before renaming and replace them with explicit declarations.

How do I migrate old user save files after renaming?

Bump the save version and ship a frozen, explicit migration table on the package side, never derived from the current registry. Add an end-to-end test that migrates from the oldest save version to the newest, since per-stage tests miss cross-version mismatches.

Why does TypeScript compilation pass but e2e tests fail after renaming?

Debug escape hatches like (window as any).__app bypass type checking entirely, so renamed fields go undetected. Grep for the escape hatch across e2e and source before renaming any field it exposes, including optional-chained accesses.