Individual skill
same-results-less-code
Same behaviour in fewer, clearer lines — covers the judgment gaps that linters cannot catch (reinvention, wrong frame, hidden duplication, derived state, procedural rebuilds, speculative generality, defensive excess, type-system underuse). Trigger when reviewing, refactoring, or simplifying code — and even when the user doesn't explicitly ask for "simplification" but is reviewing code, refactoring, or asking "is there a shorter way to write this?". Complements knip/eslint/ruff/tsc by focusing on the conceptual modelling layer those tools cannot see.
skills/.experimental/same-results-less-code/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 222
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 11,550 bytesREADME.mddoc · 6,681 bytesSKILL.mdcore · 12,231 bytesSKILL.mdcore · 12,231 bytesassets/templates/_template.mddoc · 2,713 bytesmetadata.jsonasset · 1,597 bytesreferences/_sections.mddoc · 3,040 bytesreferences/defense-guard-against-impossible.mddoc · 4,060 bytesreferences/defense-let-it-throw.mddoc · 4,469 bytesreferences/defense-null-pollution-from-bad-modelling.mddoc · 3,967 bytesreferences/defense-validate-once-at-boundary.mddoc · 4,002 bytesreferences/derive-boolean-from-data.mddoc · 3,449 bytesreferences/derive-cache-as-getter-not-field.mddoc · 3,567 bytesreferences/derive-dont-store-computed.mddoc · 3,958 bytesreferences/derive-single-source-of-truth.mddoc · 3,541 bytesreferences/derive-url-as-state.mddoc · 3,456 bytesreferences/dup-config-not-copies.mddoc · 3,403 bytesreferences/dup-cross-layer-shape.mddoc · 3,477 bytesreferences/dup-mirrored-branches.mddoc · 3,347 bytesreferences/dup-near-twin-functions.mddoc · 3,453 bytesreferences/dup-parallel-types-same-shape.mddoc · 3,269 bytesreferences/frame-composition-over-inheritance-for-shared-fields.mddoc · 3,330 bytesreferences/frame-data-over-procedure.mddoc · 3,894 bytesreferences/frame-function-not-class.mddoc · 2,925 bytesreferences/frame-manager-noun-is-a-verb.mddoc · 3,599 bytesreferences/frame-monolith-by-cohesive-axis.mddoc · 4,421 bytesreferences/proc-build-vs-declarative-template.mddoc · 3,596 bytesreferences/proc-if-chain-as-lookup.mddoc · 2,956 bytesreferences/proc-manual-recursion-of-walk.mddoc · 3,511 bytesreferences/proc-mutation-builder-over-pipeline.mddoc · 5,114 bytesreferences/proc-sequential-awaits-could-be-parallel.mddoc · 3,940 bytesreferences/reinvent-builtin-data-structures.mddoc · 2,695 bytesreferences/reinvent-date-and-time.mddoc · 2,333 bytesreferences/reinvent-deep-equality.mddoc · 2,381 bytesreferences/reinvent-explicit-state-machine.mddoc · 2,940 bytesreferences/reinvent-stdlib-collection-ops.mddoc · 2,374 bytesreferences/spec-flag-driven-paths.mddoc · 3,943 bytesreferences/spec-generic-over-one-type.mddoc · 3,519 bytesreferences/spec-interface-of-one.mddoc · 3,942 bytesreferences/spec-no-extension-point-without-extender.mddoc · 3,454 bytesreferences/spec-options-bag-of-one.mddoc · 3,489 bytesreferences/types-branding-over-runtime-checks.mddoc · 4,288 bytesreferences/types-discriminated-union-over-flags.mddoc · 3,833 bytesreferences/types-exhaustive-switch-not-default.mddoc · 4,058 bytesreferences/types-literal-union-over-string.mddoc · 3,357 bytesreferences/types-no-any-to-silence.mddoc · 3,980 bytesreferences/types-readonly-and-immutable-by-default.mddoc · 3,924 bytes
Read excerpt
# Community Refactoring Best Practices: Same Results, Less Code
Code-review and refactoring guide focused on the parts of code volume that come from **judgment and modelling gaps** — wrong abstraction choices, hidden semantic duplication, defensive habits, premature generality. This skill deliberately skips what linters and tools like `knip`, `eslint`, `ruff`, `tsc --noUnusedLocals`, or formatters already catch. It is the second pass: after the mechanical cleanup, what remains?
## Core Principles
1. **Preserve behaviour.** Every transformation must produce identical observable behaviour — same outputs, same errors, same side effects, same API surface.
2. **Earlier mistakes cascade.** A wrong frame multiplies into wrong shapes, which multiply into duplicate logic. Optimise from the top of the lifecycle.
3. **Explain why, not just what.** Each rule explains the cost of the anti-pattern so judgment can transfer to novel cases.
4. **Quantify where possible.** Prefer "eliminates N lines / prevents X bug class" over "cleaner."
5. **Don't over-refactor.** Rule of three: extract abstractions when duplication has actually appeared three times, not in anticipation.
## When to Apply
Use this skill when: