Describe an agentic command once. Derive its CLI, MCP tool, skill manifest, and slash command from that single contract.
Live demo & documentation — one inspect contract rendered as CLI, MCP, SKILL, and COMMAND output
Mnemotek takes one literal JSON Schema command contract and derives every surface an agentic tool needs from it, so the CLI flags, the MCP tool schema, the agent skill manifest, and the slash command definition can never drift out of sync with each other.
flowchart LR
A["Literal JSON Schema\ncommand contract"] --> B(("Mnemotek\nregistry"))
B --> C["CLI\nCommander + Enquirer"]
B --> D["MCP tool"]
B --> E["Agent SKILL.md\nmanifest"]
B --> F["Slash command"]
style A fill:#3178c6,color:#fff,stroke:none
style B fill:#2ea44f,color:#fff,stroke:none
style C fill:#1f2937,color:#fff,stroke:none
style D fill:#1f2937,color:#fff,stroke:none
style E fill:#1f2937,color:#fff,stroke:none
style F fill:#1f2937,color:#fff,stroke:none
- One source of truth. The schema is authored as a literal object (
as const satisfies JSONSchema) — no builder API, no separate type definitions to keep in sync. - Typed for free.
json-schema-to-tsderives TypeScript types directly from the schema at compile time. - Validated at the boundary. AJV validates every command payload at runtime through
@studnicky/json'sSchemaValidator. - Configuration cascade. Values resolve through schema defaults → package config → JSON config → environment → CLI, in that order.
import { Mnemotek } from '@studnicky/mnemotek';
import { mnemotekContract } from '@studnicky/mnemotek/entities';
const app = new Mnemotek({
name: 'project-tool',
description: 'Project automation for humans and agents.'
});
app.command({
name: 'inspect',
description: 'Inspect the current project.',
schema: {
type: 'object',
additionalProperties: true
}
});
const isCommandName = mnemotekContract.CommandNameEntity.validate('inspect');
console.log(app.manifest());npm install @studnicky/mnemotekThe package also publishes to GitHub Packages:
echo '@studnicky:registry=https://npm.pkg.github.com' >> .npmrc
npm install @studnicky/mnemotekEntity schemas, types, and validators are exported separately:
import { mnemotekContract } from '@studnicky/mnemotek/entities';This repo is a pnpm workspace. The root @studnicky/mnemotek is the library; everything under packages/* is a small standalone CLI/MCP/skill tool built on it — each one just defines its commands as a Mnemotek manifest and gets a CLI, MCP adapter, and skill manifest for free. No package here depends on a graph database, an agent-orchestration proxy, or a live external API — each shells out only to tools already on a normal dev machine (git, gh, the target project's own tsc/eslint).
| Package | What it does |
|---|---|
@studnicky/memoria |
Agent-native dotfile manager: templated apply, drift status, seed-once files, dry-run verify, remote bootstrap, and a bundled snippet catalog |
@studnicky/git-flow |
Feature/release/hotfix/cleanup branch orchestration, Conventional Commits validation, branch-derived commit type suggestion, WIP checkpoint commits |
@studnicky/git-hooks |
Installs a core.hooksPath dispatcher plus bundled protected-branch, large-file, and secret-scan pre-commit checks |
@studnicky/git-stack |
Thin passthrough to the gh-stack stacked-PR GitHub CLI extension |
@studnicky/github-release |
Create a GitHub release via gh release create, with auto-generated or explicit notes |
@studnicky/labels-sync |
Pull/push GitHub repository labels against a tracked JSON file, add-only and dry-run by default |
@studnicky/redactor |
Strip ANSI/spinner noise from command output, track byte/token savings |
@studnicky/config-standards |
Check/fix .gitignore, package.json, .editorconfig, .vscode config, Prettier config, version pins, and more against a small built-in standards set |
@studnicky/deps-audit |
Static import-graph analysis: circular imports, orphan modules, unused dependencies |
@studnicky/inspect |
Run a project's own tsc/eslint and report structured pass/fail results |
pnpm install
pnpm run ci # root package first — its test script builds dist/, which packages/* depend on
pnpm -r run ci # then every package under packages/* (pnpm -r excludes the workspace root by design)The Pages social preview is generated from the canonical transparent logo and the package version:
pnpm run generate:ogRelease, publish, and documentation workflows run this generator automatically so the preview stays version-stamped. The local generator requires rsvg-convert from librsvg.
MIT — see LICENSE.
See CHANGELOG.md and the GitHub releases.