code-simplifier
Code Simplifier
Refine recently modified code without changing what it does. Prioritize readable, explicit code over overly compact solutions.
Reference @AGENTS.md and any more specific local instructions for project conventions.
Scope
Focus on code touched in the current session or current branch diff unless the user explicitly asks for a broader pass.
Do not introduce broad refactors, formatting churn, dependency changes, or unrelated edits.
Rules
-
Preserve functionality exactly.
- Keep features, outputs, side effects, data contracts, permissions, and error behavior intact.
- Change how code is expressed, not what it does.
-
Apply project standards.
- Use TypeScript with strict null checks.
- Keep imports at the top of files.
- Import directly from original sources; do not add barrel files or re-export patterns.
- Prefer existing local patterns, frameworks, and helper APIs.
- Infer types from Zod schemas with
z.infer<typeof schema>instead of duplicating types. - Keep helper functions at the bottom of files.
- Add comments only for why, not what.
- Follow repository React, API route, server action, logging, and testing conventions when touching those areas.
-
Enhance clarity.
- Reduce unnecessary complexity and nesting.
- Remove redundant code and weak abstractions.
- Improve names when intent becomes clearer.
- Consolidate related logic only when it improves maintainability.
- Avoid nested ternaries; prefer straightforward control flow, a small helper, a switch, or a lookup table.
-
Maintain balance.
- Do not prioritize fewer lines over readability.
- Do not create clever dense one-liners.
- Do not combine too many concerns into one function or component.
- Do not remove helpful abstractions that make the code easier to understand or extend.
Workflow
- Inspect the current diff and identify recently modified sections.
- Look for low-risk simplifications that improve clarity or consistency.
- Apply only changes that preserve behavior.
- Run focused validation when practical for the files touched.
- Report significant changes and validation performed.
More from elie222/inbox-zero
ui-components
UI component and styling guidelines using Shadcn UI, Radix UI, and Tailwind
77security
Security guidelines for API route development
36fullstack-workflow
Complete fullstack workflow combining GET API routes, server actions, SWR data fetching, and form handling. Use when building features that need both data fetching and mutations from API to UI.
23test-feature
End-to-end feature testing — browser QA, API verification, eval tests, or any combination. Covers browser interactions (via agent-browser CLI), Google Workspace operations (gws CLI), API calls, and LLM eval tests. Can also persist tests as reusable QA flows or eval files.
21testing
Guidelines for testing the application with Vitest, including unit tests, integration tests (emulator), AI tests, and eval suites for LLM features
21project-structure
Project structure and file organization guidelines
21