Files
front/.kilocode/rules-code/AGENTS.md
2026-07-05 21:21:53 +08:00

912 B

Code Mode Rules (Non-Obvious Only)

Development Constraints

  • Code is not deployed yet; do not spend effort preserving backward compatibility with old code.

API Layer

  • Two axios instances exist: request.ts (custom with workspace header) and interceptor.ts (global with Bearer token). Choose based on whether you need workspace support.

Storage

  • Always use SafeStorage with AppStorageKey enum - never use localStorage directly. Supports TTL via third parameter.

useRequest Hook

  • useRequest() invokes API immediately - does NOT work in async functions. Pass params via .bind(null, params) pattern.

Dynamic Routes

  • Routes loaded from server in permission.ts using isMenuLoading/isMenuLoaded flags. Don't modify these flags manually.