|
| 1 | +--- |
| 2 | +status: Completed |
| 3 | +created: 2026-03-09 |
| 4 | +updated: 2026-03-09 |
| 5 | +paused_from: |
| 6 | +--- |
| 7 | + |
| 8 | +# Feature: Documentation Overhaul — Structure, Design Docs, and README |
| 9 | + |
| 10 | +## Problem |
| 11 | + |
| 12 | +The existing docs describe *what* exists and *where* — class names, file locations, feature lists. But that information is already in the code. What's missing is the *why*: why was the mixin pattern chosen for PSI elements? Why does symbol resolution have separate absolute and relative phases? Why use a custom in-process compiler instead of calling protoc? These design decisions are invisible in code but critical for making good future decisions. |
| 13 | + |
| 14 | +Additionally, the current docs structure is flat and unfriendly to newcomers — opening `architecture.md` immediately throws PSI hierarchies, stub indices, and compiler internals at the reader with no gradual on-ramp. |
| 15 | + |
| 16 | +The README is also bare-bones: a checklist of features with no visual appeal or project identity. |
| 17 | + |
| 18 | +## Approach |
| 19 | + |
| 20 | +Create design-intent documentation that answers *why*, not *what*. Each doc should: |
| 21 | + |
| 22 | +- **Explain the problem** the subsystem solves and why it's non-trivial |
| 23 | +- **Describe the design choices** and what alternatives were considered or rejected |
| 24 | +- **Reveal the tradeoffs** — what was gained, what was sacrificed |
| 25 | +- **Connect decisions to constraints** — IntelliJ platform requirements, protobuf spec demands, performance needs |
| 26 | + |
| 27 | +Reorganize the doc structure by reader journey (overview → architecture → design deep-dives) so newcomers aren't overwhelmed. Refresh the README for visual impact and add Copilot workflow section. |
| 28 | + |
| 29 | +## Design |
| 30 | + |
| 31 | +### New Documentation Structure |
| 32 | + |
| 33 | +``` |
| 34 | +docs/ |
| 35 | +├── README.md ← Documentation index / navigation page |
| 36 | +├── overview.md ← What the plugin does, user experience, key concepts |
| 37 | +├── architecture.md ← Simplified: layer diagram + one paragraph per layer |
| 38 | +├── getting-started.md ← Dev environment setup (extracted from development.md) |
| 39 | +├── contributing.md ← How to contribute: grammar, features, modules |
| 40 | +├── extension-points.md ← Extension API reference (existing, refined) |
| 41 | +├── design/ ← Deep-dive "why" documents |
| 42 | +│ ├── psi-and-mixin.md ← Why mixin pattern? Why feature interfaces? |
| 43 | +│ ├── symbol-resolution.md ← Why two-phase resolve? Why scope hierarchy? |
| 44 | +│ ├── stub-indexing.md ← Why stubs? What tradeoffs in index design? |
| 45 | +│ ├── annotation-system.md ← Why per-version annotators? Validation philosophy |
| 46 | +│ ├── code-completion.md ← Why provider-per-context? Insert handler design |
| 47 | +│ ├── compiler-system.md ← Why in-process compiler? Plugin architecture |
| 48 | +│ ├── prototext.md ← Why separate language? Schema linking design |
| 49 | +│ └── editions.md ← Why feature-set model? Migration from syntax versions |
| 50 | +└── modules/ ← Per-module integration docs (existing, preserved) |
| 51 | + ├── java.md |
| 52 | + ├── go.md |
| 53 | + ├── grpc.md |
| 54 | + ├── aip.md |
| 55 | + └── sisyphus.md |
| 56 | +``` |
| 57 | + |
| 58 | +### Reader Journeys |
| 59 | + |
| 60 | +- **"What does this do?"** → README → `overview.md` |
| 61 | +- **"I want to contribute"** → `getting-started.md` → `architecture.md` → `design/*` |
| 62 | +- **"I want to extend it"** → `extension-points.md` → `modules/*` |
| 63 | +- **"Why was X designed this way?"** → `design/*` directly |
| 64 | + |
| 65 | +### README Overhaul |
| 66 | + |
| 67 | +Redesign `README.md` at project root: |
| 68 | + |
| 69 | +1. **Hero section**: Logo + one-line tagline + badges (existing) + install button/link |
| 70 | +2. **Feature highlights**: Visual cards/sections with screenshots inline, not a checklist |
| 71 | +3. **Quick start**: 3-step install guide |
| 72 | +4. **Compatibility warning**: Keep the JetBrains plugin conflict note but style it better |
| 73 | +5. **Architecture at a glance**: Simple layer diagram or feature overview image |
| 74 | +6. **Copilot workflow section**: New — explain that this project uses AI-assisted development with a structured brainstorm → implement → ship → reflect cycle. Link to `.github/copilot-instructions.md` and `.github/skills/` |
| 75 | +7. **Contributing**: Link to `docs/contributing.md` |
| 76 | +8. **Screenshots gallery**: Reorganize existing screenshots with better captions |
| 77 | + |
| 78 | +### Design Doc Template |
| 79 | + |
| 80 | +Each `docs/design/*.md` follows this structure: |
| 81 | + |
| 82 | +```markdown |
| 83 | +# [Subsystem Name] |
| 84 | + |
| 85 | +## The Problem |
| 86 | +What challenge does this subsystem address? Why isn't it trivial? |
| 87 | + |
| 88 | +## Design Decisions |
| 89 | +### Decision 1: [Choice made] |
| 90 | +**Context**: What constraints or requirements drove this? |
| 91 | +**Alternatives considered**: What else could have been done? |
| 92 | +**Why this approach**: What made it the best fit? |
| 93 | +**Tradeoffs**: What was sacrificed? |
| 94 | + |
| 95 | +### Decision 2: ... |
| 96 | + |
| 97 | +## How It Fits Together |
| 98 | +Brief sketch of how this subsystem connects to others. |
| 99 | +(Not a code walkthrough — just enough to navigate.) |
| 100 | + |
| 101 | +## Key Insight |
| 102 | +One or two sentences capturing the essential "aha" for this subsystem. |
| 103 | +``` |
| 104 | + |
| 105 | +## Questions |
| 106 | + |
| 107 | +- [x] **Scope**: All 8 design docs + restructure + README — *decided: do it all* |
| 108 | +- [x] **Why vs. What**: Focus on design intent and rationale — *decided: why-first* |
| 109 | +- [x] **Audience**: Contributors and future-us (including AI) — *decided* |
| 110 | +- [x] **Formatting/navigation**: Fold into architecture.md, not separate docs — *decided* |
| 111 | +- [x] **Doc structure**: Progressive journey (overview → architecture → design/) — *decided* |
| 112 | +- [x] **README**: Visual refresh + Copilot workflow section — *decided* |
| 113 | + |
| 114 | +## Decisions |
| 115 | + |
| 116 | +1. **Why-first documentation**: Each doc focuses on design intent and rationale rather than describing current implementation. Code tells you *what*; docs tell you *why*. |
| 117 | +2. **Progressive structure**: Docs organized by reader journey — newcomers start with overview, contributors drill into design/, extenders use extension-points. |
| 118 | +3. **All 8 design docs in one pass**: Subsystems are interconnected; writing them together gives coherent coverage. |
| 119 | +4. **Audience is contributors + AI**: Not extension developers (extension-points.md already serves them). |
| 120 | +5. **Formatting/navigation merged into architecture.md**: Standard IntelliJ patterns, not enough unique "why" for standalone docs. |
| 121 | +6. **README overhaul**: Visual refresh with feature highlights, quick start, and Copilot workflow section. |
| 122 | + |
| 123 | +## Tasks |
| 124 | + |
| 125 | +(Populated when entering Implementing state) |
| 126 | + |
| 127 | +## Discussion Log |
| 128 | + |
| 129 | +### Round 1 — 2026-03-09 |
| 130 | +**Topic**: Initial brainstorm — what documentation to create |
| 131 | +**Key points**: |
| 132 | +- Codebase analysis identified 10 major subsystems, of which 7+ have thin/missing documentation |
| 133 | +- Existing docs cover the "what" well but lack the "how" |
| 134 | +- Proposed 8 new docs organized under `docs/internals/` in 3 priority tiers |
| 135 | +**Outcome**: Proposed plan needs user input on scope, depth, and audience |
| 136 | + |
| 137 | +### Round 2 — 2026-03-09 |
| 138 | +**Topic**: Documentation philosophy — why vs. what |
| 139 | +**Key points**: |
| 140 | +- User pointed out docs should explain *why* (design intent) not *what* (current implementation) |
| 141 | +- "What" is already in the code; "why" is the invisible knowledge that gets lost |
| 142 | +- Docs become more stable across refactors because rationale outlives implementation |
| 143 | +**Outcome**: Decided on why-first approach |
| 144 | + |
| 145 | +### Round 3 — 2026-03-09 |
| 146 | +**Topic**: Scope, audience, and open questions |
| 147 | +**Key points**: |
| 148 | +- All 8 docs in one pass (subsystems are interconnected) |
| 149 | +- Audience: contributors + future-us/AI (extension-points.md already serves extenders) |
| 150 | +- Formatting/navigation: merge into architecture.md (standard IntelliJ patterns) |
| 151 | +- Renamed `internals/` to `design/` to match why-first philosophy |
| 152 | +**Outcome**: All open questions resolved |
| 153 | + |
| 154 | +### Round 4 — 2026-03-09 |
| 155 | +**Topic**: Documentation structure reorganization + README |
| 156 | +**Key points**: |
| 157 | +- Current flat structure is unfriendly to newcomers |
| 158 | +- Reorganize by reader journey: overview → architecture → design/ |
| 159 | +- Split development.md into getting-started.md + contributing.md |
| 160 | +- README needs visual refresh: feature highlights instead of checklist, quick start, screenshots inline |
| 161 | +- Add Copilot workflow section to README explaining brainstorm → implement → ship → reflect cycle |
| 162 | +**Outcome**: Full scope finalized — ready to implement |
0 commit comments