# Claude Code Project Guidelines ## Project Overview A unified web dashboard aggregating Trello (PRIMARY), Todoist, Obsidian, and PlanToEat. **Stack:** Go backend + HTMX + Tailwind CSS + SQLite. ## Efficiency & Token Management - **Context Minimization:** Do not read entire files if `grep`, `sed`, or `ls` can answer a question. - **Surgical Edits:** Perform small, targeted file edits. Avoid rewriting entire files for single changes. - **Dependency Awareness:** Use `go test`, `go build`, and `lint` to verify state rather than asking the agent to "think" through logic. - **Proactive Checkpointing:** Treat every 3-4 turns as a potential session end. Update `SESSION_STATE.md` frequently. ## Workflow: Plan-then-Execute 1. **Discovery:** Use terminal tools to locate relevant Go code/handlers. 2. **Planning:** Propose a specific plan and **wait for user confirmation** before editing. 3. **Execution:** Apply changes incrementally, verifying with `go test ./...`. 4. **Handoff:** If a task is incomplete or the user mentions "limit" or "handoff," immediately summarize progress in `SESSION_STATE.md`. ## Essential Commands - **Run:** `go run cmd/dashboard/main.go` - **Test:** `go test ./...` - **Build:** `go build -o dashboard cmd/dashboard/main.go` ## State Management - **SESSION_STATE.md:** The source of truth for resuming work. It must include: - Current Task Goal - Completed Items - Architecture Decisions - **Next 3 Specific Steps** ## Technical Context - **Trello is PRIMARY:** Key + Token required in query params. - **Architecture:** chi router -> Handlers (`internal/handlers/`) -> Store (`internal/store/sqlite.go`). - **AI Endpoint:** `GET /api/claude/snapshot` with Bearer token auth. - **Errors:** Partial data/cache fallback preferred over hard failure. ## Coding Style - Use concise, idiomatic Go. - Avoid verbose explanations or comments for self-evident logic. - Prioritize terminal-based verification over manual code review.