mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
* feat(agents): generalize repository guidance for coding agents * fix(agents): use repo-root link in sim app guidance
1.6 KiB
1.6 KiB
Sim App Scope
These rules apply to files under apps/sim/ in addition to the repository root AGENTS.md.
Architecture
- Follow the app structure already established under
app/,blocks/,components/,executor/,hooks/,lib/,providers/,stores/,tools/, andtriggers/. - Keep single responsibility for components, hooks, and stores.
- Prefer composition over large mixed-responsibility modules.
- Use
lib/for app-wide helpers, feature-localutils/only when 2+ files share the helper, and inline single-use helpers.
Imports And Types
- Always use absolute imports from
@/...; do not add relative imports. - Use barrel exports only when a folder has 3+ exports; do not re-export through non-barrel files.
- Use
import typefor type-only imports. - Do not use
any; prefer precise types orunknownwith guards.
Components And Styling
- Use
'use client'only when hooks or browser-only APIs are required. - Define a props interface for every component.
- Extract constants with
as constwhere appropriate. - Use Tailwind classes and
cn()for conditional classes; avoid inline styles unless CSS variables are the intended mechanism. - Keep styling local to the component; do not modify global styles for feature work.
Testing
- Use Vitest.
- Prefer
@vitest-environment nodeunless DOM APIs are required. - Use
vi.hoisted()+vi.mock()+ static imports; do not usevi.resetModules()+vi.doMock()+ dynamic imports except for true module-scope singletons. - Do not use
vi.importActual(). - Prefer mocks and factories from
@sim/testing.