nodefony-identifiers

Detects French identifiers in TypeScript code and renames them safely via the TypeScript LanguageService.

Updated Dec 19, 2023
One-click install
npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-identifiers-nodefony
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodefony-identifiers
Source: https://github.com/nodefony/nodefony-core/tree/main/.claude/skills/nodefony-identifiers
Command: npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-identifiers-nodefony

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Codebases that mix French and English identifiers become hard to search, publish, and maintain, and naive regex-based renaming silently breaks code — private members become public, object shorthands rebind to the wrong declaration, and string-keyed data contracts break without any compiler error. This Skill provides a language gate that finds remaining French identifiers and a rename protocol that proves no symbol drifted and no displayed string changed. ## Core Features & Use Cases - Language gate: Scans production TypeScript, JavaScript, shell, and template files for French identifiers using a hand-built discriminating dictionary, with declared exceptions, a false-positive benchmark against third-party English code, and 72 tests. - AST-safe mass renaming: Renames symbols through the TypeScript LanguageService from a JSON plan (never regex), with collision guards, private-member (#name) handling, and dry-run counting. - Drift and literal proof: Post-rename controls compare results against the plan binding-by-binding and verify no user-facing string changed, closing the gaps a green typecheck cannot see (dynamic imports, any access, code inside strings, hand-typed test casts). - Use Case: Before publishing a package, run the gate to list remaining French identifiers, write a per-batch rename plan, apply it, then prove completeness with drift checks, literal checks, root-level typecheck, and a repo-wide search for the old names. ## Quick Start Ask the AI to run the identifier language gate on the repository and list which French identifiers remain to be translated, then plan a safe rename for one batch.

Frequently Asked Questions about nodefony-identifiers

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

FAQPage Schema
How do I find French identifiers in a TypeScript codebase?

Run the check-identifier-language script, which scans production TypeScript, JavaScript, shell, and template files and reports each French identifier with file, line, count, and a suggested translation. It blanks comments and strings first so legitimate French prose never triggers findings.

How do I rename symbols safely across a TypeScript project?

Use the rename-identifiers script with a JSON plan and the TypeScript LanguageService, never regex. Run with --dry first to catch target-name collisions, apply in per-file batches, then verify with drift checks, literal checks, and a root-level typecheck.

Why is regex-based renaming dangerous in TypeScript?

Regex renaming operates on text, not the syntax tree, so it can turn a private #member into a public one, rebind an object shorthand to the wrong declaration, or miss string-keyed data contracts entirely. These failures compile cleanly and only surface at runtime.

Does a green typecheck prove a rename is complete?

No. A typecheck misses dynamic imports, access on any-typed values, code embedded in strings, files outside every tsconfig, and barrel aliases that preserve the old exported name. The skill requires repo-wide searches for old names plus drift and literal controls.

How does the language gate avoid false positives on English code?

It uses a hand-built dictionary of discriminating French words, excluding homographs like content, route, and success, and strips comments, strings, and template text before judging. A benchmark runs it against third-party English packages and fails if any word is flagged by multiple independent publishers.

When should an identifier be declared as an exception instead of renamed?

Declare an exception when the name is a data contract rather than an identifier, such as string-keyed command groups, displayed table headers, or mirrored database column names. Each exception must state its reason, and unused exceptions are reported so they cannot silently lie.