For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
Goal: Finish the remaining shared interaction-layer work by wiring create_book and export_book into the shared runtime and moving Studio's create/export flows onto the same execution path.
Architecture: Keep the existing natural-language interaction path for chat/TUI/OpenClaw, but add a structured interaction entrypoint for UI-driven actions. Shared runtime tools will own create/export behavior so CLI, Studio, and external agents can reuse the same capability surface.
Tech Stack: TypeScript, Vitest, Hono, Commander, InkOS core pipeline/session tooling.
Files:
packages/core/src/__tests__/interaction-runtime.test.tspackages/core/src/__tests__/project-interaction.test.tsStep 1: Write failing tests
create_book calls a new createBook tool, binds the created book, and returns its summary text.export_book calls a new exportBook tool with format/approved-only options and returns export metadata text.create_book.Step 2: Run tests to verify they fail
Run:
pnpm --dir packages/core exec vitest run \
src/__tests__/interaction-runtime.test.ts \
src/__tests__/project-interaction.test.ts
Expected: failing tests due to missing runtime tool methods / structured request helper.
Files:
packages/core/src/interaction/intents.tspackages/core/src/interaction/runtime.tspackages/core/src/interaction/project-control.tspackages/core/src/interaction/project-tools.tsStep 1: Extend interaction request/runtime contracts
titlegenreplatformchapterWordCounttargetChaptersformatapprovedOnlyoutputPathcreateBookexportBookStep 2: Implement structured project interaction helper
processProjectInteractionRequest(...) alongside the existing natural-language helper.activeBookIdrunInteractionRequestStep 3: Implement create/export tool behavior
createBook:
PipelineRunner.initBookresponseTextexportBook:
Step 4: Run tests
Run:
pnpm --dir packages/core exec vitest run \
src/__tests__/interaction-runtime.test.ts \
src/__tests__/project-interaction.test.ts
Expected: PASS.
Files:
packages/core/src/interaction/nl-router.tspackages/core/src/__tests__/interaction-nl-router.test.tspackages/cli/src/__tests__/interact-command.test.tsStep 1: Write failing tests
/new <title>/export/export mdStep 2: Implement minimal routing
create_book / export_book.Step 3: Run tests
Run:
pnpm --dir packages/core exec vitest run src/__tests__/interaction-nl-router.test.ts
pnpm --dir packages/cli exec vitest run src/__tests__/interact-command.test.ts
Expected: PASS.
Files:
packages/studio/src/api/server.tspackages/studio/src/api/server.test.tsStep 1: Write failing tests
/api/books/create routes through shared structured interaction execution/api/books/:id/export-save routes through shared structured interaction executionStep 2: Implement endpoint changes
initBook / custom export-save logic with calls to the shared structured helper.Step 3: Run tests
Run:
pnpm --dir packages/studio exec vitest run src/api/server.test.ts
Expected: PASS.
Files:
Step 1: Run focused test/build suite
pnpm --dir packages/core exec vitest run \
src/__tests__/interaction-runtime.test.ts \
src/__tests__/project-interaction.test.ts \
src/__tests__/interaction-nl-router.test.ts
pnpm --dir packages/cli exec vitest run src/__tests__/interact-command.test.ts
pnpm --dir packages/studio exec vitest run src/api/server.test.ts
pnpm --dir packages/core run build
pnpm --dir packages/cli run build
pnpm --dir packages/studio run build
Expected: all green.
Step 2: Commit
git add packages/core/src/interaction packages/core/src/__tests__ \
packages/cli/src/__tests__/interact-command.test.ts \
packages/studio/src/api/server.ts packages/studio/src/api/server.test.ts \
docs/plans/2026-04-10-interaction-create-export-runtime.md
git commit -m "feat(interaction): add shared create and export flows"