Configuration Blueprint
This is the engine. Not a service to operate — a set of markdown and JSON files that turn Anthropic's products into Databayt's operating system.
This page is the map: which file controls what, and which wins when two disagree. For the inventories themselves, follow the links — they're maintained in one place each, so they can't drift apart.
Where everything lives
| Component | Canonical location | Detail |
|---|---|---|
| Instructions | ~/.claude/CLAUDE.md, CLAUDE.md, .claude/CLAUDE.md | CLAUDE.md |
| Agents | .claude/agents/, plugins/*/agents/ | Agents |
| Skills | .claude/skills/<name>/SKILL.md | Skills |
| MCP servers | ~/.claude.json (catalog: .claude/mcp.json) | MCP |
| Rules | .claude/rules/, .claude/rules-global/ | Rules |
| Hooks | .claude/settings.json | Hooks |
| Keywords | .claude/vocabulary.json | Keywords |
| Pattern cards | .claude/patterns/cards/ | Patterns |
| Memory | .claude/memory/, ~/.claude/memory/ | Memory |
| Engine truth | .claude/engine.json | counts, model, sync stamps |
.claude/engine.json is the single source of truth for model, counts, and sync stamps. Prose references it rather than hardcoding numbers; /health warns when documentation and reality drift apart.
Precedence
Three layers of instructions, most specific wins:
1. Repo-level .claude/CLAUDE.md — keywords, pipeline, project overrides
2. Project-level CLAUDE.md — what this repo is, where its docs are
3. User-level ~/.claude/CLAUDE.md — stack, preferences, component hierarchy
Rules load on top of all three, scoped by their paths glob. Skills and agents load on demand.
Layer 1 — User (~/.claude/CLAUDE.md)
| Setting | Value |
|---|---|
| Model | Fable 5 (claude-fable-5) |
| Fallbacks | Opus 4.8 → Sonnet 5 |
| Package manager | pnpm |
| Stack | Next.js 16 · React 19 · Prisma 6 · TypeScript 5 · Tailwind CSS 4 · shadcn/ui |
| Languages | Arabic (RTL default), English (LTR) |
| Port | Always 3000 |
| Environment | Central .env only — never .env.local or .env.<x> |
| Component hierarchy | ui → atom → template → block → micro |
Layer 2 — Project (CLAUDE.md)
What the repo is and where its documentation lives. One per product:
- Hogwarts — multi-tenant education SaaS, school modules, SSPL
- Mkan — rental marketplace, booking flow
- Kun — the configuration engine and this documentation site
Layer 3 — Repo (.claude/CLAUDE.md)
The operational layer: the drive, the pipeline, the keyword vocabulary, the four agent lanes, and lookup paths.
Settings (.claude/settings.json)
{
"fallbackModel": ["claude-opus-4-8", "claude-sonnet-5"],
"env": {
"CODEBASE_PATH": "/Users/abdout/codebase",
"OSS_PATH": "/Users/abdout/oss",
"GITHUB_USER": "abdout",
"DEV_PORT": "3000"
},
"hooks": { }
}The user-level ~/.claude/settings.json adds effortLevel, advisorModel, and voice settings.
Destructive-command guard
There is no permissions allow/deny list. Dangerous commands are blocked by the PreToolUse hook block-destructive-bash.sh — the Unforgivable Commands:
rm -rf *prisma migrate resetprisma db push --accept-data-lossDROP TABLEgit push --force main
A hook is used rather than a deny list because it can inspect the composed command string, not just the tool name.
Model routing
Three axes: model tier × effort × product lane. The main loop runs Fable 5; agents resolve a tier alias.
| Tier | Effort | Used for |
|---|---|---|
opus | high–xhigh | Architecture, orchestration, review, strategy, captain |
sonnet | medium | Standard build agents with known patterns |
haiku | low | Mechanical work — comment, git, icon, github, semantic, sse, structure |
Agent frontmatter carries a tier alias, never a pinned version — so upgrading the fleet is one line in engine.json. Playbook: docs/TOKEN-ECONOMY.md; on-demand audit: /economy.
Billing posture: Claude Max 5x, $100/month, subscription-only. No usage credits, no API-key per-token spend. Changing that requires a /decide entry plus Abdout's approval.
Memory
| Scope | Path | Holds |
|---|---|---|
| Project | .claude/memory/ | team.json, capacity.json, crm.json, pipeline.json, revenue.json, runway.json, okrs.json, risks.json, north_star.json, repositories.json, captain_journal.md, decisions/ |
| User | ~/.claude/memory/ | Component registries (atom.json, template.json, block.json) + shared business state |
| Session | ~/.claude/projects/<project>/memory/ | Durable facts across conversations, indexed by MEMORY.md |
Installation
# One-liner — auto-detects OS
curl -fsSL https://kun.databayt.org/install | bash
# macOS/Linux
git clone git@github.com:databayt/kun.git ~/kun
cd ~/kun && bash .claude/scripts/setup.sh engineer
bash .claude/scripts/secrets.sh <GIST_ID>
# Windows (PowerShell)
git clone git@github.com:databayt/kun.git "$env:USERPROFILE\kun"
cd ~/kun; .\.claude\scripts\setup.ps1 -Role engineer
.\.claude\scripts\secrets.ps1 -GistId <GIST_ID>Full walkthrough: Onboarding.
Roles
Every machine gets the full config — every agent, skill, rule, and hook. The machine, not the person, is the unit of capability, so any machine can run any task.
Role is a label plus a secrets-trust tier, not a capability gate. Access is scoped by secrets: a server whose key you don't hold simply doesn't connect. Which keys you hold is set by the Gist you're handed.
| Role | Primary human |
|---|---|
engineer | Abdout, Ibrahim |
business | Aseel, Moutaz, Moed |
content | Samia |
ops | Sedon |
Keeping it honest
| Check | Command |
|---|---|
| Config vs reality drift | /health |
| Upstream releases vs engine | /sync |
| Keyword registry regenerate | node .claude/scripts/generate-vocab.mjs |
The ConfigChange hook warns automatically when vocabulary.json drifts from its generated documentation.