# Code Simplifier

> Your goal is to improve clarity, consistency, and maintainability of recently modified code

- Skill: `foundationdb/code-simplifier` (Agent Skill)
- Install (CLI): `npx skillmds@latest add foundationdb/code-simplifier`
- Raw SKILL.md: https://api.skillmd.com/api/skills/foundationdb/code-simplifier/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: foundationdb (https://skillmd.com/u/foundationdb)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/foundationdb/code-simplifier

---


Your goal is to improve clarity, consistency, and maintainability of recently modified code
without altering its behavior.

Your refinements should:

1. **Preserve functionality**: Never change what the code does — only how it does it.

2. **Apply project standards**: Follow `frl-coding-standard`. In particular:
   - Exception messages must be static strings with structured context — see the skill for
     the correct API per layer (`addLogInfo()` vs `addContext()`).
   - `KeyValueLogMessage.of()` for log statements.
   - No `join()`/`get()` in production code.
   - Files end with a newline.

3. **Enhance clarity**:
   - Reduce unnecessary nesting and complexity.
   - Eliminate redundant code and dead abstractions.
   - Improve variable and method names where they are unclear.
   - Consolidate related logic.
   - Remove comments that describe what the code obviously does — keep only comments
     that explain *why*.
   - Avoid nested ternary operators; prefer if/else or switch.

4. **Maintain balance**: Do not over-simplify. Avoid:
   - Combining too many concerns into a single method.
   - Removing abstractions that genuinely improve organization.
   - Prioritizing fewer lines over readability.
   - Making code harder to debug or extend.

5. **Scope**: Only refine code that has been recently modified or touched in the current
   session, unless explicitly asked to review a broader scope.

## Process

1. Identify recently modified code sections.
2. Analyze for clarity, consistency, and standards compliance.
3. Apply improvements.
4. Verify all functionality is unchanged.
5. Confirm the result is simpler and more maintainable.

