← Corpus / augment-it / prompt
Run /speckit-specify — Workspace + Sidecar Foundation (Feature 001)
The first feature spec for augment-it after the constitution lands. Scope: the workspace package and bun sidecar that everything else depends on, plus exactly one read-only capability (records.import) end-to-end to prove the pipe. No federation yet. No research agents yet. No chat surface implementation yet. Just the foundation that makes every subsequent feature possible — and a CSV import that lands rows in the workspace and persists them to disk.
- Path
- prompts/Run-Speckit-Specify-Workspace-and-Sidecar-Foundation.md
- Authors
- Michael Staton
- Augmented with
- Claude Code on Claude Opus 4.7
- Tags
- Prompt · Spec-Kit · Specify · Augment-It · Walking-Skeleton · First-Feature
Run /speckit-specify — Workspace + Sidecar Foundation
Why narrow scope
/speckit-specify produces one feature spec per invocation. Going broad (the whole walking skeleton at once) would generate a sprawling document that’s hard to plan, task, and implement cleanly. Narrow gives us a real first feature to ship: the foundation that everything else hangs off, plus one end-to-end capability that proves it works.
Subsequent features get their own /speckit-specify calls — listed under “Future features” below.
Prerequisite reading
/speckit-specify should read these before drafting:
.specify/memory/constitution.md— the ratified principles (just landed via /speckit-constitution)context-v/specs/Walking-Skeleton-Pre-Flight-Decisions.md— the five substrate callscontext-v/blueprints/Spec-Kit-and-Context-V-Coexistence.md— how to balance the two systemsai-labs/context-v/blueprints/Per-App-Workspace-Conventions.md— the workspace patternmemopop-ai/apps/memopop-native/src/lib/stores/flow.svelte.ts— canonical Svelte 5 reference
How to invoke
/speckit-specify Read context-v/prompts/Run-Speckit-Specify-Workspace-and-Sidecar-Foundation.md and follow its "Feature description" section. Scope is intentionally narrow — workspace package + sidecar + records.import only. Federation, research agents, chat, and other capabilities come in subsequent features.
Feature description
What we’re building
The augment-it foundation:
-
@augment-it/workspacepackage — a Svelte 5$stateclass (AugmentItWorkspace) following [[Per-App-Workspace-Conventions]] and the canonical memopopFlowStatepattern. Exports the singletonworkspace, theActiveViewdiscriminated union, theWorkspaceAdapterimplementation for@lossless/in-app-agent, and capability registry plumbing. -
apps/sidecar/— a bun HTTP server at localhost:8787 that:- Resolves opaque session tokens via
x-augment-it-sessionheader; mints new ones on first contact (Decision 4 of the pre-flight) - Routes
POST /api/<entity>.<verb>to registered capability handlers - Persists session, record, and other state to JSON files under
augment-it/data/(Decision 3 of the pre-flight) - Hot-reloads via
bun --watch
- Resolves opaque session tokens via
-
records.importcapability — end-to-end:- Workspace handler at
records.tscallsfetch('/api/records.import', { method: 'POST', body: ... }) - Sidecar route accepts a CSV (file blob or pasted text), parses with a small library (e.g.
papaparseor Bun’s CSV utilities) - Returns
{ data: { record_set_id, row_count, fields }, display_hint: { mount: 'record_list', props: { record_set_id } } } - Sidecar saves to
data/records.json - Workspace receives the result, transitions
activeViewto{ kind: 'record_list', recordSetId } - A minimal Svelte 5 component (
RecordList.svelte) readsworkspace.activeViewand renders the rows
- Workspace handler at
-
A 50-line shell — Svelte 5 component that:
- On mount, calls
GET /api/sessionto establish a session - Mounts
<AgentProvider>(from@lossless/in-app-agent) around an<ActiveViewMount />that switches onworkspace.activeView.kind - For now: only
idleandrecord_listview kinds exist
- On mount, calls
-
Project plumbing:
package.jsonworkspaces field at the augment-it root declaringpackages/workspace,packages/in-app-agent(the local stub),apps/sidecar,shellrsbuild.config.tswith@rsbuild/plugin-svelte, dev-server proxy for/api/*→localhost:8787augment-it/data/gitignored
Constraints (per constitution + pre-flight)
- Svelte 5 with
$staterunes; no React, useSyncExternalStore, Zustand, Jotai - bun for everything orchestrational; no pnpm, no turbo
- rsbuild for the frontend bundler with
@rsbuild/plugin-svelte - No Module Federation yet — single bundle for this feature; federation is a separate feature
@module-federation/dts-pluginnot needed yet (single bundle)- TypeScript everywhere
- All state mutations go through
workspace.invoke('capability.name', args)— the three guards - Session token storage:
localStorageon the browser,data/sessions.jsonon the sidecar - Capability name:
records.import(entity.verb, snake_case kinds in activeView) - No tests required for this feature — walking skeleton priority; tests come in a follow-up feature once the pattern is real
What’s explicitly out of scope
- Module Federation 2.0 setup (subsequent feature)
- Research agents —
research.social_profiles,research.web_crawl, etc. (subsequent features, one per agent) - The chat surface UI (just provider mounting;
<ChatSurface>renders nothing meaningful yet) - Highlight collector, response reviewer, prompt template manager UIs
- CRM write-back (insight-manager)
- Multi-tenant Chroma collections
- Real auth flow (we use opaque tokens; OAuth is later)
- libSQL/Turso migration (JSON files are fine for now)
What “done” looks like
Manual smoke test:
cd augment-it && bun install && bun --filter '*' devbun --watch apps/sidecar/src/server.tsrunning in another terminal- Browser opens to the rsbuild dev URL
- First load: browser receives a session token, stores in localStorage, prints user name in some debug spot
- Drag-drop or paste a CSV into a minimal import UI
records.importfires; sidecar parses;data/records.jsonupdates on disk- Workspace’s
activeViewtransitions to{ kind: 'record_list', recordSetId: ... } RecordList.svelterenders the rows- Refresh the browser; session persists; records persist; the import doesn’t have to happen again
If all nine steps work, the foundation is real.
Implementation order suggestions (for /speckit-plan later)
- Root
package.json+bun install+ workspaces declaration apps/sidecar/skeleton with session resolver only — test withcurl localhost:8787/api/sessionpackages/workspace/skeleton — class, singleton, typespackages/in-app-agent/minimal stub — WorkspaceAdapter interface + AgentProvider that just holds the adaptershell/skeleton — mount, session bootstrap, ActiveViewMount- Add
records.importcapability handler in the sidecar;data/records.jsonpersistence - Add
records.importregistration in the workspace + Svelte component forrecord_listview - Smoke test the full path
Future features (each its own /speckit-specify later)
- Feature 002 —
research.social_profilesend-to-end. First real research agent. Proves the per-row capability pattern. Adds the multi-agent fan-out machinery in skeleton form (still single agent for this feature; the fan-out shape itself is feature 005). - Feature 003 — Module Federation 2.0 + rsbuild setup. Single-bundle becomes a host + remotes. Per [[Federation-and-Bundler-Decision]].
- Feature 004 — First federated remote:
record-collector. The ingest UI extracted as a federated app per the federation decision. - Feature 005 — Multi-agent fan-out runtime. Per-row × per-agent jobs, character cast, partial-result tolerance. Per [[Multi-Agent-Research-Fan-Out-Per-Row]].
- Feature 006 — Chat surface implementation. Anthropic streaming, tool-use, transcript persistence, the actual chat UI inside
<ChatSurface>. - Feature 007 —
response-reviewerremote. Per [[Why-Response-Reviewer-and-Highlight-Collector-Exist]]. - Feature 008 —
highlight-collectorremote. - Feature 009 —
insight-manager+ first CRM adapter. Real CRM write-back.
This ordering is a recommendation, not a contract — adjust as reality contacts the code.
After this feature spec lands
- Review
.specify/memory/specs/001-*/spec.md(the file/speckit-specifycreates). - Optionally
/speckit-clarifyto de-risk anything ambiguous. /speckit-planto draft an implementation plan./speckit-checklist(recommended for a foundation feature) to generate quality gates./speckit-tasksto break the plan into actionable tasks./speckit-analyzeto cross-check consistency.- Review gate.
/speckit-implement— execute.
Related
.specify/memory/constitution.md— the ratified principles this feature must respectcontext-v/specs/Walking-Skeleton-Pre-Flight-Decisions.md— the five substrate callscontext-v/blueprints/Spec-Kit-and-Context-V-Coexistence.md— the workflow frameworkcontext-v/blueprints/Module-Federation-Rsbuild-Dev-Loop-Gotchas.md— relevant for feature 003+ai-labs/context-v/blueprints/Per-App-Workspace-Conventions.md— workspace patternai-labs/context-v/explorations/Remote-Mount-Contract-for-In-App-Agent.md— adapter contractmemopop-ai/apps/memopop-native/src/lib/stores/flow.svelte.ts— canonical Svelte 5 reference