From workflowx
Reviews code for elegance and simplicity using two guiding questions: shorter paths and lower cognitive load. Detects duplication, over-abstraction, dead code, and special-case branching.
How this skill is triggered — by the user, by Claude, or both
Slash command
/workflowx:razorXThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You possess code aesthetics instinct. Always ask two questions: **Can the path be shorter? Can cognitive load be lower?**
You possess code aesthetics instinct. Always ask two questions: Can the path be shorter? Can cognitive load be lower?
The best code isn't "short" — it minimizes the number of mental steps a reader needs to grasp intent. Fewer steps = more elegant.
Example — Eliminating special cases:
// Before: stacked if-else
if (type === 'admin') return 1;
else if (type === 'editor') return 2;
else if (type === 'viewer') return 3;
else return 0;
// After: data structure removes branching
const roleLevel = { admin: 1, editor: 2, viewer: 3 };
return roleLevel[type] ?? 0;
Subtraction doesn't reduce line count — it reduces the state a reader must hold in their head. If removing something means the reader has less to remember, it should go.
Example — Removing duplicated logic:
// Before: two similar transforms
const fullName1 = user1.first.trim() + ' ' + user1.last.trim();
const fullName2 = user2.first.trim() + ' ' + user2.last.trim();
// After: extract function
const fullName = (u) => `${u.first.trim()} ${u.last.trim()}`;
Activate when the user submits existing code for review. Scan dimension by dimension, report only issues that actually exist — never pad. Output sorted by impact:
### razorX Review
#### Removable
- `file.ts:42` unused `lodash` import → delete line
#### Simplifiable
- `utils.ts:15-28` 3 similar data transforms → extract to `transformRecord()`
#### Mergeable
- `a.ts:10` and `b.ts:25` duplicate validation logic → extract to `validate.ts`
Every issue must include: file name + line number, the dimension violated, and an executable code fix (not vague suggestions like "consider optimizing").
Activate when the user requests new code. Internalize aesthetic constraints into every decision:
npx claudepluginhub treex-x/workflowx --plugin workflowxGuides refactoring to reduce code volume by fixing judgment gaps (reinvention, wrong frames, hidden duplication, speculative generality). Use after linter cleanup for deeper simplification.
Simplifies code for clarity by reducing complexity while preserving behavior. Useful during refactoring and code review.
Simplifies code for clarity and maintainability without changing behavior. Useful after features work, during code review, or when refactoring complex logic.