Complete setup guide for the databayt team Kun engine configuration via Claude Code.
One-Liner Setup
macOS / Linux
curl -fsSL https://kun.databayt.org/install | bashWindows (PowerShell)
powershell -ExecutionPolicy Bypass -Command "iwr https://kun.databayt.org/install.ps1 | iex"The wizard installs the Claude Code CLI, clones ~/kun, installs the team configuration, and prompts for your personal secrets Gist ID — each teammate is handed their own (see Secrets). Full walkthrough: Onboarding.
What Gets Installed
| Component | Description |
|---|---|
| Agents | Architecture, React, Prisma, product repos (hogwarts, souq, mkan, shifa), leadership fleet |
| Skills | /check, /ship, /handover, /qa, /release, /health, /sync, … — commands are retired, skills carry the verbs |
| Rules | Cross-cutting + path-scoped domain rules (React 19, Next 16, Prisma 6, Tailwind 4, …) |
| Memory | team, capacity, repositories, component snapshots |
| MCP Servers | GitHub, Neon, shadcn, browser, Vercel, Stripe, Slack, … — full fleet, universal |
| Scripts | setup, secrets, sync-repos, health (macOS + Windows) |
Live counts are declared in
kun/.claude/engine.json—/healthflags drift.
Step-by-Step Installation
Step 1: Install Claude Code CLI
macOS / Linux
curl -fsSL https://claude.ai/install.sh | shWindows (PowerShell)
irm https://claude.ai/install.ps1 | iexVerify
claude --versionStep 2: Install Team Config
macOS / Linux
git clone https://github.com/databayt/kun.git ~/kun 2>/dev/null || git -C ~/kun pull
bash ~/kun/.claude/scripts/setup.sh engineerWindows
git clone https://github.com/databayt/kun.git "$env:USERPROFILE\kun"
& "$env:USERPROFILE\kun\.claude\scripts\setup.ps1" -Role engineerStep 3: Setup Secrets
Each teammate is handed a personal Gist ID — never share yours.
macOS / Linux
~/.claude/scripts/secrets.sh <YOUR_GIST_ID>Windows
& "$env:USERPROFILE\.claude\scripts\secrets.ps1" -GistId <YOUR_GIST_ID>Step 4: Restart Terminal & Run
claude
# or with alias
cDirectory Structure
~/.claude/ # Windows: %USERPROFILE%\.claude\
├── CLAUDE.md # Personal global config — seeded from template once, never overwritten
├── settings.json # Environment & hooks (from settings-windows.json on Windows)
├── mcp.json # Full MCP server fleet (universal)
├── .env # Secrets (auto-generated, DO NOT COMMIT)
├── agents/ # Specialist + leadership agents
│ ├── architecture.md
│ ├── hogwarts.md # Education SaaS patterns
│ ├── souq.md # E-commerce patterns
│ ├── mkan.md # Rental/booking patterns
│ ├── shifa.md # Healthcare patterns
│ ├── react.md
│ ├── prisma.md
│ └── ...
├── skills/ # Skills carry the verbs (commands are retired)
│ ├── check/SKILL.md
│ ├── ship/SKILL.md
│ ├── health/SKILL.md
│ └── ...
├── rules/ # Cross-cutting + path-scoped domain rules
├── memory/ # Persistent memory files
│ ├── team.json
│ ├── capacity.json
│ └── repositories.json # All org repos with monitoring
└── scripts/
├── setup.sh / setup.ps1 # Canonical installer (kun/.claude → ~/.claude)
├── secrets.sh / .ps1 # Secrets from your personal Gist
├── sync-repos.sh / .ps1 # Sync all org repos locally
└── health.sh / .ps1 # Config health check
Shell Configuration
macOS / Linux
Add to ~/.zshrc or ~/.bashrc:
export PATH="$HOME/.local/bin:$HOME/.claude/bin:$PATH"
alias c='claude --dangerously-skip-permissions' # primary agent
alias a='agy --dangerously-skip-permissions' # secondary agent — Antigravity
# Auto-load secrets
[ -f "$HOME/.claude/.env" ] && export $(grep -v "^#" "$HOME/.claude/.env" | xargs)The installer writes these as shell functions, not aliases — same effect. a is the
secondary agent: the fallback when claude is unavailable, and the
cheap lane for easy tasks.
Reload: source ~/.zshrc
Windows (PowerShell Profile)
Add to $PROFILE:
# Agent launchers
function c { claude --dangerously-skip-permissions $args } # primary
function a { agy --dangerously-skip-permissions $args } # secondary — Antigravity
# Auto-load secrets
if (Test-Path "$env:USERPROFILE\.claude\.env") {
Get-Content "$env:USERPROFILE\.claude\.env" | ForEach-Object {
if ($_ -and -not $_.StartsWith("#")) {
$parts = $_ -split "=", 2
if ($parts.Length -eq 2) {
[Environment]::SetEnvironmentVariable($parts[0], $parts[1], "Process")
}
}
}
}Reload: . $PROFILE
Quick Keywords
After setup, just say these words to trigger actions:
Workflow
| Keyword | Action |
|---|---|
dev | Kill port 3000 → Start server → Open browser |
build | Run build with error scanning |
push | Full git commit + push |
quick | Fast commit (skip build) |
deploy | Deploy to Vercel staging |
ship | Deploy to production |
Creation
| Keyword | Action |
|---|---|
atom | Create atom (2+ primitives) |
template | Create template (full-page layout) |
block | Create block (UI + logic) |
component | Create React component |
page | Create Next.js page |
Repository References
| Keyword | Action |
|---|---|
like hogwarts | Reference education SaaS patterns |
like souq | Reference e-commerce patterns |
like mkan | Reference rental/booking patterns |
like shifa | Reference healthcare patterns |
from codebase | Clone pattern from codebase |
/repos | Explore all org repositories |
Quality
| Keyword | Action |
|---|---|
test | Generate tests (Vitest) |
security | Security audit (OWASP) |
performance | Core Web Vitals check |
review | Code review |
See full keyword list (90+) in ~/.claude/CLAUDE.md.
Secrets Management
Secrets are stored in a private GitHub gist and auto-loaded via scripts.
What's Included
Required
GITHUB_PERSONAL_ACCESS_TOKEN- GitHub API access
Per-Project Databases
DATABASE_URL_CODEBASE- Codebase project DBDATABASE_URL_HOGWARTS- Hogwarts (education SaaS) DBDATABASE_URL_MKAN- Mkan (rental marketplace) DBDATABASE_URL_SOUQ- Souq (e-commerce) DB (when created)DATABASE_URL_SHIFA- Shifa (healthcare) DB (when created)
AI Keys
ANTHROPIC_API_KEY- Claude APIGROQ_API_KEY- Groq API
Auth
- OAuth credentials (Google, Facebook)
AUTH_SECRET- NextAuth secret
Services
- Stripe, Resend, Cloudinary, ImageKit, Telegram
Per-Project Database Usage
When working on a specific project, copy the appropriate DATABASE_URL to your project's .env:
# Working on hogwarts?
DATABASE_URL=$DATABASE_URL_HOGWARTS
# Working on mkan?
DATABASE_URL=$DATABASE_URL_MKAN
# Working on codebase?
DATABASE_URL=$DATABASE_URL_CODEBASEOr use an alias in your shell profile:
alias use-hogwarts='export DATABASE_URL=$DATABASE_URL_HOGWARTS'
alias use-mkan='export DATABASE_URL=$DATABASE_URL_MKAN'
alias use-codebase='export DATABASE_URL=$DATABASE_URL_CODEBASE'Update Secrets
- Open your personal secrets Gist (each teammate is handed their own Gist ID)
- Click Edit
- Update values
- Re-run
~/.claude/scripts/secrets.sh <YOUR_GIST_ID>to pull the updates
Manual Override
Create/edit ~/.claude/.env directly:
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxx
DATABASE_URL_HOGWARTS=postgresql://...
# ... other variablesRepository Sync
Sync all organization repositories locally for deep reference:
macOS / Linux
# Sync all repos
~/.claude/scripts/sync-repos.sh
# Check status
~/.claude/scripts/sync-repos.sh status
# Watch upstream dependencies
~/.claude/scripts/sync-repos.sh watch
# Sync specific repo
~/.claude/scripts/sync-repos.sh hogwartsWindows
& "$env:USERPROFILE\.claude\scripts\sync-repos.ps1"
& "$env:USERPROFILE\.claude\scripts\sync-repos.ps1" -RepoName statusMonitored Repositories
Core Libraries (Priority 1):
codebase- Patterns, agents, templates, blocksshadcn- UI component library (shadcn/ui fork)radix- Radix primitiveskun- Code Machine config
Product Repositories (Priority 2):
hogwarts- Education SaaS (multi-tenant, LMS, billing)souq- E-commerce (multi-vendor, cart)mkan- Rental marketplace (booking, listings)shifa- Medical platform (appointments, patients)
Specialized (Priority 3):
ios-app- iOS mobileandroid-app- Android mobiledistributed-computer- Rust infrastructuremarketing- Landing pages
Configuration Sync
To get latest team configuration updates:
macOS / Linux
git -C ~/kun pull && bash ~/kun/.claude/scripts/setup.sh engineerWindows
git -C "$env:USERPROFILE\kun" pull; & "$env:USERPROFILE\kun\.claude\scripts\setup.ps1" -Role engineerThis refreshes agents, skills, rules, memory, scripts, settings, and the MCP fleet from the kun repo — the single source of truth.
Your ~/.claude/CLAUDE.md is personal and never overwritten.
MCP Servers
28 MCP servers are pre-configured:
| MCP | Purpose | Trigger |
|---|---|---|
github | Git operations | push, pr, issue |
neon | Database | prisma, migration |
shadcn | UI components | ui, component |
browser | Playwright | test, e2e |
vercel | Deployments | deploy, ship |
stripe | Payments | payment, billing |
posthog | Analytics | analytics |
sentry | Errors | error, debug |
airtable | Data | airtable |
notion | Docs | notion |
See full list in ~/.claude/mcp.json.
Product Agent Reference
Each product repo has a dedicated agent with patterns:
hogwarts (Education SaaS)
"auth like hogwarts" # Multi-tenant auth
"billing like hogwarts" # Stripe subscription
"lms like hogwarts" # Course management
Patterns: Multi-tenant architecture, subdomain routing, role-based access, Stripe billing
souq (E-commerce)
"cart from souq" # Shopping cart
"vendor like souq" # Vendor dashboard
"catalog like souq" # Product catalog
Patterns: Redux cart, multi-vendor, product variants, order management
mkan (Rental Marketplace)
"booking like mkan" # Booking system
"listings like mkan" # Property listings
"calendar like mkan" # Availability calendar
Patterns: Property listings, date range booking, availability management, search filters
shifa (Healthcare)
"appointments like shifa" # Appointment scheduling
"patient like shifa" # Patient records
"schedule like shifa" # Doctor scheduling
Patterns: Appointment system, patient records, doctor schedules, prescription management
Local Customizations
Your personal config lives in files the engine never touches:
~/.claude/CLAUDE.md— your global instructions (seeded from a template on first install, then yours: preferences, machine quirks, personal keywords).claude/settings.local.json— per-project personal settings overrides~/.claude/.env— your secrets
Everything else (agents, skills, rules, settings.json, mcp.json) is engine-managed and refreshed from the kun repo on every setup run.
Troubleshooting
Windows: "claude not found"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")macOS: Permission denied
chmod +x ~/.claude/scripts/*.shMCP servers not loading
- Check
~/.claude/mcp.jsonexists - Verify environment variables are set
- Restart Claude
Secrets not loading
# Check .env file
cat ~/.claude/.env
# Manually source
source ~/.zshrcConfig Sources
Canonical (kun)
https://github.com/databayt/kun/tree/main/.claude
The kun repo is the single source of truth. setup.sh installs it to ~/.claude/, and every machine refreshes from it — nothing installs from other repos.
Permission Flags
| Flag | Purpose |
|---|---|
--dangerously-skip-permissions | Skip all prompts |
--allowedTools "Bash,Read,Write" | Whitelist tools |
-p "prompt" | Direct prompt mode |
-r | Resume last session |
Usage Examples
# Start session
c
# Direct prompt
c "fix the login bug"
# Resume last session
c -r
# With specific tools allowed
claude --allowedTools "Read,Grep,Glob" "find all TODO comments"On This Page
One-Liner SetupmacOS / LinuxWindows (PowerShell)What Gets InstalledStep-by-Step InstallationStep 1: Install Claude Code CLIStep 2: Install Team ConfigStep 3: Setup SecretsStep 4: Restart Terminal & RunDirectory StructureShell ConfigurationmacOS / LinuxWindows (PowerShell Profile)Quick KeywordsWorkflowCreationRepository ReferencesQualitySecrets ManagementWhat's IncludedPer-Project Database UsageUpdate SecretsManual OverrideRepository SyncMonitored RepositoriesConfiguration SyncMCP ServersProduct Agent Referencehogwarts (Education SaaS)souq (E-commerce)mkan (Rental Marketplace)shifa (Healthcare)Local CustomizationsTroubleshootingWindows: "claude not found"macOS: Permission deniedMCP servers not loadingSecrets not loadingConfig SourcesPermission FlagsUsage Examples