nanohype
The factory's vocabulary
Templates, composites, standards, the SDK and the MCP server. What every other repo is described in terms of.
What follows is that repo's AGENTS.md — the entry point an agent reads before working on it. It is rendered from the repo itself at build time rather than copied, so it says what the repo says today. Links in it point back at the repo they were written for.
nanohype — agent entry point
You’re an AI client (or the author of one). This file gets you running in five minutes. For the full picture of how this repo fits into a larger nanohype-stack delivery, read docs/platform-reference.md.
What this repo gives you
- Templates (
templates/<name>/) — one scaffold per directory, for AI systems, applications, infrastructure, modules, and non-engineering deliverables.catalog.jsonenumerates them. - Composites (
composites/*.yaml) — one pre-baked multi-template stack per manifest, for common engagements (ai-chatbot, agent-team, enterprise-ai, etc.).catalog.jsonenumerates them. - Catalog (
catalog.json) — single machine-readable index of all templates + composites. Stable URL athttps://raw.githubusercontent.com/nanohype/nanohype/main/catalog.json. - Standards (
standards/) — the production bar every nanohype-stack build meets. One JSON file per guardrail, plus a human-readable README. - SDK (
@nanohype/sdk) — TypeScript reference implementation of the rendering algorithm. One runtime dependency (a YAML parser). Works against local paths or the GitHub API. - MCP server (
@nanohype/mcp) — exposes everything above as MCP resources and tools, mountable in Claude Desktop / Claude API / Bedrock agents.
Quickstart (60 seconds)
Fetch the catalog and pick a template:
curl https://raw.githubusercontent.com/nanohype/nanohype/main/catalog.json \ | jq '.templates[] | select(.category == "ai-systems") | .name'Render programmatically (TypeScript):
import { GitHubSource, renderTemplate } from "@nanohype/sdk";
const source = new GitHubSource({ repo: "nanohype/nanohype" });const { manifest, files } = await source.fetchTemplate("rag-pipeline");const result = renderTemplate(manifest, files, { ProjectName: "my-rag-bot", LlmProvider: "gateway",});// result.files — write these to disk yourself; hooks are returned, not executedOr via MCP (Claude Desktop snippet):
{ "mcpServers": { "nanohype": { "command": "npx", "args": ["-y", "@nanohype/mcp"], }, },}Then ask the model: “List templates in the ai-systems category” — the MCP tool surfaces the catalog directly.
Contract surface
If you’re writing a client (not just consuming):
- Template contract — every
templates/<name>/template.yamlvalidates againstschemas/template.schema.json. Field reference:docs/spec/template-contract.md. - Composite contract — every
composites/<name>.yamlis a multi-template orchestration manifest. Spec:docs/spec/composite-contract.md. - Rendering algorithm — the 10-step scaffolding process the SDK implements. Spec:
docs/spec/consumer-guide.md. - Catalog manifest —
catalog.jsonvalidates againstschemas/catalog.schema.json. Generated bynpm run generate:catalog. - Standards manifests — each
standards/*.jsonvalidates againstschemas/standards.schema.json. One file perkinddiscriminator value, each declaringapplies_to(the deliverables it governs) andgrades(the quality dimensions a violation is graded on), with arejectorwarnseverity on every rule.
Add a new template
- Create
templates/<name>/withtemplate.yaml,skeleton/,README.md. - Follow field order:
apiVersion, kind, name, displayName, description, version, license, persona, category, tags, variables, conditionals, hooks, composition, prerequisites. - Placeholders are
__SCREAMING_SNAKE__and appear both in file content and filenames. Variables that drive conditionals arebool. - Run
./scripts/validate.sh templates/<name>— full validation including schema, hook naming, prereqs. - Run
npm run generate:catalogto re-emitcatalog.json. CI verifies no drift. - Open a PR. CI runs
validate:schema(viavalidate:catalog),validate:catalog,validate:standards,verify:catalog, andverify:library.
Add a new composite
- Create
composites/<name>.yaml. Usekind: composite,apiVersion: nanohype/v1. - Reference templates by name; declare entry conditions and variable overrides.
- Validate against
schemas/composite.schema.json(npm run validate:composites). Composites have their own schema; a composite does not satisfy the template schema. - Re-generate the catalog (
npm run generate:catalog).
Add a new standard
Only do this if you’re publishing a new dimension of the production bar that external clients should obey. The published set is the kind enum in schemas/standards.schema.json. Adding another:
- Add the new
kindenum value toschemas/standards.schema.jsonand a per-kindcontentschema branch. Rule arrays reference#/$defs/rule, so every rule carries a severity. - Write
standards/<new-name>.jsonconforming to your new branch, withapplies_to(the deliverables it governs, including any stack scoping) andgrades(dimension ids fromstandards/quality-rubric-dimensions.json). - Update
standards/README.mdwith the human-readable form and add a row to the Standards table indocs/platform-reference.md. - In the SDK, add the name to
ALL_STANDARDSandEXPECTED_KINDinsdk/src/standards.tsand to theloadStandards()bundle there; add its type toStandardName,StandardandStandardsinsdk/src/types.ts, and export that type fromsdk/src/index.ts. - Run
npm run validate:standards. It validates every file against the schema and runsscripts/check-standards-applicability.mjs, which fails on a missingapplies_toorgrades, an unknown dimension, or a standard the README or the Platform Reference does not name.
Conventions
- 2-space indent for YAML, JSON, TypeScript, Markdown. 4-space for Python. Tabs for Go and Makefiles.
- Templates use
license: Apache-2.0. Hook name is alwaysinstall-dependencies. - All templates include
nestsInside: [monorepo]in composition (exception: themonorepotemplate itself). - Module templates carry a runtime suffix (
-ts,-go,-py) or a framework name (module-spring-security). Unsuffixed names mean the module is language-agnostic. - Skeleton code uses latest stable library versions and idiomatic patterns per language. No LangChain.
Pointers
docs/platform-reference.md— the front door for the whole stack (this repo + 8 supporting repos)docs/spec/— formal contract specificationsstandards/README.md— the production bar in human formCLAUDE.md— Claude Code session instructions for working inside this reposdk/README.md— SDK usage and API reference