2.2 KiB
2.2 KiB
Learnings & Best Practices
User Preferences & Constraints
- NO AUTO-BROWSER TESTING: Do not automatically test features in the browser to save tokens. ALWAYS ASK the user before running browser verification steps.
- Keep it Simple: Avoid over-engineering. Use standard, robust solutions (e.g., Flexbox) over complex libraries (e.g.,
react-resizable-panels) unless necessary.
Technical Learnings
Layout Architecture
- Issue:
react-resizable-panelscaused significant layout instability ("fluid shit"), with panels shrinking to unusable widths and overlapping content. - Solution: Use a Fixed Sidebar + Fluid Content pattern using standard Flexbox (
flex-none w-[300px]+flex-1 min-w-0). This is robust, predictable, and easier to maintain. - Consistency: Standardize layout across related pages (Skills, Memory, Cron, Sessions) to reduce cognitive load and maintenance overhead.
- Critical CSS: Always use
min-w-0on flex children to prevent text overflow from breaking the layout.
API & File Handling
- Root Files: When accessing core files like
MEMORY.mdat the project root via API routes, explicitly handle the path traversal (e.g.,../MEMORY.md) to avoid being restricted to subdirectories. - Path Security: Always validate or sanitize dynamic path segments to prevent arbitrary file access, but allow controlled exceptions for known root files.
Tool Integration
- Agentation: Integrated for visual feedback.
- Workflow: Defined in
docs/AGENTATION_WORKFLOW.md. - Implementation: Added to
layout.tsxfor global availability.
- Workflow: Defined in
Feature Implementation
- Navigation: Wrap interactive cards (Memory, Cron) in
Linkcomponents to match the behavior of Skills cards. - Status Indicators: Use simple visual cues (e.g., green/red dots) in the Sidebar to convey system status (fetching from
/api/statusvia SWR).
Workflow Improvements
- Prompting: Use the structured output from
agentationto clearly communicate UI changes. - Documentation: Keep
.agent/updated with new architectural decisions to prevent regression. - Git Sync: Regularly commit changes to
.agentand.claudeto keep the agent's self-knowledge in sync with the repository.