-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
listenrightmeow edited this page Jul 18, 2026
·
2 revisions
npm install --save-dev @mmmnt/feature
npx feat init # scaffolds config + first spec, installs the runtime, adapters, and vitest-
@mmmnt/featureprovides thefeatCLI. -
@mmmnt/feat-runtimeis the library your generated tests import. - Adapters connect specs to your code and infrastructure — install the ones your
feat.config.jsonnames. (vitestis the test runner; install it if you don't have it.)
npx feat initThis creates three files:
feat.config.json # how specs connect to your project
specs/greet.feat # a first spec
specs/greet.contract.json # its schemas (plain JSON Schema)
npx feat parse specs/greet.feat # 1. validate the spec
npx feat generate # 2. compile specs → test files
npx feat run # 3. execute them (red until you implement)The scaffolded spec routes the Greet command to src/greet.ts — a plain async function that
returns { status, body }:
// src/greet.ts
export async function greet(input: { name: string }) {
if (!input.name.trim())
return { status: "ERR", body: { code: "EMPTY_NAME", message: "Name is required." } };
return { status: "OK", body: { message: `Hello, ${input.name}!` } };
}Implement it, run npx feat run again, and the generated suite goes green. That's the whole
workflow: spec → generate → implement → run, with feat verify keeping the generated tests
locked to the specs in CI.
npx feat verify # committed tests match the specs (byte-for-byte)
npx feat run --coverage # predictions hold; coverage via the runner's provider
npx feat report --junit # JUnit XML path for your CI's test ingestion- Integrating with an existing project
- Testing Mechanics — where everything lives and what runs what
- Language Guide — everything a spec can express