Codebase Health Refactoring
kucherenko/jscpd
A three-part cleanup guided by jscpd: measure health, then fix duplicated code, remove dead code and simplify the most complex files, finishing by re-measuring the score.
Finds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes.
$ npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install citrolabs/ego-lite ego-lite-simplify --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/citrolabs/ego-lite.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/dev-skills/ego-lite-simplify .claude/skills/ego-lite-simplify && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "ego-lite-simplify" agent skill from https://github.com/citrolabs/ego-lite/tree/main/.github/dev-skills/ego-lite-simplify into .claude/skills/ego-lite-simplify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ego-lite-simplify", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/citrolabs/ego-lite/tree/main/.github/dev-skills/ego-lite-simplifyType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install citrolabs/ego-lite ego-lite-simplify --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/citrolabs/ego-lite.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/dev-skills/ego-lite-simplify .agents/skills/ego-lite-simplify && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "ego-lite-simplify" agent skill from https://github.com/citrolabs/ego-lite/tree/main/.github/dev-skills/ego-lite-simplify into .agents/skills/ego-lite-simplify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ego-lite-simplify", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install citrolabs/ego-lite ego-lite-simplify --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/citrolabs/ego-lite.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/dev-skills/ego-lite-simplify .cursor/skills/ego-lite-simplify && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "ego-lite-simplify" agent skill from https://github.com/citrolabs/ego-lite/tree/main/.github/dev-skills/ego-lite-simplify into .cursor/skills/ego-lite-simplify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ego-lite-simplify", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/citrolabs/ego-lite.git --path .github/dev-skills/ego-lite-simplify--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install citrolabs/ego-lite ego-lite-simplify --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/citrolabs/ego-lite.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/dev-skills/ego-lite-simplify .gemini/skills/ego-lite-simplify && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "ego-lite-simplify" agent skill from https://github.com/citrolabs/ego-lite/tree/main/.github/dev-skills/ego-lite-simplify into .gemini/skills/ego-lite-simplify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ego-lite-simplify", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install citrolabs/ego-lite ego-lite-simplifyInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/citrolabs/ego-lite.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/dev-skills/ego-lite-simplify .github/skills/ego-lite-simplify && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "ego-lite-simplify" agent skill from https://github.com/citrolabs/ego-lite/tree/main/.github/dev-skills/ego-lite-simplify into .github/skills/ego-lite-simplify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ego-lite-simplify", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install citrolabs/ego-lite ego-lite-simplify --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/citrolabs/ego-lite.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/dev-skills/ego-lite-simplify .opencode/skills/ego-lite-simplify && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "ego-lite-simplify" agent skill from https://github.com/citrolabs/ego-lite/tree/main/.github/dev-skills/ego-lite-simplify into .opencode/skills/ego-lite-simplify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ego-lite-simplify", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
ego-lite-simplifyFinds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes.
The aim is to cut concepts and maintenance surface rather than line count, preferring a few well-proven deletions to a long list of guesses. The agent first reads `AGENTS.md` and the design document that owns the behavior, checks `git status` to preserve unrelated changes, and decides whether the request is an audit or an authorized implementation. It also maps the boundaries: `globalThis.ego` comes from a closed-source app and is documented in `docs/native-bindings-api.md`, there are CLI and embedded SDK startup paths, and public agent APIs must stay aligned with tests, `help()` and `skills/ego-browser/SKILL.md`.
Strong candidates include exports, options and fallbacks with no production consumer, tests or docs that are the only users of dropped behavior, duplicated state representations, pass-through layers, compatibility code on a breaking branch and hand-written parsers, queues or retry logic that a Node.js built-in could replace. Moving logic into a wrapper does not count, and each candidate is proven with `rg` searches and a read of its callers before anything is removed.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit dca7003. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
npmgitFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use npm and git, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Code Simplification for ego-lite loads about 1.2k tokens when it runs. Until then it costs about 98 tokens; SKILL.md has 605 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from citrolabs/ego-lite at commit dca7003, republished under its MIT licence (© citrolabs). 605 words, ~1,211 tokens.
.claude/skills/ego-lite-simplify/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Reduce concepts and maintenance surface, not just line count. Prefer a few well-proven deletions over a long list of guesses.
AGENTS.md and the design document that owns the affected behavior.git status and preserve unrelated user changes.globalThis.ego is supplied by the closed-source app; docs/native-bindings-api.md documents that external contract.help(), and skills/ego-browser/SKILL.md.Start with production areas carrying the most state, branching, or public surface. Look for:
Do not count moving logic into a wrapper as simplification. Estimate the net result: implementation, tests, docs, public names, state transitions, and special cases removed minus new glue and dependencies added.
Use rg first. Search exact symbols, method forms, event names, configuration keys, error codes, protocol strings, and dynamic registration points. Read the callers rather than relying only on static-analysis output.
Classify evidence as:
package/ego-browser/src, runtime scripts, build and loader paths, and shipped site learnings.help(), skills/ego-browser/SKILL.md, architecture documents, and native binding behavior.Reject or downgrade a candidate when a real production caller exists, the native contract is uncertain, the change merely relocates complexity, or the deletion requires unrelated churn. A small local cleanup may be implemented directly; a behavior or API decision belongs in the owning design document first.
For an audit, present each worthwhile candidate with:
Call out candidates that require a user decision separately from behavior-preserving cleanups.
Follow spec-driven TDD when changing code:
Run the narrowest relevant checks first. From package/ego-browser/, use npm test for runtime changes, npm run e2e for real task-space/browser behavior, and npm run validate:site-skills for learning changes. Finish with git diff --check and report any verification that could not run.
Never edit generated build output as the source of a simplification. Never remove a defensive path until its trust or lifecycle boundary is understood.
© citrolabs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in .github/dev-skills/ego-lite-simplify of citrolabs/ego-lite.
Open the folder on GitHubat commit dca7003
Code Simplification for ego-lite next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Code Simplification for ego-lite this skillcitrolabs/ego-lite | 17k | — | ~1.2k | Automated safety check: Pass | MIT | |
| Codebase Health Refactoringkucherenko/jscpd | 6.4k | — | ~2.5k | Automated safety check: Pass | MIT | |
| DRY Refactoring With jscpdkucherenko/jscpd | 6.4k | — | ~2.1k | Automated safety check: Pass | MIT | |
| Dead Code Removal with Knipshift-editor/shift | 348 | — | ~1.8k | Automated safety check: Pass | Apache-2.0 | |
| TechdebtDataDog/dd-trace-java | 736 | — | ~565 | Automated safety check: Notes | Apache-2.0 | |
| Code RefinerMathews-Tom/armory | 328 | — | ~3.1k | Automated safety check: Pass | MIT |
kucherenko/jscpd
A three-part cleanup guided by jscpd: measure health, then fix duplicated code, remove dead code and simplify the most complex files, finishing by re-measuring the score.
kucherenko/jscpd
Removes copy-paste duplication found by jscpd, starting with exact clones and hotspots, then renamed and near-miss copies, using proven refactoring strategies.
shift-editor/shift
Finds unused files, exports and class members with Knip, then verifies each candidate through reference tracing before removing anything, never using knip --fix.
DataDog/dd-trace-java
Review a code diff / branch / PR for technical debt — code duplication, unnecessary complexity / over-engineering, and redundant or dead code.
Mathews-Tom/armory
Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.
luongnv89/claude-howto
Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.
Works with
Categories
Finds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes. The aim is to cut concepts and maintenance surface rather than line count, preferring a few well-proven deletions to a long list of guesses.md` and the design document that owns the behavior, checks `git status` to preserve unrelated changes, and decides whether the request is an audit or an authorized implementation.
Code Simplification for ego-lite fits situations like: auditing ego-lite for dead code or duplicated state; replacing hand-written utilities with a Node.js built-in; reducing maintenance surface without changing behavior silently.
Run `npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a claude-code`. Or copy the skill folder (.github/dev-skills/ego-lite-simplify in citrolabs/ego-lite) into .claude/skills/ego-lite-simplify in your project. Claude Code loads it when a task matches its description.
Run `npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a codex`. Or copy the skill folder (.github/dev-skills/ego-lite-simplify in citrolabs/ego-lite) into .agents/skills/ego-lite-simplify in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add citrolabs/ego-lite --skill ego-lite-simplify -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ego-lite-simplify, .gemini/skills/ego-lite-simplify, .github/skills/ego-lite-simplify and .opencode/skills/ego-lite-simplify in your project.
Going by SKILL.md and its folder, Code Simplification for ego-lite needs the command-line tools its instructions call (npm and git). Our summary lists: A checkout of the ego-lite repository.
SKILL.md contains no URLs. Its commands use npm and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Code Simplification for ego-lite is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Code Simplification for ego-lite: Codebase Health Refactoring (kucherenko/jscpd, 6.4k stars), DRY Refactoring With jscpd (kucherenko/jscpd, 6.4k stars), Dead Code Removal with Knip (shift-editor/shift, 348 stars) and Techdebt (DataDog/dd-trace-java, 736 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
citrolabs (a GitHub organization) maintains it in citrolabs/ego-lite, which has 16,997 GitHub stars. The repository was last updated on October 8, 2026.
Source: citrolabs/ego-lite on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.