Visarga

PROJECT_MIND_MAPPING.md

Feb 1st, 2026
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.14 KB | None | 0 0
  1. # Project Mind Mapping - Methodology Guide
  2.  
  3. A comprehensive guide for creating interconnected mind map documentation that captures both the current state and evolutionary history of software projects.
  4.  
  5. ## Overview
  6.  
  7. Mind maps transform complex codebases into navigable knowledge graphs where each node represents a key concept and links create an interconnected understanding web. This methodology combines architectural analysis with historical context to create living documentation.
  8.  
  9. ## Mind Map Format
  10.  
  11. ### Usage Instructions Header
  12.  
  13. **Every MIND_MAP.md file must start with this exact text at the very top before any nodes:**
  14.  
  15. ```markdown
  16. > **For AI Agents:** This mind map is your primary knowledge index. Read overview nodes [1-5] first, then follow links [N] to find what you need. Always reference node IDs. When you encounter bugs, document your attempts in relevant nodes. When you make changes, update outdated nodes immediately—especially overview nodes since they're your springboard. Add new nodes only for genuinely new concepts. Keep it compact (20-50 nodes typical). The mind map wraps every task: consult it, rely on it, update it.
  17. ```
  18.  
  19. ### Node Structure
  20.  
  21. Each node follows this structure:
  22.  
  23. ```markdown
  24. [Node Number] **Node Title** - Node text where you add [<link-nr>] links embedded naturally in the text. Text should be moderate size (3-8 sentences), dense with information but readable.
  25. ```
  26.  
  27. ### Key Principles:
  28.  
  29. 1. **Natural Link Integration**: Links [1][2][3] should flow naturally within sentences, not just listed at the end
  30. 2. **Moderate Density**: Each node should be substantial but scannable - aim for 100-300 words
  31. 3. **Semantic Grouping**: Related concepts should link bidirectionally to create knowledge clusters
  32. 4. **Progressive Detail**: Start with high-level concepts, drill down to implementation details
  33. 5. **Cross-References**: Every node should link to at least 2-3 other nodes; important nodes link to 5-10
  34.  
  35. ## Phase 1: Current State Analysis
  36.  
  37. ### Step 1: Initial Reconnaissance
  38.  
  39. Start with broad exploration to understand project structure:
  40.  
  41. ```bash
  42. # Explore project layout
  43. ls -la
  44. find . -type f -name "*.md" | head -20
  45. find . -type f -name "README*"
  46. find . -type f -name "package.json"
  47. find . -type f -name "*.config.*"
  48. ```
  49.  
  50. **Read these first:**
  51. - README files (project overview, setup, usage)
  52. - Documentation files in docs/ or top-level
  53. - Configuration files (package.json, tsconfig.json, etc.)
  54. - TODO or ROADMAP files
  55.  
  56. ### Step 2: Architecture Discovery
  57.  
  58. Use semantic search and file reading to understand:
  59.  
  60. **Core Components:**
  61. ```bash
  62. # Find entry points
  63. grep -r "main\|index\|app" --include="*.{ts,tsx,js,jsx,py}" -l
  64.  
  65. # Identify key directories
  66. ls -d */ | grep -v node_modules
  67. ```
  68.  
  69. **Technology Stack:**
  70. - Frontend: Look for React, Vue, Angular, etc. in package.json
  71. - Backend: Express, Flask, FastAPI, etc.
  72. - Build tools: Vite, Webpack, etc.
  73. - Key libraries: Check dependencies
  74.  
  75. **Data Flow:**
  76. Use `codebase_search` to trace:
  77. - "How does data flow from input to output?"
  78. - "Where is the main state managed?"
  79. - "How do components communicate?"
  80.  
  81. ### Step 3: Feature Mapping
  82.  
  83. Identify major features by exploring:
  84. - Component files in src/components/
  85. - API endpoints in server/routes/ or similar
  86. - Utility functions in src/utils/
  87. - Data models in types/ or models/
  88.  
  89. For each feature, understand:
  90. - **What**: What does it do?
  91. - **How**: Implementation approach
  92. - **Why**: Design decisions
  93. - **Dependencies**: What it connects to
  94.  
  95. ### Step 4: Implementation Details
  96.  
  97. Dive into key algorithms, patterns, and systems:
  98.  
  99. ```bash
  100. # Find interesting implementations
  101. grep -r "class\|function\|const.*=.*=>|def " --include="*.{ts,js,py}"
  102.  
  103. # Look for comments explaining complex logic
  104. grep -r "TODO\|FIXME\|NOTE\|IMPORTANT" --include="*.{ts,js,py}"
  105. ```
  106.  
  107. Read critical files completely:
  108. - Core algorithm implementations
  109. - State management logic
  110. - API integration code
  111. - Data transformation pipelines
  112.  
  113. ## Phase 2: Historical Analysis
  114.  
  115. ### Step 5: Git History Exploration
  116.  
  117. **Get the full timeline:**
  118. ```bash
  119. # All commits for the project/folder
  120. git log --all --date=short --pretty=format:"%h | %ad | %s" -- path/to/project/
  121.  
  122. # With file change stats
  123. git log --all --date=short --stat --pretty=format:"%n=== %h | %ad | %s ===" -- path/to/project/
  124.  
  125. # Find first commit that created the folder
  126. git log --all --diff-filter=A --date=short --pretty=format:"%h | %ad | %s" -- path/to/project/ | tail -5
  127. ```
  128.  
  129. **Understand each major commit:**
  130. ```bash
  131. # Show what changed in a commit
  132. git show <commit-hash> --stat
  133.  
  134. # See the actual changes
  135. git show <commit-hash> -- path/to/specific/file
  136. ```
  137.  
  138. **Identify development phases:**
  139. - Initial creation commit
  140. - Major refactors (large insertions/deletions)
  141. - Feature additions (new files)
  142. - Architectural changes (file renames, deletions)
  143. - Bug fixes and refinements (small changes)
  144.  
  145. ### Step 6: Evolution Patterns
  146.  
  147. Look for:
  148. - **Technology migrations**: Library changes, framework upgrades
  149. - **Architecture shifts**: Monolith → microservices, REST → GraphQL
  150. - **Feature expansion**: What was added over time?
  151. - **Simplifications**: What was removed or refactored?
  152.  
  153. **Timeline markers:**
  154. ```bash
  155. # Commits by date with line counts
  156. git log --all --shortstat --pretty=format:"%h | %ad | %s" --date=short -- path/to/project/
  157. ```
  158.  
  159. ## Phase 3: Mind Map Construction
  160.  
  161. ### Step 7: Node Planning
  162.  
  163. Create a hierarchical outline before writing:
  164.  
  165. **Level 1: Foundation (Nodes 1-5)**
  166. - [1] Project Overview - What, why, high-level architecture
  167. - [2] Core Theory/Concept - Fundamental principles or domain theory
  168. - [3] Data Flow - How information moves through the system
  169. - [4] Frontend/UI Architecture - User-facing components
  170. - [5] Backend/Services Architecture - Server-side logic
  171.  
  172. **Level 2: Systems (Nodes 6-15)**
  173. - [6-10] Major subsystems (e.g., data schema, algorithms, file management, validation, AI integration)
  174. - [11-15] Key features and components
  175.  
  176. **Level 3: Implementation (Nodes 16-20)**
  177. - [16] Technology stack details
  178. - [17] Historical context/migrations
  179. - [18] Development workflow
  180. - [19] Future roadmap/TODOs
  181. - [20] Design principles
  182.  
  183. **Level 4: Deep Dives (Nodes 21-25+)**
  184. - [21+] Specialized topics (specific algorithms, optimization, interpretation, error handling, performance)
  185. - [N] Development history with commit details
  186.  
  187. ### Step 8: Writing Nodes
  188.  
  189. For each node:
  190.  
  191. 1. **Start with a clear title**: Noun phrase that names the concept
  192. 2. **Opening sentence**: Define what this node is about, link to parent concepts [1][2]
  193. 3. **Core content**: Explain the concept with specific details
  194. 4. **Implementation details**: Code structure, file locations, key functions
  195. 5. **Link to related nodes**: Embed [N] references naturally throughout
  196. 6. **Technical specifics**: Parameters, configurations, examples
  197.  
  198. **Writing style:**
  199. - Dense but readable - every sentence should add information
  200. - Use specific examples: "The PCAVisualizer class in pcaVisualizer.ts" not "the visualizer"
  201. - Include numbers: "5-10 features", "23,000+ lines", "700 ticks"
  202. - Reference actual filenames, function names, variable names
  203. - Explain WHY decisions were made, not just WHAT exists
  204.  
  205. ### Step 9: Link Weaving
  206.  
  207. After drafting all nodes:
  208.  
  209. 1. **Identify connections**: Which nodes discuss related concepts?
  210. 2. **Add forward and backward links**: If [5] mentions [12], make sure [12] mentions [5]
  211. 3. **Create knowledge clusters**: Groups of highly interconnected nodes (e.g., all visualization nodes link to each other)
  212. 4. **Build progressive paths**: [1]→[2]→[7]→[8] should form a coherent learning path
  213. 5. **Verify link accuracy**: Every [N] reference should point to a relevant node
  214.  
  215. **Link density guidelines:**
  216. - Overview nodes: 5-10 links to major subsystems
  217. - System nodes: 3-7 links to related systems and implementation details
  218. - Implementation nodes: 2-5 links to parent systems and related details
  219. - Specialized nodes: 2-4 links to closely related concepts
  220.  
  221. ### Step 10: Historical Node Integration
  222.  
  223. The history node should:
  224.  
  225. 1. **List all major commits chronologically** with hashes
  226. 2. **Explain what each commit did** (files changed, features added)
  227. 3. **Show line count changes** for context on commit size
  228. 4. **Identify development phases** (prototype, rewrite, refinement, migration)
  229. 5. **Connect to other nodes** - link commits to the features they introduced
  230.  
  231. **Template:**
  232. ```markdown
  233. [N] **Development History** - The project evolved over X days/months from DATE to DATE [parent-nodes].
  234. Commit HASH (DATE) created the initial folder with FILE1, FILE2, and X features [feature-nodes].
  235. Commit HASH (DATE) was the massive rewrite with N insertions creating SYSTEM1 [node], SYSTEM2 [node],
  236. and SYSTEM3 [node]. Commit HASH (DATE) added FEATURE [node] with N insertions. ...
  237. Total development: X commits, ~N lines of code, transforming from STATE1 to STATE2 [principle-nodes].
  238. ```
  239.  
  240. ## Quality Checklist
  241.  
  242. ### Completeness:
  243. - [ ] All major systems/features have nodes
  244. - [ ] Technology stack is documented
  245. - [ ] Data flow is explained
  246. - [ ] Every significant file/component is mentioned
  247. - [ ] Development history is captured with commit hashes
  248. - [ ] Future directions are noted
  249.  
  250. ### Interconnectedness:
  251. - [ ] Every node has 2+ links
  252. - [ ] Important nodes have 5+ links
  253. - [ ] Links are embedded naturally in text
  254. - [ ] Bidirectional links exist where appropriate
  255. - [ ] Node clusters form around major concepts
  256.  
  257. ### Clarity:
  258. - [ ] Each node has a clear, specific title
  259. - [ ] First sentence defines the concept
  260. - [ ] Technical terms are explained or linked
  261. - [ ] Code examples use actual file/function names
  262. - [ ] Node length is moderate (not too short, not overwhelming)
  263.  
  264. ### Accuracy:
  265. - [ ] All file paths are correct
  266. - [ ] Function/class names match the code
  267. - [ ] Numbers and metrics are accurate
  268. - [ ] Commit hashes are verified
  269. - [ ] Links point to relevant nodes
  270.  
  271. ## Example Node Structures
  272.  
  273. ### System Architecture Node
  274. ```markdown
  275. [N] **System Name** - Brief definition and purpose [parent-node]. The system consists of
  276. COMPONENT1 which handles TASK1 [detail-node], COMPONENT2 for TASK2 [detail-node], and
  277. COMPONENT3 managing TASK3 [detail-node]. Implementation resides in path/to/files using
  278. TECHNOLOGY [tech-node] with KEY_PATTERN design pattern [pattern-node]. The system
  279. integrates with EXTERNAL_SYSTEM [integration-node] through API_METHOD and processes
  280. data using ALGORITHM [algorithm-node]. Key parameters include PARAM1 (range, default)
  281. and PARAM2 (type, purpose) [parameter-node].
  282. ```
  283.  
  284. ### Implementation Detail Node
  285. ```markdown
  286. [N] **Algorithm/Feature Name** - Technical description [parent-system-node][theory-node].
  287. The ClassName in path/to/file.ts implements APPROACH [architecture-node]. The algorithm
  288. follows these steps: first, STEP1 with DETAILS [step1-node], then STEP2 involving
  289. COMPUTATION [step2-node], and finally STEP3 producing OUTPUT [step3-node]. Parameters
  290. include PARAM1 (type, purpose, default) and PARAM2 (range, effect) [parameter-node].
  291. Performance characteristics: TIME_COMPLEXITY for typical datasets with SIZE_RANGE
  292. [performance-node]. The implementation uses LIBRARY for TASK [tech-node].
  293. ```
  294.  
  295. ### Historical Node
  296. ```markdown
  297. [N] **Development History** - The project evolved over TIMESPAN from DATE1 to DATE2
  298. [overview-node][architecture-node]. Commit HASH1 (DATE) created the initial structure
  299. with FRAMEWORK [theory-node], TOOL [tech-node], and N founding ITEMS [item-node].
  300. Commit HASH2 (DATE) was the major milestone with N insertions creating SYSTEM1
  301. [system1-node], SYSTEM2 [system2-node], and SYSTEM3 [system3-node]. Commit HASH3
  302. (DATE) introduced FEATURE with N insertions [feature-node]. Commit HASH4 (DATE)
  303. executed the MIGRATION with N insertions [migration-node], implementing NEW_APPROACH
  304. [approach-node] and documenting the shift in FILE [doc-node]. Total development:
  305. N commits, ~N lines, transforming from STATE1 to STATE2 [principle-node].
  306. ```
  307.  
  308. ## Tools and Commands Reference
  309.  
  310. ### File Exploration
  311. ```bash
  312. # Find all files of type
  313. find . -name "*.ts" -not -path "*/node_modules/*"
  314.  
  315. # Count lines of code
  316. find . -name "*.ts" -not -path "*/node_modules/*" | xargs wc -l
  317.  
  318. # Search for patterns
  319. grep -r "pattern" --include="*.ts" -n
  320. ```
  321.  
  322. ### Git Analysis
  323. ```bash
  324. # Commit history for specific path
  325. git log --all --oneline -- path/
  326.  
  327. # Detailed history with stats
  328. git log --all --stat --date=short --pretty=format:"%h | %ad | %s" -- path/
  329.  
  330. # See what changed in commit
  331. git show <hash>
  332.  
  333. # Find when file was created
  334. git log --diff-filter=A --follow -- path/to/file
  335.  
  336. # Count commits
  337. git log --all --oneline -- path/ | wc -l
  338.  
  339. # Largest commits
  340. git log --all --shortstat --oneline -- path/ | grep -E "file.*change" | sort -t' ' -k4 -rn | head -10
  341. ```
  342.  
  343. ### Code Analysis
  344. ```bash
  345. # Find all classes/functions
  346. grep -r "^class\|^function\|^const.*= " --include="*.ts"
  347.  
  348. # Find imports/dependencies
  349. grep -r "^import" --include="*.ts" | cut -d'"' -f2 | sort -u
  350.  
  351. # Find all exports
  352. grep -r "^export" --include="*.ts"
  353. ```
  354.  
  355. ## Final Tips
  356.  
  357. 1. **Start broad, then drill down**: Overview → Systems → Implementation → Details
  358. 2. **Write for future you**: Assume you'll forget everything in 6 months
  359. 3. **Include the "why"**: Design decisions, not just features
  360. 4. **Link generously**: Better too many links than too few
  361. 5. **Update iteratively**: Add nodes as you discover new areas
  362. 6. **Test navigation**: Can you follow links to learn any topic?
  363. 7. **Capture uncertainty**: Note TODOs or unclear areas
  364. 8. **Balance depth and breadth**: Cover everything, deep-dive on key systems
  365.  
  366. ## Success Criteria
  367.  
  368. A good mind map should enable someone to:
  369. - Understand what the project does (overview nodes)
  370. - Learn how it works (system and implementation nodes)
  371. - Trace any feature from concept to code (following links)
  372. - Understand design decisions (principle and history nodes)
  373. - See how the project evolved (history node)
  374. - Find specific implementations (detailed nodes with file paths)
  375. - Identify areas for contribution (TODO and future nodes)
  376.  
  377. The mind map becomes a **living index** into the codebase, making onboarding, maintenance, and evolution dramatically easier.
  378.  
  379.  
Advertisement
Add Comment
Please, Sign In to add comment