29. Claude Code as workspace development harness
Date: 2026-10-04
Status
Accepted
Context
The Unicorn workspace groups five git repos (unicorn-frontend, unicorn-backend, archi-agentic-toolset, plus the workspace harness itself and the Hugo site). The backend is a Dapr-based distributed system with three services; the agentic toolset adds a fourth. Onboarding a new developer — or resuming a session after a break — previously required mental reconstruction of port assignments, component names, smoke test procedures, and IcePanel conventions. There was no single place that held all of that operational knowledge, and no enforced link between the architecture model (IcePanel C4) and the day-to-day coding loop.
The team needed a lightweight harness that could: (a) encode workspace knowledge durably, (b) enforce runtime invariants (no Docker, no secrets in code), (c) reduce bootstrap time for a new machine to a handful of commands, and (d) let an AI coding assistant operate safely and usefully without human supervision for routine tasks.
Decision
We will use Claude Code (Anthropic’s CLI agent) as the primary development harness for the workspace, with the following concrete setup:
CLAUDE.mdfiles at workspace root and in each repo encode service maps, port tables, runtime rules, and known gaps. These are the agent’s first read in any session.- A project-scoped
.claude/settings.jsonregisters five slash commands as named skills:/discover(derivesdapr.yaml, local Dapr components, and smoke tests from the live repo state),/local-up,/smoke,/new-adr, and/arch-check. - A
protect-files.shhook blocks the agent from writing any.envfile; secrets are created out-of-band by the operator. - An IcePanel MCP server is registered so the agent can read and propose updates to the live C4 model without leaving the coding session.
Makefiletargets (make up,make down,make check,make smoke,make smoke-clean) provide a stable, human-facing interface that wraps Dapr and Podman commands.scripts/smoke.shandscripts/smoke-clean.shexercise the full pub/sub → Gemini RAG → GitHub push pipeline and clean up test artefacts afterwards.
Rejected alternatives:
- Plain shell scripts + wiki: low ceremony but no enforcement, and knowledge drifts from reality quickly.
- Dev containers / Codespaces: heavier; conflicts with the Podman-only constraint and the need to mount local Dapr state.
- Cursor / Copilot Workspace: no CLI agent API that could be scripted into Makefile targets or slash commands; no hook mechanism for secrets protection.
Consequences
Easier
- Bootstrapping a new machine:
git clone,make bootstrap, create.envfiles,make up. /discoverproducesdapr.yamland local component YAML in one pass; subsequent sessions read CLAUDE.md rather than re-deriving structure.- The
protect-files.shhook gives a hard guarantee that secrets never enter the agent’s tool calls or session history. /new-adrand/arch-checkkeep ADRs and the IcePanel C4 model in sync with code changes without a separate documentation step.- Dapr component-name parity (Redis locally, Service Bus/Cosmos DB on Azure) is an explicit CLAUDE.md rule the agent checks before editing any component file.
Harder / watch-outs
- The harness is opinionated about Podman + Dapr self-hosted. A Docker-based environment
needs
CLAUDE.mdedits and Makefile overrides before the agent can be trusted to run commands safely. - All API keys (Gemini, Pusher, Auth0, GitHub PAT) must exist in
.envfiles beforemake up; missing secrets cause module-load failures at service startup, not deferred errors. - Claude Code sessions consume API tokens; long
/discoveror/smokeruns on a cold repo can be expensive. Cachedapr.yamland component files in version control once stable.
Follow-up
Replace the— done; path set toTODO(ADR_DIR)placeholder in the workspaceCLAUDE.md../unicorn-hugo-website/content/adr.- Add the Hugo site repo to the workspace once it is imported; extend
CLAUDE.mdand the/discoverskill accordingly. - When IcePanel becomes the authoritative C4 source (superseding the Archi export), update the RAG ingestion path described in ADR 0026.