Architecture

Architecture Overview

Neenja is a filename-driven documents reader with a CLI runtime, a shared parser/model layer, an Astro/React reader shell, and agent skills that maintain the canonical files.

Source Files:

  • bin/neenja.mjs
  • lib/documentation-file.ts
  • components/docs-shell.tsx
  • src/pages/index.astro
  • src/pages/[documentSlug]/index.astro
  • src/pages/[documentSlug]/[entryId].astro
  • skills/neenja-init/SKILL.md
  • skills/neenja-bootstrap/SKILL.md
  • skills/neenja-sync/SKILL.md

Runtime Layers

Runtime responsibility is split across a small chain: the CLI resolves source paths, sets environment variables, and starts Astro dev/build commands; the parser reads recognized .neenja/ files and converts them into typed reader documents; Astro routes build static paths for document slugs and entry IDs; the React reader shell handles document switching, sidebars, search, and task graph interaction; and the skills define how agents create and maintain the canonical Neenja documents.

The architecture is intentionally small and filename-based. The reader supports three canonical documents and ignores unknown files in .neenja/.

Data Flow

The runtime flow starts when the CLI or Astro runtime resolves .neenja/ as the document directory. readDocumentCollection scans for recognized filenames, sends each recognized file through its document-specific parser, and orders the parsed documents for navbar rendering. Astro pages then pass that collection into DocsShell, which chooses the document-specific navigation and rendering behavior.

The document collection is the shared boundary between the parser, routing, and reader UI. New behavior should keep that model explicit instead of spreading filename decisions through UI components.