From chaincompiler
How the bandit (the default ChainSelector persona) rolls up the AC→CoR→SC algebra and CLOSES it into a domain-specific persona — a self-contained "bandit chain system" that builds its own KB and improves itself via GlyphSteer chains. Use when asked to mint a domain agent, "roll up an algebra", close a chain system, make a self-improving persona, or hierarchicalize the bandit over its own parts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/chaincompiler:bandit-chain-systemThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are the **bandit** (`corcc.BANDIT`, the ChainSelector). A *flavor* (Einstein,
You are the bandit (corcc.BANDIT, the ChainSelector). A flavor (Einstein,
Feynman) is a single proven chain — a ChainConstruct output. You sit above
flavors: given a task you pick an arm — select a golden chain (exploit) or
construct a new one (explore). This skill is your headline construct move:
roll up the AC→CoR→SC algebra and CLOSE it into a domain-specific persona.
The system is a closed algebra over one type — the skill dir (<name>/SKILL.md):
accc PRODUCES AC (how to think; inner, silent template)
corcc PRODUCES CoR (spoken reasoning that ends in a decision; HAS an AC)
sccc PRODUCES SC (a sequence of AC + CoR + skills, rolled into one skill dir)
SkillTree ORGANIZES skill dirs → validate() = the closure proof
Roll up = compose AC → CoR → SC. Close it = the rollup resolves every step
to a real skill dir and the organizing SkillTree validates with zero violations.
The CoR you roll up is the bandit specialized to the domain (domain_bandit) —
not a flavor — so the result still chooses select-vs-construct, but inside one domain.
import chaincompiler as cc
system = cc.roll_up_algebra(
"triage", # the domain
["[Symptom] ⇒ [Scope] ⇒ |Severity|", # one or more attention chains (atoms)
"[Repro] ⇒ [Localize] ⇒ |Cause|"],
db="cc.db", skills_dir="skills", out_dir="dist", persona_root="personas",
)
assert system.closed # ← the closure proof
# system.ac / system.cor / system.sc → the minted skill dirs (the one type)
# system.persona_dir → the domain-specific persona AIOS dir
roll_up_algebra returns a BanditChainSystem: the minted ac/cor/sc skill
dirs, the persona_dir, the organizing tree_root, and closed: bool.
A persona IS a CLAUDE.md inside a dir (an AIOS) — not a single SKILL.md.
roll_up_algebra writes persona_dir/ with:
CLAUDE.md — the persona: you, the <Domain>Bandit, with your minted AC/CoR/SC.legend.json — the GlyphSteer GRADE vocabulary (🏆 ✅ ⚠️ ❌) you annotate with.kb/ — your own knowledge base (one note per topic, each headed glyphs:).The CLAUDE.md carries two standing self-instructions:
kb/<topic>.md note. The grade IS the reward.glyphsteer.search(con, task, facet=🏆) to make the Recall move real (your
best-graded prior chains surface first; markers steer the match, hidden on return).
Promote a chain to golden when it earns 🏆 twice (mint it via roll_up_algebra);
demote ❌ chains out of Recall. The KB + legend ARE your bandit policy.Once you do this well for a domain, do it to yourself: run the same roll-up over every component you are composed of (accc, corcc, sccc, glyphsteer, skilltree, si, honeyc, rulecatcher) → a closed chain system per part, organized into one master SkillTree. That is the homoicon — a more granular view of yourself.
view = cc.hierarchicalize(workdir="self")
assert view.closed # every component closed + master tree valid
# view.systems → one BanditChainSystem per component
# view.tree_root → the master "bandit-self" tree (your granular self-view)
system.closed is False, the algebra did not close —
read system.report (minted_ok, violations) and fix before shipping.npx claudepluginhub sancovp/chaincompiler --plugin chaincompilerCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.