@polderlabs/bizar 10.23.22 → 10.23.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/AGENTS.md +17 -14
  2. package/README.md +209 -67
  3. package/cli/commands/models.mjs +19 -1
  4. package/cli/commands/validate.mjs +5 -6
  5. package/cli/install/interactive-setup.mjs +13 -1
  6. package/cli/install/paths.mjs +2 -10
  7. package/cli/provision.mjs +21 -14
  8. package/cli/utils.mjs +2 -11
  9. package/config/claude/CLAUDE.md +17 -14
  10. package/config/claude/agents/office-manager.md +13 -15
  11. package/config/claude/commands/bizar.md +6 -5
  12. package/config/claude/commands/plow-through.md +3 -2
  13. package/config/claude/commands/quick.md +14 -14
  14. package/config/claude/commands/team.md +5 -2
  15. package/config/claude/hooks/sessionend-recall.mjs +1 -9
  16. package/config/claude/hooks/sessionstart-prime.mjs +2 -2
  17. package/config/claude/hooks/thinking-route.mjs +0 -1
  18. package/config/claude/hooks/worker-suggest.mjs +12 -24
  19. package/config/claude/hooks/workflow-route-guard.mjs +4 -3
  20. package/config/claude/hooks/workflow-route-state.mjs +1 -1
  21. package/config/workflows/bizar-debug.js +1 -0
  22. package/config/workflows/bizar-implement.js +1 -0
  23. package/config/workflows/bizar-research.js +1 -0
  24. package/config/workflows/ultracode-research.js +1 -0
  25. package/config/workflows/ultracode-review.js +1 -0
  26. package/config/workflows/ultracode.js +1 -0
  27. package/package.json +1 -1
  28. package/packages/sdk/dist/version.d.ts +1 -1
  29. package/packages/sdk/dist/version.js +1 -1
  30. package/packages/sdk/package.json +1 -1
  31. package/config/claude/commands/migrate.md +0 -18
  32. package/config/claude/commands/tailscale-serve.md +0 -14
  33. package/config/claude/commands/tier.md +0 -31
  34. package/config/claude/commands/upgrade-defaults.md +0 -34
  35. package/config/claude/commands/use-default.md +0 -12
  36. package/config/claude/commands/use-premium.md +0 -12
package/AGENTS.md CHANGED
@@ -58,13 +58,15 @@ still deny prohibited actions and escalate externally visible or irreversible
58
58
  actions with `permissionDecision: "ask"`; that escalation list is the
59
59
  authoritative floor, not a starting point.
60
60
 
61
- Mike selects the coordination mode after bounded read-only orientation and one
62
- user clarification checkpoint: direct work only for an unmistakably tiny
63
- single-target copy/style/format edit; one isolated Agent for a clear bounded
64
- change; a native workflow for repeatable phased work; parallel Agents for
65
- disjoint scopes; and an Agent team for 3+ sustained roles that genuinely need
66
- cross-talk. Do not add unnecessary phases or duplicate workers. The team is
67
- host-side state under `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, and per
61
+ Mike performs bounded read-only orientation, then uses a native Agent team as
62
+ the default for substantive work. Direct work is reserved for an unmistakably
63
+ tiny single-target copy/style/format edit or the user's explicit `/quick`
64
+ request. A single Agent or native workflow is used only when the user
65
+ explicitly requests that mode or a durable workflow must be resumed. Ask one
66
+ concise clarification question only when a material choice, acceptance
67
+ criterion, safety boundary, or unresolved constraint would change the work;
68
+ otherwise continue autonomously. The team is host-side state under
69
+ `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, and per
68
70
  Anthropic's docs `team_name` is deprecated and ignored. Every editing dispatch
69
71
  uses an explicit configured model and call-level `isolation: "worktree"`.
70
72
  When two or more subtasks have non-overlapping writable scopes and no data
@@ -133,13 +135,14 @@ The autonomy and approval policy above governs this execution model. The project
133
135
  Every non-empty primary request enters Bizar through `office-manager` (`@mike`).
134
136
  The installer sets Claude Code's global `agent` setting to Mike's frontmatter
135
137
  name (`mike`),
136
- and the routing hook supplies the adaptive coordination policy. For non-tiny
137
- work, Mike first gathers only bounded read-only context, asks one concise
138
- clarification question that names the inferred outcome and proposed mode, then
139
- continues autonomously after the answer. A native workflow is one available
140
- mode, not a universal gate; Mike may select an isolated Agent, parallel Agents,
141
- or an Agent team when that better fits the work. Mike owns integration and
142
- final verification.
138
+ and the routing hook supplies the team-first coordination policy. For non-tiny
139
+ work, Mike first gathers only bounded read-only context. When the inferred
140
+ outcome, acceptance criteria, and safety boundary are clear, it forms the
141
+ default Agent team and continues autonomously. It asks one concise
142
+ clarification only when a material choice or unresolved constraint would
143
+ change the work. `/quick` explicitly selects direct primary-session execution;
144
+ single Agents and native workflows are explicit or resumed modes. Mike owns
145
+ integration and final verification.
143
146
  A Bizar custom agent already executing its assigned role does not recursively
144
147
  dispatch itself.
145
148
 
package/README.md CHANGED
@@ -1,92 +1,231 @@
1
- # Bizar Harness
1
+ <div align="center">
2
+
3
+ ```text
4
+ ██████╗ ██╗███████╗ █████╗ ██████╗
5
+ ██╔══██╗██║╚══███╔╝██╔══██╗██╔══██╗
6
+ ██████╔╝██║ ███╔╝ ███████║██████╔╝
7
+ ██╔══██╗██║ ███╔╝ ██╔══██║██╔══██╗
8
+ ██████╔╝██║███████╗██║ ██║██║ ██║
9
+ ╚═════╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝
10
+ ```
11
+
12
+ ### Guarded autonomy for Claude Code
13
+
14
+ Choose your models once. Give Claude Code real work. Bizar supplies the routing,
15
+ specialists, guardrails, and evidence to carry it through responsibly.
16
+
17
+ `84 agents` · `80 skills` · `33 commands` · `14-tool MCP server`
18
+
19
+ </div>
2
20
 
3
- Bizar is a guarded-autonomy harness for Claude Code. It packages 16 uniquely named role agents, 66 skills, slash-command workflows, lifecycle and safety hooks, a typed SDK, a 14-tool MCP server, and install/audit/test utilities.
21
+ ---
4
22
 
5
- ## What it does
23
+ ## Why Bizar?
6
24
 
7
- - Executes clear local edit/test/verify work autonomously.
8
- - Uses Claude Code permission modes plus deterministic hooks for safety.
9
- - Requires human confirmation for commits, pushes, PR mutations, releases, publishing, deployments, and other external or irreversible operations.
10
- - Routes non-trivial work through research, plan/audit, implementation, review, and verification phases.
11
- - Preserves bounded session handoffs and learning evidence without providing a general-purpose note vault.
12
- - Guards compaction fidelity, commit quality, prose quality, dangerous shell commands, protected paths, and reviewer context.
25
+ Claude Code is already powerful. Bizar makes longer, cross-cutting work easier
26
+ to trust and easier to follow. It starts with a small read-only orientation,
27
+ forms an agent team by default for substantive work, and asks a clarification
28
+ only when a material decision remains unresolved. `/quick` deliberately
29
+ selects direct primary-session work; workflows and single agents are explicit
30
+ or resumed modes.
13
31
 
14
- Bizar deliberately ships no embedded web control plane, browser extension,
15
- background web service, or note-vault/search subsystem. The machine-readable
16
- `bizar control` command lets an optional OpenKan installation present Bizar
17
- agents, tasks, sessions, feature state, and durable messages without coupling
18
- to Bizar internals.
32
+ It keeps the operator in control of model selection and high-impact actions.
33
+ Your configured model choices live in your global Claude configuration—not in
34
+ the project you happen to be working on.
19
35
 
20
- ## Quick start
36
+ | You want | Bizar provides |
37
+ | --- | --- |
38
+ | A clean way to begin | A guided installer and `bizar models` picker |
39
+ | Your own gateway models | Global selection, full-ID subagent definitions, and native alias mapping |
40
+ | Useful parallel work | Isolated worktrees, scoped tasks, and specialist roles |
41
+ | Fewer surprises | Explicit safety checks for releases, publication, deployment, pushes, and destructive operations |
42
+ | Confidence at the end | Tests, architecture checks, E2E checks, and evidence-aware handoff |
43
+
44
+ ## Start here
45
+
46
+ Install Bizar globally, install its Claude Code integration, then choose the
47
+ models you want Bizar to use.
21
48
 
22
49
  ```sh
23
- npm install
24
- npm run build
25
- node cli/bin.mjs install
26
- make check
27
- make test
28
- make e2e
50
+ npm install -g @polderlabs/bizar
51
+ bizar install
52
+ bizar models
29
53
  ```
30
54
 
31
- Claude Code reads `.claude/settings.json`. `cli/provision.mjs` can copy agents, commands, skills, hooks, rules, and settings into `~/.claude/` for user-level use.
55
+ Restart Claude Code after installation. The installer adds Bizar's agents,
56
+ skills, commands, hooks, and settings to your user-level Claude configuration.
57
+ It preserves your configured gateway endpoint and credential values during a
58
+ clean reinstall.
32
59
 
33
- ## Core surfaces
60
+ For a completely fresh Bizar-managed Claude setup while retaining endpoint and
61
+ authentication settings:
34
62
 
35
- | Surface | Purpose |
36
- | --- | --- |
37
- | `.claude/agents/` | Office-themed role agents and orchestrator |
38
- | `config/skills/` | Canonical skill library |
39
- | `.claude/commands/` | Slash-command workflows |
40
- | `.claude/hooks/` | Safety, HITL, lifecycle, routing, telemetry, and compaction hooks |
41
- | `packages/sdk/` | Agent registry, router, learning logs, federation, consensus, and MCP |
42
- | `cli/` | Installer, validator, backup, audit, cost/claim/task/control, sandbox, repair |
43
- | `scripts/` | Architecture, absence, E2E, feature, eval, and clean-state verification |
63
+ ```sh
64
+ bizar install --force
65
+ bizar models
66
+ ```
67
+
68
+ Then open any repository in Claude Code and describe the outcome you want.
69
+ Mike—the Bizar coordinator—handles the rest.
70
+
71
+ > **Tip:** Run `bizar doctor` whenever you want to verify that the global
72
+ > install, Claude settings, hooks, skills, agents, and provider connection are
73
+ > healthy.
74
+
75
+ ## The first-task experience
76
+
77
+ ```mermaid
78
+ flowchart LR
79
+ U["Describe the outcome"] --> M["Mike: brief orientation"]
80
+ M --> Q{"Material choice?"}
81
+ Q -- Yes --> C["One concise question"]
82
+ C --> R["Choose a coordination mode"]
83
+ Q -- No --> R
84
+ R --> D["Direct edit"]
85
+ R --> A["Isolated specialist"]
86
+ R --> P["Parallel agents / team"]
87
+ R --> W["Visible workflow"]
88
+ D --> V["Verify and report evidence"]
89
+ A --> V
90
+ P --> V
91
+ W --> V
92
+ ```
93
+
94
+ The coordinator does not force every request through a workflow. Small,
95
+ obvious edits stay small; larger requests get only the structure they need.
96
+ Writing agents work in Git worktrees, while read-only research stays light and
97
+ foregrounded.
44
98
 
45
- The MCP tools are `plan_action`, `loop_start`, `loop_stop`, `loop_list`, `loop_status`, `graph_query`, `graph_path`, `list_instincts`, and `list_decisions`.
99
+ ## Your models, everywhere Bizar dispatches
46
100
 
47
- ## Parallel agent coordination
101
+ `bizar models` is the single operator-facing place to select models. It
102
+ discovers candidates from your configured gateway and writes your selections to
103
+ the global model router:
48
104
 
49
- Code-writing subagents run in isolated Git worktrees. `bizar task` stores a
50
- shared SQLite task graph under Git's common directory, so all worktrees observe
51
- the same dependencies, owners, path scopes, and expiring leases. The
52
- PreToolUse ownership hook denies edits outside the current task scope and edits
53
- to paths leased by sibling agents.
105
+ ```text
106
+ ~/.claude/model-router.json
107
+ ```
108
+
109
+ The router is never stored in a project directory. Bizar uses the selected
110
+ models for direct subagents, workflows, and agent-team teammates.
111
+
112
+ ```mermaid
113
+ flowchart TD
114
+ Picker["bizar models"] --> Router["Global model router\n~/.claude/model-router.json"]
115
+ Router --> Definitions["Global Bizar agent definitions\nfull model ID in frontmatter"]
116
+ Router --> Aliases["sonnet · opus · haiku · fable\ncompatibility aliases"]
117
+ Definitions --> Agent["Subagents"]
118
+ Definitions --> Workflow["Workflow workers"]
119
+ Definitions --> Team["Agent-team teammates"]
120
+ ```
121
+
122
+ Claude Code's native per-call model field has a small alias vocabulary. Bizar
123
+ avoids making that vocabulary a limitation: it projects each selected gateway
124
+ model into a global subagent definition whose frontmatter contains the full
125
+ model ID. The agent, workflow, and team routes use that definition. The four
126
+ native aliases are compatibility shortcuts only; they do not enable an
127
+ unselected provider or reduce your selected-model pool to four choices.
128
+
129
+ Useful inspection commands:
54
130
 
55
131
  ```sh
56
- bizar task create sdk-change --title "Update SDK" --scope "packages/sdk/**"
57
- bizar task claim sdk-change --owner todd --workspace "$PWD"
58
- bizar task heartbeat sdk-change --owner todd
59
- bizar task complete sdk-change --owner todd --evidence "targeted tests passed"
60
- bizar task integrate enqueue sdk-change --commit abc1234 --owner todd
61
- bizar task integrate claim --worker steve
62
- bizar task integrate pass 1 --worker steve --evidence "aggregate checks passed"
132
+ bizar models --list
133
+ bizar models --agent-types --json
134
+ bizar models explain todd
135
+ bizar doctor
63
136
  ```
64
137
 
65
- The integration queue records the commit, base reference, verification command,
66
- owner, integrator, and outcome. It deliberately does not perform unapproved
67
- merge, rebase, push, or publication operations.
138
+ ## A specialist bench, not a generic swarm
139
+
140
+ Bizar ships its core coordination roles alongside 68 focused specialists for
141
+ architecture, accessibility, security, testing, documentation, performance,
142
+ language and framework review, build repair, operations, and evaluation. It
143
+ also ships 80 skills for planning, debugging, verification, review,
144
+ worktrees, and implementation practice.
145
+
146
+ The coordinator selects specialists when their expertise reduces a concrete
147
+ risk. It does not create parallel workers merely to look busy. You can inspect
148
+ the installed specialist definition names through `bizar models --agent-types
149
+ --json` and use a relevant Bizar specialist directly when needed.
150
+
151
+ ```text
152
+ Core coordination Specialist coverage
153
+ ───────────────── ──────────────────────────────────
154
+ Mike · research · plan Architecture · accessibility · security
155
+ Implementation · review Build repair · tests · documentation
156
+ Verification · integration Frameworks · performance · operations
157
+ Evaluation · product and domain analysis
158
+ ```
159
+
160
+ ## Guardrails that stay out of the way
161
+
162
+ Bizar is designed to be autonomous for local, reversible work and deliberate
163
+ for consequential actions.
164
+
165
+ | Category | Default behavior |
166
+ | --- | --- |
167
+ | Read, inspect, edit, test, format | Proceeds autonomously within the task scope |
168
+ | Parallel code changes | Uses isolated worktrees and scoped task ownership |
169
+ | Ambiguous material design choice | Asks one concise clarification before execution |
170
+ | Commit | Locally allowed, with a fresh simplify review reminder |
171
+ | Push, PR mutation, release, publish, deploy | Requires an explicit human decision |
172
+ | Rebase, force-push, broad destructive commands | Denied or escalated by the safety floor |
173
+
174
+ The goal is not to make Claude Code timid. It is to make its boundaries clear:
175
+ Bizar works through local implementation and verification, then stops at the
176
+ point where an external or difficult-to-reverse decision belongs to you.
177
+
178
+ ## What gets installed
179
+
180
+ ```text
181
+ ~/.claude/
182
+ ├── agents/ 84 Bizar roles and specialist definitions
183
+ ├── skills/ 80 skill packs
184
+ ├── commands/ 39 slash-command surfaces
185
+ ├── hooks/ routing, lifecycle, safety, evidence, and quality hooks
186
+ ├── rules/ focused guidance for common development work
187
+ ├── workflows/ native workflow definitions
188
+ ├── settings.json Bizar-managed Claude Code integration
189
+ └── model-router.json operator-selected model state
190
+
191
+ ~/.config/bizar/
192
+ ├── installed.json install record
193
+ ├── evidence/ local dispatch and verification evidence
194
+ ├── telemetry/ local routing and rejected-action feedback
195
+ └── worktree-queue.json completed worktree integration queue
196
+ ```
68
197
 
69
- ## OpenKan control plane
198
+ `bizar control` is a machine-readable command boundary for optional external
199
+ interfaces. Bizar deliberately does not include an embedded browser control
200
+ plane, background daemon, or general-purpose note vault.
70
201
 
71
- `bizar control snapshot --json` exposes the current agent catalogue, durable
72
- task and integration queues, feature ledger, progress summary, Claude Code
73
- background sessions, and durable control messages. OpenKan invokes task and
74
- session mutations through the same CLI instead of importing Bizar modules or
75
- opening its SQLite database.
202
+ ## Commands worth knowing
76
203
 
77
- Messages are atomically queued under `.bizar/control/messages/`. Supported
78
- Claude Code `SessionStart` and `UserPromptSubmit` hooks claim and inject matching
79
- messages exactly once. A session-targeted message can request a documented
80
- background resume; Bizar never edits transcripts or attaches to private process
81
- internals.
204
+ | Command | When to use it |
205
+ | --- | --- |
206
+ | `bizar install` | Install or refresh Bizar in your global Claude configuration |
207
+ | `bizar models` | Discover and select the models Bizar may dispatch |
208
+ | `bizar doctor` | Diagnose the global installation and provider connectivity |
209
+ | `bizar validate` | Run an install-focused health check |
210
+ | `bizar task` | Inspect or coordinate scoped worktree tasks |
211
+ | `bizar worktree-merge --all` | Review and merge completed isolated work, surfacing conflicts |
212
+ | `bizar control snapshot --json` | Read the machine-friendly current harness state |
213
+ | `bizar evidence` | Inspect local dispatch and verification evidence |
82
214
 
83
- ## Guarded autonomy
215
+ ## Running Bizar from this repository
84
216
 
85
- Project settings default to `acceptEdits`, which lets Claude iterate locally while preserving prompts around broader shell operations. Operators who meet Claude Code's requirements may choose Auto mode; Bizar's deny/ask hooks still apply before permission-mode evaluation.
217
+ For contributors, use the repository checkout rather than the global package:
86
218
 
87
- The Git workflow hook denies force-push, rebase, unsupported commit subjects, and AI-attribution trailers. It asks before a commit, push, PR mutation, release, publish, or deploy. The simplify guard requires `/simplify` for every commit attempt.
219
+ ```sh
220
+ npm install
221
+ npm run build
222
+ node cli/bin.mjs install
223
+ make check
224
+ make test
225
+ make e2e
226
+ ```
88
227
 
89
- ## Verification
228
+ The verification suite covers both the code and the integration contract:
90
229
 
91
230
  ```sh
92
231
  make verify-removed-surfaces
@@ -98,10 +237,13 @@ make clean-check
98
237
  make check
99
238
  ```
100
239
 
101
- The root package uses a runtime-only allowlist: no test files, local state,
102
- duplicate skill mirror, or source-only fixture is published.
240
+ ## Learn more
103
241
 
104
- See [the documentation index](docs/INDEX.md), [architecture](docs/architecture.md), [core feature audit](docs/audits/core-feature-audit-2026-07-30.md), [repository cleanup audit](docs/audits/repository-cleanup-2026-07-30.md), and [upstream parity matrix](docs/audits/claude-codex-settings-parity-2026-07-30.md).
242
+ - [Documentation index](docs/INDEX.md)
243
+ - [Architecture](docs/architecture.md)
244
+ - [Model routing decisions](docs/decisions/)
245
+ - [Current progress and evidence](PROGRESS.md)
246
+ - [MIT license](LICENSE)
105
247
 
106
248
  ## License
107
249
 
@@ -18,6 +18,7 @@
18
18
  * reject user-selected IDs.
19
19
  */
20
20
  import chalk from 'chalk';
21
+ import { createHash } from 'node:crypto';
21
22
  import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from 'node:fs';
22
23
  import { dirname, join } from 'node:path';
23
24
  import readline from 'node:readline';
@@ -1077,6 +1078,13 @@ export const NATIVE_AGENT_ALIASES = Object.freeze(['sonnet', 'opus', 'haiku', 'f
1077
1078
 
1078
1079
  const MODEL_AGENT_WORDS = Object.freeze({ a:'alpha', b:'bravo', c:'charlie', d:'delta', e:'echo', f:'foxtrot', g:'golf', h:'hotel', i:'india', j:'juliet', k:'kilo', l:'lima', m:'mike', n:'november', o:'oscar', p:'papa', q:'quebec', r:'romeo', s:'sierra', t:'tango', u:'uniform', v:'victor', w:'whiskey', x:'xray', y:'yankee', z:'zulu', 0:'zero', 1:'one', 2:'two', 3:'three', 4:'four', 5:'five', 6:'six', 7:'seven', 8:'eight', 9:'nine', '/':'slash', '.':'dot', '-':'dash', '_':'under' });
1079
1080
 
1081
+ // Keep generated names below common filesystem component limits and leave
1082
+ // enough path budget for the Claude config directory on Windows. The complete
1083
+ // gateway ID remains in frontmatter; this limit only affects the native agent
1084
+ // name and its filename.
1085
+ export const MODEL_AGENT_NAME_MAX_LENGTH = 160;
1086
+ const MODEL_AGENT_NAME_HASH_LENGTH = 16;
1087
+
1080
1088
  // These are the stable Bizar role frontmatter names. Model definitions are
1081
1089
  // projected per role so Claude Code's task UI retains a meaningful Bizar agent
1082
1090
  // identity instead of displaying an opaque model-only worker.
@@ -1102,7 +1110,17 @@ export function stableSpecialistAgentNames(agentsDir = join(resolveClaudeConfigD
1102
1110
 
1103
1111
  export function modelAgentName(modelId, role = 'worker') {
1104
1112
  const safeRole = BIZAR_AGENT_ROLES.includes(role) ? role : 'worker';
1105
- return `${safeRole}-bizar-${[...String(modelId || '').toLowerCase()].map((ch) => MODEL_AGENT_WORDS[ch] || 'unknown').join('-')}`;
1113
+ const normalizedModelId = String(modelId || '').toLowerCase();
1114
+ const expanded = [...normalizedModelId].map((ch) => MODEL_AGENT_WORDS[ch] || 'unknown').join('-');
1115
+ const fullName = `${safeRole}-bizar-${expanded}`;
1116
+ if (fullName.length <= MODEL_AGENT_NAME_MAX_LENGTH) return fullName;
1117
+
1118
+ const hash = createHash('sha256')
1119
+ .update(`${safeRole}\0${normalizedModelId}`)
1120
+ .digest('hex')
1121
+ .slice(0, MODEL_AGENT_NAME_HASH_LENGTH);
1122
+ const suffix = `-${hash}`;
1123
+ return `${fullName.slice(0, MODEL_AGENT_NAME_MAX_LENGTH - suffix.length)}${suffix}`;
1106
1124
  }
1107
1125
 
1108
1126
  export function isGeneratedModelAgentName(name, modelIds) {
@@ -46,12 +46,11 @@ export const REQUIRED_AGENTS = [
46
46
  export const REQUIRED_COMMANDS = [
47
47
  'artifact.md', 'audit.md', 'autopilot.md', 'backup.md', 'bizar.md',
48
48
  'browser.md', 'cancel.md', 'cron.md', 'doctor.md', 'explain.md', 'init.md',
49
- 'learn.md', 'migrate.md', 'plan.md', 'plow-through.md', 'pr-review.md',
50
- 'quick.md', 'ralph.md', 'ralplan.md', 'rca.md', 'repair.md', 'restore.md',
51
- 'setup-provider.md', 'spec.md', 'sprint.md', 'tailscale-serve.md', 'team.md',
52
- 'test.md', 'tier.md', 'tools.md', 'ultracode.md', 'ultraqa.md',
53
- 'ultrawork.md', 'update.md', 'upgrade-defaults.md', 'use-default.md',
54
- 'use-premium.md', 'validate.md', 'verify.md',
49
+ 'learn.md', 'plan.md', 'plow-through.md', 'pr-review.md', 'quick.md',
50
+ 'ralph.md', 'ralplan.md', 'rca.md', 'repair.md', 'restore.md',
51
+ 'setup-provider.md', 'spec.md', 'sprint.md', 'team.md', 'test.md',
52
+ 'tools.md', 'ultracode.md', 'ultraqa.md', 'ultrawork.md', 'update.md',
53
+ 'validate.md', 'verify.md',
55
54
  ];
56
55
 
57
56
  // v6.3.0 — Claude Code hook adapter scripts (executable, .mjs extension).
@@ -92,7 +92,19 @@ export async function runInteractiveSetup({
92
92
  const interactive = enabled && input.isTTY === true && output.isTTY === true;
93
93
  if (!interactive) {
94
94
  if (detected.missing.length > 0) {
95
- writeLine(output, ` ! Provider ${detected.missing.join(' and ')} not detected; set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN or run \`bizar setup-provider\`.`);
95
+ const missing = detected.missing.join(' and ');
96
+ const header = ` [BIZAR_PROVIDER_CONFIG_MISSING] Provider ${missing} not configured in this non-interactive run.`;
97
+ const action = ` Set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in the environment, or run \`bizar setup-provider\` interactively.`;
98
+ writeLine(output, '');
99
+ writeLine(output, header);
100
+ writeLine(output, action);
101
+ writeLine(output, '');
102
+ // Also surface to stderr when output is the real stdout so CI runners
103
+ // and operator logs do not silently lose the warning in a flood of
104
+ // piped output. The custom test output streams ignore stderr.
105
+ if (output === process.stdout) {
106
+ process.stderr.write(`${header}\n${action}\n`);
107
+ }
96
108
  }
97
109
  return { ok: true, interactive: false, configured: detected.missing.length === 0, missing: detected.missing };
98
110
  }
@@ -8,22 +8,14 @@
8
8
  import chalk from 'chalk';
9
9
  import { homedir } from 'node:os';
10
10
  import { join } from 'node:path';
11
+ import { resolveClaudeConfigDir } from '../config-paths.mjs';
11
12
 
12
13
  /** Resolve the Claude Code config directory.
13
14
  * 1. `process.env.CLAUDE_CONFIG_DIR`
14
15
  * 2. `$HOME/.claude`
15
16
  */
16
17
  export function resolveClaudeDir() {
17
- const HOME = homedir();
18
- if (process.env.CLAUDE_CONFIG_DIR && process.env.CLAUDE_CONFIG_DIR.trim()) {
19
- return process.env.CLAUDE_CONFIG_DIR.trim();
20
- }
21
- if (process.platform === 'win32') {
22
- return process.env.APPDATA
23
- ? join(process.env.APPDATA, 'Claude')
24
- : join(HOME, '.claude');
25
- }
26
- return join(HOME, '.claude');
18
+ return resolveClaudeConfigDir();
27
19
  }
28
20
 
29
21
  const HOME = homedir();
package/cli/provision.mjs CHANGED
@@ -31,7 +31,11 @@ import {
31
31
  import { homedir } from 'node:os';
32
32
  import { dirname, join, resolve, sep } from 'node:path';
33
33
  import { fileURLToPath } from 'node:url';
34
- import { resolveBizarHome, resolveGlobalModelRouter } from './config-paths.mjs';
34
+ import {
35
+ resolveBizarHome,
36
+ resolveClaudeConfigDir,
37
+ resolveGlobalModelRouter,
38
+ } from './config-paths.mjs';
35
39
  import {
36
40
  buildClaudeModelOverrides,
37
41
  configuredEnabledModels,
@@ -64,15 +68,7 @@ export const BIZAR_VERSION = (() => {
64
68
  * 2. `$HOME/.claude`
65
69
  */
66
70
  export function resolveClaudeDir() {
67
- if (process.env.CLAUDE_CONFIG_DIR && process.env.CLAUDE_CONFIG_DIR.trim()) {
68
- return process.env.CLAUDE_CONFIG_DIR.trim();
69
- }
70
- if (process.platform === 'win32') {
71
- return process.env.APPDATA
72
- ? join(process.env.APPDATA, 'Claude')
73
- : join(HOME, '.claude');
74
- }
75
- return join(HOME, '.claude');
71
+ return resolveClaudeConfigDir();
76
72
  }
77
73
 
78
74
  export const CLAUDE_DIR = resolveClaudeDir();
@@ -98,9 +94,13 @@ export const CLAUDE_RULES_DIR = join(CLAUDE_DIR, 'rules');
98
94
 
99
95
  // ─── Tiny utilities ──────────────────────────────────────────────────────────
100
96
 
101
- function haveCmd(cmd) {
97
+ export function haveCmd(cmd) {
102
98
  try {
103
- execSync(`command -v ${cmd}`, { stdio: ['ignore', 'pipe', 'ignore'] });
99
+ if (process.platform === 'win32') {
100
+ execFileSync('where.exe', [cmd], { stdio: ['ignore', 'pipe', 'ignore'] });
101
+ } else {
102
+ execSync(`command -v ${cmd}`, { stdio: ['ignore', 'pipe', 'ignore'] });
103
+ }
104
104
  return true;
105
105
  } catch {
106
106
  return false;
@@ -1204,7 +1204,14 @@ export async function runProvision(opts = {}) {
1204
1204
  if (routerStep.ok) logOk(routerStep.message); else logErr(routerStep.message);
1205
1205
  stepResults.push({ label: 'model-router', ...routerStep });
1206
1206
 
1207
- const modelAgentsStep = syncConfiguredModelAgents({ dryRun });
1207
+ section('Syncing configured model agents');
1208
+ let modelAgentsStep;
1209
+ try {
1210
+ modelAgentsStep = syncConfiguredModelAgents({ dryRun });
1211
+ } catch (err) {
1212
+ const message = err?.message ?? String(err);
1213
+ modelAgentsStep = { ok: false, message: `configured model-agent sync failed: ${message}`, error: message, code: err?.code };
1214
+ }
1208
1215
  if (modelAgentsStep.ok) logOk(modelAgentsStep.message); else logErr(modelAgentsStep.message);
1209
1216
  stepResults.push({ label: 'model-agents', ...modelAgentsStep });
1210
1217
 
@@ -1259,7 +1266,7 @@ export async function runProvision(opts = {}) {
1259
1266
  } else {
1260
1267
  console.log(chalk.dim(' Premium model: (no premium pick configured yet — run `bizar models`)'));
1261
1268
  }
1262
- console.log(chalk.dim(' See /use-premium or .claude/commands/use-premium.md for the full launch snippet.'));
1269
+ console.log(chalk.dim(' Inspect configured selections with `bizar models --list` or `bizar models --agent-types --json`.'));
1263
1270
  console.log('');
1264
1271
  return { ok: !anyFail, mode: effectiveMode, state: detectState(), stepResults };
1265
1272
  }
package/cli/utils.mjs CHANGED
@@ -4,12 +4,11 @@ import { homedir } from 'node:os';
4
4
  import { join } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { existsSync, readFileSync } from 'node:fs';
7
+ import { resolveClaudeConfigDir } from './config-paths.mjs';
7
8
 
8
9
  const __dirname = fileURLToPath(new URL('.', import.meta.url));
9
10
  const REPO_ROOT = join(__dirname, '..');
10
11
 
11
- const isWin = process.platform === 'win32';
12
-
13
12
  export function repoPath(...parts) {
14
13
  return join(REPO_ROOT, ...parts);
15
14
  }
@@ -21,15 +20,7 @@ export function repoPath(...parts) {
21
20
  * 2. `$HOME/.claude` (Claude Code default)
22
21
  */
23
22
  export function claudeConfigDir() {
24
- if (process.env.CLAUDE_CONFIG_DIR && process.env.CLAUDE_CONFIG_DIR.trim()) {
25
- return process.env.CLAUDE_CONFIG_DIR.trim();
26
- }
27
- if (isWin) {
28
- return process.env.APPDATA
29
- ? join(process.env.APPDATA, 'claude')
30
- : join(homedir(), '.claude');
31
- }
32
- return join(homedir(), '.claude');
23
+ return resolveClaudeConfigDir();
33
24
  }
34
25
 
35
26
  export function claudeAgentsDir() {
@@ -69,13 +69,15 @@ still deny prohibited actions and escalate externally visible or irreversible
69
69
  actions with `permissionDecision: "ask"`; that escalation list is the
70
70
  authoritative floor, not a starting point.
71
71
 
72
- Mike selects the coordination mode after bounded read-only orientation and one
73
- user clarification checkpoint: direct work only for an unmistakably tiny
74
- single-target copy/style/format edit; one isolated Agent for a clear bounded
75
- change; a native workflow for repeatable phased work; parallel Agents for
76
- disjoint scopes; and an Agent team for 3+ sustained roles that genuinely need
77
- cross-talk. Do not add unnecessary phases or duplicate workers. The team is
78
- host-side state under `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, and per
72
+ Mike performs bounded read-only orientation, then uses a native Agent team as
73
+ the default for substantive work. Direct work is reserved for an unmistakably
74
+ tiny single-target copy/style/format edit or the user's explicit `/quick`
75
+ request. A single Agent or native workflow is used only when the user
76
+ explicitly requests that mode or a durable workflow must be resumed. Ask one
77
+ concise clarification question only when a material choice, acceptance
78
+ criterion, safety boundary, or unresolved constraint would change the work;
79
+ otherwise continue autonomously. The team is host-side state under
80
+ `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, and per
79
81
  Anthropic's docs `team_name` is deprecated and ignored. Every editing dispatch
80
82
  uses an explicit configured model and call-level `isolation: "worktree"`.
81
83
  When two or more subtasks have non-overlapping writable scopes and no data
@@ -144,13 +146,14 @@ The autonomy and approval policy above governs this execution model. The project
144
146
  Every non-empty primary request enters Bizar through `office-manager` (`@mike`).
145
147
  The installer sets Claude Code's global `agent` setting to Mike's frontmatter
146
148
  name (`mike`),
147
- and the routing hook supplies the adaptive coordination policy. For non-tiny
148
- work, Mike first gathers only bounded read-only context, asks one concise
149
- clarification question that names the inferred outcome and proposed mode, then
150
- continues autonomously after the answer. A native workflow is one available
151
- mode, not a universal gate; Mike may select an isolated Agent, parallel Agents,
152
- or an Agent team when that better fits the work. Mike owns integration and
153
- final verification.
149
+ and the routing hook supplies the team-first coordination policy. For non-tiny
150
+ work, Mike first gathers only bounded read-only context. When the inferred
151
+ outcome, acceptance criteria, and safety boundary are clear, it forms the
152
+ default Agent team and continues autonomously. It asks one concise
153
+ clarification only when a material choice or unresolved constraint would
154
+ change the work. `/quick` explicitly selects direct primary-session execution;
155
+ single Agents and native workflows are explicit or resumed modes. Mike owns
156
+ integration and final verification.
154
157
  A Bizar custom agent already executing its assigned role does not recursively
155
158
  dispatch itself.
156
159
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mike
3
- description: Mike — adaptive orchestrator that selects the lightest safe coordination mode.
3
+ description: Mike — team-first orchestrator that uses direct work only for quick or tiny requests.
4
4
  tools: Workflow, Agent, Read, Write, Edit, Bash, Grep, Glob, WebFetch, WebSearch, Skill, AskUserQuestion
5
5
  skills:
6
6
  - i-have-adhd
@@ -9,27 +9,25 @@ skills:
9
9
  # Mike — adaptive primary orchestrator
10
10
 
11
11
  Follow `_shared/AGENT_BASELINE.md`. You own the user outcome, integration, and
12
- final verification. Direct execution is a narrow exception; workflows are the
13
- default for meaningful work.
12
+ final verification. Direct execution is a narrow exception; native Agent teams
13
+ are the default for meaningful work.
14
14
 
15
- ## Orient, clarify, then select the coordination mode
15
+ ## Orient, decide, then coordinate
16
16
 
17
17
  | Shape | Signals | Execution |
18
18
  |---|---|---|
19
19
  | Tiny direct | one obvious copy, typo, comment, whitespace, or single style-token edit; one target; no behavior or test change | inspect, make the micro-edit, run the smallest proving check yourself |
20
- | Single isolated worker | one bounded implementation after scope is clear | dispatch one worktree-isolated native Agent with its explicit Bizar model; use an exact-model process worker only when a separate Claude process is useful; integrate and verify |
21
- | Native workflow | repeatable diagnosis, research, review, or an implementation needing visible phase barriers | invoke the matching Bizar workflow with explicit Bizar routing |
22
- | Agent team | three or more sustained, independent roles need bounded cross-talk or coordinated handoff | use the native Agent-team capability; writers use worktrees and explicit Bizar models |
23
- | Parallel agents | two disjoint writable scopes with no cross-talk needed | dispatch concurrently with explicit models and worktree isolation |
20
+ | Default substantive work | any request beyond a tiny edit or explicit `/quick` | form a native Agent team with bounded research, implementation, and review/integration ownership |
21
+ | Explicit single worker | user specifically asks for one agent or one narrow owner is required | dispatch one worktree-isolated native Agent and integrate its result |
22
+ | Explicit/resumed workflow | user explicitly requests a workflow or an existing workflow must continue | invoke the matching Bizar workflow with explicit Bizar routing |
24
23
 
25
24
  For every non-tiny request, first make only enough read-only inspection to
26
- understand the repository boundary and current constraints. Then ask the user
27
- one concise clarification checkpoint: state the inferred outcome, the material
28
- choice or risk, and the proposed coordination mode. Wait for the answer before
29
- writing, dispatching editors, creating branches, or running tests. If the user
30
- explicitly says to proceed without questions, record that choice and continue.
31
- After the answer, work autonomously until the requested outcome and verification
32
- are complete. Research current official docs only for external or
25
+ understand the repository boundary and current constraints. If the inferred
26
+ outcome, acceptance criteria, and safety boundary are clear, form the default
27
+ team and continue autonomously. Ask one concise clarification question only
28
+ when a material choice, unresolved constraint, or missing success criterion
29
+ would change the work. `/quick` is an explicit direct-execution request and
30
+ does not form a team. Research current official docs only for external or
33
31
  version-sensitive claims. Inspect installed skills before hard or specialized
34
32
  work; if stuck with no match, search skills.sh and review the candidate before
35
33
  proposing installation.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Show the Bizar autonomous harness controls and choose the smallest safe workflow.
2
+ description: Show the Bizar autonomous harness controls and start the team-first coordination policy.
3
3
  ---
4
4
 
5
5
  # Bizar Harness
@@ -7,9 +7,10 @@ description: Show the Bizar autonomous harness controls and choose the smallest
7
7
  Use `/bizar` to orient a task to the installed Claude Code-native harness.
8
8
 
9
9
  1. Read `PROGRESS.md`, `feature_list.json`, and the repository instructions.
10
- 2. Select the smallest appropriate lane: direct execution, research, plan/audit, team, or guarded background work.
11
- 3. State the target result, constraints, validation evidence, and stop condition.
12
- 4. Use `bizar --help` for CLI primitives and the installed skills for workflow-specific instructions.
13
- 5. Preserve human approval gates for destructive, publishing, deployment, and credential-sensitive operations.
10
+ 2. For substantive work, form a native Agent team after bounded read-only orientation. Use direct work only for a genuinely tiny task or an explicit `/quick` request; use a single Agent or a workflow only when the user explicitly asks for one or is resuming one.
11
+ 3. Ask one concise clarification question only when orientation leaves a material outcome, acceptance criterion, constraint, or safety boundary unresolved. Otherwise proceed autonomously.
12
+ 4. State the target result, constraints, validation evidence, and stop condition.
13
+ 5. Use `bizar --help` for CLI primitives and the installed skills for workflow-specific instructions.
14
+ 6. Preserve human approval gates for destructive, publishing, deployment, and credential-sensitive operations.
14
15
 
15
16
  Bizar has no browser control plane or persistent web service. Project files, Claude Code hooks, MCP tools, and CLI output are the operational surfaces.
@@ -8,8 +8,9 @@ Execute the requested local work end-to-end without pausing for ordinary reversi
8
8
 
9
9
  1. Read repository instructions, `PROGRESS.md`, and relevant project files.
10
10
  2. Infer reasonable details from evidence; record material assumptions.
11
- 3. Use direct execution by default. Use parallel dispatch only for genuinely
12
- independent scopes where it materially improves throughput.
11
+ 3. Form the default native Agent team with bounded research, implementation,
12
+ and review/integration ownership. Use direct execution only for an explicit
13
+ `/quick` request or an unmistakably tiny edit.
13
14
  4. Continue through edit, targeted tests, full required gates, documentation, and state updates.
14
15
  5. Stop only when verified complete or when an approval-gated action is the only remaining step.
15
16
 
@@ -1,32 +1,32 @@
1
1
  ---
2
- description: Skip Bizar\'s mandatory routing for this turn. Use for trivial single-step work the chat can handle directly.
2
+ description: Use direct primary-session execution for this turn instead of Bizar's default agent team.
3
3
  argument-hint: "[task]"
4
4
  disable-model-invocation: true
5
5
  allowed-tools: Read, Bash, Edit, Write, Grep, Glob
6
6
  ---
7
7
 
8
- # /quick — One-Turn Routing Bypass
8
+ # /quick — Direct Execution
9
9
 
10
- Run `$ARGUMENTS` directly in this session. Do NOT delegate to subagents.
10
+ Run `$ARGUMENTS` directly in this session. Do not create an Agent team,
11
+ dispatch a subagent, or start a workflow for this turn.
11
12
 
12
13
  ## Mechanism
13
14
 
14
- The `worker-suggest` hook recognizes `/quick` directly, but honors the bypass
15
- only when the argument still qualifies as an unmistakably tiny edit. Legacy
16
- `.bizar/.quick-once` sentinels are consumed on their first prompt and cannot
17
- bypass routing for substantive work.
15
+ The `worker-suggest` hook recognizes `/quick` directly and applies the direct
16
+ execution policy for this request. `/quick` changes coordination only: it never
17
+ bypasses model selection, safety hooks, approval boundaries, or verification.
18
18
 
19
19
  ## What this is for
20
20
 
21
- - One-line file edits
21
+ - A focused implementation you want handled in the primary session
22
22
  - Quick lookups ("find X", "show me Y")
23
- - One-token style adjustments
23
+ - A single-owner debugging or editing task
24
24
 
25
25
  ## What this is NOT for
26
26
 
27
- - Multi-step implementations
28
- - Anything that requires verification across multiple files
29
- - Any task that should be tracked in `feature_list.json`
27
+ - Work that benefits from independent research, implementation, and review
28
+ - Work with disjoint lanes where a team will be materially faster
29
+ - A task whose scope is unclear after bounded orientation
30
30
 
31
- If the task balloons, abort, delete the sentinel, and re-run the request
32
- without `/quick` so the orchestrator can dispatch properly.
31
+ If the task expands into independent lanes or becomes materially unclear, stop
32
+ and re-run it without `/quick` so Bizar can form the default agent team.
@@ -5,7 +5,10 @@ allowed-tools: Read, Bash, Agent, SendMessage
5
5
 
6
6
  # Team — Coordinated Claude Code Agents
7
7
 
8
- Use `/team` only when teammates need to coordinate or communicate directly while parallel, independent scopes materially improve delivery. Use ordinary subagents for focused delegation and native dynamic workflows for deterministic large fan-out.
8
+ `/team` is Bizar's standard substantive-work mode. Use it after bounded
9
+ orientation whenever the task is not an explicit `/quick` direct request or an
10
+ unmistakably tiny edit. Use an explicit single-agent or workflow route only
11
+ when the user asks for it or a durable workflow must be resumed.
9
12
 
10
13
  Agent teams are experimental. They require `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, which Bizar installs by default. Current Claude Code versions create and clean up teams automatically; do not call obsolete `TeamCreate` or `TeamDelete` tools.
11
14
 
@@ -30,7 +33,7 @@ Team agents may inspect, edit, build, and test locally without approval. They mu
30
33
 
31
34
  ## Checklist
32
35
 
33
- - [ ] Parallelism is justified; a direct lane would be slower or less reliable.
36
+ - [ ] The team has a concrete research, implementation, and review/integration purpose.
34
37
  - [ ] File scopes are disjoint.
35
38
  - [ ] Every editing lane has a claimed task/worktree and path scope.
36
39
  - [ ] Lockfiles and root configuration have one owner.
@@ -28,7 +28,7 @@
28
28
 
29
29
  'use strict';
30
30
 
31
- import { readFileSync, existsSync, mkdirSync, writeFileSync, appendFileSync, unlinkSync } from 'node:fs';
31
+ import { readFileSync, existsSync, mkdirSync, writeFileSync, appendFileSync } from 'node:fs';
32
32
  import { join } from 'node:path';
33
33
  import os from 'node:os';
34
34
  import { createHash } from 'node:crypto';
@@ -354,14 +354,6 @@ process.stdin.on('end', () => {
354
354
  const notePath = writeSessionNote(cwd, sessionId, reason, summary);
355
355
  const stateOk = writeSessionState(cwd, sessionId, reason, summary, nextStep);
356
356
 
357
- // Clear /quick sentinel so the next session is back to orchestrator routing.
358
- try {
359
- const quickSentinel = join(cwd, '.bizar', '.quick-once');
360
- if (existsSync(quickSentinel)) {
361
- try { unlinkSync(quickSentinel); } catch { /* best-effort */ }
362
- }
363
- } catch { /* best-effort */ }
364
-
365
357
  // Silent success — the artifact is the file system.
366
358
  process.stdout.write(
367
359
  JSON.stringify({
@@ -186,13 +186,13 @@ function startupBriefing(cwd, featureBrief, recentCommits, projectLine, progress
186
186
  }
187
187
  }
188
188
  if (progressLast) lines.push(`- Progress: ${progressLast}.`);
189
- lines.push('- You are @mike. For non-tiny work, do bounded read-only orientation, ask one clarification checkpoint, then choose a single isolated worker, native workflow, parallel workers, or an Agent team by actual dependency. Use worktrees for editors and explicit Bizar models for every Agent.');
189
+ lines.push('- You are @mike. For non-tiny work, do bounded read-only orientation, then form a native Agent team by default. Ask one concise clarification only when a material choice, acceptance criterion, or safety boundary remains unresolved; otherwise continue autonomously. /quick is the explicit direct-execution exception. Use worktrees for editors and explicit Bizar models for every Agent.');
190
190
  lines.push('- External/version-sensitive work requires current official docs via WebSearch/WebFetch. Use relevant installed skills; apply i-have-adhd to user output. WIP=1.');
191
191
  lines.push('- TaskCompleted/SubagentStop/<task-notification> is terminal: consume its original <result> once, mark done/failed, merge queued work, and continue the objective. Never turn a terminal notification into a worker follow-up or replace that result with a later status reply.');
192
192
  // Default-first-stop hint when nothing is active yet.
193
193
  if (featureBrief && featureBrief.active.length === 0) {
194
194
  lines.push(
195
- '- First move: read PROGRESS.md and feature_list.json, then do bounded orientation and ask the clarification checkpoint before choosing the fitting coordination mode.',
195
+ '- First move: read PROGRESS.md and feature_list.json, do bounded orientation, and form the default team when the outcome is clear. Ask only if a material decision remains unresolved.',
196
196
  );
197
197
  }
198
198
  return lines.join('\n');
@@ -259,7 +259,6 @@ process.stdin.on('end', () => {
259
259
  { cmd: '/audit', note: 'Run Forseti-style code-review audit on the current diff.' },
260
260
  { cmd: '/test', note: 'Auto-detects runner (jest/vitest/bun/pytest/cargo/go); streams output.' },
261
261
  { cmd: '/explain', note: 'Read-only explanation — dispatch susan (or general-purpose) to look up the answer with file:line refs.' },
262
- { cmd: '/tailscale-serve', note: 'Authenticate Tailscale and configure `tailscale serve` for a local port.' },
263
262
  { cmd: '/bizar', note: 'Bizar harness orientation — guarded workflows, plans, loops, graph, cost, and claims.' },
264
263
  { cmd: '/init', note: 'Run `bizar init` to scaffold project context and graph state in this repo.' },
265
264
  { cmd: '/cron', note: 'Manage scheduled tasks via the Bizar SDK cron API — list / add / remove / pause.' },
@@ -5,9 +5,8 @@
5
5
  * Bizar Background Workers — UserPromptSubmit hook.
6
6
  *
7
7
  * Runs on every user prompt. Only unmistakably tiny, single-scope edits take
8
- * a cheap fast path. Every other request is routed into a native Bizar
9
- * adaptive coordination mode selected by Mike after bounded orientation and a
10
- * clarification checkpoint.
8
+ * a cheap fast path. Every other request is routed into a team-first Bizar
9
+ * coordination mode selected by Mike after bounded orientation.
11
10
  *
12
11
  * Uses import.meta.url + dynamic import() to resolve the sibling CLI module so
13
12
  * the hook works regardless of install path (fixes ERR_MODULE_NOT_FOUND after
@@ -36,7 +35,6 @@
36
35
  'use strict';
37
36
 
38
37
  import { dirname, join } from 'node:path';
39
- import { existsSync, unlinkSync } from 'node:fs';
40
38
  import { fileURLToPath } from 'node:url';
41
39
  import { isTinyDirectTask } from './workflow-route-state.mjs';
42
40
 
@@ -56,10 +54,17 @@ const FAST_ROUTE_POLICY = [
56
54
  '- If inspection reveals behavioral logic, more than one target, ambiguity, a required test change, or any interaction beyond the named micro-edit, stop the direct path and invoke the matching native Bizar workflow before editing further.',
57
55
  ].join('\n');
58
56
 
57
+ const QUICK_ROUTE_POLICY = [
58
+ 'Bizar /quick direct path:',
59
+ '- The user explicitly selected direct, primary-session execution for this turn. Do not create an Agent team, dispatch a subagent, or start a workflow merely because the request is substantial.',
60
+ '- Do bounded read-only orientation, then proceed autonomously when the requested outcome, acceptance criteria, and safety boundary are clear. Ask only when a material choice or missing success criterion prevents a safe, correct implementation.',
61
+ '- /quick never bypasses worktree, approval, credential, destructive-action, or verification safeguards. Run the smallest relevant proof before reporting completion.',
62
+ ].join('\n');
63
+
59
64
  const ROUTE_POLICY = [
60
65
  'Adaptive Bizar routing policy:',
61
- '- If this is the primary session, you ARE @mike. First do only bounded read-only orientation. Then ask one concise clarification question describing the inferred outcome, the material choice/risk, and your proposed coordination mode. Wait for the answer before edits, branches, tests, or editor dispatch. If the user explicitly waives questions, continue autonomously.',
62
- '- After clarification, choose the lightest coordination mode: a direct tiny edit, one isolated Agent for a bounded change, a native Bizar Workflow for repeatable phased work, parallel Agents for disjoint scopes, or an Agent team only when 3+ sustained roles need cross-talk. Do not force a workflow or team when it adds no value.',
66
+ '- If this is the primary session, you ARE @mike. First do only bounded read-only orientation. If the inferred outcome, acceptance criteria, and safety boundary are clear, continue without a clarification question. Ask one concise question only when a material choice, unresolved constraint, or missing success criterion would change the work.',
67
+ '- For substantive work, native Agent teams are the default execution method. Form a small team with clear ownership, use a lead to integrate evidence, and use worktrees for editors. Use direct execution only for an unmistakably tiny edit or an explicit /quick request. Use a single agent or a native workflow only when the user explicitly requests that mode or an existing workflow must be resumed.',
63
68
  '- For every normal Agent, workflow worker, or agent-team teammate, pass its stable Bizar role name (`greg`, `todd`, `linda`, and so on) as `subagent_type` and OMIT the native `model` field. `bizar models` keeps that global role definition frontmatter bound to the default enabled operator-selected gateway ID. Never put a raw gateway ID or a Claude family alias in the native model field; aliases are compatibility-only. `bizar models --agent-types --json` is advanced explicit per-model routing only. For teams, do not name a competing model in the spawn prompt. If the stable role definition is missing, run `bizar models`; do not retry by cycling providers or tiers. Every editing worker uses call-level `isolation: "worktree"`. For genuinely disjoint writable scopes, dispatch concurrently; otherwise use one owner.',
64
69
  '- Consume each terminal agent result exactly once from its original `<result>`/final summary, merge queued worktrees with bizar worktree-merge, and run integration checks in the primary session. Never send a terminal notification, idle ping, or completed task back to that agent as a follow-up and never re-dispatch a completed background agent merely to summarize its result. A subagent may not recursively dispatch itself.',
65
70
  '- Do NOT execute any tool you do not have. If a tool you need is missing from your tools list, dispatch to a subagent that has it — do not pretend you have it.',
@@ -91,28 +96,11 @@ process.stdin.on('end', async () => {
91
96
 
92
97
  if (/^\/quick(?:\s|$)/i.test(prompt)) {
93
98
  const quickTask = prompt.replace(/^\/quick(?:\s+|$)/i, '').trim();
94
- const context = !quickTask || isFastLocalTask(quickTask) ? FAST_ROUTE_POLICY : ROUTE_POLICY;
99
+ const context = !quickTask ? FAST_ROUTE_POLICY : QUICK_ROUTE_POLICY;
95
100
  process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: 'UserPromptSubmit', additionalContext: context } }) + '\n');
96
101
  return;
97
102
  }
98
103
 
99
- // /quick sentinel bypass: when .bizar/.quick-once exists, skip the
100
- // orchestrator routing policy for this single turn. The sentinel is
101
- // created by the /quick slash command and removed by session-end.
102
- const quickSentinel = join(input.cwd || process.cwd(), '.bizar', '.quick-once');
103
- if (existsSync(quickSentinel)) {
104
- try { unlinkSync(quickSentinel); } catch { /* best-effort one-shot cleanup */ }
105
- const context = isFastLocalTask(prompt) ? FAST_ROUTE_POLICY : ROUTE_POLICY;
106
- process.stdout.write(JSON.stringify({
107
- hookSpecificOutput: {
108
- hookEventName: 'UserPromptSubmit',
109
- additionalContext: context,
110
- },
111
- }) + '\n');
112
- process.exit(0);
113
- return;
114
- }
115
-
116
104
  // Empty prompts get the silent treatment — the user has not yet
117
105
  // committed any intent.
118
106
  if (prompt.length === 0) {
@@ -88,9 +88,10 @@ process.stdin.on('end', () => {
88
88
  }
89
89
 
90
90
  // Coordination is an orchestrator decision, not a hard-coded tool gate.
91
- // Instructions require orientation + clarification before mutation; Agent
92
- // calls are independently protected by agent-model-guard.mjs. Keeping this
93
- // hook advisory avoids trapping valid single-worker and Agent-team plans.
91
+ // Instructions require orientation, then a team by default; clarification
92
+ // is conditional on unresolved material choices. Agent calls are
93
+ // independently protected by agent-model-guard.mjs. Keeping this hook
94
+ // advisory avoids trapping valid direct, single-worker, and team plans.
94
95
  } catch (error) {
95
96
  process.stderr.write(`[bizar.workflow-route] ${error?.message || String(error)}\n`);
96
97
  }
@@ -66,6 +66,6 @@ export function promptRequiresWorkflow(input) {
66
66
  if (!prompt) return false;
67
67
  if (input?.task_notification || /^<task-notification\b[\s\S]*<result\b[\s\S]*<\/task-notification>\s*$/i.test(prompt)) return false;
68
68
  const quick = prompt.match(/^\/quick(?:\s+([\s\S]*))?$/i);
69
- if (quick) return Boolean(quick[1]?.trim()) && !isTinyDirectTask(quick[1]);
69
+ if (quick) return false;
70
70
  return !isTinyDirectTask(prompt);
71
71
  }
@@ -39,6 +39,7 @@ const dispatchAgent = (agentFn, agentName, prompt, opts = {}) => {
39
39
  const prefix = `[Bizar dispatch ${sequence}: ${agentName}; role=${opts.role || 'worker'}; phase=${opts.phase || 'work'}; label=${opts.label || agentName}]`
40
40
  const agentOptions = {
41
41
  subagent_type: routeAgentType(opts.risk || 'medium', opts.role),
42
+ model: routeModel(opts.risk || 'medium'),
42
43
  effort: opts.risk === 'high' ? 'high' : 'medium',
43
44
  }
44
45
  if (opts.schema) agentOptions.schema = opts.schema
@@ -38,6 +38,7 @@ const dispatchAgent = (agentFn, agentName, prompt, opts = {}) => {
38
38
  const prefix = `[Bizar dispatch ${sequence}: ${agentName}; role=${opts.role || 'worker'}; phase=${opts.phase || 'work'}; label=${opts.label || agentName}]`
39
39
  const agentOptions = {
40
40
  subagent_type: routeAgentType(opts.risk || 'medium', opts.role),
41
+ model: routeModel(opts.risk || 'medium'),
41
42
  effort: opts.risk === 'high' ? 'high' : 'medium',
42
43
  }
43
44
  if (opts.schema) agentOptions.schema = opts.schema
@@ -39,6 +39,7 @@ const dispatchAgent = (agentFn, agentName, prompt, opts = {}) => {
39
39
  const prefix = `[Bizar dispatch ${sequence}: ${agentName}; role=${opts.role || 'worker'}; phase=${opts.phase || 'work'}; label=${opts.label || agentName}]`
40
40
  const agentOptions = {
41
41
  subagent_type: routeAgentType(opts.risk || 'medium', opts.role),
42
+ model: routeModel(opts.risk || 'medium'),
42
43
  effort: opts.risk === 'high' ? 'high' : 'medium',
43
44
  }
44
45
  if (opts.schema) agentOptions.schema = opts.schema
@@ -37,6 +37,7 @@ const dispatchAgent = (agentFn, agentName, prompt, opts = {}) => {
37
37
  const prefix = `[Bizar dispatch ${sequence}: ${agentName}; role=${opts.role || 'worker'}; phase=${opts.phase || 'work'}; label=${opts.label || agentName}]`
38
38
  const agentOptions = {
39
39
  subagent_type: routeAgentType(opts.risk || 'medium', opts.role),
40
+ model: routeModel(opts.risk || 'medium'),
40
41
  effort: opts.risk === 'high' ? 'high' : 'medium',
41
42
  }
42
43
  if (opts.schema) agentOptions.schema = opts.schema
@@ -36,6 +36,7 @@ const dispatchAgent = (agentFn, agentName, prompt, opts = {}) => {
36
36
  const prefix = `[Bizar dispatch ${sequence}: ${agentName}; role=${opts.role || 'worker'}; phase=${opts.phase || 'work'}; label=${opts.label || agentName}]`
37
37
  const agentOptions = {
38
38
  subagent_type: routeAgentType(opts.risk || 'medium', opts.role),
39
+ model: routeModel(opts.risk || 'medium'),
39
40
  effort: opts.risk === 'high' ? 'high' : 'medium',
40
41
  }
41
42
  if (opts.schema) agentOptions.schema = opts.schema
@@ -38,6 +38,7 @@ const dispatchAgent = (agentFn, agentName, prompt, opts = {}) => {
38
38
  const prefix = `[Bizar dispatch ${sequence}: ${agentName}; role=${opts.role || 'worker'}; phase=${opts.phase || 'work'}; label=${opts.label || agentName}]`
39
39
  const agentOptions = {
40
40
  subagent_type: routeAgentType(opts.risk || 'medium', opts.role),
41
+ model: routeModel(opts.risk || 'medium'),
41
42
  effort: opts.risk === 'high' ? 'high' : 'medium',
42
43
  }
43
44
  if (opts.schema) agentOptions.schema = opts.schema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polderlabs/bizar",
3
- "version": "10.23.22",
3
+ "version": "10.23.23",
4
4
  "description": "Autonomous, human-in-the-loop multi-agent harness for Claude Code with guarded workflows, typed SDK primitives, and MCP tools.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * SDK version constant. Keep synchronized with the workspace package versions.
3
3
  */
4
- export declare const SDK_VERSION: "10.23.22";
4
+ export declare const SDK_VERSION: "10.23.23";
5
5
  //# sourceMappingURL=version.d.ts.map
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * SDK version constant. Keep synchronized with the workspace package versions.
3
3
  */
4
- export const SDK_VERSION = "10.23.22";
4
+ export const SDK_VERSION = "10.23.23";
5
5
  //# sourceMappingURL=version.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polderlabs/bizar-sdk",
3
- "version": "10.23.22",
3
+ "version": "10.23.23",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,18 +0,0 @@
1
- ---
2
- description: Migrate a legacy ~/.config/cline/ install to the user-level Claude Code directory.
3
- allowed-tools: Read, Bash
4
- ---
5
-
6
- # /migrate — Cline-era ~/.config/cline/ → ~/.claude/
7
-
8
- Runs `bizar migrate` once. It is safe to re-run.
9
-
10
- 1. Detects `~/.config/cline/{settings.json,CLAUDE.md,agents,commands}` and any
11
- other Cline-era surfaces that still live under `~/.config/`.
12
- 2. Moves them under `~/.claude/` (or `$CLAUDE_CONFIG_DIR`) and reconciles
13
- names with the current Claude Code conventions.
14
- 3. Writes a stamp file `~/.claude/.bizar-cline-migration-stamp` recording the
15
- source and Bizar version that performed the migration.
16
-
17
- No file is deleted. The original `~/.config/cline/` is left in place until you
18
- verify the move succeeded.
@@ -1,14 +0,0 @@
1
- ---
2
- description: Expose an explicitly selected local service through Tailscale Serve with confirmation.
3
- ---
4
-
5
- # Tailscale Serve
6
-
7
- This command is generic and does not start any Bizar service.
8
-
9
- 1. Require the user to provide the local port or socket to expose.
10
- 2. Verify the target is listening locally.
11
- 3. Show the exact `tailscale serve` command and exposure scope.
12
- 4. Ask before changing the machine's Tailscale Serve configuration.
13
- 5. After approval, run the command and verify `tailscale serve status`.
14
- 6. Report the public/private URL and the reversal command: `tailscale serve reset`.
@@ -1,31 +0,0 @@
1
- ---
2
- description: Pick the cheapest Bizar tier that fits a task description; the same selection the @mike orchestrator makes.
3
- allowed-tools: Read, Bash
4
- ---
5
-
6
- # /tier — automatic task-based model selection
7
-
8
- Routes a task description through the same Bizar tier resolver the `@mike`
9
- orchestrator uses. Useful when you want to know which model an agent would
10
- land on before launching a session.
11
-
12
- ```bash
13
- # After `npm install -g @polderlabs/bizar` the script lives at:
14
- bizar tier --agent mike "design a deterministic migration plan for X"
15
- bizar tier --list
16
- ```
17
-
18
- Selection rules:
19
-
20
- 1. The role default (`premium` / `high` / `mid-design` / `default` / `mid` /
21
- `budget`) comes from the global Bizar router under `BIZAR_HOME`.
22
- 2. Mike adjusts that default from the current task's risk and complexity. A
23
- role never carries fixed `model:` frontmatter.
24
- 3. If live model discovery reports a configured candidate for the chosen tier,
25
- Mike passes the first matching candidate on the Agent call.
26
- 4. If discovery is unavailable, stale, ambiguous, or has no matching candidate,
27
- Mike uses the closest enabled configured tier candidate and keeps `model` explicit.
28
- 5. A failed dispatch is not retried through aliases, providers, or tiers.
29
-
30
- The orchestrator's decision can be logged to `~/.config/bizar/tier.log` with a
31
- short rationale.
@@ -1,34 +0,0 @@
1
- ---
2
- description: Apply the user-favored defaults to ~/.claude/settings.json — bypass permissions and enable background worktree isolation.
3
- allowed-tools: Read, Bash
4
- ---
5
-
6
- # /upgrade-defaults — set user-favored Claude Code defaults for Bizar
7
-
8
- Re-applies the defaults that pair with `bypassPermissions` mode and
9
- worktree-based background isolation:
10
-
11
- - `permissions.defaultMode = "bypassPermissions"`
12
- - `worktree.bgIsolation = "worktree"`
13
- - `model = first enabled user-selected or configured-tier model`
14
- - `alwaysThinkingEnabled = true`
15
- - `effortLevel = "high"`
16
- - `skipDangerousModePermissionPrompt = true`
17
- - `showThinkingSummaries = true`
18
- - `askUserQuestionTimeout = "5m"`
19
-
20
- The command preserves any user-set value that is more restrictive than the
21
- default (e.g. if `defaultMode` is already `acceptEdits`, it stays). Every
22
- unrelated key — `mcpServers`, `hooks`, `env`, `attribution`, `enabledPlugins`,
23
- `extraKnownMarketplaces` — is preserved verbatim.
24
-
25
- ```bash
26
- # Preview the diff without writing.
27
- bizar upgrade-defaults --dry-run
28
-
29
- # Apply (writes a timestamped .bak-<stamp> alongside settings.json first).
30
- bizar upgrade-defaults
31
- ```
32
-
33
- This command preserves unrelated settings and creates a timestamped backup
34
- before changing Bizar-owned defaults.
@@ -1,12 +0,0 @@
1
- ---
2
- description: Show the configured model Bizar will use for ordinary work.
3
- allowed-tools: Bash
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /use-default
8
-
9
- Run `bizar tier --agent mike --json "ordinary repository task"`. Report the
10
- first enabled configured candidate and the global router path. Do not hardcode
11
- a provider or write project-local model settings. To change the global picks,
12
- run `bizar models`.
@@ -1,12 +0,0 @@
1
- ---
2
- description: Show the configured model Bizar will use for high-risk reasoning.
3
- allowed-tools: Bash
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /use-premium
8
-
9
- Run `bizar tier --agent carl --json "high-risk architecture and debugging"`.
10
- Report the first enabled configured candidate and the global router path. Do
11
- not hardcode a model, invent a cost ceiling, or create project-local overrides.
12
- To change premium candidates globally, run `bizar models`.