DEV Community

cen lin
cen lin

Posted on

Stop pasting files to Cursor/Claude! I built an open-source whiteboard to generate compact tree docs for AI agents

Every time I start a new session with Cursor, Claude Code, or Copilot, I find myself losing valuable time re-explaining my project structure. Pasting entire files into the chat context is brutally expensive, and writing long prose descriptions often leaves the AI guessing, leading to hallucination and goal drifting.

To solve this, I built MindForAI — an open-source visual whiteboard that translates your architectural mind maps into a highly compact, indented tree format (.mindforai) specifically designed for AI consumption.


🧠 Why natural language fails AI (and why trees win)

Human text is linear and full of ambiguity. When you feed a 2000-word PRD or design doc into an AI, the agent often gets lost in the weeds, misinterprets dependencies, or suffers from context pollution.

MindForAI maps your intentions explicitly using a tree structure:

  1. Zero Ambiguity: Each node represents a single concept. Parent-child relationships mean task decomposition; sibling nodes mean parallel constraints.
  2. Insanely Token-Friendly: The exported .mindforai format drops all quotes, braces, and trailing commas. It's several times smaller than JSON and way cleaner than messy Markdown headers.
  3. Local-First & Private: Your data never leaves your machine. It utilizes the File System Access API to read/write directly from your disk.

📄 What the .mindforai format looks like

Instead of a heavy JSON tree, your board exports into a clean, indented format that LLMs natively parse with incredible accuracy:

type: mindforai
version: 1
content[1]:
  - text: TODOS
    children[2]:
      - Read core project config at ./project.mindforai first
      - text: Rules
        children[1]:
          - The final report generated for the user must be in Chinese
Enter fullscreen mode Exit fullscreen mode

When you start a session in Cursor or Claude Code, you simply drop this file in and say:

"Please read ./project.mindforai first. Locate my target files along the module paths. Do not grep the whole repo."

The AI immediately captures the big picture, maps out file responsibilities, and executes tasks flawlessly without drifting away from your guidelines.


🛠️ Core Features

  • 🎨 Mindmaps + Flowcharts: A unified spatial canvas powered by the Plait framework.
  • 🔗 Mermaid Import: Paste your existing Mermaid text to instantly generate an editable mindmap.
  • 📦 Docker One-Liner: Want to host it yourself? Deploy completely offline via Docker in seconds (bash rundocker.sh).
  • 🩹 Self-Healing Syntax: If an AI accidentally corrupts the file while editing, the built-in validator highlights the exact broken line with one-click auto-formatting.
  • ♻️ 100% Open Source: Built with React 19 + TypeScript + Nx Monorepo under the MIT License.

💬 I'd love your feedback!

Our ultimate philosophy is 1 Doc + 1 Agent = 1 Project. We believe .mindforai can rewrite the foundational documentation layer for AI Agents.

I would especially love to hear the community's thoughts on the data structure itself:

  • Do you think a minimalist indented tree is strictly better than Markdown for giving AI structural context?
  • Where do you think this format breaks down in larger codebases?

If you like the concept, feel free to try the live demo or drop a ⭐ star on our GitHub Repository!

Top comments (0)