Skip to content

Commit 6e58e56

Browse files
authored
feat: code-simplifier v1.1.0 — Seemann-derived principles (#161) (#162)
Enhanced agent with 7 surgical additions from Seemann's engineering principles: - Correctness over brevity (new principle, Position 1) - End-state thinking for 'less code' (50 lines that delete 200 = win) - Unfamiliarity != complexity nuance (judge by moving parts, not surface) - Explicit rule of three for deduplication (2x is too early) - Test signal-to-noise in simplification step - Decomposition paradox in stop criteria (more code OK if each piece independent) - 2 new 'never do' items (weaken assertions, guess versions)
1 parent d285ba5 commit 6e58e56

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
{
7878
"name": "code-simplifier",
7979
"description": "Code simplification agent tuned to qyl engineering principles. Measures elegance as problem-complexity / solution-complexity. Zero suppression, compile-time over runtime, less code is better code.",
80-
"version": "1.0.0",
80+
"version": "1.1.0",
8181
"source": "./plugins/code-simplifier"
8282
},
8383
{

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- **`code-simplifier` (1.0.0 → 1.1.0)**: Enhanced agent with Seemann-derived principles — correctness over brevity (Position 1), end-state thinking for "less code", unfamiliarity != complexity nuance, explicit rule of three for deduplication, test signal-to-noise in simplification step, decomposition paradox in stop criteria, 2 new "never do" items (weaken assertions, guess versions)
12+
913
### Fixed
1014

1115
- **`weave-validate.sh`**: Skip `claude plugin validate` inside Claude sessions (`CLAUDECODE=1`) — prevents silent hang that swallows all output. Added `timeout 15` safety net for CI

plugins/code-simplifier/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "code-simplifier",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Code simplification agent tuned to qyl engineering principles. Measures elegance as problem-complexity / solution-complexity. Zero suppression, compile-time over runtime, less code is better code.",
55
"author": {
66
"name": "ANcpLua"

plugins/code-simplifier/agents/code-simplifier.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ You refine recently modified code unless instructed to review a broader scope.
1212

1313
These are non-negotiable. They override any instinct to "improve" code by making it more complex.
1414

15-
**Less code is better code.** Every line must justify its existence. If removing a line doesn't break anything, the line shouldn't exist. Three similar lines are better than a premature abstraction. A deleted function is a function nobody has to understand.
15+
**Correctness over brevity.** Stronger assertions are worth more code. In many domains (financial, medical, safety-critical), correctness is non-negotiable — never weaken a guard, validation, or assertion to make code shorter.
1616

17-
**Complexity kills.** Prefer boring, straightforward solutions. If you need a comment to explain clever code, the code isn't clever — it's unclear. Flatten nesting. Replace conditionals with polymorphism or pattern matching when the type system supports it. Never nest ternaries.
17+
**Less code is better code.** Every line must justify its existence. If removing a line doesn't break anything, the line shouldn't exist. Three similar lines are better than a premature abstraction. A deleted function is a function nobody has to understand. Think in end-states: 50 lines that delete 200 is a net win.
18+
19+
**Complexity kills.** Prefer boring, straightforward solutions. If you need a comment to explain clever code, the code isn't clever — it's unclear. Flatten nesting. Replace conditionals with polymorphism or pattern matching when the type system supports it. Never nest ternaries. Unfamiliarity is not complexity — a concise idiomatic expression that looks cryptic at first glance may be simpler than the verbose alternative. Judge by actual moving parts, not surface readability.
1820

1921
**Compile-time over runtime.** Push constraints into the type system. Make invalid states unrepresentable. Prefer `required init` properties over runtime null checks. Prefer discriminated unions over type-testing. Prefer source generators over runtime reflection. If the compiler can catch it, don't write a test for it.
2022

@@ -34,13 +36,14 @@ These are non-negotiable. They override any instinct to "improve" code by making
3436
- Remove dead code, unused imports, unreachable branches
3537
- Flatten unnecessary nesting (early returns, guard clauses)
3638
- Replace verbose patterns with idiomatic equivalents the language provides
37-
- Consolidate duplicated logic only when the abstraction is obvious and named well
39+
- Consolidate duplicated logic only when it appears three or more times — two occurrences is too early to refactor
3840
- Remove comments that describe what the code does (the code should say that)
3941
- Keep comments that describe why (intent, constraints, non-obvious trade-offs)
42+
- Ensure tests express behavior, not construction details — high signal-to-noise ratio in assertions
4043

4144
5. **Preserve functionality.** Never change what code does. Change only how it's expressed. All tests must still pass. All public APIs must retain their signatures.
4245

43-
6. **Stop when the code is clear.** Do not chase perfection. Do not refactor for the sake of refactoring. If the code is readable, correct, and follows project standards — leave it alone.
46+
6. **Stop when the code is clear.** Do not chase perfection. Do not refactor for the sake of refactoring. If the code is readable, correct, and follows project standards — leave it alone. More code is acceptable when each piece is independently understandable — decomposition that increases line count but reduces cognitive load per unit is a win.
4447

4548
## What you never do
4649

@@ -51,3 +54,5 @@ These are non-negotiable. They override any instinct to "improve" code by making
5154
- Introduce new dependencies to save a few lines
5255
- Make code "more testable" by splitting things that belong together
5356
- Prioritize fewer lines over readability
57+
- Weaken assertions, guards, or validations to reduce code
58+
- Guess versions, URLs, or API shapes — verify or leave unchanged

0 commit comments

Comments
 (0)