Vercel Composition Patterns
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
Think in Behavior-Oriented Concurrency, not threads-and-locks.
$ npx skills add microsoft/bocpy --skill thinking-in-boc -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install microsoft/bocpy thinking-in-boc --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/microsoft/bocpy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/thinking-in-boc .claude/skills/thinking-in-boc && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "thinking-in-boc" agent skill from https://github.com/microsoft/bocpy/tree/main/.github/skills/thinking-in-boc into .claude/skills/thinking-in-boc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "thinking-in-boc", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/microsoft/bocpy/tree/main/.github/skills/thinking-in-bocType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add microsoft/bocpy --skill thinking-in-boc -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install microsoft/bocpy thinking-in-boc --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/bocpy.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/thinking-in-boc .agents/skills/thinking-in-boc && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "thinking-in-boc" agent skill from https://github.com/microsoft/bocpy/tree/main/.github/skills/thinking-in-boc into .agents/skills/thinking-in-boc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "thinking-in-boc", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/bocpy --skill thinking-in-boc -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install microsoft/bocpy thinking-in-boc --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/bocpy.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/thinking-in-boc .cursor/skills/thinking-in-boc && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "thinking-in-boc" agent skill from https://github.com/microsoft/bocpy/tree/main/.github/skills/thinking-in-boc into .cursor/skills/thinking-in-boc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "thinking-in-boc", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/microsoft/bocpy.git --path .github/skills/thinking-in-boc--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add microsoft/bocpy --skill thinking-in-boc -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install microsoft/bocpy thinking-in-boc --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/bocpy.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/thinking-in-boc .gemini/skills/thinking-in-boc && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "thinking-in-boc" agent skill from https://github.com/microsoft/bocpy/tree/main/.github/skills/thinking-in-boc into .gemini/skills/thinking-in-boc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "thinking-in-boc", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install microsoft/bocpy thinking-in-bocInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add microsoft/bocpy --skill thinking-in-boc -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/microsoft/bocpy.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/thinking-in-boc .github/skills/thinking-in-boc && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "thinking-in-boc" agent skill from https://github.com/microsoft/bocpy/tree/main/.github/skills/thinking-in-boc into .github/skills/thinking-in-boc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "thinking-in-boc", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/bocpy --skill thinking-in-boc -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install microsoft/bocpy thinking-in-boc --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/bocpy.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/thinking-in-boc .opencode/skills/thinking-in-boc && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "thinking-in-boc" agent skill from https://github.com/microsoft/bocpy/tree/main/.github/skills/thinking-in-boc into .opencode/skills/thinking-in-boc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "thinking-in-boc", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
thinking-in-bocThink in Behavior-Oriented Concurrency, not threads-and-locks.
Thinking In Boc is an agent skill from microsoft/bocpy, published by the product's own GitHub organization. Think in Behavior-Oriented Concurrency, not threads-and-locks. Use when: writing or reviewing any bocpy code (library, examples, tests), about to reach for time.sleep / threading.Event / atomic counters / polling loops / waitfor helpers, designing how a downstream behavior observes an upstream one, scheduling work to run after the next worker is free, or building loop / tail-recursion patterns. Catches the reflex to apply classical synchronization to a problem that wants a cown.
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development. The repository describes itself as: Behavior-Oriented Concurrency in Python. The licence is MIT.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit c8f3ceb. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Thinking In Boc loads about 2.6k tokens when it runs. Until then it costs about 126 tokens; SKILL.md has 1,214 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from microsoft/bocpy at commit c8f3ceb, republished under its MIT licence (© microsoft). 1,214 words, ~2,569 tokens.
.claude/skills/thinking-in-boc/SKILL.md (or your agent's skills folder).This skill is a corrective. The default reflex when synchronizing concurrent
work is to reach for threads-and-locks primitives: shared state, a mutex,
a condition variable, a busy-wait loop, an atomic counter, an event flag, a
Future. In BOC, those answers are almost always wrong — not because they
break, but because they bypass the very mechanism that makes BOC safe and
fast.
The BOC question is not "what synchronization primitive do I need here?"
It is: "what cown is this work ordered against, and what behavior should run when that cown is free?"
Read this skill any time you catch yourself writing one of the smells below.
If you find yourself typing any of these inside, or in code that interacts with, a BOC program — stop and re-derive the design.
| Smell | What you almost certainly meant |
|---|---|
time.sleep(...) in a polling loop | Schedule a behavior on the cown the predicate depends on. |
while not <flag>: ... busy-wait | Same — make <flag> a cown and @when(flag) a behavior. |
threading.Event / Condition / Lock | A cown plus a behavior chain. |
wait_for_<x>_version(target) polling | @when(downstream_cowns) — let the cown graph order it. |
atomic_counter from Python | A Cown(int) mutated inside @when(counter). |
Future, Queue.get(), "ferry one value out" | return the value from a behavior; @when(that_behavior) reads it. |
time.sleep(0) "yield" | @when() — the empty-cown behavior runs when a worker is free. |
if work_remaining: do_work(); else: stop in a thread loop | A behavior loop: the behavior re-schedules itself with @when(state) on the same cown until done. |
The smells are signals that you are managing concurrency outside the runtime. The runtime cannot help you make that correct or fast.
There are only a handful of BOC patterns. Almost every problem decomposes into one of them.
@when(cown)A behavior runs when its cowns are free. That is the entire ordering
mechanism. If step2 must observe step1's effect on x, both behaviors
take x:
@when(x)
def step1(x):
x.value = "ready"
@when(x)
def step2(x):
assert x.value == "ready"You did not need a lock. You did not need an event. You did not need to
poll. The runtime acquired x for step1, released it, and only then gave
it to step2.
@when(cowns) vs @when(a, b, c)There are two distinct shapes for "this behavior depends on multiple cowns" and choosing the right one matters.
Use @when(a, b, c) — separate positional arguments — when you know
at write-time exactly which cowns the behavior needs and they have
distinct roles. The decorated function takes one named parameter per
cown:
@when(account_a, account_b)
def transfer(src, dst): # two roles, two names
dst.value += src.value
src.value = 0Use @when(cowns) — a single list/tuple argument — when the set
is dynamic or homogeneous (its size is determined at runtime, or the
cowns play the same role). The decorated function takes one parameter
which is the list itself:
cowns = [Cown(i) for i in range(N)]
for c in cowns:
@when(c)
def producer(c):
... # writes whatever it writes
@when(cowns) # one list arg, not *cowns
def consumer(cowns):
total = sum(c.value for c in cowns) # cowns IS the listThis is the classical N-way barrier, expressed as data dependence: the
runtime acquires every cown in the list before the behavior runs, so the
consumer cannot start until every producer behavior has returned. Do
not spread the list with * — @when accepts the list directly, and
spreading would force you to know N at write-time, defeating the point.
Mixing the two forms — @when(anchor, cowns) — is also valid: the
behavior takes one named parameter (anchor) plus one list parameter.
@when returns a Cown holding the behavior's result. Pass that cown to a
later @when to enforce happens-after across unrelated data:
@when(x)
def writer(x):
x.value = compute()
@when(y, writer) # y is unrelated; writer is the result cown
def reader(y, w):
consume(y.value, w.value) # runs only after writer finishedHere reader touches its own data (y) and would otherwise be free to run
concurrently with writer. Depending on the writer result cown is what
serializes them: the runtime cannot acquire writer until that behavior has
returned, so reader sees its result via w.value.
@when()@when() with no arguments schedules a behavior with no data dependencies.
It runs as soon as a worker is available. Use this when you want some work
to happen in the background and you do not need to coordinate with any
particular cown — for example, sending a report after forks have been
released:
@when(left, right, hunger)
def take_bite(left, right, hunger):
left.value.use(); right.value.use()
hunger.value -= 1
if hunger.value == 0:
# forks released when this behavior returns; the report goes
# out from a fresh behavior so it does not delay the release.
@when()
def _():
send("report", ("full", index))@when() is also the BOC equivalent of "tail-call this on the worker
pool" — it lets the current behavior return promptly while the follow-up
work waits its turn.
To process work in chunks until done, do not write a while loop
inside one behavior — that pins one worker for the duration. Instead, the
behavior does one chunk and then schedules the next iteration on the
same cown:
def step(state: Cown[State]):
@when(state)
def _(state):
if state.value.done:
send("done", state.value.result)
return
state.value.do_one_chunk()
step(state) # tail-schedule next iterationThis is the BOC analogue of tail recursion. Each iteration releases the cown between chunks, so:
state can interleave between iterations,prime_factor.py (sieve_check → sieve_work → sieve_check) is the
canonical example in this repository.
@when returns a Cown holding whatever the behavior returns. That cown
is your rendezvous — there is no need to allocate a separate Cown(None)
and assign into it:
@when(x)
def compute(x):
return expensive(x.value) # the result lives in `compute`
@when(compute)
def consume(result): # result is a Cown
send("answer", result.value) # unwrap with .valueThis replaces Future / Queue for one-shot results. For streaming use
the message queue (send / receive) directly.
Before writing any synchronization, ask:
@when(). If the answer is "X" you want @when(X). If you know
at write-time exactly which cowns you need, prefer the explicit form
@when(X, Y, Z) — it is faster than the list form because the runtime
can resolve each dependency by position rather than iterating a
sequence. Only fall back to @when([X, Y, Z]) (one list arg) when the
set is dynamic or homogeneous.@when(...) should include the cown I
wrote to, or my behavior's result-cown.threading.* primitive inside a behavior?
Almost certainly the wrong layer. Threads-and-locks primitives belong
only at the BOC runtime boundary (test setup, wait(), receive() for
assertions, the runtime's own internals).Classical synchronization is correct in three places:
receive("assert") for assertion messages is a thread-level wait, and
that is fine — it is the boundary between the test harness and the
behavior graph.wait() itself. The library uses condvars internally to block the
main thread until the runtime drains. Do not reinvent this._core.c uses mutexes and condvars
because it implements BOC. User Python code should not.If you are not in one of those three places and you are reaching for a classical primitive, walk back through the checklist.
If you have already written code that uses time.sleep, wait_for_*, an
event flag, or a polling loop in a behavior or in code that schedules
behaviors, treat it as a defect. Ask:
Which cown carries the dependency I am polling on? Why is the consuming work not a behavior on that cown?
Rewrite to remove the classical primitive. The result is almost always shorter, faster, and provably free of races.
© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .github/skills/thinking-in-boc of microsoft/bocpy.
Open the folder on GitHubat commit c8f3ceb
Thinking In Boc next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Thinking In Boc this skillmicrosoft/bocpy | 201 | — | ~2.6k | Automated safety check: Pass | MIT | |
| Vercel Composition Patternssupabase/supabase | 111k | 59 repos | ~726 | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 296k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Typescript Advanced Typesrolling-scopes/rsschool-app | 10k | 25 repos | ~4.2k | Automated safety check: Pass | MPL-2.0 | |
| PR Babysitteropeninterpreter/openinterpreter | 69k | 3 repos | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Code Review ChecklistshareAI-lab/learn-claude-code | 78k | 5 repos | ~1.1k | Automated safety check: Pass | MIT |
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
rolling-scopes/rsschool-app
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.
openinterpreter/openinterpreter
Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.
shareAI-lab/learn-claude-code
Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.
onyx-dot-app/onyx
Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.
microsoft/bocpy
Multi-perspective code review for a branch before merging. An agent skill from microsoft/bocpy.
microsoft/bocpy
Write a C extension whose custom types can live inside a bocpy Cown and travel between worker sub-interpreters.
microsoft/bocpy
Follow bocpy commenting and documentation conventions. An agent skill from microsoft/bocpy.
microsoft/bocpy
Finalize a feature branch for merge. An agent skill from microsoft/bocpy.
microsoft/bocpy
Multi-perspective planning with rebuttal rounds and adversarial review loop.
microsoft/bocpy
Write tests for the bocpy message queue — the lock-free tag-based MPSC ring buffer.
Categories
Think in Behavior-Oriented Concurrency, not threads-and-locks. Thinking In Boc is an agent skill from microsoft/bocpy, published by the product's own GitHub organization. Think in Behavior-Oriented Concurrency, not threads-and-locks.
Thinking In Boc fits situations like: reviewing any bocpy code (library; about to reach for time.sleep / threading.Event / atomic counters / polling loops / waitfor helpers; designing how a downstream behavior observes an upstream one; scheduling work to run after the next worker is free.
Run `npx skills add microsoft/bocpy --skill thinking-in-boc -a claude-code`. Or copy the skill folder (.github/skills/thinking-in-boc in microsoft/bocpy) into .claude/skills/thinking-in-boc in your project. Claude Code loads it when a task matches its description.
Run `npx skills add microsoft/bocpy --skill thinking-in-boc -a codex`. Or copy the skill folder (.github/skills/thinking-in-boc in microsoft/bocpy) into .agents/skills/thinking-in-boc in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/bocpy --skill thinking-in-boc -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/thinking-in-boc, .gemini/skills/thinking-in-boc, .github/skills/thinking-in-boc and .opencode/skills/thinking-in-boc in your project.
SKILL.md names no scripts, command-line tools or credentials: Thinking In Boc is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Thinking In Boc is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Thinking In Boc: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
microsoft (a GitHub organization, an official publisher) maintains it in microsoft/bocpy, which has 201 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on September 28, 2026.
Source: microsoft/bocpy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.