@marchese-md/core
v1.0.0
Published
Parser, validator, budget estimator, MVM router, gotcha ledger, and loop engine for MARCHESE.md
Readme
@marchese-md/core
Parser, validator, and runtime engine for MARCHESE.md — the efficiency and orchestration contract layer for AI agent engineering.
This package holds all the logic behind the marchese CLI and the @marchese-md/mcp server: JSON Schema validation (Ajv, draft 2020-12), context budget estimation, Minimum Viable Model routing, the gotcha ledger, the 4-block orchestration loop engine, the RTK PreToolUse processor, the Codex offload router, and the self-improving knowledge base. If you're building your own tool on top of MARCHESE.md rather than using the CLI or MCP server directly, this is the package to depend on.
Install
npm install @marchese-md/coreUsage
import { parse, validate, resolveMinimumViableModel, auditContextBudget } from '@marchese-md/core';
const result = validate(rawMarcheseMdContent);
if (!result.ok) {
console.error(result.errors);
}
const route = resolveMinimumViableModel('linting', config.models);
const budget = auditContextBudget(rawClaudeMdContent, estimatedTokens);Key exports: parse, validate, auditContextBudget, auditWorkspace, resolveMinimumViableModel, GotchaLedger, executeOrchestrationLoop, formatAskUserQuestion, formatInterviewPrompt, detectCodexBinary, resolveCodexOffload, runCodexOffload, processPreToolUse, detectRtkBinary, runImproveSystem, ingestKnowledge, knowledgeStatus, loadMarcheseSpec.
Docs
Full spec: docs/SPEC.md in the main repo.
License
MIT
