Ponytail
DavidObando/gsharp
Forces the laziest solution that actually works, simplest, shortest, most minimal.
Simplifies code for clarity. An agent skill from sanity-io/sanity.
$ npx skills add sanity-io/sanity --skill code-simplification -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install sanity-io/sanity code-simplification --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/sanity-io/sanity.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/code-simplification .claude/skills/code-simplification && 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 "code-simplification" agent skill from https://github.com/sanity-io/sanity/tree/main/.agents/skills/code-simplification into .claude/skills/code-simplification/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplification", 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/sanity-io/sanity/tree/main/.agents/skills/code-simplificationType 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 sanity-io/sanity --skill code-simplification -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install sanity-io/sanity code-simplification --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanity-io/sanity.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/code-simplification .agents/skills/code-simplification && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "code-simplification" agent skill from https://github.com/sanity-io/sanity/tree/main/.agents/skills/code-simplification into .agents/skills/code-simplification/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplification", 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 sanity-io/sanity --skill code-simplification -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install sanity-io/sanity code-simplification --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanity-io/sanity.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/code-simplification .cursor/skills/code-simplification && 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 "code-simplification" agent skill from https://github.com/sanity-io/sanity/tree/main/.agents/skills/code-simplification into .cursor/skills/code-simplification/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplification", 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/sanity-io/sanity.git --path .agents/skills/code-simplification--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 sanity-io/sanity --skill code-simplification -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install sanity-io/sanity code-simplification --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanity-io/sanity.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/code-simplification .gemini/skills/code-simplification && 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 "code-simplification" agent skill from https://github.com/sanity-io/sanity/tree/main/.agents/skills/code-simplification into .gemini/skills/code-simplification/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplification", 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 sanity-io/sanity code-simplificationInstalls 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 sanity-io/sanity --skill code-simplification -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/sanity-io/sanity.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/code-simplification .github/skills/code-simplification && 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 "code-simplification" agent skill from https://github.com/sanity-io/sanity/tree/main/.agents/skills/code-simplification into .github/skills/code-simplification/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplification", 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 sanity-io/sanity --skill code-simplification -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install sanity-io/sanity code-simplification --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanity-io/sanity.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/code-simplification .opencode/skills/code-simplification && 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 "code-simplification" agent skill from https://github.com/sanity-io/sanity/tree/main/.agents/skills/code-simplification into .opencode/skills/code-simplification/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplification", 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.
code-simplificationSimplifies code for clarity. An agent skill from sanity-io/sanity.
Code Simplification is an agent skill from sanity-io/sanity, published by the product's own GitHub organization. Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.
Its SKILL.md is about 3.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Code simplification and Refactoring. The repository describes itself as: Sanity Studio – Rapidly configure content workspaces powered by structured content. The licence is MIT.
9 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 982525c. 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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and python).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom 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 loads about 3.8k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 1,162 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 sanity-io/sanity at commit 982525c, republished under its MIT licence (© sanity-io). 1,162 words, ~3,808 tokens.
.claude/skills/code-simplification/SKILL.md (or your agent's skills folder).Inspired by the Claude Code Simplifier plugin. Adapted here as a model-agnostic, process-driven skill for any AI coding agent.
Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines — it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"
When NOT to use:
Don't change what the code does — only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.
ASK BEFORE EVERY CHANGE:
→ Does this produce the same output for every input?
→ Does this maintain the same error behavior?
→ Does this preserve the same side effects and ordering?
→ Do all existing tests still pass without modification?Simplification means making code more consistent with the codebase, not imposing external preferences. Before simplifying:
1. Read CLAUDE.md / project conventions
2. Study how neighboring code handles similar patterns
3. Match the project's style for:
- Import ordering and module system
- Function declaration style
- Naming conventions
- Error handling patterns
- Type annotation depthSimplification that breaks project consistency is not simplification — it's churn.
Explicit code is better than compact code when the compact version requires a mental pause to parse.
// UNCLEAR: Dense ternary chain
const label = isNew ? 'New' : isUpdated ? 'Updated' : isArchived ? 'Archived' : 'Active'
// CLEAR: Readable mapping
function getStatusLabel(item: Item): string {
if (item.isNew) return 'New'
if (item.isUpdated) return 'Updated'
if (item.isArchived) return 'Archived'
return 'Active'
}// UNCLEAR: Chained reduces with inline logic
const result = items.reduce(
(acc, item) => ({
...acc,
[item.id]: {...acc[item.id], count: (acc[item.id]?.count ?? 0) + 1},
}),
{},
)
// CLEAR: Named intermediate step
const countById = new Map<string, number>()
for (const item of items) {
countById.set(item.id, (countById.get(item.id) ?? 0) + 1)
}Simplification has a failure mode: over-simplification. Watch for these traps:
Default to simplifying recently modified code. Avoid drive-by refactors of unrelated code unless explicitly asked to broaden scope. Unscoped simplification creates noise in diffs and risks unintended regressions.
Before changing or removing anything, understand why it exists. This is Chesterton's Fence: if you see a fence across a road and don't understand why it's there, don't tear it down. First understand the reason, then decide if the reason still applies.
BEFORE SIMPLIFYING, ANSWER:
- What is this code's responsibility?
- What calls it? What does it call?
- What are the edge cases and error paths?
- Are there tests that define the expected behavior?
- Why might it have been written this way? (Performance? Platform constraint? Historical reason?)
- Check git blame: what was the original context for this code?If you can't answer these, you're not ready to simplify. Read more context first.
Scan for these patterns — each one is a concrete signal, not a vague smell:
Structural complexity:
| Pattern | Signal | Simplification |
|---|---|---|
| Deep nesting (3+ levels) | Hard to follow control flow | Extract conditions into guard clauses or helper functions |
| Long functions (50+ lines) | Multiple responsibilities | Split into focused functions with descriptive names |
| Nested ternaries | Requires mental stack to parse | Replace with if/else chains, switch, or lookup objects |
| Boolean parameter flags | doThing(true, false, true) | Replace with options objects or separate functions |
| Repeated conditionals | Same if check in multiple places | Extract to a well-named predicate function |
Naming and readability:
| Pattern | Signal | Simplification |
|---|---|---|
| Generic names | data, result, temp, val, item | Rename to describe the content: userProfile, validationErrors |
| Abbreviated names | usr, cfg, btn, evt | Use full words unless the abbreviation is universal (id, url, api) |
| Misleading names | Function named get that also mutates state | Rename to reflect actual behavior |
| Comments explaining "what" | // increment counter above count++ | Delete the comment — the code is clear enough |
| Comments explaining "why" | // Retry because the API is flaky under load | Keep these — they carry intent the code can't express |
Redundancy:
| Pattern | Signal | Simplification |
|---|---|---|
| Duplicated logic | Same 5+ lines in multiple places | Extract to a shared function |
| Dead code | Unreachable branches, unused variables, commented-out blocks | Remove (after confirming it's truly dead) |
| Unnecessary abstractions | Wrapper that adds no value | Inline the wrapper, call the underlying function directly |
| Over-engineered patterns | Factory-for-a-factory, strategy-with-one-strategy | Replace with the simple direct approach |
| Redundant type assertions | Casting to a type that's already inferred | Remove the assertion |
Make one simplification at a time. Run tests after each change. Submit refactoring changes separately from feature or bug fix changes. A PR that refactors and adds a feature is two PRs — split them.
FOR EACH SIMPLIFICATION:
1. Make the change
2. Run the test suite
3. If tests pass → commit (or continue to next simplification)
4. If tests fail → revert and reconsiderAvoid batching multiple simplifications into a single untested change. If something breaks, you need to know which simplification caused it.
The Rule of 500: If a refactoring would touch more than 500 lines, invest in automation (codemods, sed scripts, AST transforms) rather than making the changes by hand. Manual edits at that scale are error-prone and exhausting to review.
After all simplifications, step back and evaluate the whole:
COMPARE BEFORE AND AFTER:
- Is the simplified version genuinely easier to understand?
- Did you introduce any new patterns inconsistent with the codebase?
- Is the diff clean and reviewable?
- Would a teammate approve this change?If the "simplified" version is harder to understand or review, revert. Not every simplification attempt succeeds.
// SIMPLIFY: Unnecessary async wrapper
// Before
async function getUser(id: string): Promise<User> {
return await userService.findById(id)
}
// After
function getUser(id: string): Promise<User> {
return userService.findById(id)
}
// SIMPLIFY: Verbose conditional assignment
// Before
let displayName: string
if (user.nickname) {
displayName = user.nickname
} else {
displayName = user.fullName
}
// After
const displayName = user.nickname || user.fullName
// SIMPLIFY: Manual array building
// Before
const activeUsers: User[] = []
for (const user of users) {
if (user.isActive) {
activeUsers.push(user)
}
}
// After
const activeUsers = users.filter((user) => user.isActive)
// SIMPLIFY: Redundant boolean return
// Before
function isValid(input: string): boolean {
if (input.length > 0 && input.length < 100) {
return true
}
return false
}
// After
function isValid(input: string): boolean {
return input.length > 0 && input.length < 100
}# SIMPLIFY: Verbose dictionary building
# Before
result = {}
for item in items:
result[item.id] = item.name
# After
result = {item.id: item.name for item in items}
# SIMPLIFY: Nested conditionals with early return
# Before
def process(data):
if data is not None:
if data.is_valid():
if data.has_permission():
return do_work(data)
else:
raise PermissionError("No permission")
else:
raise ValueError("Invalid data")
else:
raise TypeError("Data is None")
# After
def process(data):
if data is None:
raise TypeError("Data is None")
if not data.is_valid():
raise ValueError("Invalid data")
if not data.has_permission():
raise PermissionError("No permission")
return do_work(data)// SIMPLIFY: Verbose conditional rendering
// Before
function UserBadge({user}: Props) {
if (user.isAdmin) {
return <Badge variant="admin">Admin</Badge>
} else {
return <Badge variant="default">User</Badge>
}
}
// After
function UserBadge({user}: Props) {
const variant = user.isAdmin ? 'admin' : 'default'
const label = user.isAdmin ? 'Admin' : 'User'
return <Badge variant={variant}>{label}</Badge>
}
// SIMPLIFY: Prop drilling through intermediate components
// Before — consider whether context or composition solves this better.
// This is a judgment call — flag it, don't auto-refactor.| Rationalization | Reality |
|---|---|
| "It's working, no need to touch it" | Working code that's hard to read will be hard to fix when it breaks. Simplifying now saves time on every future change. |
| "Fewer lines is always simpler" | A 1-line nested ternary is not simpler than a 5-line if/else. Simplicity is about comprehension speed, not line count. |
| "I'll just quickly simplify this unrelated code too" | Unscoped simplification creates noisy diffs and risks regressions in code you didn't intend to change. Stay focused. |
| "The types make it self-documenting" | Types document structure, not intent. A well-named function explains why better than a type signature explains what. |
| "This abstraction might be useful later" | Don't preserve speculative abstractions. If it's not used now, it's complexity without value. Remove it and re-add when needed. |
| "The original author must have had a reason" | Maybe. Check git blame — apply Chesterton's Fence. But accumulated complexity often has no reason; it's just the residue of iteration under pressure. |
| "I'll refactor while adding this feature" | Separate refactoring from feature work. Mixed changes are harder to review, revert, and understand in history. |
After completing a simplification pass:
© sanity-io, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/code-simplification of sanity-io/sanity.
Open the folder on GitHubat commit 982525c
We found 16 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 11 other GitHub owners. This page covers the copy in sanity-io/sanity, which our catalogue first saw on October 7, 2026.
Code Simplification 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 this skillsanity-io/sanity | 6.4k | 11 repos | ~3.8k | Automated safety check: Pass | MIT | |
| PonytailDavidObando/gsharp | 564 | 8 repos | ~1.7k | Automated safety check: Pass | MIT | |
| Code Simplification for ego-litecitrolabs/ego-lite | 17k | — | ~1.2k | Automated safety check: Pass | MIT | |
| Refactor Pass for Simplicitystar-history/star-history | 9.6k | 1 repos | ~168 | Automated safety check: Pass | MIT | |
| RTK Rust Code Simplifierrtk-ai/rtk | 83k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Deslopmillionco/react-doctor | 15k | — | ~1.2k | Automated safety check: Pass | Custom licence |
DavidObando/gsharp
Forces the laziest solution that actually works, simplest, shortest, most minimal.
citrolabs/ego-lite
Finds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes.
star-history/star-history
Perform a refactor pass focused on simplicity after recent changes. Use when the user asks for a refactor/cleanup pass, simplification, or dead-code removal…
rtk-ai/rtk
Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.
millionco/react-doctor
Simplify and refine recently modified code while preserving functionality.
tt-a1i/simplify-codebase
Simplification audit or authorized codebase simplification whose stated objective is to remove accidental complexity.
sanity-io/sanity
Automates browser interactions for web testing, form filling, screenshots, and data extraction.
sanity-io/sanity
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities.
sanity-io/sanity
React and Next.js performance optimization guidelines from Vercel Engineering.
sanity-io/sanity
Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block.
sanity-io/sanity
React DevTools CLI for AI agents. An agent skill from sanity-io/sanity.
sanity-io/sanity
Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.
Categories
Simplifies code for clarity. An agent skill from sanity-io/sanity. Code Simplification is an agent skill from sanity-io/sanity, published by the product's own GitHub organization. Simplifies code for clarity.
Code Simplification fits situations like: refactoring code for clarity without changing behavior; code works but is harder to read; extend than it should be; reviewing code that has accumulated unnecessary complexity.
Run `npx skills add sanity-io/sanity --skill code-simplification -a claude-code`. Or copy the skill folder (.agents/skills/code-simplification in sanity-io/sanity) into .claude/skills/code-simplification in your project. Claude Code loads it when a task matches its description.
Run `npx skills add sanity-io/sanity --skill code-simplification -a codex`. Or copy the skill folder (.agents/skills/code-simplification in sanity-io/sanity) into .agents/skills/code-simplification 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 sanity-io/sanity --skill code-simplification -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-simplification, .gemini/skills/code-simplification, .github/skills/code-simplification and .opencode/skills/code-simplification in your project.
SKILL.md names no scripts, command-line tools or credentials: Code Simplification is instructions for the agent only. Our summary lists: Python 3.
SKILL.md names 1 domain. As links in the text: github.com. 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 is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.8k tokens (SKILL.md is roughly 15k 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: Ponytail (DavidObando/gsharp, 564 stars), Code Simplification for ego-lite (citrolabs/ego-lite, 17k stars), Refactor Pass for Simplicity (star-history/star-history, 9.6k stars) and RTK Rust Code Simplifier (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
sanity-io (a GitHub organization, an official publisher) maintains it in sanity-io/sanity, which has 6,352 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on October 7, 2026.
Source: sanity-io/sanity on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.