# @lssm-tech/biome-config

Biome presets, Grit plugins, and policy manifest for ContractSpec repositories.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `6.0.4`
- Package path: `packages/tools/biome-config`
- Manifest path: `packages/tools/biome-config/package.json`
- Manifest Git blob: `449c73ae2d85548f7412947f4ebd3020ffa348c5`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/biome-config](https://lssm.co/docs/packages/biome-config/)
- 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/packages/tools/biome-config)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/biome-config/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/biome-config/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/biome-config.txt)

## Package metadata

```json
{
  "layer": "tools",
  "physicalArea": null,
  "primaryArea": "tooling-and-agent-delivery",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "sharedLibs",
    "catalogKind": "tool",
    "catalogStatus": "active",
    "adoptionMode": "operator-only",
    "stability": "stable"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

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

Primary area: [CLI, authoring and agent tooling](https://lssm.co/docs/areas/tooling-and-agent-delivery/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/tools/biome-config/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/biome-config/README.md",
  "blobSha": "2066eafe594329406178a21ae69f5a7a76dc3693",
  "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/biome-config

Website: https://contractspec.io

**Typed ContractSpec lint-policy package that generates Biome presets, Grit plugins, and AI-facing rule summaries.**

## What It Provides

- Acts as the source of truth for repository and consumer Biome policy artifacts.
- Publishes generated presets, Grit plugins, and AI summaries alongside the typed manifest and generation helpers.
- Requires artifact synchronization whenever the typed policy manifest changes so committed outputs stay aligned.
- Enforces React and React Native compatible JSX in shared presentation packages by preferring layout primitives (`HStack`, `VStack`, `Box`) over raw `<div>` and requiring visible text to sit inside `Text` or approved typography components. Repository app packages are excluded by default and can be opted in with the policy allowlist.
- Related ContractSpec packages include `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.

## Installation

`npm install @lssm-tech/biome-config`

or

`bun add @lssm-tech/biome-config`

## Usage

Import the root entrypoint from `@lssm-tech/biome-config`, or choose a documented subpath when you only need one part of the package surface.

### JSX Primitive Fixer

The Biome Grit plugins emit diagnostics only. To apply conservative native HTML replacement fixes, run:

`bun run jsx:fix-primitives`

or from this package:

`bun run fix:jsx-primitives`

By default the fixer scans `packages/bundles`, `packages/examples`, and `packages/modules`. It skips `packages/apps` unless an app is explicitly allowlisted:

`bun run jsx:fix-primitives -- --allow-app web-landing`

Use `--check` for a dry run. The fixer preserves original attributes and className by default, infers safe list props from simple class strings, rewrites generic `<span>` elements to inline-safe `Text`, maps native HTML controls to design-system controls (including the cross-platform `NativeSelect` family), and wraps raw text with context awareness: block-safe containers keep `<Text>...</Text>`, while mixed-content contexts use inline-safe `<Text asChild><span>...</span></Text>`. Semantic form roots remain diagnostic-only when no behavior-preserving design-system replacement exists.

## Architecture

- `src/policies.ts` defines the typed policy manifest.
- `src/generate.ts` and `src/sync.ts` generate and synchronize derived artifacts.
- `src/fix-jsx-primitives.ts` provides the conservative companion codemod for deterministic JSX primitive replacements.
- `src/types.ts` and `src/index.ts` expose the public API for generation and policy consumption.
- `presets/`, `plugins/`, and `ai/` contain committed generated artifacts consumed by downstream tools.

## Public Entry Points

- Exports the root library API and ships generated presets, Grit plugins, and AI-facing summaries as committed package artifacts.
- Export `.` resolves through `./src/index.ts`.

## Local Commands

- `bun run dev` — contractspec-bun-build dev
- `bun run build` — contractspec-bun-build build
- `bun run test` — bun test
- `bun run lint` — bun run lint:fix
- `bun run lint:check` — biome check .
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
- `bun run fix:jsx-primitives` — apply conservative JSX primitive replacements.
- `bun run typecheck` — tsgo --noEmit
- `bun run sync:artifacts` — bun src/sync.ts
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
- `bun run clean` — rimraf dist .turbo
- `bun run build:bundle` — contractspec-bun-build transpile
- `bun run build:types` — contractspec-bun-build types
- `bun run prebuild` — bun run sync:artifacts && contractspec-bun-build prebuild

## Recent Updates

- Add cross-platform JSX layout and text guardrails for React and React Native compatibility.
- Add a conservative JSX primitive fixer command for deterministic native HTML replacements.
- Replace eslint+prettier by biomejs to optimize speed.

## Notes

- The committed `presets/`, `plugins/`, and `ai/` artifacts are intended for downstream scaffolding without code execution.


## Declared capabilities

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

## Catalogue metadata

```json
{
  "family": "sharedLibs",
  "kind": "tool",
  "status": "active",
  "adoptionMode": "operator-only",
  "stability": "stable",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    "."
  ],
  "examples": [],
  "replacements": [],
  "nonAdoptableRationale": "This tool is published for execution by operators, 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/biome-config` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/biome-config/src/index.ts); verified source file.

## Package publication metadata

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

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "dist",
    "README.md",
    "presets",
    "plugins",
    "ai"
  ],
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.typescript-runtime](https://lssm.co/docs/packages/lib.typescript-runtime/): `workspace:^`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@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
{
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
  "publish:pkg:canary": "bun publish:pkg --tag canary",
  "build": "contractspec-bun-build build",
  "build:bundle": "contractspec-bun-build transpile",
  "build:types": "contractspec-bun-build types",
  "clean": "rimraf dist .turbo",
  "lint": "bun run lint:fix",
  "lint:fix": "node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .",
  "lint:check": "node ../../../scripts/biome.cjs check .",
  "fix:jsx-primitives": "bun src/fix-jsx-primitives.ts --write",
  "sync:artifacts": "bun src/sync.ts",
  "test": "bun test",
  "prebuild": "bun run sync:artifacts && contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit",
  "dev": "contractspec-bun-build dev"
}
```

## Declared documentation links

- [Biome Config documentation](https://www.npmjs.com/package/%40lssm-tech%2Fbiome-config) — declared link; destination not verified.

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

## Existing agent-guide projection

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