Final P0 deliverables to make the system bootable in mock mode and
pass `scripts/phase0-verify.js` + `scripts/phase0-test-call.js` end-to-end.
ClaudeCliProtocol (mock mode):
- LEMONBOSS_CLAUDE_MODE=mock or { mock: true } in constructor enables
mock mode. connect() becomes a no-op; sendPrompt reads fixtures from
fixtures/devloop-mock/{agentName}.json and emits scripted session_update
chunks + session/result(mock=true). Falls back to default.json.
Agent registry:
- 6 entries added to system/templates/_registry.json (devloop-pm,
devloop-architect, devloop-coder, devloop-tester, devloop-integrator,
devloop-triager).
- Per-agent dirs system/templates/devloop-{role}/ with:
* prompt.md — auto-extracted from agents-{role}.html §2.2
* config.json — cli.toolPolicy.allowedTools + sandbox.writeAllowList
Tooling:
- scripts/extract-agent-prompts.js — regex-extracts §2.2 system prompts
from 6 agent HTML pages to system/templates/devloop-{role}/prompt.md.
- server/src/tools/devloop/index.js — central export (tools Map,
bashHooks, dispatch).
- server/src/core/devloop/loop-controller.js (P0 skeleton) — exposes
createProject (sandbox alloc + git init + first commit + timeline) and
commitAfterAgent (per-agent kind-routed git commit + timeline event).
Mock fixtures:
- fixtures/devloop-mock/default.json + devloop-pm.json
Acceptance scripts:
- scripts/phase0-verify.js — 8 static checks (35 tools loadable,
6 agents registered, prompt+config wired, bash guard exported, services
require, fixtures present, git-vault interface, loop-controller).
- scripts/phase0-test-call.js — 7 end-to-end steps under mock mode
(createProject → CLI connect → sendPrompt chunks → no-op commit returns
null → real write commits → git log ≥2 → timeline has both events).
vitest.config.js: include packages/**/*.test.js so the mock smoke test
runs in the suite.
Results:
- 162/162 devloop + acp-core tests pass (up from 159).
- phase0-verify: 8/8.
- phase0-test-call: 7/7.
Specs: docs/prd/newfunction/_spec/plan-migration.md · Quick-Start step 7
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>