Complete setup guide for the databayt team Kun engine configuration via Claude Code.
One-Liner Setup
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.sh | bash && ~/.claude/scripts/secrets.sh 68453b25fa9d28c94426c55c179b3838Windows (PowerShell)
irm https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.ps1 | iex; & "$env:USERPROFILE\.claude\scripts\secrets.ps1" -GistId 68453b25fa9d28c94426c55c179b3838This installs Claude Code CLI, downloads team configuration, and sets up secrets automatically.
What Gets Installed
| Component | Count | Description |
|---|---|---|
| Agents | 29 | Architecture, React, Prisma, product repos (hogwarts, souq, mkan, shifa), etc. |
| Commands | 17 | /repos, /atom, /template, /block, /build, /deploy, etc. |
| Memory | 5 | atoms, templates, blocks, reports, repositories |
| MCP Servers | 28 | GitHub, Neon, shadcn, browser, Vercel, Stripe, etc. |
| Scripts | 6 | install, sync, setup-secrets, sync-repos (macOS + Windows) |
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: Download Team Config
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.sh | bashWindows
irm https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.ps1 | iexStep 3: Setup Secrets
macOS / Linux
~/.claude/scripts/secrets.sh 68453b25fa9d28c94426c55c179b3838Windows
& "$env:USERPROFILE\.claude\scripts\secrets.ps1" -GistId 68453b25fa9d28c94426c55c179b3838Step 4: Restart Terminal & Run
claude
# or with alias
cDirectory Structure
~/.claude/ # Windows: %USERPROFILE%\.claude\
├── CLAUDE.md # Global instructions (468 lines, 90+ keywords)
├── CLAUDE.local.md # Your personal overrides (not synced)
├── settings.json # Environment & hooks (macOS/Linux)
├── settings-windows.json # Windows-specific hooks
├── mcp.json # 28 MCP server configurations
├── .env # Secrets (auto-generated, DO NOT COMMIT)
├── agents/ # 29 custom 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
│ └── ...
├── commands/ # 17 slash commands
│ ├── repos.md # Repository explorer
│ ├── atom.md
│ ├── template.md
│ ├── block.md
│ └── ...
├── memory/ # Persistent memory files
│ ├── atom.json
│ ├── template.json
│ ├── block.json
│ ├── report.json
│ └── repositories.json # All org repos with monitoring
└── scripts/
├── install.sh # macOS/Linux installer
├── install.ps1 # Windows installer
├── sync.sh # macOS/Linux config sync
├── sync.ps1 # Windows config sync
├── secrets.sh # macOS/Linux secrets setup
├── secrets.ps1 # Windows secrets setup
├── sync-repos.sh # Sync all org repos locally
└── sync-repos.ps1 # Windows repo sync
Shell Configuration
macOS / Linux
Add to ~/.zshrc or ~/.bashrc:
export PATH="$HOME/.local/bin:$HOME/.claude/bin:$PATH"
alias c='claude --dangerously-skip-permissions'
# Auto-load secrets
[ -f "$HOME/.claude/.env" ] && export $(grep -v "^#" "$HOME/.claude/.env" | xargs)Reload: source ~/.zshrc
Windows (PowerShell Profile)
Add to $PROFILE:
# Claude Code alias
Set-Alias -Name c -Value claude
# Quick start with permissions
function cc { claude --dangerously-skip-permissions $args }
# 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
- Go to: https://gist.github.com/abdout/68453b25fa9d28c94426c55c179b3838
- Click Edit
- Update values
- Team members run setup-secrets again to get 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):
swift-app- iOS mobiledistributed-computer- Rust infrastructuremarketing- Landing pages
Configuration Sync
To get latest team configuration updates:
macOS / Linux
~/.claude/scripts/sync.shWindows
& "$env:USERPROFILE\.claude\scripts\sync.ps1"This updates:
- CLAUDE.md (keywords, patterns)
- Agents (29 files)
- Commands (17 files)
- Memory files
- Scripts
Your CLAUDE.local.md is preserved.
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
Create ~/.claude/CLAUDE.local.md for personal overrides:
# My Local Settings
## Additional Preferences
- My preferred editor: VSCode
- Custom project paths: /path/to/my/projects
## Personal Keywords
| Keyword | Action |
|---------|--------|
| `myproject` | cd to my main project |This file is never overwritten by sync.
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
Configuration is available from two repositories:
Primary (codebase)
https://github.com/databayt/codebase/tree/main/.claude
Alternative (kun)
https://github.com/databayt/kun/tree/main/.claude
Both contain identical configuration.
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: Download 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