-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
The reference doc generator (referenceDocConfigs) has a solid foundation with 4 content sources (conventions, diagrams, shapes, behaviors) but several gaps limit its usefulness for generating rich technical documentation. This issue tracks enhancements across three tiers of effort.
Context
The @libar-docs-arch-view annotation + DiagramScope filtering already enables scoped Mermaid diagrams. Shape extraction (@libar-docs-extract-shapes) pulls real TypeScript constructs from AST. Convention content pulls structured rules from Gherkin. But behavior rendering is shallow, diagram types are limited to flowcharts, and some extraction gaps exist.
Tier 1: Codec Enhancements (data exists in MasterDataset, rendering missing)
Deep behavior rendering
- Render full scenario steps, DataTables, and DocStrings from
pattern.scenariosin reference docs - Currently
behaviorCategoriesonly renders rule name + 120-char truncated description — essentially an index
Full rule descriptions in behavior content
- Remove 120-character truncation on rule descriptions
- Parse structured
**Invariant:**/**Rationale:**content from behavior patterns (same as conventions do)
JSDoc prose alongside shapes
- Render
directive.descriptionmarkdown alongside extracted shapes in reference docs - Currently shapes render source code but lose the narrative JSDoc context
archLayer filter in DiagramScope
- Add
archLayertoDiagramScopeinterface andcollectScopePatterns() - Enable filtering diagrams by domain/application/infrastructure layer
New Mermaid diagram types
- Sequence diagrams (
sequenceDiagram) — valuable for event flow documentation - State machine diagrams (
stateDiagram-v2) — FSM visualization - C4 diagrams (
C4Context,C4Container) — architecture overview - Class diagrams (
classDiagram) — could leverageshapeSourcesdata - Currently all diagrams are flowcharts (
graph TD/TB/LR) - Add
diagramTypefield toDiagramScope
Edge labels on diagrams
- Show event/command names on relationship arrows
- Currently edges only distinguish type via arrow style
Custom node shapes/styles per archRole
- Different Mermaid node shapes for different
archRolevalues (e.g., saga vs projection vs command)
Tier 2: Extraction Enhancements (pipeline changes)
@param/@returns/@throws extraction
- Currently dropped during JSDoc scanning in
ast-parser.ts - Function shapes lack parameter documentation
- Schema update needed: add
params,returns,throwstoExtractedShape
Full property-level JSDoc
- Currently truncated to first line only (
extractJsDocText()) - Multi-line property descriptions, markdown tables within property JSDoc discarded
- Remove first-line truncation, preserve full property docs
Auto-shape discovery mode
- Extract all exported types from a file without requiring explicit
@libar-docs-extract-shapestag - Could be opt-in via
@libar-docs-extract-shapes *or a new tag - Reduces manual annotation burden
Convention content from TypeScript JSDoc
- Pull structured
**Invariant:**/**Rationale:**content from TypeScript JSDoc blocks - Currently convention extraction only works with Gherkin
Rule:blocks - Would enable TypeScript files to self-document business rules
Tier 3: Config-Only (zero code, available today)
These require no code changes — just annotation and config work:
- Add
@libar-docs-arch-viewto more source files for richer diagrams - Add
@libar-docs-extract-shapesto key infrastructure files - Use
diagramScopes(plural) for multiple views per reference doc - Combine all 4 content sources in single reference doc configs
Priority Recommendation
- Deep behavior rendering — highest ROI, unlocks full Gherkin content
- JSDoc prose alongside shapes — makes shape docs self-documenting
@param/@returnsextraction — completes function documentation story- New diagram types — sequence diagrams especially for event flows
- Auto-shape discovery — removes manual annotation burden
Related
- Pattern Relationship Model spec (
specs/pattern-relationship-model.feature) referenceDocConfigsin downstreamdelivery-process.config.js- Reference codec:
src/renderable/codecs/reference.ts - Shape extractor:
src/extractor/shape-extractor.ts - Diagram utils:
src/renderable/codecs/diagram-utils.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels