Skip to content

Commit bfe3147

Browse files
authored
Add mental model documentation following arc42 structure
Create comprehensive mental model documentation based on Peter Naur's principles using the arc42 framework. This includes sections on system vision, architecture decisions, onboarding processes, and critical requirements for new senior developers.
1 parent 57e5d9c commit bfe3147

1 file changed

Lines changed: 183 additions & 0 deletions

File tree

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
description: Build Mental Model Documentation (Peter Naur)
3+
---
4+
5+
Analyze this software project and create comprehensive mental model documentation following Peter Naur's "Programming as Theory Building" principles. Use arc42 as the structural framework.
6+
7+
## Your Task
8+
9+
Build documentation that enables new senior developers to understand not just WHAT the system does, but WHY it exists and HOW to think about it.
10+
11+
## Documentation Structure
12+
13+
Create the following arc42-based structure:
14+
15+
### arc42/01-introduction.md
16+
- System vision and purpose
17+
- Core quality goals (top 3)
18+
- Stakeholders
19+
- **ADD:** Technical roadmap (next 12 months)
20+
- **ADD:** Deprecation plans
21+
22+
### arc42/03-context.md
23+
- System boundaries (what's IN vs OUT)
24+
- External interfaces
25+
- Neighbor systems with rationale
26+
27+
### arc42/04-solution-strategy.md
28+
**CRITICAL:** Document the top 5 architecture decisions
29+
For each: Decision + Rationale + Consequences + Alternatives considered
30+
31+
### arc42/05-building-blocks.md
32+
- Component landscape
33+
- For each component: Role, Responsibility, Key constraint
34+
- Dependency relationships
35+
36+
### arc42/08-concepts.md
37+
**CRITICAL:** Mental Model Map
38+
39+
Include:
40+
1. **Core Metaphor:** Central analogy for the system
41+
2. **Must-Understand Concepts:** 3-5 fundamental concepts with:
42+
- Why it matters
43+
- Impact on development
44+
- Common mistakes newcomers make
45+
3. **Unwritten Rules:** Team conventions not in code
46+
4. **Failed Experiments:** "We tried X, didn't work because Y"
47+
5. **Cross-cutting concerns:** Error handling, logging, security patterns
48+
49+
### arc42/09-decisions/
50+
**CRITICAL:** Architecture Decision Records (ADRs)
51+
52+
Follow Michael Nygard's ADR format with these extensions:
53+
54+
**Required sections:**
55+
- Status, Date, Context, Decision, Consequences
56+
- **ADD:** Problem Statement (what issue are we solving?)
57+
- **ADD:** Pugh Matrix for alternatives evaluation
58+
59+
**Pugh Matrix format:**
60+
```
61+
| Criterion | Baseline | Alt 1 | Alt 2 |
62+
|-----------------|----------|-------|-------|
63+
| [Criterion 1] | 0 | -2/+2 | -2/+2 |
64+
| [Criterion 2] | 0 | -2/+2 | -2/+2 |
65+
| Total Score | 0 | X | Y |
66+
```
67+
Scale: -2 (much worse) to +2 (much better) vs baseline
68+
69+
Write each ADR to its own file.
70+
71+
**ADD:** README.md with ADR timeline showing evolution phases
72+
73+
### arc42/11-risks.md
74+
**ADD:** Post-mortems section
75+
- Major incidents
76+
- Root causes
77+
- Lessons learned
78+
- Why certain rules exist now
79+
80+
### onboarding/journey-map.md
81+
4-week learning path:
82+
- Week 1: Overview (goals + validation questions)
83+
- Week 2: Fundamentals (goals + validation questions)
84+
- Week 3: Deep dive (goals + validation questions)
85+
- Week 4: Independence (goals + validation questions)
86+
87+
### onboarding/development-workflow.md
88+
- Feature lifecycle (design → implement → review → deploy)
89+
- Review checklist
90+
- When to write ADRs
91+
- Deployment process
92+
93+
### onboarding/team-structure.md
94+
- Knowledge map (who knows what)
95+
- Code ownership
96+
- Decision processes
97+
- Escalation paths
98+
99+
### onboarding/common-issues.md
100+
Troubleshooting patterns in format:
101+
**Symptom****Common Cause****Debugging Steps****Prevention**
102+
103+
### llm/knowledge-graph.md
104+
**FOR LLM USAGE:** Structured knowledge
105+
106+
```yaml
107+
concepts:
108+
- name: [Concept Name]
109+
level: [0=Fundamental, 1=Architecture, 2=Implementation]
110+
priority: [CRITICAL/HIGH/MEDIUM/LOW]
111+
prerequisites: [list]
112+
enables: [list]
113+
learning_time: [estimate]
114+
common_mistakes:
115+
- mistake: [description]
116+
why: [root cause]
117+
correct: [right approach]
118+
validation: [question to verify understanding]
119+
code_locations: [where to find examples]
120+
```
121+
122+
### llm/antipatterns.md
123+
Document what NOT to do:
124+
```
125+
❌ Antipattern: [Name]
126+
Why wrong: [explanation]
127+
✅ Correct approach: [solution]
128+
Code example: [side-by-side comparison]
129+
Related: [ADR/concept links]
130+
```
131+
132+
## Critical Requirements
133+
134+
1. **Document the "Why"** - Not just what exists, but why decisions were made
135+
2. **Make implicit explicit** - Capture "everyone knows" tribal knowledge
136+
3. **Show evolution** - How the system got here (phases, pivots, migrations)
137+
4. **Include failures** - What didn't work and lessons learned
138+
5. **Hierarchy over timeline** - Structure concepts by dependency, not sequence
139+
6. **Validate understanding** - Include questions to test comprehension
140+
7. **Link everything** - Connect ADRs, code, concepts, runbooks
141+
142+
## Open Questions Report
143+
144+
**CRITICAL:** Create `open-questions.md` documenting:
145+
- Missing information you need
146+
- Ambiguities found in code/docs
147+
- Unclear design decisions
148+
- Assumptions you had to make
149+
- Areas needing clarification from team
150+
- Inconsistencies discovered
151+
152+
Format:
153+
```markdown
154+
## [Category]
155+
**Question:** [specific question]
156+
**Context:** [why this matters]
157+
**Impact:** [what's blocked without answer]
158+
**Found in:** [file/location]
159+
**Assumption made:** [if you proceeded anyway]
160+
```
161+
162+
## Quality Criteria
163+
164+
Documentation is complete when a new senior developer can:
165+
- ✅ Understand design decisions without asking team
166+
- ✅ Know why the system is built this way
167+
- ✅ Develop features consistent with architecture
168+
- ✅ Recognize violations of unwritten rules
169+
- ✅ Debug issues using documented patterns
170+
- ✅ Avoid common pitfalls that trapped others
171+
172+
## Process
173+
174+
1. Analyze codebase structure, dependencies, patterns
175+
2. Review existing docs (if any)
176+
3. Identify core architectural decisions
177+
4. Extract implicit knowledge from code patterns
178+
5. Document in arc42 structure in asciidoc format with plantuml diagrams
179+
6. Build LLM knowledge graph
180+
7. Create onboarding journey
181+
8. **Document all open questions continuously**
182+
183+
Focus on Peter Naur's insight: The real program is the theory in developers' minds, not the code itself. Your job is to externalize that theory.

0 commit comments

Comments
 (0)