sliceloop
v0.1.1
Published
SliceLoop — turn a refined PRD's atomic slices into a work queue an AI coding agent can drive over MCP. `npx sliceloop` runs a local-first server (web UI + MCP) against a project-local SQLite file.
Maintainers
Readme
SliceLoop
Turn a refined PRD's atomic slices into a work queue an AI coding agent can drive — over MCP.
Published to npm as
sliceloop(run withnpx sliceloop). The MCP server it registers is namedkopyand its local state lives in.kopy/— those internal identifiers are unchanged.
SliceLoop is a PRD refiner (a Nuxt/Nitro app) with a second surface: an MCP server that exposes each PRD's atomic slices — their issues, tests, and decisions — as work orders. An external coding agent (e.g. Claude Code) reads a slice, does the work in your repo, and reports progress back through the same journal-disciplined mutation door the UI uses. The agent's trail lands on the very board you refine PRDs on.
Local-first: npx sliceloop runs the server (web UI and MCP) against a project-local
SQLite file. Hosting (Cloudflare D1 + per-workspace auth) is designed and on the roadmap.
Quick start (local)
# in the repo your coding agent works in
npx sliceloop init # scaffolds .kopy/config.json, a package.json script, and .mcp.json
npx sliceloop # boots the server: web UI + MCP at http://localhost:3737init writes an .mcp.json entry so Claude Code auto-discovers kopy. Or register manually:
claude mcp add --transport http kopy http://localhost:3737/mcp/<workspaceId>
claude mcp list # → kopy: http://localhost:3737/mcp/<workspaceId> (HTTP) - ✓ ConnectedThen, in a new Claude Code session (MCP servers load at session start):
“list my kopy slices” · “show slice
<id>” · “mark issue<id>done” · “flip test<id>to passing”
The MCP surface
Read
| Tool | What it returns |
|------|-----------------|
| list_slices | The workspace backlog (cross-PRD). Filter by status / priority / blocked; lean rows with issue & test rollups. |
| get_slice | One slice's full contract — the work order: ships narrative, issues, tests, decisions, recent events. |
Report progress — each call appends exactly one agent-attributed event to the slice's trail:
| Tool | Effect |
|------|--------|
| mark_issue_done | Mark a slice issue done (or reopen with done:false). |
| mark_test_passing | Flip a test to pass (or reset with passing:false). |
| set_slice_status | Advance backlog → in_progress → in_review. shipped is human-only. |
| flag_blocked | Flag or clear a slice's blocked state. |
| record_decision | Record a decision (e.g. discovered scope for you to slice later). |
Guarantees
- Workspace-scoped, no existence leak — tools only touch slices in the connected workspace; a foreign or unknown id returns an indistinguishable
Slice not found. - Report-only — the agent never creates slices/issues/tests. Discovered scope becomes a
record_decision/flag_blockednote you turn into new slices in the refiner. - Ship gate — the agent can take a slice to
in_review; a human ships it.
Configuration — .kopy/
// .kopy/config.json (committed — shared wiring)
{ "endpoint": "http://localhost:3737", "port": 3737, "workspaceId": "<uuid>" }- The MCP URL is
${endpoint}/mcp/${workspaceId}. Point several repos at the same{ endpoint, workspaceId }to share one backlog. .kopy/config.jsonis committed;.kopy/db.sqliteis gitignored (local state).- Override the DB path with the
PRD_REFINER_DBenv var.
How it fits together
- One store, two surfaces. The web app refines a PRD → its Scope resolves → slices materialize → the MCP exposes them → the agent's reports show on the same board.
- Backend seam. Local = a
node:sqlitefile; hosted = Cloudflare D1. The switch lives at a single point (getCfEnv), so domain code is backend-agnostic. - Transport. MCP Streamable HTTP via the web-standard transport — the same route runs
on Node (
npx sliceloop) and, later, Cloudflare Workers.
Design record: .scratch/prd-refiner/MCP-FLOW.md.
Build tickets: .scratch/prd-refiner/issues/21–26.
Caveats
- A web MCP is reachable only while the server runs. Keep
npx sliceloopup — MCP clients auto-start stdio servers but not HTTP ones. - Hosting is not built yet. Multi-tenant D1, per-workspace bearer-token auth, and
Workers session affinity are designed but deferred — see
issues/26.
Development
npm run dev # Nuxt dev (Cloudflare / miniflare bindings)
npm test # vitest
npm run typecheck # nuxt typecheck
npm run db:migrate:local # apply D1 migrations to the local (miniflare) DBStatus: local-first MCP is implemented and verified (unit tests + a live end-to-end
against the running route: initialize/SSE, tools/list, list_slices, ship-gate
rejection). Hosting is the next phase.
