defenseunicorns/lula

View CLAUDE.md
developer tooling JavaScriptShellTypeScript Updated 2026-02-10

Analysis

Category: Developer Tooling

Category Rationale: This is the first compliance-as-code example in the collection, showcasing how to manage security compliance (NIST 800-53) with Git-friendly architecture. It demonstrates modern web development patterns with SvelteKit 5 Runes, CLI-embedded Express server, and file-based storage for version control. Essential for developers building compliance tools, audit systems, or governance platforms.

Source Information

  • Repository: defenseunicorns/lula
  • CLAUDE.md: View Original
  • License: Apache-2.0
  • Language: TypeScript (SvelteKit 5, Node.js)
  • Stars: 24
  • Topics: compliance, nist-800-53, svelte, git-friendly, security-controls
  • Discovery Score: 63/100 points

Key Features That Make This Exemplary

This compliance control management system showcases modern approaches to building Git-friendly governance tools. It demonstrates how to structure collaborative compliance documentation with individual file-per-control architecture enabling meaningful version control and team collaboration.

1. Git-Friendly YAML Architecture

  • Individual YAML files per security control
  • Family-based directory organization (controls/AC/, controls/AU/)
  • Meaningful Git diffs for compliance changes
  • Git history integration showing file-level changes over time
  • UUID-based mapping system for code-to-control relationships

2. SvelteKit 5 Runes State Management

  • New runes-based state ($state, $effect, $derived)
  • Component architecture organized by feature
  • Centralized API layer (src/lib/api.ts)
  • Modern TypeScript patterns throughout

3. CLI-Embedded Express Server

  • Express server embedded in CLI tool (index.ts)
  • npx lula2 for direct execution
  • Configurable working directory and port
  • WebSocket support for real-time updates
  • In-memory caching for performance

4. OSCAL Framework Integration

  • NIST 800-53 Rev 4 example control set
  • Spreadsheet import with customizable field mapping
  • Source code mapping to compliance controls
  • Pull request analysis for compliance impact (npx lula2 crawl)

Standout Patterns

File-Based Storage Architecture

examples/nist-800-53-v4-moderate/
├── lula.yaml                 # Control set metadata
├── controls/                 # Individual control files
│   ├── AC/                   # Access Control family
│   ├── AU/                   # Audit family
│   └── ...
└── mappings/                 # Source code mappings

Each control gets its own YAML file for clean Git diffs.

CLI-First Development

# Run CLI tool directly
npx lula2 --dir <path> --port <port>

# Analyze pull requests for compliance impact
npx lula2 crawl

# Development mode
pnpm run dev:full  # Frontend + backend concurrently

Single command to launch full application.

SvelteKit 5 Runes

// Modern Svelte 5 state management
let controls = $state([]);
let selectedControl = $derived(controls.find(c => c.id === currentId));

$effect(() => {
  // React to state changes
});

Uses new runes instead of traditional stores.

WebSocket Real-Time Updates

  • Real-time updates for control changes across clients
  • Centralized WebSocket server (cli/server/websocketServer.ts)
  • Event-driven architecture for collaborative editing

Key Takeaways for Developers

  1. Compliance as Code: Structure compliance documentation as individual files in Git for version control, collaboration, and automated analysis. Use family-based organization and UUID tracking for code-to-control relationships.

  2. CLI-Embedded Web Servers: Embed Express servers in CLI tools for zero-configuration local development. Enable direct npx execution with configurable working directory and WebSocket support for rich UX.

  3. SvelteKit 5 Patterns: Adopt new Svelte 5 runes for state management, organize components by feature, centralize API communication, and leverage TypeScript for type safety throughout the stack.

Attribution

Original CLAUDE.md created by the Defense Unicorns team for the Lula project. This analysis references the original file under the terms of the Apache-2.0 License.