Agent Workflow
Thinai is designed to be read by coding agents as well as people. The model describes the domain; the agent implements code using the repository’s conventions. There is no code generator.
Interfaces
Section titled “Interfaces”Use whichever interface is available:
- LSP — diagnostics, completion, definitions, references, document symbols, hover, formatting, and code actions.
- CLI — model export, context slices, impact, validation, and an MCP server.
- MCP — structured model queries for agents that support tool calling.
All three read the same model. The model remains the source of truth.
Install the CLI with npm install -g thinai-cli@alpha or run it with
npx thinai-cli@alpha. The commands below assume thinai-cli is on PATH.
Inspect the model
Section titled “Inspect the model”thinai-cli inspect path/to/model.tni --out model.jsonThe output uses the thinai-model-v1 schema. Element IDs are canonical and
kind-prefixed:
Aggregate:Ordering.OrderField:Ordering.Order.Order.idIntegrationEvent:Ordering.OrderPlacedV1Request a context slice
Section titled “Request a context slice”Prefer one aggregate, bounded context, module, or contract over loading the whole model.
thinai-cli context path/to/model.tni Aggregate:Ordering.Order --format mdThe slice includes the root, its members, relevant dependencies, contracts, and the relationships between included elements. Module and cross-context visibility metadata is preserved.
Report impact
Section titled “Report impact”thinai-cli impact path/to/model.tni ValueObject:Ordering.Order.OrderId --jsonThe report lists the changed element, its descendants, incoming references, and the elements that reference it.
Validate
Section titled “Validate”thinai-cli validate path/to/model.tniThe CLI validates the source file and its transitive imports. It does not discover separate files that import the source file. Use a workspace-aware client for the complete import-connected model.
MCP server
Section titled “MCP server”thinai-cli mcp path/to/model.tniThe server is read-only. Available tools:
list_elementssearch_elementsget_elementget_contextget_dependenciesget_visibilityvalidate_modelimpact_of_change
Use MCP when the agent supports structured tool calls but not LSP or shell commands. Use the CLI when shell access is available. Use LSP for editor and agent navigation.
Workflow
Section titled “Workflow”- Locate the model and the relevant bounded context.
- Request a context slice.
- Respect module exposure and cross-context boundaries.
- Implement code using the repository’s language and framework conventions.
- Validate the model and run the repository’s tests.
- Check that every touched aggregate, event, contract, and exposed operation has a code counterpart.
Model rules to preserve
Section titled “Model rules to preserve”identifierfields reference a value object declared in the same aggregate.- Module visibility requires exposure and, for sibling modules,
depends on. - Cross-context use requires a mirror, shared kernel, integration event, or published query contract.
- Domain events are context-private; integration events are cross-context contracts.
- Data objects are boundary shapes, not domain state.
- Primitives are
string,boolean,integer,decimal,date,time, andinstant.
A deterministic conformance manifest and thinai verify workflow are planned
after the first alpha.