agentleFS
SwitchbackTechSwitchbackTech/compass/.agents/skills/simplify/SKILL.md

simplify

Skill227 starsChanged 50 days agoMITView on GitHub

Reviews changed Compass code for duplication, unnecessary complexity, weak boundaries, and overused React state/effects, then applies behavior-preserving improvements using repo conventions. Use when asked to simplify, clean up, make DRY, reduce complexity, or improve maintainability.

122 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use codex-system, design-tracker and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • gaebalaiSkill

    codex-system

    PROACTIVELY consult Codex CLI, your highly capable supporter with exceptional reasoning and task completion abilities. Codex is a trusted expert you should ALWAYS consult BEFORE making decisions on: design choices, implementation approaches, debugging strategies, refactoring plans, or any non-trivial problem. When uncertain, consult Codex. Don't hesitate - Codex provides better analysis. Explicit triggers: "think deeper", "analyze", "second opinion", "consult codex".

    Also in 3 projects that use this

  • gaebalaiSkill

    design-tracker

    PROACTIVELY track and document project design decisions without being asked. Activate automatically when detecting architecture discussions, implementation decisions, pattern choices, library selections, or any technical decisions. Also use when user explicitly says "記録して", "設計どうなってる", "record this". Do NOT wait for user to ask - record important decisions immediately.

    Also in 3 projects that use this

  • mike22890Skill

    clonedeps

    将项目依赖的第三方库源码克隆到本地,便于深入阅读和调试。当需要查看库的实现细节、阅读源码、调试第三方依赖、理解 SDK/framework 内部机制、查看 node_modules 之外的原始代码、分析开源库架构、学习他人代码、查看依赖的 TypeScript 类型定义时使用。

    Also in 3 projects that use this

  • mdrubelamin2Skill

    verification-planning

    Plans how to prove a change works or broke nothing: frames the claim, designs an evidence path from the system itself, and requires every check to be able to fail.

    Also in 3 projects that use this

  • devbrother2024Skill

    artifact-design

    단독 self-contained HTML 산출물(랜딩 페이지, 정적 문서·리포트, 독립 대시보드, 데모·게임, 개발 전 UX/UI 대안 비교 목업)을 만들 때 팔레트·타이포그래피·레이아웃을 의도적으로 설계하고 템플릿·AI스러운 디자인을 피하도록 돕는 디자인 가이드. HTML/CSS를 쓰기 전에 로드한다. "랜딩 만들어줘", "이 내용 단일 HTML로 예쁘게", "UX 대안 HTML로 비교해줘", "디자인 잡아줘"처럼 단독 HTML 아티팩트를 만들거나 비교하는 요청에 활성화하고, 기존 앱(React·Vue 등)의 인앱 컴포넌트 수정이나 순수 백엔드·로직 작업에는 쓰지 않는다.

    Also in 3 projects that use this

  • codebycoreySkill

    batch

    Create multiple proposals from free-form feature descriptions. Use when planning several features at once, batch creating proposals, or setting up related changes.

    Also in 4 projects that use this

  • +3 more from gaebalai

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. 0 are common, 19 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 113 edited versions we read keep these.

  • 19

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No behavior change; conventions from AGENTS.md kept.

    line 23
  2. Very specific:

    Do not “improve” by rewriting unrelated files.

    line 27
  3. Distinctive:

    Default to the complete branch diff against its base.

    line 41
  4. Distinctive:

    If an inspected pattern should stay, state why.

    line 45
  5. Distinctive:

    Do not unify code that only looks similar or break a repo-wide convention in one file merely to remove repetition.

    line 65
  6. Distinctive:

    Add only what the current requirement needs.

    line 72
  7. Distinctive:

    Prefer direct, boring code over generic machinery.

    line 73
  8. Distinctive:

    Delete indirection that does not clarify ownership or contracts.

    line 74
  9. Distinctive:

    Keep one responsibility per function and React component.

    line 75
  10. Distinctive:

    Use guard clauses over nested conditionals.

    line 76
  11. Distinctive:

    Prefer an event handler or existing browser API over lifecycle synchronization.

    line 90
  12. Distinctive:

    Keep hooks that genuinely synchronize with non-React systems, hold imperative DOM handles, or own isolated UI state.

    line 95
  13. Distinctive:

    Use package aliases and concrete source imports.

    line 100
  14. Very specific:

    Put shared web/backend Zod contracts in packages/core.

    line 101
  15. Distinctive:

    Keep React components in their own files.

    line 102
  16. Distinctive:

    Use Tailwind semantic colors and canonical scale utilities.

    line 104
  17. Distinctive:

    Prefer existing package locations:

    line 105
  18. Very specific:

    Read docs/development/testing-playbook.md before changing test architecture.

    line 111
  19. Distinctive:

    Run the smallest checks that cover touched behavior:

    line 116
  20. Distinctive:

    When this skill was explicitly invoked to change code, commit the simplification separately from implementation after verification, using a …

    line 130
  21. Distinctive:

    Never amend implementation or push from this skill.

    line 138
  22. Distinctive:

    commit hash/message, or that no commit was needed

    line 147

“Common” is measured: kept by at least 6 in 10 of the 113 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

When

Asked to simplify, clean up, or make DRY; also the nightly cleanup sweep.

Steps

High-value detectors, then Compass conventions, then Verify.

Output

Behavior-preserving diff; separate commit when files change.

Pass

No behavior change; conventions from AGENTS.md kept.

Anti-patterns

Do not “improve” by rewriting unrelated files. See anti-patterns.md.

Escalate

A simplification that would change public behavior or contracts.

Simplify Compass code

Favor the smallest, clearest implementation. This is a quality pass, not a correctness or security review.

Scope

  • Default to the complete branch diff against its base. Honor a narrower file or feature scope when the user names one.
  • Preserve behavior. Do not expand into unrelated cleanup.
  • Find existing abstractions before creating new ones.
  • If an inspected pattern should stay, state why.

High-value detectors

Inspect in this order:

  1. Largest churn — start where the diff added the most code and branches.
  2. Repeated scaffolding — extract one helper only when the shared intent and parameter surface are clear.
  3. Test-only production hooks — prefer narrow dependency injection over registries or environment branches added only for tests.
  4. Casts and broad mocks — reshape the seam instead of hiding type or process-global coupling.
  5. Dead exports and unreachable guards — verify call sites and invariants, then delete misleading code.
  6. Hidden shared state — fix ownership/reset/injection rather than test ordering or timeouts.
  7. Comments explaining mechanics — simplify the mechanism; retain comments that document constraints the code cannot express.

Do not unify code that only looks similar or break a repo-wide convention in one file merely to remove repetition.

Principles

Minimal surface

  • Add only what the current requirement needs.
  • Prefer direct, boring code over generic machinery.
  • Delete indirection that does not clarify ownership or contracts.
  • Keep one responsibility per function and React component.
  • Use guard clauses over nested conditionals.

Extract versus inline

Extract when logic is used in multiple places, has shared intent, and admits a narrow stable API. Inline when it is used once or extraction needs vague names, optional parameters, or special cases.

React state and effects

Challenge every added useEffect, useRef, and useState:

  1. Derive values during render when possible.
  2. Let Zustand own shared transient state and TanStack Query own server state.
  3. Prefer an event handler or existing browser API over lifecycle synchronization.
  4. Move or split the ownership boundary when local hook coordination is the real complexity.

Keep hooks that genuinely synchronize with non-React systems, hold imperative DOM handles, or own isolated UI state. Record why they remain.

Compass conventions

  • Use package aliases and concrete source imports; do not add barrels.
  • Put shared web/backend Zod contracts in packages/core.
  • Keep React components in their own files.
  • Preserve semantic web test queries and user-event.
  • Use Tailwind semantic colors and canonical scale utilities.
  • Prefer existing package locations:
    • shared logic: packages/core/src/util
    • web helpers: apps/calendar-web/src/common
    • backend helpers: packages/backend/src/common
    • sync ownership: packages/sync/src

Read docs/development/testing-playbook.md before changing test architecture.

Verify

Run the smallest checks that cover touched behavior:

  • packages/core → bun run test:core
  • apps/calendar-web → bun run test:web
  • packages/backend → bun run test:backend
  • packages/sync → bun run test:sync
  • packages/scripts → bun run test:scripts
  • shared contracts → affected package tests plus bun run type-check

bun run verify selects checks from the diff. Run bun run lint for non-docs changes.

Commit and report

When this skill was explicitly invoked to change code, commit the simplification separately from implementation after verification, using a lower-case conventional message such as:

refactor(web): simplify event form state

Never amend implementation or push from this skill. If nothing changed, do not create an empty commit.

Report:

  1. the behavior-preserving simplification
  2. principles applied and tradeoffs
  3. checks run
  4. React hook count direction and justification for retained hooks
  5. commit hash/message, or that no commit was needed

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.