codemcp.toml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Claude Desktop project's instructions (in "project knowledge"):
  2. # "Initialize the codemcp tool with /Users/yellowdig/personal/projects/microtables/."
  3. # (use absolute path for <home> because otherwise the LLM will hallucinate a home path)
  4. project_prompt = '''
  5. # Microtables
  6. ## Project Overview
  7. A lightweight spreadsheet application designed for quick calculations — positioned between a calculator and a full office suite. The goal is fast loading with support for common spreadsheet operations.
  8. ## Architecture
  9. **Frontend** (`/frontend/`)
  10. - **Language**: ClojureScript (compiled via shadow-cljs)
  11. - **Framework**: Reagent + re-frame (React wrapper)
  12. - **Build**: Leiningen + shadow-cljs
  13. - **Dev server**: `lein dev` → localhost:8280
  14. **Server** (`/server/`)
  15. - **Language**: JavaScript (ES6+ with Babel)
  16. - **Framework**: Express
  17. - **Status**: Minimal implementation - currently the frontend is fully functional standalone
  18. - **Future**: Will handle persistence and collaboration
  19. ## Key Concepts
  20. ### Data Structure
  21. The spreadsheet data is a nested map: `{column-letter {row-number {:value ...}}}`
  22. Example:
  23. ```clojure
  24. {"A" {1 {:value 78 :inbound [...]}
  25. 3 {:value "=B2 * 4" :refs [...]}}
  26. "B" {2 {:value "=A1 + 3" :refs [...] :inbound [...]}}}
  27. ```
  28. ### Formula System
  29. - Formulae start with `=` and are evaluated using **math.js** library
  30. - Range syntax supported: `=sum(A1:A10)`
  31. - Cell references create a **doubly-linked tree structure**:
  32. - `:refs` - forward references (cells this formula depends on)
  33. - `:inbound` - back references (cells that depend on this cell)
  34. - `:display` - computed/evaluated value shown to user
  35. - `:value` - raw user input
  36. - `:dirty` - flag indicating re-evaluation needed
  37. ### Evaluation Flow
  38. 1. When a cell changes, parse for references
  39. 2. Update forward (`:refs`) and back (`:inbound`) reference trees
  40. 3. Evaluate the cell
  41. 4. Recursively evaluate all cells in `:inbound` queue
  42. 5. Cycle detection prevents infinite loops
  43. ## Important Files
  44. **Frontend Core Logic**
  45. - `frontend/src/cljs/microtables_frontend/core.cljs` - App initialization
  46. - `frontend/src/cljs/microtables_frontend/db.cljs` - Data model definition
  47. - `frontend/src/cljs/microtables_frontend/events.cljs` - State mutations (re-frame)
  48. - `frontend/src/cljs/microtables_frontend/subs.cljs` - Data queries (re-frame)
  49. - `frontend/src/cljs/microtables_frontend/evaluation.cljs` - Formula evaluation engine
  50. - `frontend/src/cljs/microtables_frontend/views/sheet.cljs` - Grid rendering
  51. **Project Configuration**
  52. - `frontend/project.clj` - Leiningen config
  53. - `frontend/shadow-cljs.edn` - ClojureScript build config
  54. ## Development Notes
  55. - Almost everything is subject to change (architecture, structure, design)
  56. - The frontend currently operates completely standalone
  57. - Focus is on simplicity and performance for common use cases
  58. - Data structures prioritize clarity over micro-optimization (small dataset assumption)
  59. ## Common Tasks
  60. **Run frontend**: `cd frontend && lein dev`
  61. **Install npm dependency**: Add to `shadow-cljs.edn`, then restart
  62. **Understand formula eval**: Start in `evaluation.cljs`, trace through `evaluate-from-cell`
  63. **Modify grid UI**: Look in `views/sheet.cljs`
  64. '''
  65. [commands]