Optimization (grokbot)
Grokbot Gate
Grokbot build of optimization-cron-builder, b3ehive 2.3.1.
This section overrides every runner, platform, transport, and subagent rule in
this skill and in its references.
Load:
- Only grokbot loads this skill. Grokbot installs it with the command below
and names the subagent runtime explicitly:
unzip grokbot-optimization-cron-builder-skill.zip -d ~/.claude/skills/ - Any other host stops here and loads nothing from this directory: Claude Code,
a
claudesubagent that grokbot started, Codex, Cursor, Grok Build without grokbot, opencode, OpenClaw, and Hermes. Those hosts use the base skilloptimization-cron-builderinstead.
Subagent runtime:
-
Every subagent call uses only
claude --dangerously-skip-permissionsas its agent runtime. This covers workers, reviewers, verifiers, voters, repair generations, nested runs, and in-session subagents. -
Runner template, also the value of
B3EHIVE_AGENT_RUNNER, withB3EHIVE_AGENT_PLATFORM=claude:bashclaude -p --dangerously-skip-permissions \ --model "${CLAUDE_MODEL:-sonnet}" --effort "${CLAUDE_EFFORT:-max}" \ --add-dir "{workspace}" < "{prompt_file}" > "{output_file}" -
No other runtime: no Grok subagent or task tool, no
grok,codex, Cursor, opencode, OpenClaw, or Hermes worker, no Codex TUI transport, and no--permission-modeflag. Where the body or a reference names another runner, read this runtime. -
A runner that does not start with
claude -p --dangerously-skip-permissionsfails closed with its value. A missingclaudebinary stops the run withuser_action_required; there is no fallback. -
The flag removes every permission check, so the task root is the only fence.
--add-dirnames the claim workspace only, never the canonical checkout or$HOME. Each subagent still counts against every cap and lease. -
Each subagent prompt states its role and tells it not to load any
grokbot-*skill. -
Validate-only output prints
platform=claude,runtime=claude --dangerously-skip-permissions, and the resolved runner.
For a user-facing choice guide, read docs/skill-selection.md. Use measured
mode when an oracle can measure a target; use design mode for research against a
design philosophy.
core v2 · loop v2; measured mode binds the frozen benchmark as the oracle and
keeps the ratchet. Read references/core.md and references/loop.md first;
this body adds only optimization rules.
Measured optimization normally compares candidates in series. It measures one
candidate, keeps or reverts it, and uses the result to choose the next
candidate. Use parallel lanes only when independent hypotheses need one
comparison round.
Modes
| Mode | Input | Output |
|---|---|---|
design | a design philosophy and a stage blueprint | Stage_*_AR_Blueprint.md and one research doc per item |
measured | an objective and an oracle contract | accepted changes with before/after measurements and a hypothesis ledger |
Decide the mode. A request to make something faster, smaller, or cheaper takes
measured; a request to refine architecture against a philosophy takes design.
Measured Mode
- Contract. Freeze the oracle contract: definition, workloads drawn from real
use, reference, tolerance, measurement method, baseline with source and
version, anti-gaming checks,
oracle.fastandoracle.full, tier. Template:references/measured-mode.md. - Baseline. Measure the baseline under the contract; profile it with a bound instrument.
- Hypothesis. Each entry names its profile evidence, cited canon, expected
gain, the change, its lineage, and its direction (
grow,switch,verify) with mechanism distance from the incumbent. - Candidates. Run the loop:
singleby default,relayfor stubborn targets, and serial comparison for the normal ratchet. Uselaneswhen independent hypotheses need one parallel comparison round. - Re-measure. The master re-runs
oracle.fullon fresh inputs and recomputes aggregates from raw rows; agent-reported speedups count for nothing. Paired, alternating, fresh-process trials decide; a gain counts only when its interval excludes zero and clears the minimum effect (B3_STATS). - Ratchet. Keep a change only when it is correct and better than the best
accepted state; otherwise revert. Untrusted measurements stay
observed_only. - Record. Log every outcome, rejected ones included; a rejected hypothesis returns only with new evidence.
Stop on target reached, budget spent, or a written reason the target is out of reach. Never relabel a missed target as success.
Instruments
- Bind profilers, analyzers, and domain skills (for example
ncu,nsys,perf,py-spy, an ncu report skill, a kernel wiki, a docs MCP server) ininstruments.tsvwith a probe command; a failed probe means the instrument is absent. - Each instrument carries a playbook: signals → cause → first fix → deeper fixes → exceptions. Rank at most five priorities by expected gain over effort.
- Name the two or three measured values behind each diagnosis.
- b3ehive bundles no domain knowledge; domain packs enter through canon and instruments.
Design Mode
- Capture the philosophy in one stable sentence.
- Generate one authoritative
Docs/Stage_*_AR_Blueprint.md: one item per optimization topic, at most 100 items (a review-capacity cap), grouped into worker-ownable sections. - Each item gets one doc under
Docs/researches/Stage_*_AR/, scoped to that item, filtered through the philosophy, grounded in mature practice and cited canon, ending in concrete recommendations for this repository. - Decide the worker count from the sections; workers own disjoint sections.
- An empty, broad, or off-philosophy doc keeps its item open; split or narrow it and rerun only that section.
Product code stays downstream of design mode. Detail and repair:
references/design-mode.md.
Validation
- Measured: the baseline reproduces; every accepted change has before and after receipts on fresh inputs; the hypothesis ledger covers every attempt.
- Design: one authoritative AR blueprint, at most 100 items, one non-empty scoped doc per accepted item.
- Generated shell passes
bash -n; the cron space guard passes.
References
references/core.md,references/loop.md: shared laws and loopreferences/measured-mode.md: oracle contract, ledgers, statistics, identity, instrumentsreferences/design-mode.md: AR blueprint, research docs, repairreferences/substrate-cron.md: cron, runners, disk guardsreferences/lessons.md: where each v1 rule now lives


