Module Design
USM Config
sources
Purpose: Defines include/exclude globs, package manifests, and code globs for scanning
services
Purpose: Array of service match rules with kind (web-app, api-server, worker, etc.)
shared
Purpose: Array of shared package rules with kind (ui-kit, orm, auth-lib, etc.)
data
Purpose: Array of data extraction rules (prisma, drizzle, etc.)
outputs
Purpose: Output directory mappings for usm_source, design_docs, help_docs, etc.
generation
Purpose: Generation settings: merge strategy, comment preservation, format
enrichment
Purpose: LLM enrichment config: provider, model, temperature, fields to enrich
USM CLI
commander
Purpose: CLI framework (Commander.js) for subcommand routing
Paths: src/cli/index.ts
scan
Purpose: Structural, route, infrastructure, and merge modules for codebase scanning
Paths: src/scan
Related features:
- usm/cli-init — The usm init command analyzes the repo and generates a starter usmconfig.json.
- usm/cli-multi-lang-scan — Multi-language scanner support, extended with a detector plugin system. usm scan
- usm/cli-scan — The usm scan command reads usmconfig.json, scans the codebase, and generates .us
- usm/upgrade — usm upgrade — detect stale USM projects and guide users through adopting new opt
- usm/agent-feedback — Agent feedback protocol — teaches AI agents a consistent, configurable way to su
enrich
Purpose: LLM-based enrichment of TODO placeholders in .usm files
Paths: src/enrich
Related features:
- usm/cli-enrich — The usm enrich command fills in TODO: describe placeholders in .usm files using
generators
Purpose: Output generators (markdown, mermaid, openapi, archimate, togaf, agentsMd, testSpecs)
Paths: src/generators
Related features:
- usm/vitepress-home-feedback-schema — Refine the VitePress docs homepage into a clean, scannable technical reference (
- usm/vitepress-schema-polish — Evolve the generated VitePress docs into an outstanding, adoption-accelerating s
- usm/gen-agentsmd — AGENTS.md generator — produces AI agent context files with USM-augmented system
- usm/gen-archimate — ArchiMate 3.1 generator — produces an Open Exchange XML model (XMI 2.1) from USM
- usm/gen-content-blocks — First-principles redesign of the docs generator. Introduces a content-block sche
- usm/docs-experience — Overhaul the generated docs site from a spec-dump into a real reading experience
- usm/gen-feature-review — Review-quality feature markdown — restructures the feature markdown generator to
- usm/feedback-upstream-routing — Scope-aware feedback routing — the generated feedback protocol, MCP tool, and do
- usm/gen-help-reference — Help docs reference expansion — adds usage/options/prerequisites fields to featu
- usm/gen-markdown — Markdown generator — produces GitHub-flavored markdown docs for each .usm file,
- usm/gen-mermaid — Mermaid diagram generator — produces architecture, ER, sequence, and service-dep
- usm/gen-openapi — OpenAPI 3.1 generator — produces an openapi.yaml spec and TypeScript types from
- usm/opencode-integration — First-class opencode support in the rules-files generator — emits a usm-workflow
- usm/gen-roadmap — Roadmap improvements — add feature links and shipped_in version to roadmap items
- usm/gen-rules-files — Tool-specific rules file generator with two-tier enforcement — detailed workflow
- usm/gen-source-mapping — Source mapping generator — reads all service and feature specs to build a bidire
- usm/structurizr-bridge — Structurizr bridge — import a Structurizr workspace JSON into .usm system and se
- usm/gen-technical-design — Technical Design Document generator — renders a 13-section detailed design docum
- usm/gen-testspecs — Vitest test specs generator — produces per-feature and aggregated Vitest test fi
- usm/gen-togaf — TOGAF ADM generator — produces phase deliverables (A through H) from USM data fo
- usm/agent-feedback — Agent feedback protocol — teaches AI agents a consistent, configurable way to su
USM MCP Server
mcp-sdk
Purpose: @modelcontextprotocol/sdk for MCP server registration and stdio transport
Paths: src/cli/mcp.ts
mcp-tools
Purpose: 12 tool implementations: list, read, search, validate, summary, references, contracts, flows (read) + draft_feature, write_feature, update_feature, update_feature_status (write)
Paths: src/mcp