# @lssm-tech/example.opencode-cli

Reference integration for using ContractSpec with the OpenCode CLI.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `4.0.4`
- Package path: `examples/opencode-cli`
- Manifest path: `examples/opencode-cli/package.json`
- Manifest Git blob: `20c636da2bae485b569d37650dcde72969487d93`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/example.opencode-cli](https://lssm.co/docs/packages/example.opencode-cli/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/example.opencode-cli.txt)

## Package metadata

```json
{
  "layer": "examples",
  "physicalArea": null,
  "primaryArea": "examples-and-patterns",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "solutions",
    "catalogKind": "example",
    "catalogStatus": "active",
    "adoptionMode": "reference-only",
    "stability": "stable"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Examples and implementation patterns](https://lssm.co/docs/areas/examples-and-patterns/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "examples/opencode-cli/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/README.md",
  "blobSha": "913c23307ca4eb484415039635fe2269f8bd643f",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "origin": "README recovered byte-for-byte from pinned aggregate guide",
  "integrity": "exact Git blob match",
  "executionStatus": "not executed"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/example.opencode-cli

**OpenCode CLI example showing agent-mode contract building and validation.**

## What This Demonstrates

- Agent-mode (`--agent-mode opencode`) contract compilation.
- Implementation checking via `--check-implementation`.
- Maintained example package included in the ContractSpec example registry.
- `src/contracts/` contains contract specs, operations, entities, and registry exports.
- `src/docs/` contains docblocks and documentation-facing exports.
- `src/handlers/` contains handlers or demo adapters wired to contract surfaces.

## Running Locally

From `examples/opencode-cli`:
- `bun run build`
- `bun run test`
- `bun run typecheck`
- `bun run smoke`
- `bun run preflight`

## Usage

Use `@lssm-tech/example.opencode-cli` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.

## Architecture

- `src/contracts/` contains contract specs, operations, entities, and registry exports.
- `src/docs/` contains docblocks and documentation-facing exports.
- `src/example.ts` is the runnable example entrypoint.
- `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
- `src/index.ts` is the root public barrel and package entrypoint.
- `src/opencode-cli.feature.ts` defines a feature entrypoint.

## Public Entry Points

- Export `.` resolves through `./src/index.ts`.
- Export `./contracts/opencode` resolves through `./src/contracts/opencode.contracts.ts`.
- Export `./docs` resolves through `./src/docs/index.ts`.
- Export `./docs/opencode-cli.docblock` is an alias of `./docs` and resolves through `./src/docs/index.ts`.
- Export `./example` resolves through `./src/example.ts`.
- Export `./opencode-cli.feature` resolves through `./src/opencode-cli.feature.ts`.

## Local Commands

- `bun run build` — bun ../../packages/apps/cli-contractspec/src/cli.ts build src/contracts/opencode.contracts.ts --agent-mode opencode
- `bun run validate` — bun ../../packages/apps/cli-contractspec/src/cli.ts validate src/contracts/opencode.contracts.ts --check-implementation --agent-mode opencode
- `bun run typecheck` — tsgo --noEmit
- `bun run test` — bun test
- `bun run smoke` — bun test src/example.smoke.test.ts
- `bun run preflight` — bun run build && bun run typecheck && bun run test && bun run validate && bun run smoke

## Recent Updates

- Replace eslint+prettier by biomejs to optimize speed.
- Stability.
- Missing contract layers.

## Notes

- Works alongside `@lssm-tech/lib.contracts-spec`, `@lssm-tech/lib.schema`.


## Declared capabilities

This manifest does not declare a capability catalogue. Assess the package using its guide, import map and source.

## Catalogue metadata

```json
{
  "family": "solutions",
  "kind": "example",
  "status": "active",
  "adoptionMode": "reference-only",
  "stability": "stable",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./contracts/opencode",
    "./docs",
    "./docs/opencode-cli.docblock",
    "./example",
    "./opencode-cli.feature"
  ],
  "examples": [],
  "replacements": [],
  "nonAdoptableRationale": "This example is published for reference and learning, not as a reusable library dependency."
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/example.opencode-cli` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/src/index.ts); verified source file.

- `@lssm-tech/example.opencode-cli/contracts/opencode` — subpath `./contracts/opencode`
  - `unconditional`: `./src/contracts/opencode.contracts.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/src/contracts/opencode.contracts.ts); verified source file.

- `@lssm-tech/example.opencode-cli/docs` — subpath `./docs`
  - `unconditional`: `./src/docs/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/src/docs/index.ts); verified source file.

- `@lssm-tech/example.opencode-cli/docs/opencode-cli.docblock` — subpath `./docs/opencode-cli.docblock`
  - `unconditional`: `./src/docs/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/src/docs/index.ts); verified source file.

- `@lssm-tech/example.opencode-cli/example` — subpath `./example`
  - `unconditional`: `./src/example.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/src/example.ts); verified source file.

- `@lssm-tech/example.opencode-cli/opencode-cli.feature` — subpath `./opencode-cli.feature`
  - `unconditional`: `./src/opencode-cli.feature.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/opencode-cli/src/opencode-cli.feature.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": null,
  "files": [
    "LICENSE",
    "README.md",
    "dist",
    "src",
    "!**/*.test.*",
    "!**/*.spec.*",
    "!**/*.tsbuildinfo"
  ],
  "publishExports": null
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.contracts-spec](https://lssm.co/docs/packages/lib.contracts-spec/): `workspace:^`
- [@lssm-tech/lib.schema](https://lssm.co/docs/packages/lib.schema/): `workspace:^`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "build": "bun x --bun tsc --project tsconfig.json",
  "scaffold": "bun ../../packages/apps/cli-contractspec/src/cli.ts build src/contracts/opencode.contracts.ts --agent-mode opencode",
  "validate": "bun ../../packages/apps/cli-contractspec/src/cli.ts validate src/contracts/opencode.contracts.ts --check-implementation --agent-mode opencode",
  "typecheck": "tsgo --noEmit",
  "test": "bun test",
  "smoke": "bun test src/example.smoke.test.ts",
  "preflight": "bun run build && bun run typecheck && bun run test && bun run validate && bun run smoke"
}
```

## Declared documentation links

- [Example Opencode Cli documentation](https://www.npmjs.com/package/%40lssm-tech%2Fexample.opencode-cli) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Fexample.opencode-cli",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/example.opencode-cli.txt",
  "route": "/llms/example.opencode-cli",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/example.opencode-cli.txt",
  "blobSha": "913c23307ca4eb484415039635fe2269f8bd643f",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
