if you want to use rhachet, you want to use roles.
there's two ways to use roles. via
cli. both are described below.---
cli
humans have brains. robots have brains. who would have thought they'd need the same briefs and skills to work well?
the cli powers the most common usecase for rhachet. robots and humans depend on it in day to day operations via their roles.
$3
`$3
#### how
install a rhachet-roles package and run init:
`if the same role name exists in multiple packages, use
$repo/$roleafter init, any agents you spawn in the repo will boot with those roles. rhachet configures your brain-repls via hooks (e.g., in
.claude/settings.json directory is a curated & shared source of truth. robots get their briefs and skills from here. so can humans.zero magic. full transparency.
`browse the same briefs robots get booted with. invoke the same skills they dispatch. edit and iterate โ changes take effect immediately.
$3
| command | route | what it does |
| ----------------- | ------- | ------------------------------------------ |
|
npx rhachet run | ๐ง fluid | converse with an actor, brain decides path |#### ๐ชจ solid: run
deterministic operations, no brain.
`#### ๐ฉ rigid: act
augmented orchestration, harness controls flow, brain augments.
`sh
npx rhachet act \
--role mechanic --skill review \
--input "https://github.com/org/repo/pull/9"npx rhachet act \
--role mechanic --skill review \
--input "https://github.com/org/repo/pull/9" \
--brain openai/codex
`#### ๐ง fluid: ask
probabilistic exploration, brain decides the path.
`---
sdk
the sdk powers programmatic actor usage with strict contracts. applications and services depend on it to leverage actors for reliable, composable, and improvable thought.
$3
`ts
import { genActor } from 'rhachet';
import { genBrainRepl } from 'rhachet-brains-openai';
import { mechanicRole } from './domain.roles/mechanic';// init actor
const mechanic = genActor({
role: mechanicRole,
brains: [genBrainRepl({ slug: 'openai/codex' })],
});
// use actor
await mechanic.ask({ prompt: 'how to simplify ...?' }); // ๐ง fluid
await mechanic.act({ skill: { review: { pr } } }); // ๐ฉ rigid
await mechanic.run({ skill: { 'fetch.pr-comments': { pr } } }) // ๐ชจ solid
`$3
#### how
generate an actor from a role with an allowlist of brains:
`ts
import { genActor } from 'rhachet';
import { genBrainRepl } from 'rhachet-brains-openai';
import { mechanicRole } from './domain.roles/mechanic';export const mechanic = genActor({
role: mechanicRole,
brains: [
genBrainRepl({ slug: 'openai/codex' }), // default (first in list)
genBrainRepl({ slug: 'openai/codex/mini' }), // fast + cheap alternative
],
});
`#### why
the actor interface provides:
- strict enrollment โ brains allowlist ensures only approved brains can be used
- isomorphic with cli โ same
.run() interface as cli commands
- composition โ actors can be composed into higher-order workflows and skills
- consistent contracts โ type-safe inputs and outputs across all thought routescommon usecases:
- create reusable skills that leverage brain capabilities
- deliver product behaviors powered by enrolled actors
- build automation pipelines with reliable, testable thought
$3
| method | route | what it does |
| ------------- | ------- | ------------------------------------------ |
|
actor.run() | ๐ง fluid | converse with an actor, brain decides path |#### ๐ชจ solid: run
deterministic operations, no brain.
`#### ๐ฉ rigid: act
augmented orchestration, harness controls flow, brain augments.
`ts
// uses default brain (first in allowlist)
await mechanic.act({
skill: { review: { input: 'https://github.com/org/repo/pull/9' } },
});// uses explicit brain (must be in allowlist)
await mechanic.act({
brain: { repo: 'openai', slug: 'codex/mini' },
skill: { review: { input: 'https://github.com/org/repo/pull/9' } },
});
`#### ๐ง fluid: ask
probabilistic exploration, brain decides the path.
`collocated roles
create directly in
.agent/repo=.this/. zero dependencies. instant experimentation.$3
repo=.this/role=any/ is created whenever rhachet is linked in a repo. it applies to anyone who works in the repo โ human or robot. use it for repo-wide briefs and skills.$3
create custom roles for scoped briefs and skills:
| role | purpose |
| -------------- | ------------------------------------------------- |
|
role=human | briefs & skills applicable only to humans |
| role=robot | briefs & skills applicable only to robots |
| role=dbadmin | briefs & skills for database administration scope |custom roles are opt-in โ irrelevant by default, enrolled when needed.
`
.agent/repo=.this/
role=any/ # default, applies to everyone
role=human/ # human-specific
role=robot/ # robot-specific
role=dbadmin/ # scoped to db work
`published roles
to share roles via npm as a
rhachet-roles-* package, generate a rhachet.repo.yml manifest.$3
run
repo introspect to generate the manifest from your package's getRoleRegistry export`sh
npx rhachet repo introspect
creates rhachet.repo.yml at package root
`preview before write:
`sh
npx rhachet repo introspect --output -
outputs yaml to stdout
`$3
the manifest describes your roles for package-based discovery:
`yaml
slug: ehmpathy
readme: readme.md
roles:
- slug: mechanic
readme: roles/mechanic/readme.md
briefs:
dirs: roles/mechanic/briefs
skills:
dirs: roles/mechanic/skills
inits:
dirs: roles/mechanic/inits
`| field | what |
| ------------------- | --------------------------------------- |
|
slug | unique identifier for the repo |
| readme | path to repo readme relative to root |
| roles | list of role definitions |
| roles.slug | unique identifier for the role |
| roles.readme | path to role readme |
| roles.briefs.dirs | path(s) to briefs directories |
| roles.skills.dirs | path(s) to skills directories |
| roles.inits.dirs | path(s) to inits directories (optional) |
---
concepts
.tldr
`
๐งข roles (๐ช skills + ๐ briefs)
+ ๐ง brains
= ๐ญ actors
โ ๐ง .ask() to think
โ ๐ฉ .act() on your behalf
โ ๐ชจ .run() curated executables
`---
.usage
$3
a ๐งข role bundles ๐ช skills and ๐ briefs:
- ๐ช skills = executable capabilities (e.g.,
fetch-pr-comments.sh, review.rigid.ts)
- ๐ briefs = curated knowledge (e.g., rule.require.arrow-functions.md, define.input-context-pattern.md)create your own roles, or reuse roles published as
rhachet-roles-* packages.the spec is light: a readme, a briefs dir, a skills dir. that's it.
$3
a ๐ง brain is an inference provider (openai, anthropic, etc).
enroll a ๐ง brain with a ๐งข role โ produce an ๐ญ actor.
๐ญ actors can:
-
.ask() โ ๐ง fluid thought, brain decides the path
- .act() โ ๐ฉ rigid thought, harness controls, brain augments
- .run() โ ๐ชจ solid execution, no brain needed`ts
const mechanic = genActor({
role: mechanicRole,
brains: [genBrainRepl({ slug: 'openai/codex' })],
});await mechanic.ask({ prompt: 'how to simplify ...?' }); // ๐ง fluid
await mechanic.act({ skill: { review: { pr } } }); // ๐ฉ rigid
await mechanic.run({ skill: { 'fetch-pr-comments': { pr } } }) // ๐ชจ solid
`---
.terms
$3
| concept | emoji | what |
| ------- | ----- | ------------------------------------------------------- |
| role | ๐งข | bundle of skills + briefs |
| brain | ๐ง | inference provider (atom = one-shot, repl = multi-turn) |
| actor | ๐ญ | brain enrolled in a role |
| skill | ๐ช | executable capability |
| brief | ๐ | curated knowledge |
$3
๐ง brains are inference providers that enable probabilistic thought:
| grain | symbol | what | characteristics | example |
| ---------- | ------ | -------------------- | ------------------------------ | -------------------------------- |
| brain.atom | โ | single inference | stateless, one-shot | claude/haiku, openai/gpt-4o-mini |
| brain.repl | โป | read-eval-print-loop | stateful, multi-turn, tool use | claude/code, openai/codex |
โ brain.atom is for single-turn operations. โป brain.repl is for multi-turn operations.
$3
| route | emoji | what | when |
| ----- | ----- | ----------------------------------------- | ---------------------------------- |
| solid | ๐ชจ | deterministic throughout | faster, cheaper, reliable |
| rigid | ๐ฉ | deterministic harness + probabilistic ops | you control flow, brain fills gaps |
| fluid | ๐ง | probabilistic throughout | brain decides the path |
$3
| method | route | what |
| -------- | ----- | ----------------------------- |
|
.run() | ๐ชจ | execute skill, no brain |
| .act() | ๐ฉ | execute skill, brain augments |
| .ask() | ๐ง | converse, brain decides path |
---
.enrollment
to enroll = pair a ๐ง brain with a ๐งข role โ produce an ๐ญ actor.
$3
๐งข roles are portable. the same role works with any brain:
`
mechanic role + openai โ mechanic actor (openai-powered)
mechanic role + anthropic โ mechanic actor (anthropic-powered)
`๐ง brains are swappable. upgrade, downgrade, or switch โ the role stays the same.
this separation means:
- ๐งข roles encode institutional knowledge that improves over time
- ๐ง brains can be swapped without any change to the role
- ๐ญ actors inherit skills + briefs, powered by whichever brain is enrolled
define a role once, enroll any brain, clone that thought.
$3
๐ briefs change the perspective and preferences of the enrolled ๐ง brain. they suffix the system prompt to flavor how the brain thinks.
briefs supply knowledge about:
- tone (e.g., "use lowercase prose")
- terms (e.g., "call it 'customer', never 'user' or 'client'")
- patterns (e.g., "always use input-context pattern")
- rules (e.g., "never use gerunds")
briefs are suffixed to every system prompt and survive compaction โ reliable enrollment.
> ๐ช analogy: concept planets
>
> ๐ง brains navigate concept space like ships navigate galactic space.
>
> ๐ briefs register concept planets. each planet has gravity that pulls the brain's thought toward it.
>
> ask an unenrolled brain to review code. it drifts toward whatever concepts it absorbed โ java idioms, verbose comments, patterns you've never used.
>
> enroll that brain with a mechanic role. the ๐ briefs register concept planets:
> - ๐ช "arrow functions only"
> - ๐ช "input-context pattern"
> - ๐ช "fail fast via HelpfulError"
>
> these planets now have immense gravity. the brain's thought bends toward them. it reviews code the way your team reviews code โ because enrollment shaped the gravity of the concepts it navigates to.
$3
๐ช skills offload work from imagine-cost to compute-cost:
- imagine-cost = time + tokens to imagine how to do a task
- compute-cost = deterministic executable, instant and free
example:
`
wout skill: "please fetch the pr comments" โ brain imagines how, calls gh api, parses response
with skill: mechanic.run({ skill: { 'fetch-pr-comments': { pr } } }) โ instant, deterministic
``skills unlock consistency. ๐ง brains are probabilistic โ they won't do the same task the same way twice. ๐ช skills maximize determinism and composition โ via distillation of thought routes from fluid โ rigid โ solid.
the determinism spectrum:
| route | example | determinism |
| ------- | ----------------------------------------------------------- | ------------------ |
| ๐ชจ solid | fetch pr comments | 100% deterministic |
| ๐ฉ rigid | review pr (fetch = deterministic, analysis = probabilistic) | blended |
| ๐ง fluid | "what should we refactor?" | 100% probabilistic |
ideally, eject as much work as possible into ๐ชจ solid skills. use ๐ฉ rigid when you need to blend deterministic setup with probabilistic thought. reserve ๐ง fluid for open-ended exploration.
---
sophi
$3
digital actors that run from anywhere, for anyone.
distill portable, durable roles with rhachet. compose them, share them, open source them.
- open source top to bottom โ to raise the floor and spread prosperity.
- observable thought routes โ to not only debug, but align.
- composable thought routes โ for iterative improvement and testable guarantees.
here's to a solarpunk future of distributed abundance ๐๐ด
$3
the name reflects a dual ratchet metaphor:
1. to ratchet iterative improvement โ slipless iterative improvement of capabilities via roles, briefs, and skills. each iteration builds on the last, externalized and durable.
2. to ratchet distributed abundance โ rhachet unlocks the distribution of "brains that build brains". when anyone can enroll any brain to execute any skill, access to postlabor abundance spreads irreversibly.
for the philosophy behind distributed abundance, see the postlabor briefs.
$3
1. externalization โ knowledge systematically externalized in skills and briefs, outside of the internalized knowledge of any single brain
2. enrollment โ any brain durably enrolled to execute any skill via roles; portable across brains, composable across roles
3. determinism โ thought routes iteratively harden from fluid โ rigid โ solid; reliability and efficiency compound
each skill published is a click. each brief shared is a click. each thought route hardened is a click. the ratchet only moves forward.