<!-- This file was generated by @travetto/doc and should not be modified directly -->
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/llm-support/DOC.tsx and execute "npx trv doc" to rebuild -->
# LLM Support

## Task-oriented synthesized LLM guidance for Travetto modules.

The [LLM Support](https://github.com/travetto/travetto/tree/main/module/llm-support#readme "Task-oriented synthesized LLM guidance for Travetto modules.") module provides guided LLM assistance for Travetto projects. It helps you move from a target outcome to a concrete plan by combining bundle recommendations, workflow guidance, operation planning, and snippet selection.

## Install
In a Travetto workspace, install the module and use the standard CLI entrypoint:

**Code: Install the module**
```bash
npm install @travetto/llm-support
```

The module is designed to be used through [Command Line Interface](https://github.com/travetto/travetto/tree/main/module/cli#readme "CLI infrastructure for Travetto framework") commands, so once the package is available you can invoke the LLM support workflow with `trv`.

## Usage
The recommended flow is intentionally plan-first:
   1. Run `trv llm:support:recommend` to choose a bundle, workflow, category, or snippet set.
   1. Run `trv llm:support:plan` to preview the files and changes that would be produced.
   1. Run `trv llm:support:execute` to apply the selected operations, with dry-run behavior available by default.
   1. Run `trv lint --fix` to clean up formatting and styles on the generated changes.

**Code: Recommended flow**
```bash
trv llm:support:recommend
trv llm:support:plan
trv llm:support:execute --apply
trv lint --fix
```

The recommendation command supports filtering by `bundles`, `workflows`, `categories`, and `snippet-tags`. The plan command focuses on selected `operations` and produces file-level change steps. Execution supports dry-run, overwrite, target directory selection, monorepo bootstrap selection (`--monorepo`), and several operation-specific hints such as route, controller, service, model, and email naming.

## What It Supports
The module covers the core assistant paths used by Travetto projects:
   *  **Project bootstrap** - guided module and backend selection for a new application.
   *  **Web** - route, controller, service, interceptor, and client-oriented flows.
   *  **Auth** - session-backed identity and auth-web guided setup.
   *  **Model** - persistence, query, indexed, and backend selection guidance.
   *  **Upload** - direct upload and presigned URL support.
   *  **Workflow** - deployment-oriented GitHub workflow generation.
   *  **Quality** - linting and test suite setup.
   *  **Email** - templates, rendering, transport, preview, and send flows.
   *  **Test** - fixture and suite generation guidance.
   *  **Config** - configuration class and file generation.
   *  **Cache** - cache decorators and evictions workflows.

The available categories exposed by the CLI are `project`, `web`, `auth`, `model`, `upload`, `workflow`, `quality`, `email`, `test`, `config`, and `cache`.

## Bundles And Workflows
Recommendations are grouped into install guidance bundles and workflow guidance:
   *  `web-api-baseline` - web application fundamentals with DI and schema support.
   *  `web-model-crud` - controller/service CRUD flows backed by model-query.
   *  `model-persistence-stack` - model persistence and adapter selection.
   *  `auth-enabled-web` - web auth with auth-web integration.
   *  `quality-lint-and-test` - linting and test guardrails.
   *  `email-generation-stack` - email template and delivery setup.
   *  `project-bootstrap` - guided new-project setup.
   *  `create-web-route` - route/controller/service generation workflow.
   *  `generate-web-model-crud` - model-backed CRUD generation workflow.

The recommendation output also includes snippets that match the selected operations and capability tags, so the generated plan stays tied to reusable implementation patterns.

## Command Options
The CLI surface is designed for narrow, predictable selection:
   *  `--module` - scope recommendations to the active module.
   *  `--bundles` - choose specific install guidance bundles.
   *  `--workflows` - choose specific workflow guidance entries.
   *  `--operations` - choose specific operations for planning.
   *  `--categories` - filter by capability category.
   *  `--snippet-tags` - narrow the snippet catalog.
   *  `--include-excluded` - include excluded operations when you need the full catalog.
   *  `--monorepo` - when used with `project-bootstrap`, generate a workspace root and `packages/app` project layout.
   *  `--workspace-path` - customize the monorepo app location (for example `packages/api`).
   *  `--workspace-name` - customize the generated workspace package name used by root scripts.

That combination lets you start broad, then narrow to exactly the path you want before making changes.

## MCP Integration
The module exposes a minimal stdio MCP entrypoint for tool-calling integrations:

**Code: Start MCP server**
```bash
trv llm:support:mcp
```

Supported methods are `initialize`, `tools/list`, and `tools/call`. Requests and responses are newline-delimited JSON-RPC 2.0 payloads.

**Code: MCP request examples**
```json
{"jsonrpc":"2.0","id":1,"method":"initialize"}
{"jsonrpc":"2.0","id":2,"method":"tools/list"}
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"llm_support_plan","arguments":{"operations":["create-web-route"]}}}
```

## Contract Model
Contributor contract model for this module:
   *  Boundary contracts are schema classes first (inputs and outputs).
   *  Public type names are derived from classes instead of parallel interface trees.
   *  Runtime boundaries validate both inbound payloads and outbound responses.
   *  Tests should prefer schema bind+validate over custom shape guards when practical.

For execution and tooling helpers in this module, prefer non-assertion-safe binding where required by project rules.
