cto-legends · module overview · foundation · MIT
legends-a2ui: Offline A2UI v1.0 Validation, Projection & Preview
Offline-first A2UI v1.0, v0.9.1, v0.9, and v0.8 toolkit: strict schema and graph validation, deterministic legacy normalization, curated interactive surface composition, zero-coupling JSON-to-A2UI projection, zero-daemon file:// HTML previewing, and Precision Noir React, WebCore, and Lit renderer scaffolding.
GitHub Repository (https://github.com/avalonreset/legends-a2ui)
Prompting an unguided coding agent to emit interactive A2UI JSON or wire an @a2ui/* web renderer routinely breaks across six predictable failure modes: mixed v0.8/v0.9/v1.0 wire syntax, broken HTTP 404 draft catalog URIs, non-UAX #31 component IDs and cyclic component graphs, unsafe javascript: URLs or leaked API tokens, Light DOM CSS collisions in @a2ui/web_core and @a2ui/lit, and headless terminals dumping raw JSON walls or spawning unapproved localhost servers.
legends-a2ui solves all six locally and offline on the Python 3.11+ standard library with zero third-party pip dependencies. Every official a2ui-project/a2ui schema, Basic and Standard Catalog, and protocol guide across v1.0, v0.9.1, v0.9, and v0.8 is vendored under vendor/a2ui-spec/ with SHA-256 manifest verification. Validate single JSON objects, arrays, wrapper envelopes, JSONL streams, or fenced Markdown a2ui blocks; deterministically upgrade legacy v0.8/v0.9 payloads into strict canonical v1.0 with context-aware @path and @call rewriting; compose 8 curated operator templates; or project arbitrary CLI JSON into interactive surfaces without cross-module coupling.
When an operator needs to inspect a surface visually from a terminal, preview builds a single self-contained, zero-CDN file:// HTML5 app under a strict CSP with reactive dataModel bindings, Precision Noir dark and Light themes, and a live Action Event Inspector. When integrating into a web app, scaffold generates preview-first (planSha256) TypeScript and Light DOM CSS kits for React, WebCore, or Lit, while doctor audits project @a2ui/* package drift and knowledge-pack attaches 7 curated runbooks to an Empire vault.
Deterministic Execution Boundary
Why Unguided Agent A2UI Payloads Fail in Production Renderers
Frontier models blend deprecated v0.8 beginRendering envelopes, v0.9 bare path/call bindings and broken 404 catalog URIs, and v1.0 @path/@call syntax inside the same reply, while omitting TextField.value, emitting hyphenated IDs, or leaking unsafe URLs and live credentials straight into rendered cards.
- SHA-256-Pinned Official Spec & Multi-Format Validation: Verifies all 28 vendored a2ui-project/a2ui files locally and validates JSON objects, arrays, JSONL streams, and Markdown fenced a2ui blocks for UAX #31 IDs, root presence, dangling refs, iterative 3-color DFS cycles, Basic Catalog rules, media/openUrl allowlists, ReDoS bounds, and fail-closed secret refusal.
- Context-Aware Legacy-to-v1.0 Normalization: Upgrades v0.8, v0.9, v0.9.1, and draft v1.0 payloads to strict canonical v1.0 with @path/@call syntax while keeping ChildList.path and updateDataModel.path unprefixed, migrating Text.variant headings to Markdown, synthesizing missing TextField.value, and remapping non-UAX #31 IDs safely.
- Zero-Coupling CLI JSON Projection & Zero-Daemon Preview: Compiles any structured CLI JSON (such as planSha256 previews, doctor reports, or briefings) into strict A2UI v1.0 via project without coupling upstream tools to A2UI, and renders offline file:// HTML5 previews under a strict default-src 'none' CSP with zero background localhost daemons.
- Preview-First Write Safety & EDR Guardrails: Every disk mutation in compose --output, preview, and scaffold requires a preview pass returning a deterministic planSha256 followed by --apply --confirm-plan, enforcing base-directory containment, symlink refusal, atomic no-clobber writes, and zero ambient credential reads.
CLI Subcommands & Capability Surface
- Runtime, Vendored Spec & Project Drift Doctor: Verifies Python 3.11+, optional Node.js 18+ and Playwright availability, SHA-256 digests across all 28 vendored a2ui-project/a2ui files and knowledge/a2ui/pack.json, static read-only --project <dir> checks for @a2ui/* <0.16.0 drift, broken 404 catalog URIs, and legacy v0.8 keys (skipping .env*), plus an optional --live TLS 1.2+ DNS-pinned upstream probe.
- Strict Multi-Format A2UI Validator: Validates JSON objects, arrays, messages wrappers, streaming JSONL, and Markdown fenced a2ui blocks (--extract-markdown) across v1.0, v0.9.1, v0.9, and v0.8 for UAX #31 IDs, id: "root", dangling references, orphans, 3-color DFS cycles, Row/Column weight placement, all 18 Basic Catalog components and 14 functions, Checkable @checks, URL protocol allowlists, CWE-400 bounds, and fail-closed secret refusal.
- Deterministic Legacy-to-v1.0 Normalizer: Deterministically upgrades v0.8, v0.9, v0.9.1, and transitional v1.0 payloads into canonical v1.0 with context-aware @path and @call rewriting (keeping ChildList.path and updateDataModel.path unprefixed), Markdown heading migration, missing TextField.value synthesis, collision-safe UAX #31 ID remapping, canonical catalogId repair, and strict post-normalization verification.
- Curated Operator Surface Composer: Emits strict-validated A2UI v1.0 surfaces from 8 curated operator templates (ship-call, choice-picker, intake-form, tabbed-briefing, status-dashboard, confirm-action, media-review, wizard-step) with --vars or --vars-file, fail-closed secret scanning, and markdown-fence, json, or jsonl output.
- Zero-Coupling JSON-to-A2UI Surface Projector: Compiles arbitrary structured CLI JSON (--input <path|->) into strict-validated A2UI v1.0 surfaces via --preset auto|plan-approval|health-deck|data-briefing so any cto-legends tool's --json output renders as an interactive approval card, health deck, or briefing with zero cross-module coupling.
- Zero-Daemon Offline Static HTML Preview: Generates a single self-contained, zero-CDN file:// HTML5 preview (preview-first planSha256) under a strict default-src 'none' CSP with RFC 8259 Unicode JSON escaping, all 18 Basic Catalog components, reactive dataModel bindings, @checks feedback, Precision Noir dark and Light themes, and a live Action Event Inspector.
- Preview-First Host Renderer Scaffolder: Previews (planSha256) and writes TypeScript plus Light DOM CSS integration kits for --target react|web-core|lit (precision-noir or neutral theme), including a2uiParser.ts, a2uiSecurity.ts, a2uiTheme.css, unit tests, action bridge wiring, ErrorBoundary, and SSR-safe Markdown renderer integration.
- Offline Pinned Spec Catalog & Wiki Search: Queries all 18 Basic Catalog components and 14 built-in functions across v1.0, v0.9.1, v0.9, and v0.8 offline via catalog, and searches all 28 SHA-256-pinned a2ui-project/a2ui specification files and local wiki/ runbooks via docs-lookup with optional --live-locations URLs.
- Empire Knowledge Pack & Resource Resolver: Verifies SHA-256 digests across knowledge/a2ui/pack.json (7 wiki runbooks, references/sources.md, and templates/surface-receipt.md), outputs the legends-empire attachment command, and resolves checkout or wheel package_data paths via resources.
Raw Frontier LLM vs. legends-a2ui Execution Matrix
- Protocol Versions & Catalog URIs: Standard AI Chat (Mixes v0.8 beginRendering, v0.9 bare path/call bindings, broken 404 v0_9/basic_catalog.json URIs, and v1.0 @path syntax in one payload.) vs. With legends-a2ui (Validates against 28 SHA-256-pinned official a2ui-project/a2ui files and deterministically upgrades legacy payloads to canonical v1.0 with context-aware @path/@call rules.) · legends-a2ui validate --version 1.0 --strict --json confirms canonical catalogId and zero protocol drift.
- Component Graph & UAX #31 IDs: Standard AI Chat (Emits hyphenated IDs (submit-btn), omits id: "root", leaves dangling child references, or creates cyclic component trees that crash renderers.) vs. With legends-a2ui (Enforces Unicode UAX #31 identifiers, root presence, iterative 3-color DFS cycle detection, dangling-ref refusal, and Row/Column weight placement.) · Structured JSON validation report with exact failing component path and deterministic ID remapping on normalize.
- Terminal Preview & Cross-Module UI: Standard AI Chat (Dumps raw unreadable JSON in headless terminals, spawns unapproved localhost preview servers, or hardcodes UI builders into every CLI module.) vs. With legends-a2ui (Projects any CLI --json output into strict A2UI v1.0 via project and renders a single offline file:// HTML5 preview with zero background daemons.) · Self-contained HTML preview under strict CSP with RFC 8259 Unicode escaping and live Action Event Inspector.
- Security, Secrets & Host CSS Isolation: Standard AI Chat (Passes javascript: URLs, ReDoS regexes, or raw API keys into rendered cards and lets @a2ui/web_core Light DOM styles collide with host apps.) vs. With legends-a2ui (Refuses unsafe URLs, catastrophic regexes, and live secret patterns fail-closed, and scaffolds Precision Noir React, WebCore, or Lit kits with ErrorBoundary and Light DOM CSS overrides.) · Preview-first planSha256 write lock on all disk mutations plus included a2uiParser.test.ts verification.
Explicit Safety Boundaries & Exclusions
- Does not host live multi-tenant A2UI agent backends, provision cloud infrastructure, or act as a remote LLM proxy.
- Never spawns detached background localhost preview servers; all visual previews render as static offline file:// HTML5 files under a strict CSP.
- Never bypasses URL allowlists, ReDoS bounds, or fail-closed secret-token refusal checks, and never reads browser profiles, cookie stores, or .env* files during --project scans.
- Never writes preview HTML, composed surfaces, or host renderer scaffolds to disk without an explicit preview pass and matching --confirm-plan <planSha256> hash.
Operator FAQ
- Why use legends-a2ui instead of letting an AI coding agent write A2UI JSON and renderer glue by hand?
- Unguided models routinely blend v0.8, v0.9, and v1.0 A2UI syntax, emit the broken HTTP 404 v0_9/basic_catalog.json URI, forget required TextField.value fields, use hyphenated IDs that violate UAX #31, or leave Light DOM CSS collisions in @a2ui/web_core and @a2ui/lit. legends-a2ui pins all 28 official a2ui-project/a2ui spec files with SHA-256 verification and catches or normalizes every one of those defects locally offline.
- Does legends-a2ui require pip dependencies, paid API keys, or network access?
- No. The entire CLI runs strictly on the Python 3.11+ standard library with zero third-party pip dependencies and zero paid API keys. All 11 subcommands operate completely offline against vendored schemas and runbooks; only the optional doctor --live flag contacts the network using HTTPS TLS 1.2+ with DNS IP pinning against a 4-host allowlist.
- How does legends-a2ui project work with other cto-legends CLI modules?
- Any module that emits structured JSON (such as planSha256 mutation previews, doctor readiness checks, or telemetry briefings) can pipe stdout straight into legends-a2ui project --input - --preset auto. It compiles that JSON into a strict-validated A2UI v1.0 card, health deck, or tabbed briefing on demand without adding A2UI coupling or dependencies to upstream modules.
- How does legends-a2ui preview render interactive surfaces without starting a localhost server?
- preview generates a single self-contained, zero-CDN file:// HTML5 document under a strict default-src 'none' CSP with RFC 8259 Unicode JSON escaping. Opening the local file in any browser gives you all 18 Basic Catalog components, live reactive dataModel state, @checks validation feedback, Precision Noir dark and Light theme toggles, and an Action Event Inspector with zero background daemons.
Work Directly With Benjamin (Async-First Advisory & 48-Hour Diagnostics)
Message Benjamin directly by text or voice note at /dm, or start at /home#home-offer: Step 1: Missing customers study ($256) (48-hour service-area Google Maps heatmap, competitor demand report, site teardown, and ranked fix checklist), Step 2: Tech & marketing game plan ($1,024) (full study plus software/vendor/agency cut list, custom AI workflow map, and 90-day execution plan), or Step 3: Fractional CTO retainer ($4,096/mo) (same-day direct line to Benjamin, study and game plan kept current, second opinion on every quote or hire, and on-demand live screen-shares under the one-page retainer agreement).
All cto-legends Packages (CLI Router + On-Demand Modules)
cto-legends · GitHub: Stop memorizing CLI flags and managing dozens of skill folders. Register one vendor-agnostic router skill with any AI coding agent, speak to your coding agent in plain english, and let it load curated open-source tools on demand with every change previewed first.
legends-empire · GitHub: Turn your local Markdown vault into source-cited AI agent memory: ships the Seven Provinces starter map (Work, Money, Craft, Home, People, Self, Ambition), instant local search, SHA-256 research intake, the Ontology Engine, and hash-locked transactions.
legends-hetzner · GitHub: Scan live European Hetzner Cloud CX43, CX33, CX23, and CAX stock, compare Fractional CTO x86 and ARM64 sizing, and enforce 10-check SHA-256 preflight plans before provisioning or sniping any server.
legends-coolify · GitHub: Audit your self-hosted Coolify v4 servers, Docker container states, deployment queues, Dockerfile/Compose environment variable keys, and database backup schedules over pinned read-only HTTPS with zero secret exposure.
legends-cloudflare · GitHub: Execute preview-first Cloudflare DNS updates and cutovers that preserve orange-cloud proxy states, guard multi-record hostnames, and verify every change via live API readback.
legends-astro · GitHub: Complete agency Astro v7 lifecycle: Day-1 greenfield starters, multi-framework and WordPress or Webflow migrations, two-pass asset localization, Day-2 article publishing with 301-safe renames, baseline manifest regression gating, and Visual Digital Twin diffing.
legends-gohighlevel · GitHub: Operate GoHighLevel sub-accounts, batch-clone V2 snapshots with headless PIT minting, X-ray and rebrand internal workflow steps, stage A2P 10DLC Trust Center profiles, and enforce 5-layer agency permissions and 4-store SaaS rebilling markups.
legends-stripe · GitHub: Audit Stripe .env price IDs, issue orphan-free B2B Hosted Invoices and scan overdue receivables, sync Test and Live price ladders behind SHA-256 plan locks, reconcile fixed-fee drag and net retained cash to the cent, and verify raw-body HMAC webhooks with zero dependencies.
legends-dataforseo · GitHub: Query a 53-route DataForSEO v3 catalog covering Google SERPs, AI Optimization LLM citations, Google AI Mode, Maps, Labs, Backlinks, and On-Page Lighthouse JSON with fail-closed decoy SERP defense, automatic Page-1 /goto domain unmasking, 5x search-operator cost guards, and SHA-256 local evidence banking.
legends-geogrid · GitHub: Map your entire Google Maps territory on a river-clipped radial hexagonal lattice up to 30 positions deep at wholesale DataForSEO rates: 39.5% fewer pins for equal blind-spot accuracy (52.3% fewer with river clipping), 30-layer topography, Winnability relief Campaigns, 3-pane Keyword Stuffing studio, Strategy Room avoid zones, and a 5-page vector-hex PDF.
legends-firecrawl · GitHub: Run the 15-route Firecrawl v2 catalog (lfc) and 114-provider Alexandria data catalog (lax) with fail-closed SERP verification, /goto platform resolution, local PDF/DOCX parsing, 43M research papers, and SHA-256 local evidence banking.
legends-grant · GitHub: Search federal, state, and foundation grants across 56 US jurisdictions, verify verbatim eligibility rules against your private company facts, and check proposal budgets to the cent.
legends-youtube · GitHub: Unified YouTube Data API v3, Analytics API v2, Studio packaging, and verified yt-dlp media archiving CLI: 2-unit channel inventory, 0-quota outlier and public readback radar, Perfect Video Score idea scoring, anonymous SHA-256 yt-dlp batch capture, GPU word-timed FFmpeg clips, lossless ETag metadata updates, SHA-256 private-draft uploads, and an 18-file Empire knowledge pack.
legends-obs · GitHub: Automate OBS Studio over its local WebSocket v5 server with scene and source filter topology audits, audio gain and track preflight, idle-only profile backups, window-aware scene switching, and FFprobe canary clip verification.
legends-capcut · GitHub: Agent-native editing for CapCut Desktop: compile a plain JSON timeline into a real CapCut project, read any project back into scenes, surgically patch one scene with ripple sync, render six-frame storyboards, and audit reveal-aware text readability over CLI or stdio MCP.
legends-captions · GitHub: Repair misheard technical terms, lock letter-by-letter acronym timing, render frame-accurate 9:16 and 16:9 ASS subtitles, and format injection-safe FFmpeg burn-in filtergraphs.
legends-stable-audio-3 · GitHub: Preview-first Stable Audio text-to-audio, audio-to-audio, and inpainting CLI studio with duration/seed/credit guardrails, SHA-256 WAV/MP3 stem banking, and active-cue loudness mastering.
legends-hyperyap · GitHub: Push-to-talk local GPU voice dictation for Windows, macOS, and Linux: transcribe speech offline with NVIDIA Parakeet and paste straight into your active editor or terminal.
legends-ambient-intelligence · GitHub: Offline voice-memo and field-recording transcription pipeline: archive USB voice recorders with SHA-256 deduplication, run local faster-whisper or Parakeet ASR, stitch 15-minute recorder rollovers, and distill structured legends-empire Markdown notes.
legends-temporal · GitHub: Replace fragile crontabs, sleep loops, and rate-limited chat-app schedulers with server-side Temporal schedules, one-shot start_delay timers, first-class cto-legends --module scheduling, live orphaned-queue and inventory drift audits, local/Docker/systemd cluster bootstrap blueprints, and single-screen event-history failure verdicts.
legends-jev · GitHub: Local Python OCR and visual verification for UI screenshots, exact original-image pixel_box coordinates, Street View storefront signage audits, and 120s-gated UI action advice.
legends-buzz · GitHub: Operate self-hosted Block Buzz Nostr relays, validate NIP-01/NIP-19 secp256k1 Bech32 and hex keys, route all 26 Buzz domains through token-compact CLI calls, diagnose NIP-29 and NIP-FI membership 403s, isolate reply threads, and lock relay publishing behind SHA-256 plan hashes.
legends-a2ui · GitHub: Offline-first A2UI v1.0, v0.9.1, v0.9, and v0.8 toolkit: strict schema and graph validation, deterministic legacy normalization, curated interactive surface composition, zero-coupling JSON-to-A2UI projection, zero-daemon file:// HTML previewing, and Precision Noir React, WebCore, and Lit renderer scaffolding.
legends-github · GitHub: GitHub repository audit, release readiness, DataForSEO 20-topic SEO discovery, non-destructive README scoring, and 1280x640 Open Graph social preview pixel-parity CLI for coding agents.