# CLI, authoring and agent tooling

Navigate the command host, source analysis, documentation generators and native agent-pack delivery used to work on ContractSpec projects.

Source snapshot: bcc79fcc27c4d801c2119bef81ddcce7b4e86498

## Find the command’s owner

CliRuntime supplies host construction and command-pack discovery. The documented discovery scope is the consumer’s direct dependencies and optionalDependencies whose package metadata declares a command pack. Include/exclude configuration selects packs, exclusion wins, and package-name ordering is deterministic. Selected packs are loaded before registration; conflicts are rejected before a pack changes the Commander program. Use this model to locate an optional AI, builder, design or examples command rather than assuming every command lives in the main CLI application.

Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cli-runtime/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/agentpacks/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/docs-generator/src/generate.ts
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/scripts/generate-llms-full.mjs

## Distinguish the generation stages

Workspace analysis owns source scanning, static diagnostics, semantic diff and Markdown/DocBlock rendering. The docs-generator tool is a separate stage that combines existing generated Markdown with the seeded registry to make a reference index. README-to-LLMS generation is another projection in web-landing. When documentation looks inconsistent, trace the particular producer and its inputs instead of rerunning an unrelated build. Preserve source paths and versions so diagnostics can lead an editor or agent to the real owner.

Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cli-runtime/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/agentpacks/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/docs-generator/src/generate.ts
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/scripts/generate-llms-full.mjs

## Choose the coding-tool target explicitly

Agentpacks merges configuration into host-specific rules, hooks, skills and other outputs for supported coding tools. Skills can include references and scripts; they should stay focused on a task and fetch version-appropriate context. The documented generate --diff path uses a non-writing overlay and reports drift. Successful writing generation has an additional RTK refresh behavior, so select the intended mode deliberately. Editor bridges and native plugin exports remain separate delivery surfaces whose supported features and versions need inspection.

Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cli-runtime/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/agentpacks/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/docs-generator/src/generate.ts
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/scripts/generate-llms-full.mjs

## Trace one CLI action

Open the application entry and its command-pack declaration, then locate the owning implementation. Check whether the action reads, writes generated artifacts or requests a governed mutation before putting it into an automated workflow.

Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cli-runtime/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/agentpacks/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/docs-generator/src/generate.ts
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/scripts/generate-llms-full.mjs

## Follow a generated document

Identify the authored spec/DocBlock or README, the producer, its output path and the loader that consumes it. Record which stage is stale and which dependencies should invalidate it.

Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cli-runtime/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/agentpacks/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/docs-generator/src/generate.ts
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/scripts/generate-llms-full.mjs

## Prepare a coding-agent context path

Choose the installed host target and a focused skill. Link its required package/version references and example sources; keep retrieved evidence separate from trusted instructions and inspect the generated diff before applying configuration changes.

Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cli-runtime/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/agentpacks/README.md
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/docs-generator/src/generate.ts
Source: https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/scripts/generate-llms-full.mjs

## Packages

- [@lssm-tech/lib.cli-runtime](https://lssm.co/docs/packages/lib.cli-runtime/): Deterministic command-pack discovery and registration for ContractSpec CLI hosts
- [@lssm-tech/lib.plugins](https://lssm.co/docs/packages/lib.plugins/): Plugin API and registry for ContractSpec extensions
- [@lssm-tech/module.workspace](https://lssm.co/docs/packages/module.workspace/): Workspace discovery and management module
- [@lssm-tech/agentpack.contractspec](https://lssm.co/docs/packages/agentpack.contractspec/): Canonical repository-local Claude, Codex, and agent guidance for ContractSpec consumers.
- [@lssm-tech/agentpacks](https://lssm.co/docs/packages/agentpacks/): Composable AI agent configuration manager. Pack-based rules, commands, skills, hooks, and MCP sync across OpenCode, Cursor, Claude Code, Codex, Gemini, Copilot, and more.
- [@lssm-tech/biome-config](https://lssm.co/docs/packages/biome-config/): Biome presets, Grit plugins, and policy manifest for ContractSpec repositories.
- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): Shared Bun build presets and CLI for ContractSpec packages
- [@lssm-tech/tool.contracts-mcp-gen](https://lssm.co/docs/packages/tool.contracts-mcp-gen/): Generator that walks ContractSpec defineCommand/defineQuery specs and produces MCP-compatible tool schemas.
- [@lssm-tech/tools.contractspec-codemods](https://lssm.co/docs/packages/tools.contractspec-codemods/): Codemods + import-graph scanner that mechanically migrate consumers of the rich-reference legacy surfaces (CodeBlock, DiffBlock, ObjectReferenceHandler, RichContentReference, rich-code-preferences) to the post-S-8 surface (RichBlock, RichRef, RichReference, rich-reference/preferences).
- [@lssm-tech/tool.contractspec-drizzle-gen](https://lssm.co/docs/packages/tool.contractspec-drizzle-gen/): Generator that compiles ContractSpec defineDatabaseTable specs into Drizzle pgTable definitions, relations, and an RLS adapter manifest.
- [@lssm-tech/tool.create-contractspec-plugin](https://lssm.co/docs/packages/tool.create-contractspec-plugin/): CLI tool for creating ContractSpec plugins from templates
- [@lssm-tech/tool.docs-generator](https://lssm.co/docs/packages/tool.docs-generator/): CLI tool for generating docs artifacts from ContractSpec specs and DocBlocks
- [@lssm-tech/tools.eslint-plugin-i18n](https://lssm.co/docs/packages/tools.eslint-plugin-i18n/): ESLint rules enforcing i18n hygiene: no module-scope translation calls and no raw Accept-Language reads.
- [@lssm-tech/tools.eslint-plugin-no-implicit-sensitivefields](https://lssm.co/docs/packages/tools.eslint-plugin-no-implicit-sensitivefields/): ESLint rule enforcing that every defineReferenceKind() call declares an explicit sensitiveFields array (closes F-4).
- [@lssm-tech/tool.i18n-dead-key-pruner](https://lssm.co/docs/packages/tool.i18n-dead-key-pruner/): Build-time tool that prunes unreferenced translation catalog keys using RouteShardManifest reachability and t('key') source scanning
- [@lssm-tech/lib.source-extractors](https://lssm.co/docs/packages/lib.source-extractors/): Extract contract candidates from TypeScript source code across multiple frameworks (NestJS, Express, Fastify, Hono, Elysia, tRPC, Next.js)
- [@lssm-tech/tool.tsdown](https://lssm.co/docs/packages/tool.tsdown/): Shared tsdown config presets for LSSM monorepo
- [@lssm-tech/lib.typescript-runtime](https://lssm.co/docs/packages/lib.typescript-runtime/): Owned TypeScript compiler API boundary for ContractSpec tooling
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): Pinned TypeScript tooling and shared compiler configuration for ContractSpec packages.
- [@lssm-tech/integration.cli-contractspec-ai](https://lssm.co/docs/packages/integration.cli-contractspec-ai/): Optional AI command pack for the ContractSpec CLI
- [@lssm-tech/integration.cli-contractspec-builder](https://lssm.co/docs/packages/integration.cli-contractspec-builder/): Optional Builder command pack for the ContractSpec CLI
- [@lssm-tech/integration.cli-contractspec-design](https://lssm.co/docs/packages/integration.cli-contractspec-design/): Optional design command pack for the ContractSpec CLI
- [@lssm-tech/integration.cli-contractspec-examples](https://lssm.co/docs/packages/integration.cli-contractspec-examples/): Optional examples command pack for the ContractSpec CLI
- [@lssm-tech/integration.workspace-ai](https://lssm.co/docs/packages/integration.workspace-ai/): Optional concrete AI providers and agents for ContractSpec workspace hosts
- [@lssm-tech/bundle.workspace](https://lssm.co/docs/packages/bundle.workspace/): Workspace utilities for monorepo development
- [@lssm-tech/app.cli-contractspec](https://lssm.co/docs/packages/app.cli-contractspec/): CLI tool for creating, building, and validating contract specifications
- [@lssm-tech/app.cli-database](https://lssm.co/docs/packages/app.cli-database/): Command-line database tooling for ContractSpec-managed schemas and operations.
- [@lssm-tech/app.cli-databases](https://lssm.co/docs/packages/app.cli-databases/): Multi-database command-line workflows for ContractSpec workspaces.
- [@lssm-tech/jetbrains-contractspec-bridge](https://lssm.co/docs/packages/jetbrains-contractspec-bridge/): Node.js bridge server for ContractSpec JetBrains Plugin
- [@lssm-tech/app.registry-packs](https://lssm.co/docs/packages/app.registry-packs/): Registry application for discovering and distributing ContractSpec agent packs.
- [@lssm-tech/app.registry-server](https://lssm.co/docs/packages/app.registry-server/): Registry server for ContractSpec packages, contracts, and ecosystem metadata.
- [vscode-contractspec](https://lssm.co/docs/packages/vscode-contractspec/): Inspect the package guide, declared imports and source relationships.
- [contractspec](https://lssm.co/docs/packages/contractspec/): CLI tool for creating, building, and validating contract specifications
- [@lssm-tech/app.cursor-marketplace](https://lssm.co/docs/packages/app.cursor-marketplace/): Cursor marketplace catalog for ContractSpec product and core libraries
- [spec-driven-development](https://lssm.co/docs/packages/spec-driven-development/): CLI tool for creating, building, and validating contract specifications
- [@lssm-tech/repo-scripts](https://lssm.co/docs/packages/repo-scripts/): Private root contributor tooling (repository scripts). Owns the workspace dependencies that root scripts import so the repository root declares none and Turbo's global hash stays independent of package sources.
