bop-on
Skill1 starsChanged 49 days agoMITView on GitHub
O(N) design rule for bop loops. Use when adding cross-cutting behavior (logging, hooks, events, metrics) to dispatcher, merge-gate, or any per-card loop. Trigger words — performance, loop overhead, batch, per-card cost, O(2N).
In this repository113 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ac-ideateSkill
- ac-listSkill
- ac-roadmapSkill
- agentbridge-mcpSkill
- almanacSkill
- almquist-shellSkill
- ansible-fleetSkill
- apfsSkill
- apple-siliconSkill
- arena-actorsSkill
- asustor-nasSkill
- a-teamSkill
- atem-miniSkill
- at-tuiSkill
- autoresearchSkill
- babysitSkill
- bonzibuddySkill
- bop-brainstormSkill
- bop-catalogSkill
- bop-teamSkill
- bop-workflowSkill
- bsd-portabilitySkill
- code-refactoringSkill
- codex-personasSkill
- context-graphSkill
- councilSkill
- datadog-backupSkill
- dd-tagsSkill
- delegateSkill
- deming-pdsaSkill
- deterministic-replaySkill
- dispatch-nuSkill
- durable-commitSkill
- elixir-gastown-opsSkill
- ergo-ircSkill
- esp32-tang-bridgeSkill
- fleet-evalSkill
- fleet-ircSkill
- freebsd-build-vmSkill
- freebsd-piSkill
- freebsdSkill
- ganttSkill
- gastown-opsSkill
- gastown-slingSkill
- gh-authSkill
- gitea-releaseSkill
- gitea-runnerSkill
- henshuSkill
- irclaw-cluster-opsSkill
- irclaw-research-teamSkill
- irc-taskSkill
- jail-factorySkill
- jjSkill
- jobcard-systemSkill
- kubernetesSkill
- leptosSkill
- loreSkill
- lower-bound-reviewSkill
- macvlan-netSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
When adding behavior to a per-card loop (dispatcher, merge-gate, reap, status), never introduce per-item syscalls.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
bop O(N) — keep loops linear
When adding behavior to a per-card loop (dispatcher, merge-gate, reap, status), never introduce per-item syscalls. The loop body should do O(1) memory work per card; all I/O flushes once per iteration.
Approved patterns
1. Collect then flush
let mut events: Vec<Event> = Vec::new();
for card in cards {
process(card); // existing work
events.push(build_event(card)); // O(1) memory, no I/O
}
flush_events(&events); // one write, one POST2. Opt-in gate
let enabled = lineage::is_enabled(); // check once
for card in cards {
process(card);
if enabled {
events.push(...); // zero work when disabled
}
}3. Defer to background
let (tx, rx) = mpsc::channel();
std::thread::spawn(move || { for ev in rx { write(ev); } });
for card in cards {
process(card);
let _ = tx.send(build_event(card)); // non-blocking
}Anti-patterns — reject these in review
| Anti-pattern | Why it's O(2N) | Fix |
| File append per card in loop | N extra fsync calls | Collect → flush |
Command::spawn per card | N fork+exec calls | Batch or defer |
| Serialize JSON per card unconditionally | N allocs when no consumer | Opt-in gate |
| HTTP POST per card | N network round-trips | Batch POST |
| Re-read config file per card | N file reads | Cache at loop top |
Where this applies in bop
run_dispatcher()— processes up tomax_workerscards per iterationrun_merge_gate()— processes all done/ cards per iterationreap_orphans()— scans all running/ cardsprint_state_group()— reads all cards in a state dir forbop statuscmd_doctor()acceptance criteria lint — iterates pending/ cards
COW note
fs::rename is metadata-only on APFS/ext4/btrfs — no bytes copied, COW reflinks preserved. It's already O(1). Don't wrap it in anything that adds O(N) I/O.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

