SCHEMA-FIRST AGENT TOOLING

One contract.
Every surface.

Mnemotek turns one literal JSON Schema and one runner into a validated CLI, MCP tool, agent skill, and slash command. Build the contract once; every surface stays synchronized.

Why it matters: your users get the interface they prefer, while you stop duplicating arguments, defaults, validation, and result handling across four tools.

TypeScript · AJV · json-schema-to-ts · Commander · Enquirer
01 / THE PREMISE

Your schema is the source of truth.

Define a command once. Mnemotek carries its name, description, arguments, defaults, validation, and result contract into every interface without making you maintain four drifting toolchains.

Literal schemas

JSON Schema stays inspectable, portable, and honest.

Derived types

FromSchema keeps TypeScript aligned with runtime data.

Shared validation

AJV validates configuration and results at the boundary.

02 / SEE IT RUN

One schema in. Four surfaces out.

This is the whole move: describe inspect once, then let Mnemotek carry the same argument contract into every place an agent or human can call it.

COMMAND CONTRACT
path: string · required · validated
LIVE MANIFEST OUTPUT
$ project-tool inspect --path src
✓ validated against inspectSchema
→ { "path": "src", "files": 18, "status": "ready" }
03 / THE SURFACES

Build once. Hit every channel.

04 / QUICKSTART

A small manifest hits hard.

import { Mnemotek } from '@studnicky/mnemotek';

const inspectSchema = {
  type: 'object',
  properties: { path: { type: 'string' } },
  required: ['path']
} as const;

const tool = new Mnemotek({
  name: 'project-tool',
  description: 'Project automation.'
});

tool.command({ name: 'inspect', description: 'Inspect a path.',
  schema: inspectSchema, runner: async ({ path }) => ({ path }) });

Register the command once. The CLI, MCP adapter, skill manifest, and slash-command renderer read the same manifest.

05 / CONFIGURATION

CSS-cascade thinking for config.

Defaults are structural. Package config, config files, environment variables, and CLI arguments layer in order, with the most specific source winning. No mystery values. No silent drift.

DEFAULTSschema.default
PROJECTpackage.json
LOCAL.mnemotek / JSON
RUNTIME.env → CLI
06 / REFERENCE

Designed for extension.