Simplify
Simplify recently modified business code. Keep tests, fixtures, snapshots, and test harnesses out of scope unless the user explicitly includes them.
Target Architecture
Treat Lynx as a monolith with real frontend/server and external-adapter boundaries. Within one process, prefer:
- Direct import
- Context or state only for genuinely runtime-, user-, UI-, or provider-scoped values
- Dependency injection only for a real boundary or implementation that must vary outside the module
The result should be direct, local, explicit, and owned in one place.
Required Review
- Read the current diff and list every new or materially changed file, method, type, component, hook, service, utility, wrapper, and module.
- Search the repository for existing equivalents before keeping any new symbol or file.
- Classify each change as a root-cause fix or a patch-style workaround.
- Identify duplicated ownership, alternate data shapes, forwarding layers, and stale wiring.
- Rewrite only where the simpler form preserves requested behavior.
- Remove superseded code, types, fields, parameters, call sites, imports, and files in the same pass.
- Re-read the final diff and run the repository-required validation for code changes.
Simplification Rules
- Reuse an existing implementation or source type before creating another.
- Prefer plain functions. Use hooks only when they call hooks or own React lifecycle; use classes only for stateful clients or specialized data structures.
- Delete pass-through helpers, renaming wrappers, no-op adapters, forwarding modules, and same-process message layers.
- Keep one-off logic local when clear. Extract only for real reuse, meaningful ownership, or long-file navigation.
- Use inline literals for one-off values and module constants for shared static data. Do not hide static data behind functions, hooks, factories, providers, or lazy builders.
- Prefer language, runtime, browser, and existing framework APIs over local reimplementations.
- Consume raw source data and source types when they fit. Transform or normalize only at a real boundary, once, in the owning layer.
- Compute synchronous UI values directly; do not mirror them into React state or effects.
- Prefer direct imports over threading static config, constants, helpers, or services through props, context, state, factories, or DI.
- Do not preserve a fallback, compatibility path, or abstraction merely because it already exists when no active contract requires it.
Root-Cause Gate
Do not keep a workaround that masks broken ownership or data flow, including:
- UI compensation for invalid source data
- normalization repeated on both sides of a boundary
- guards or fallbacks that suppress a deeper inconsistency
- one-off transforms near the symptom
- parallel implementations with slightly different names or shapes
If replacing the workaround requires a material behavior or scope change not requested by the user, report the required root-cause change instead of silently widening scope.
Scope
Focus on the current-session diff. Expand only to reuse an existing implementation, restore one source of truth, or remove wiring superseded by the change.
Completion Criteria
- behavior is preserved unless the request changes it
- fewer layers, wrappers, helpers, and duplicate concepts remain
- ownership and runtime boundaries are clearer
- new symbols were checked against the repository
- no dead or orphaned implementation remains
- required validation passes
If the diff already meets this bar, leave it unchanged and say so.
1---2name: simplify3description: Simplify recently modified Lynx business code while preserving behavior. Use to remove unnecessary wrappers, hooks, DI, transforms, duplicate types, and stale wiring; prefer direct imports, plain functions, existing APIs, root-cause fixes, and one source of truth. Do not trigger for test-only refactors.4---56# Simplify78Simplify recently modified business code. Keep tests, fixtures, snapshots, and test harnesses out of scope unless the user explicitly includes them.910## Target Architecture1112Treat Lynx as a monolith with real frontend/server and external-adapter boundaries. Within one process, prefer:13141. Direct import152. Context or state only for genuinely runtime-, user-, UI-, or provider-scoped values163. Dependency injection only for a real boundary or implementation that must vary outside the module1718The result should be direct, local, explicit, and owned in one place.1920## Required Review21221. Read the current diff and list every new or materially changed file, method, type, component, hook, service, utility, wrapper, and module.232. Search the repository for existing equivalents before keeping any new symbol or file.243. Classify each change as a root-cause fix or a patch-style workaround.254. Identify duplicated ownership, alternate data shapes, forwarding layers, and stale wiring.265. Rewrite only where the simpler form preserves requested behavior.276. Remove superseded code, types, fields, parameters, call sites, imports, and files in the same pass.287. Re-read the final diff and run the repository-required validation for code changes.2930## Simplification Rules3132- Reuse an existing implementation or source type before creating another.33- Prefer plain functions. Use hooks only when they call hooks or own React lifecycle; use classes only for stateful clients or specialized data structures.34- Delete pass-through helpers, renaming wrappers, no-op adapters, forwarding modules, and same-process message layers.35- Keep one-off logic local when clear. Extract only for real reuse, meaningful ownership, or long-file navigation.36- Use inline literals for one-off values and module constants for shared static data. Do not hide static data behind functions, hooks, factories, providers, or lazy builders.37- Prefer language, runtime, browser, and existing framework APIs over local reimplementations.38- Consume raw source data and source types when they fit. Transform or normalize only at a real boundary, once, in the owning layer.39- Compute synchronous UI values directly; do not mirror them into React state or effects.40- Prefer direct imports over threading static config, constants, helpers, or services through props, context, state, factories, or DI.41- Do not preserve a fallback, compatibility path, or abstraction merely because it already exists when no active contract requires it.4243## Root-Cause Gate4445Do not keep a workaround that masks broken ownership or data flow, including:4647- UI compensation for invalid source data48- normalization repeated on both sides of a boundary49- guards or fallbacks that suppress a deeper inconsistency50- one-off transforms near the symptom51- parallel implementations with slightly different names or shapes5253If replacing the workaround requires a material behavior or scope change not requested by the user, report the required root-cause change instead of silently widening scope.5455## Scope5657Focus on the current-session diff. Expand only to reuse an existing implementation, restore one source of truth, or remove wiring superseded by the change.5859## Completion Criteria6061- behavior is preserved unless the request changes it62- fewer layers, wrappers, helpers, and duplicate concepts remain63- ownership and runtime boundaries are clearer64- new symbols were checked against the repository65- no dead or orphaned implementation remains66- required validation passes6768If the diff already meets this bar, leave it unchanged and say so.