Sonny
Keeps me honest about the architecture of my projects.
00What it is
Two pieces: an analyzer emits JSON, and a renderer draws it. Nexus uses both.
- swift-syntax analysis: walks every
.swiftfile in a project and emits a typed node and edge graph - Versioned JSON. Schema changes are deliberate.
- Cytoscape.js renderer published as an ESM npm package, mountable into any web page
- Powers the Nexus Architecture tab across every project, refreshed daily by a scheduler
- Useful for at-a-glance review of what overnight agents have built or changed
depends-onandreferencesedges by default, with optionalimplementsedges for protocol conformance
01Why it exists
LLMs have the benefit of increasingly large context windows. Humans do not. As we sit down to look at an unfamiliar codebase, and find a distinct lack of architectural information, we sometimes wonder why we didn't become an alpaca farmer instead.
The same problem applies to my own projects. With a dozen projects on the go at any time, having an at-a-glance view of each one's architecture is a quick and helpful reminder of how this thing works.
02What it does
Point Sonny at a Swift project and it walks the source tree, identifies the major structural elements and emits a versioned JSON model describing the graph. The renderer takes that model and draws it as a navigable, zoomable graph you can explore in a browser.
The contract between analyzer and renderer is a small, stable JSON schema. That separation means the renderer works the same whether the model was generated by Sonny, written by hand, or produced by some future tool
03What's next
Sonny is integrated into Nexus as the architecture tab. It runs every morning to check for updates in each project, and is particularly helpful for at-a-glance context on what your agents are building. It's also available as a standalone npm package for use outside Nexus.