Reference
mikk.json Reference
Complete schema reference for the mikk.json architecture contract file.
mikk.json is generated by mikk init and mikk contract generate. Edit it to define your module boundaries, constraints, and architectural decisions.
Top-level Schema
Prop
Type
ModuleDefinition
Prop
Type
Constraints
Prop
Type
Full Example
{
"modules": {
"core": {
"intent": "Pure business logic — no I/O, no framework dependencies",
"include": ["src/core/**"],
"publicApi": ["processOrder", "validateCart", "calculateTax"],
"constraints": {
"no-import": ["api", "db", "auth"],
"layer": 1,
"naming": "^process|^validate|^calculate"
}
},
"auth": {
"intent": "Authentication and session management",
"include": ["src/auth/**"],
"publicApi": ["login", "logout", "validateToken", "refreshSession"],
"constraints": {
"no-import": ["payments"],
"must-use": ["logger"],
"layer": 2
}
},
"api": {
"intent": "HTTP layer — route handlers and middleware only",
"include": ["src/api/**"],
"publicApi": [],
"constraints": {
"no-call": ["db"],
"layer": 3,
"max-files": 30
}
},
"db": {
"intent": "Database access layer — queries and migrations",
"include": ["src/db/**"],
"publicApi": ["query", "transaction", "migrate"],
"constraints": {
"no-import": ["api", "auth"],
"layer": 1
}
}
},
"decisions": [
{
"id": "ADR-001",
"title": "Core module has zero framework dependencies",
"status": "accepted",
"date": "2025-01-15",
"rationale": "Keep business logic testable without spinning up HTTP or DB",
"constraints": ["core.no-import.api", "core.no-import.db"]
}
],
"config": {
"ignorePatterns": ["**/*.test.ts", "**/*.spec.ts"],
"maxHops": 3,
"defaultTokenBudget": 4000
}
}MikkConfig
Prop
Type
ADR Schema
Prop
Type
Was this page helpful?