Skip to content
Skill

K code simplifier

Refactors code for clarity and maintainability without changing its behavior

K code simplifier is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
12
Last commit
License
Apache-2.0
Listing updated

Similar skills

About K code simplifier

This skill guides an agent through simplifying existing code, such as flattening deep nesting, replacing nested ternaries with if/else or switch statements, and removing duplication, while keeping outputs and behavior intact. It asks the agent to run the existing tests before editing, note any behavior the tests leave unpinned, such as boundary values or explicit null arguments, and then re-run the same tests and compare results against the baseline.

The workflow also asks the agent to check rewritten conditions against the original on those edge inputs, since passing tests alone do not prove equivalence. Changes are reported selectively, listing the file, what changed, why it is clearer, and whether tests ran. The guidance warns against over-compact one-liners and against removing abstractions that aid organization.

The skill works on code in any language and expects a project with a test suite it can run. It is published in the konductor repository by AWS Solutions and is distributed as a Claude Code plugin.

When your agent uses it

Simplifies and refines code for clarity, consistency, and maintainability while preserving functionality. Use when asked to simplify, clean up or flatten code (nested ternaries, deep nesting, duplication) without changing behavior.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (3 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the konductor plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add aws-solutions/konductor
/plugin install konductor@konductor

Or copy only this skill to ~/.claude/skills/k-code-simplifier:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/aws-solutions/konductor.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/k-code-simplifier &&
cp -R "$tmp/skills/k-code-simplifier" ~/.claude/skills/k-code-simplifier &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/k-code-simplifier inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/k-code-simplifier to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/aws-solutions/konductor.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/k-code-simplifier &&
cp -R "$tmp/skills/k-code-simplifier" ~/.agents/skills/k-code-simplifier &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/k-code-simplifier inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/k-code-simplifier to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/aws-solutions/konductor.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/k-code-simplifier &&
cp -R "$tmp/skills/k-code-simplifier" ~/.cursor/skills/k-code-simplifier &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/k-code-simplifier inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/aws-solutions/konductor.git --path skills/k-code-simplifier

Or copy the folder to ~/.gemini/skills/k-code-simplifier yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/k-code-simplifier:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/aws-solutions/konductor.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/k-code-simplifier &&
cp -R "$tmp/skills/k-code-simplifier" ~/.copilot/skills/k-code-simplifier &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/k-code-simplifier inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/aws-solutions/konductor.git

Then copy konductor/skills/k-code-simplifier into your agent's skills folder as k-code-simplifier. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Behavior-preserving refactoring
Changes how code is written while requiring that all original outputs and behaviors remain the same.
Baseline test workflow
Runs existing tests before and after edits and reports both results for comparison.
Edge-case checks
Identifies untested inputs such as zero, negative, boundary and null values to verify rewritten logic.
Nesting and ternary cleanup
Flattens deep nesting and replaces nested ternaries with clearer if/else or switch logic.
Clarity guidelines
Favors explicit, descriptive names and readable code over clever compact solutions.

Good for

  • Flatten a deeply nested function without changing its results
  • Replace nested ternary expressions with readable conditionals
  • Remove duplicated logic across several modules
  • Clean up recently modified code before a review
  • Tidy a messy function while keeping its test suite green

K code simplifier FAQ

Does K code simplifier need any scripts or extra tools?

The skill ships as a single SKILL.md with no scripts. It expects the project's own tests to be runnable so the agent can compare results before and after changes.

What happens if the code has no tests?

The workflow tells the agent to say so before changing anything, since it cannot confirm behavior is preserved without a baseline.

When does the skill trigger?

It applies when a user asks to simplify, clean up or flatten code, such as removing nested ternaries, deep nesting or duplication, without changing behavior.

How do I install K code simplifier in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/k-code-simplifier to use it in all your projects, or to .claude/skills/k-code-simplifier in one project. Or install the konductor plugin, which includes it: /plugin marketplace add aws-solutions/konductor, then /plugin install konductor@konductor.

Does K code simplifier run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use K code simplifier?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to K code simplifier?

The closest alternatives to K code simplifier are Code simplifier, Code simplification, Code simplification edho ferdian, Code simplification and Principle subtract before you add.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from aws-solutions/konductor

  1. Helps diagnose and troubleshoot an existing Konductor install, CLI, and MCP setup

    • Open source
    • 12 GitHub stars
    • Developer tools
  2. Installs, updates or removes the Konductor toolkit in a Kiro workspace with consent gates

    • Open source
    • 12 GitHub stars
    • Developer tools
  3. Onboards you to Konductor: install the CLI, set up agent content, and start a session

    • Open source
    • 12 GitHub stars
    • Developer tools
  4. Adversarial second-pass code review that hunts for disclosure, data integrity

    • Open source
    • 12 GitHub stars
    • Security