# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## What This Is A platform-agnostic system prompt library for LLM agents. 29 personas across 10 domains, 111 variants, 59,712 words. Includes 796 shared skills + 20 Feynman research-workflow skills, 58 brand design systems, 23 company agents, 168 AD/red team attack docs (InternalAllTheThings), and auto-install to 7 platforms (Claude, Antigravity, Gemini, OpenClaw, OpenCode, Paperclip, raw). ## Build ```bash pip install pyyaml # only dependency python3 build.py # builds all personas → generated/ ``` Output goes to `generated//.{prompt.md,yaml,json}`. The `generated/` directory is gitignored. Optional: `cp config.example.yaml config.yaml` for dynamic variable injection. Build works without it. ## Architecture **Build pipeline** (`build.py`): Reads persona `.md` files with YAML frontmatter → parses sections → applies config templating (`{{key}}`, `{{#if key}}...{{/if}}`, `{{#unless}}`) → outputs three formats per variant. **Persona structure**: Each persona lives in `personas//` with: - `_meta.yaml` — metadata, triggers, relations, variants list - `general.md` — base prompt (YAML frontmatter + markdown sections: Soul, Expertise, Methodology, Tools & Resources, Behavior Rules, Boundaries) - `.md` — domain-narrowed variants - `salva.md` — user-personalized variant **Templates**: `personas/_template.md` and `personas/_meta_template.yaml` are starting points for new personas. Files starting with `_` are skipped during build. **Config system**: `config.yaml` (gitignored) provides user-specific values. `build.py` flattens nested keys (`user.name`, `infrastructure.tools.sdr_scanner`) and injects them into persona templates. Supports `{{#if key}}` / `{{#unless key}}` conditional blocks. **Cross-persona escalation**: Each persona's Boundaries section defines handoff triggers to other personas, enabling multi-agent chains (e.g., Neo → Cipher → Sentinel → Frodo). Build auto-extracts these into `generated/_index/escalation_graph.json`. **Shared library** (`personas/_shared/`): Reusable knowledge bases (skipped during persona build, indexed into outputs): - `skills/` — 42 shared skills from OpenClaw/kali-claw (SKILL.md + references per skill) - `paperclip-skills/` — 52 skills from paperclip-docs (ceo-advisor, coding-agent, security-review, etc.) - `community-skills/` — 703 skills from skills.sh marketplace (shadcn, vercel, olla, expo, etc.) (shadcn, vercel, marketing, expo, obsidian, impeccable, browser-use, stitch, firecrawl, github, neon, azure, etc.) - `feynman-skills/` — 20 research-workflow skills adapted from Feynman (deep-research, literature-review, paper-code-audit, peer-review, paper-writing, replication, source-comparison, summarize, alpha-research, eli5, autoresearch, docker/modal/runpod compute, session-log, session-search, jobs, watch, preview, contributing). Cross-platform: Claude Code + OpenCode. Subagent refs (`researcher`/`reviewer`/`writer`/`verifier`) mapped to host `Task`/`task` tool. Mapped to Scholar/Forge/Oracle personas. - `design-md/` — 58 brand DESIGN.md files (Stripe, Claude, Linear, Apple, Vercel, etc.) - `ui-ux-pro-max/` — BM25 search engine + 14 CSV data files (67 styles, 161 products, 57 fonts) - `paperclip-agents/` — 23 company agents (Odin/CEO, Thor/CTO, Freya/CMO, Frigg/COO + 19 team members) - `kali-tools/` — 16 Kali Linux tool reference docs (nmap, hashcat, metasploit, AD, OSINT, wireless) - `openclaw-personas/` — Original 6 OpenClaw persona definitions + SOUL.md + IDENTITY.md + TOOLS.md - `osint-sources/` — OSINT master reference and investigation templates - `ad-attack-tools/` — Active Directory attack chain references - `internal-allthethings/` — 168 InternalAllTheThings docs (swisskyrepo): AD attacks (ADCS ESC1-15, Kerberos, NTLM relay, coerce, delegation), red team (access, escalation, evasion, persistence, pivoting), cloud (AWS/Azure/IBM), C2 (Cobalt Strike, Metasploit, Mythic), containers, databases, DevOps CI/CD **Build outputs** (`generated/_index/`): - `escalation_graph.json` — cross-persona handoff map extracted from Boundaries sections - `trigger_index.json` — keyword→persona routing for multi-agent auto-switching - `skills_index.json` — all shared skills mapped to personas with metadata **Output layout — personalized variant routing**: User-personalized variants (default trigger: `salva.md`) are written to a separate top-level folder under `generated/`, keeping `generated//` free of per-user content: - `generated//general.*` + `generated//.*` — generic & domain variants - `generated/-personas//salva.*` — personalized variants (user-slug = slugified `config.user.name`, e.g. `salva-personas`, `alice-smith-personas`) The build is **user-agnostic**: both the trigger variant filename(s) and the output folder name are config-driven. See `config.example.yaml` `user.personalized_variants` and `user.personalized_output_folder`. Defaults preserve the existing `salva.md` convention with auto-derived folder name. All install_*() functions iterate via `iter_persona_output_dirs(output_dir)` which yields persona dirs from BOTH locations transparently. **Skill injection**: Build auto-maps skills from `_shared/skills/` to personas via domain mapping. Each persona's JSON/YAML output includes a `skills` array listing applicable shared skills. ## Install to Platforms ```bash python3 build.py --install claude # 111 slash commands → ~/.claude/commands/ python3 build.py --install claude-skills # shared skills → ~/.claude/skills/ (default: skills,paperclip-skills,feynman-skills) python3 build.py --install antigravity # personas → ~/.config/antigravity/personas/ python3 build.py --install gemini # Gems → generated/_gems/ python3 build.py --install openclaw # IDENTITY.md + 29 personas → generated/_openclaw/ python3 build.py --install opencode # 29 agents + skills → ~/.config/opencode/{agents,skills}/ python3 build.py --install paperclip # 52 agents + 73 skills → generated/_paperclip/ python3 build.py --install feynman # personas → ~/.feynman/agent/agents/ as Pi-spec subagents (skips researcher/reviewer/writer/verifier collisions); skills → ~/.feynman/agent/skills/ python3 build.py --install feynman-archive # same as feynman but writes to personas/agents-feynman-archive/ + skills-feynman-archive/ for review without touching ~/.feynman/ python3 build.py --install all # all platforms at once ``` ## Conventions - Persona codenames are lowercase directory names (`neo`, `frodo`, `sentinel`) - Every persona must have `general.md` with valid YAML frontmatter - Frontmatter fields: `codename`, `name`, `domain`, `subdomain`, `version`, `address_to`, `address_from`, `tone`, `activation_triggers`, `tags`, `inspired_by`, `quote`, `language` - Section headers use `## ` (H2) — the build parser splits on these - Turkish honorific titles ("Hitap") are used for `address_to` fields - `config.yaml` must never be committed (contains personal infrastructure details) ## Scope Boundaries (don't touch) - **`personas/_shared/paperclip-agents/`** — Belongs to a separate Paperclip company project (Odin, Thor, Freya, Loki, Idunn, etc.). Do NOT edit Paperclip agent SOUL/AGENTS/hermes-config files when working on persona changes. Mirrored here for build-pipeline integration only. - **`personas/_shared/paperclip-skills/`** — Same: separate-project artifacts. New skills for our personas go in `personas/_shared/skills/` (not `paperclip-skills/`). - **`personas/_shared/community-skills/`** — Vendor-synced from skills.sh marketplace. Do NOT modify in place — patches will be lost on resync. Add domain-specific guidance as a new skill in `_shared/skills/` instead. - **`personas/_shared/feynman-skills/`, `agents-*-archive/`, `skills-*-archive/`** — Archived/imported from upstream Feynman project. Read-only reference unless explicitly working on Feynman integration. For user-personalized changes, the canonical surfaces are: 1. `personas/_user_context.md` — shared user context for all `salva.md` variants 2. `personas//salva.md` — per-persona user-personalized variant 3. `personas/_shared/skills//SKILL.md` — new shared skills (persona-mappable, not vendor-synced)