Agent skill

Stylistic Refactor

by nklisch in nklisch/claude-code-modes

Project stylistic refactoring rules for Bun/TypeScript CLI. An agent skill from nklisch/claude-code-modes.

MITAuto-check: notesDevelopment

Install Stylistic Refactor

skills CLI
$ npx skills add nklisch/claude-code-modes --skill stylistic-refactor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nklisch/claude-code-modes stylistic-refactor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nklisch/claude-code-modes.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/stylistic-refactor .claude/skills/stylistic-refactor && rm -rf skills-src

Use ~/.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/

Facts

Skill name
stylistic-refactor
GitHub stars
116
Token cost
~523 tokens
SKILL.md length
186 words
Files
8 (incl. references)
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Project stylistic refactoring rules for Bun/TypeScript CLI. An agent skill from nklisch/claude-code-modes.

  • Tasks that involve Refactoring
  • SKILL.md covers Styles and Output
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Stylistic Refactor is an agent skill from nklisch/claude-code-modes. Project stylistic refactoring rules for Bun/TypeScript CLI. Proactively scans for refactoring opportunities and produces a prioritized plan. Defines the team's preferred coding style.

Its SKILL.md is about 520 tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/concatenation-style.md`, `references/declarative-imperative-split.md` and `references/early-returns.md`).

It sits in Development, covering Refactoring. It works with TypeScript. The repository describes itself as: CLI launcher for Claude Code with behaviorally-tuned system prompts — control agency, quality, and scope instead of fighting the defaults. The licence is MIT.

When your agent uses it

  • Tasks that involve Refactoring

Example prompts

  • “/stylistic-refactor”

Requirements

  • Pre-approved tools (allowed-tools): Read, Glob, Grep, Bash, Agent, Write

What it can do on your machine

Read from SKILL.md and the folder at commit 4dbbb28. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep
    • Bash
    • Agent
    • Write

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Stylistic Refactor loads about 523 tokens when it runs, and up to ~4.7k if it reads all its reference files. Until then it costs about 51 tokens; SKILL.md has 186 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~523
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.7k

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.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Glob, Grep, Bash, Agent, Write

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.

SKILL.md

The full file from nklisch/claude-code-modes at commit 4dbbb28, republished under its MIT licence (© nklisch). 186 words, ~523 tokens.

Download SKILL.mdSave it as .claude/skills/stylistic-refactor/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
stylistic-refactor
description
Project stylistic refactoring rules for Bun/TypeScript CLI. Proactively scans for refactoring opportunities and produces a prioritized plan. Defines the team's preferred coding style.
allowed-tools
Read, Glob, Grep, Bash, Agent, Write
user-invocable
true

Stylistic Refactor

Scan the codebase for opportunities to apply these stylistic preferences. Each style has a reference file with rationale, examples, and exceptions.

Styles

StyleRule (one line)Reference
Functions Over ClassesUse top-level functions and plain objects; never introduce classesdetails
Early ReturnsUse guard clauses and early returns; never nest more than 2 levels deepdetails
Declarative/Imperative SplitDeclarative (.map/.filter) for pure transforms; imperative for-loops for side effectsdetails
Immutable FirstCreate new objects via spread; mutate only caller-owned local datadetails
Ternary DisciplineTernaries for simple 2-branch expressions only; if/else for anything complexdetails
Verb-First NamingFunctions start with verbs; booleans use is/has prefixesdetails
Concatenation StyleTemplate literals for multi-line strings; + concatenation for simple joinsdetails

Output

Write the refactoring plan to docs/stylistic-refactor-plan.md (create docs/ if needed).

The document should be a prioritized refactoring plan with these sections:

High Value

Implement-ready entries with file:line, current code, target code, and acceptance criteria.

Worth Considering

Valid refactors with moderate impact. Brief entries with file paths and rationale.

Not Worth It

Code that technically violates a style but should NOT be refactored, with explanation why.

© nklisch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in .claude/skills/stylistic-refactor of nklisch/claude-code-modes.

  • SKILL.md
  • references/concatenation-style.md
  • references/declarative-imperative-split.md
  • references/early-returns.md
  • references/functions-over-classes.md
  • references/immutable-first.md
  • references/ternary-discipline.md
  • references/verb-first-naming.md

Open the folder on GitHubat commit 4dbbb28

Compare with similar skills

Stylistic Refactor 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.

Stylistic Refactor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stylistic Refactor this skillnklisch/claude-code-modes116—~523Automated safety check: NotesMIT
Svelte5 Best PracticesSikandarJODD/cnblocks4311 repos~810Automated safety check: PassMIT
Dinero Best Practicesdinerojs/dinero.js6.8k—~756Automated safety check: PassMIT
Code Guidelinesgetsentry/sentry-react-native1.8k—~3.2kAutomated safety check: PassMIT
AST Visitor Pattern for Unionsprisma/orm48k—~830Automated safety check: PassApache-2.0
ast-grep Codemod Referencewarp-drive-data/warp-drive3.2k—~2.6kAutomated safety check: PassMIT

Similar skills

  • Svelte5 Best Practices

    SikandarJODD/cnblocks

    Svelte 5 runes, snippets, SvelteKit patterns, and modern best practices for TypeScript and component development.

    431 GitHub starsUsed in 1 repo~810 tokens
    DevelopmentAuto-check passed
  • Dinero Best Practices

    dinerojs/dinero.js

    Core best practices for the Dinero.js money library. An agent skill from dinerojs/dinero.js.

    6.8k GitHub stars~756 tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Code Guidelines

    getsentry/sentry-react-native

    Official

    Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review.

    1.8k GitHub stars~3.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Replaces a plain TypeScript union plus switch statements with frozen subclasses and a visitor interface when several places dispatch on the same variants.

    48k GitHub stars~830 tokensUpdated today
    DevelopmentAuto-check passed
  • ast-grep Codemod Reference

    warp-drive-data/warp-drive

    Reference for writing and debugging TypeScript and JavaScript codemods with @ast-grep/napi: parsing, node queries, meta-variables, rule objects and editing.

    3.2k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Deep Refactor Audit

    AlmanacCode/codealmanac

    A skill your agent uses when a user asks for a major architecture/refactor audit, codebase smell investigation, boundary critique, feature simplification review, vibe-coded or AI-generated code…

    997 GitHub stars~3.5k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed

More from nklisch/claude-code-modes

  • Sync Upstream

    nklisch/claude-code-modes

    Compare this project's base prompts and model metadata against a Claude Code release.

    116 GitHub stars~1.8k tokensUpdated 9 days ago
    Auto-check: notes
  • Structural Refactor

    nklisch/claude-code-modes

    Project structural organization rules for Bun/TypeScript CLI.

    116 GitHub stars~526 tokensUpdated 9 days ago
    Auto-check: notes
  • Patterns

    nklisch/claude-code-modes

    Project code patterns and conventions. An agent skill from nklisch/claude-code-modes.

    116 GitHub stars~228 tokensUpdated 9 days ago
    Auto-check passed

Works with

Categories

Questions about Stylistic Refactor

What does Stylistic Refactor do?

Project stylistic refactoring rules for Bun/TypeScript CLI. An agent skill from nklisch/claude-code-modes. Stylistic Refactor is an agent skill from nklisch/claude-code-modes. Project stylistic refactoring rules for Bun/TypeScript CLI.

When should I use Stylistic Refactor?

Stylistic Refactor fits situations like: tasks that involve Refactoring.

How do I install Stylistic Refactor in Claude Code?

Run `npx skills add nklisch/claude-code-modes --skill stylistic-refactor -a claude-code`. Or copy the skill folder (.claude/skills/stylistic-refactor in nklisch/claude-code-modes) into .claude/skills/stylistic-refactor in your project. Claude Code loads it when a task matches its description.

How do I install Stylistic Refactor in Codex?

Run `npx skills add nklisch/claude-code-modes --skill stylistic-refactor -a codex`. Or copy the skill folder (.claude/skills/stylistic-refactor in nklisch/claude-code-modes) into .agents/skills/stylistic-refactor in your project. Codex loads it when a task matches its description.

Can I use Stylistic Refactor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nklisch/claude-code-modes --skill stylistic-refactor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stylistic-refactor, .gemini/skills/stylistic-refactor, .github/skills/stylistic-refactor and .opencode/skills/stylistic-refactor in your project.

What does Stylistic Refactor need to run?

SKILL.md names no scripts, command-line tools or credentials: Stylistic Refactor is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Glob, Grep, Bash, Agent, Write.

Does Stylistic Refactor access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Stylistic Refactor safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Stylistic Refactor use?

Stylistic Refactor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stylistic Refactor use?

About 523 tokens (SKILL.md is roughly 2.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.1k tokens, read only when the agent opens those files.

What are the alternatives to Stylistic Refactor?

Skills that share tags, products or a category with Stylistic Refactor: Svelte5 Best Practices (SikandarJODD/cnblocks, 431 stars), Dinero Best Practices (dinerojs/dinero.js, 6.8k stars), Code Guidelines (getsentry/sentry-react-native, 1.8k stars) and AST Visitor Pattern for Unions (prisma/orm, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stylistic Refactor?

nklisch (a GitHub user) maintains it in nklisch/claude-code-modes, which has 116 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 1, 2026.

Source: nklisch/claude-code-modes on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.