# Interaction Create/Export Runtime Implementation Plan > **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. --- ### Task 1: Add failing core tests for create/export runtime behavior **Files:** - Modify: `packages/core/src/__tests__/interaction-runtime.test.ts` - Modify: `packages/core/src/__tests__/project-interaction.test.ts` **Step 1: Write failing tests** - Add a runtime test proving `create_book` calls a new `createBook` tool, binds the created book, and returns its summary text. - Add a runtime test proving `export_book` calls a new `exportBook` tool with format/approved-only options and returns export metadata text. - Add a project-control test proving structured interaction requests persist session updates for `create_book`. **Step 2: Run tests to verify they fail** Run: ```bash 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. ### Task 2: Implement shared create/export runtime support **Files:** - Modify: `packages/core/src/interaction/intents.ts` - Modify: `packages/core/src/interaction/runtime.ts` - Modify: `packages/core/src/interaction/project-control.ts` - Modify: `packages/core/src/interaction/project-tools.ts` **Step 1: Extend interaction request/runtime contracts** - Add structured fields for create/export: - `title` - `genre` - `platform` - `chapterWordCount` - `targetChapters` - `format` - `approvedOnly` - `outputPath` - Add runtime tool methods: - `createBook` - `exportBook` **Step 2: Implement structured project interaction helper** - Add `processProjectInteractionRequest(...)` alongside the existing natural-language helper. - It should: - load session - optionally bind `activeBookId` - execute `runInteractionRequest` - persist the updated session **Step 3: Implement create/export tool behavior** - `createBook`: - derive a book config - call `PipelineRunner.initBook` - return interaction metadata with `responseText` - `exportBook`: - centralize the existing CLI export logic into the shared tool - return output path / exported chapter count in interaction metadata **Step 4: Run tests** Run: ```bash pnpm --dir packages/core exec vitest run \ src/__tests__/interaction-runtime.test.ts \ src/__tests__/project-interaction.test.ts ``` Expected: PASS. ### Task 3: Add CLI routing/tests for shared create/export **Files:** - Modify: `packages/core/src/interaction/nl-router.ts` - Modify: `packages/core/src/__tests__/interaction-nl-router.test.ts` - Modify: `packages/cli/src/__tests__/interact-command.test.ts` **Step 1: Write failing tests** - Add NL routing coverage for: - `/new