Configuration

The engine blueprint — every setting, agent, skill, hook, MCP, rule, and memory

Configuration Blueprint

This IS the engine. Every setting, agent, skill, hook, MCP server, rule, and memory file that transforms Anthropic's products into Databayt's operating system.

Inventory

ComponentCountLocation
CLAUDE.md files3 layers~/.claude/, CLAUDE.md, .claude/CLAUDE.md
Agents40~/.claude/agents/
Skills25~/.claude/commands/
MCP Servers18~/.claude/mcp.json + 3 role configs
Rules8~/.claude/rules/
Hooks5~/.claude/settings.json
Memory files6~/.claude/memory/
Allow rules38~/.claude/settings.json
Deny rules4~/.claude/settings.json
Keywords100+.claude/CLAUDE.md

Settings (~/.claude/settings.json)

Model & Environment

SettingValue
Modelclaude-opus-4-6
CODEBASE_PATH/Users/abdout/codebase
GITHUB_USERabdout
DEV_PORT3000
CLAUDE_CODE_SUBAGENT_MODELopus

Permissions

Allow (38 rules): git, pnpm, npx, node, Read, Edit, Write, Glob, Grep, Agent, WebFetch, WebSearch, + 17 MCP server wildcards.

Deny (4 rules):

  • rm -rf * — prevent catastrophic deletion
  • prisma migrate reset * — prevent database wipe
  • prisma db push --accept-data-loss * — prevent data loss
  • DROP TABLE * — prevent table deletion via Neon MCP

Hooks

HookEventAction
SessionStartSession beginsPrint model + timestamp
PreToolUseBefore pnpm devKill port 3000
PostToolUseAfter pnpm devOpen Chrome to localhost:3000
PostToolUseAfter Write/EditAuto-run Prettier
StopAgent finishesLog session end

CLAUDE.md Hierarchy

Layer 1: User-Level (~/.claude/CLAUDE.md)

SettingValue
ModelOpus 4.6
Package managerpnpm
StackNext.js 16, React 19, Prisma 6, TypeScript 5, Tailwind CSS 4, shadcn/ui
LanguagesArabic (RTL default), English (LTR)
ModeFull Autopilot (100-turn cycles)
PortAlways 3000
EnvironmentSingle .env only
Component hierarchyui → atom → template → block → micro

Layer 2: Project-Level (CLAUDE.md)

Project-specific context per product:

  • Hogwarts: Multi-tenant education SaaS, school modules, SSPL license
  • Mkan: Rental marketplace, Airbnb-inspired, booking flow
  • Kun: Configuration engine, documentation site, 3-phase roadmap

Layer 3: Repo-Level (.claude/CLAUDE.md)

Operational configuration: 100+ keyword-to-action mappings, MCP trigger table, slash command reference, organization repository references, React best practices.

Agent Fleet (40 agents, 4 tiers)

Tier 0 — Captain

AgentScope
captainCEO brain — weekly allocation, revenue strategy, team coordination across 5 products and 4 humans

Tier 1 — Business (3)

AgentScope
revenuePricing strategy, proposals, contracts, MRR tracking, Saudi payment setup
growthContent strategy, SEO, social media, developer relations, Arabic-first content
supportCustomer onboarding, issue triage, knowledge base, SLA tracking

Tier 2 — Product (2)

AgentScope
productRoadmap across 5 products, user stories, ICE scoring, release planning
analystMarket intelligence per vertical, competitor analysis, usage analytics

Tier 3 — Tech Leadership (3)

AgentScope
tech-leadArchitecture across 14 repos, shared patterns, breaking changes, tech debt
opsCI/CD, deployment health, API spend tracking, cost optimization, uptime
guardianOWASP Top 10, performance budgets, SSPL compliance, medical data privacy

Specialist Agents (31 agents, 7 chains)

Stack Chain (7)

AgentDomain
nextjsApp Router, Server Components, Server Actions
reactHooks, concurrent features, performance
typescriptStrict mode, generics, advanced types
tailwindSemantic tokens, responsive, RTL/LTR
prismaPostgreSQL, migrations, query optimization
shadcnRadix primitives, registry, MCP
authjsJWT, OAuth, sessions

Design Chain (4)

AgentDomain
orchestrationMaster coordinator, multi-agent workflows
architectureMirror pattern, multi-tenant (Hogwarts)
patternCode conventions, anti-patterns
structureFile organization, naming

UI Chain (4)

AgentDomain
shadcnRadix primitives, registry
atomCompose 2+ shadcn/ui primitives
templateFull-page layouts
blockUI + business logic (DataTable, auth, payments)

DevOps Chain (3)

AgentDomain
buildTypeScript validation, Turbopack
deployVercel, staging/production
testVitest, Playwright, TDD

VCS Chain (2)

AgentDomain
gitBranching, commits, conventional format
githubPRs, issues, Actions, code review

Specialized (8)

AgentDomain
middlewareAuth, i18n, subdomain routing
internationalizationArabic/English, RTL/LTR, dictionaries
semanticHTML, color tokens, accessibility
sseServer-side exception diagnosis
optimizeFeature optimization, automation
performanceCore Web Vitals, profiling
commentCode comments
iconSVG icon management

Reference Chain (4 product agents)

AgentProduct
hogwartsEducation SaaS patterns
souqE-commerce patterns
mkanRental marketplace patterns
shifaMedical platform patterns

Skill Library (25 skills)

Workflow

SkillTriggerWhat It Does
/devdevKill port → pnpm dev → Chrome
/buildbuildpnpm build + TypeScript check + auto-fix
/quickpushLint → fix → commit → push
/deploydeploy, shipVercel deploy with retry (max 5)

Creation

SkillTriggerWhat It Does
/atomatom [name]Create/list/preview atom components
/templatetemplate [name]Create/list/preview page layouts
/blockblock [name]Create/refactor/audit with 100-point scoring
/saassaas [feature]Schema + actions + UI + pages

Quality

SkillTriggerWhat It Does
/testtest [file]Vitest + Playwright tests
/securitysecurityOWASP Top 10 + dependency scan
/performanceperformanceCore Web Vitals + bundle + DB queries
/fixfixAuto-fix all TypeScript/lint/build errors

Other

SkillTriggerPurpose
/docsdocsMDX, API docs, Storybook stories
/codebasecodebaseBrowse/search/copy patterns
/reposreposExplore databayt repositories
/screenshotscreenshotView recent screenshot
/motionmotionAdd Framer Motion animations
/handoverhandover [block]5-pass production QA

Business

SkillTriggerWhat It Does
/proposalproposal [client]Generate client proposal via revenue agent
/pricingpricing [product]Calculate pricing tiers with competitor comparison
/weeklyweekly [plan/check/review]Captain's weekly review cycle

Content

SkillTriggerWhat It Does
/translatetranslate [file]AR/EN translation with context preservation
/content-calendarcontent-calendarWeekly content schedule across pillars

Ops

SkillTriggerWhat It Does
/monitormonitorCheck deployments + costs + uptime across products
/costscostsAPI spend breakdown and optimization
/incidentincident [severity]P0/P1/P2 incident response workflow

MCP Ecosystem (18 servers)

UI & Design (5)

ServerPurpose
shadcnComponent registry
figmaDesign file access (127.0.0.1:3845)
tailwindCSS utilities, docs
a11yAccessibility audits (WCAG 2.1 AA)
storybookVisual testing

Testing (2)

ServerPurpose
browserHeadless Chromium (1920x1080)
browser-headedVisible Chromium (auth flows)

DevOps & Infra (4)

ServerPurpose
githubRepos, issues, PRs, Actions
vercelDeployments, logs
sentryError monitoring
gcloudGoogle Cloud CLI

Data & Auth (4)

ServerPurpose
neonNeon PostgreSQL branching
postgresDatabase queries (dbhub)
stripePayments, subscriptions
keychainmacOS Keychain credentials

Knowledge & PM (3)

ServerPurpose
refTechnical documentation
context7Up-to-date library docs
linearIssue tracking

Role-Specific MCP Configs

RoleConfig FileServers
engineermcp.jsonAll 18 servers
businessmcp-business.jsongithub, slack, linear, stripe, notion, browser, context7, memory-bank
contentmcp-content.jsongithub, slack, notion, browser, figma, context7, memory-bank, ref
opsmcp-ops.jsongithub, slack, vercel, sentry, neon, stripe, browser, posthog, memory-bank

Rules Engine (8 rules)

RuleActivates OnEnforces
auth**/auth/**, **/middleware.*NextAuth v5, session scoping
i18n**/*-ar.json, **/dictionaries/**Single-language storage, RTL
prisma**/*.prismaschoolId inclusion, $extends
tailwind**/*.css, **/styles/**CSS-first v4, OKLCH, RTL logical
testing**/tests/**, **/*.spec.*Playwright/Vitest conventions
deployment**/vercel.jsonpnpm, tsc before builds
multi-repo(global)Codebase paths, fork workflows
org-refs(global)Repo priority lookup

Memory System (6 files)

FileContents
preferences.jsonPort 3000, single .env, pnpm-only
repositories.json14 databayt repos with paths + stacks
atom.json59 atoms across 6 categories
template.json31 templates across 5 categories
block.json4 blocks (DataTable, Auth, Invoice, Report)
report.jsonT&C electrical report templates

Project-Level Memory

Stored at ~/.claude/projects/[project]/memory/:

  • Company profile (team, financials)
  • Active project status (Hogwarts pilot)
  • User preferences and feedback

Installation (~5 minutes)

# macOS (engineer role is default)
git clone git@github.com:databayt/kun.git ~/kun
cd ~/kun && bash .claude/scripts/install.sh
bash .claude/scripts/secrets.sh <GIST_ID>
 
# macOS (business or content role)
cd ~/kun && bash .claude/scripts/install.sh business
cd ~/kun && bash .claude/scripts/install.sh content
 
# Windows (PowerShell)
git clone git@github.com:databayt/kun.git ~/kun
cd ~/kun; .\.claude\scripts\install.ps1
.\.claude\scripts\secrets.ps1 -GistId <GIST_ID>

Roles

RoleSkillsMCPHooksPrimary Human
engineerAll 25All 18All 5Abdout
business11 (core + business)8 (mcp-business.json)Prettier onlyAli
content11 (core + content)8 (mcp-content.json)Prettier onlySamia
ops11 (core + ops)9 (mcp-ops.json)All 5Sedon

What the Installer Does

  1. Copies agents to ~/.claude/agents/
  2. Copies skills to ~/.claude/commands/ (role-filtered)
  3. Copies rules to ~/.claude/rules/
  4. Installs settings into ~/.claude/settings.json (role-specific)
  5. Sets up MCP servers in ~/.claude/mcp.json (engineer only)
  6. Creates memory directory with component registry
  7. Clones databayt/codebase to ~/codebase (engineer only)

Keyword Quick Reference

SayWhat Happens
devKill port 3000 → pnpm dev → Chrome
pushgit add → commit → push
deployVercel deploy → retry → report
table usersblock agent → DataTable → prisma
authauthjs agent → NextAuth setup
saas billingorchestrate → stripe MCP → schema + UI
test logintest agent → Vitest + Playwright
handover auth5-pass QA → both environments