WORKBENCH_MVP_PLAN

Galaxy Tool Util Studio — MVP Plan

Overview

New package @galaxy-tool-util/studio — a Vue 3 web app for browsing, validating, and cleaning Galaxy workflow files in a local directory. Operations run client-side in the browser (importing schema/core). A thin Fastify server handles filesystem I/O and git integration.

Concurrent with studio creation: rename packages/serverpackages/tool-cache-proxy (@galaxy-tool-util/tool-cache-proxy).

Decisions Made

DecisionChoiceRationale
FrontendVue 3 + Vite + PrimeVue (unstyled) + ShikiUser preference; PrimeVue unstyled allows custom theming
OperationsClient-side in browserValidate/clean/normalize/convert are pure TS functions in schema/core; no server roundtrip needed
ServerFastify sidecarOnly for fs read/write + git ops; Fastify has native TS support, fast
Gitsimple-gitWraps git CLI; galaxy-workflows-vscode uses VSCode git API (not transferable); simple-git is clean and full-featured
Syntax highlightingShikiFile viewer + diff views
File editingWrite-back with git awarenessShow git status/diff context, require confirmation before writes
AudienceCommunity toolClean UX, configurable, installable via npx/pnpm dlx
Proxy rename@galaxy-tool-util/tool-cache-proxyDescriptive; stays separate from studio

Architecture

Browser (Vue 3 + PrimeVue unstyled + Shiki)
  ├── imports @galaxy-tool-util/schema  — validate, clean, normalize, convert
  ├── imports @galaxy-tool-util/core    — ParsedTool model, cache types
  └── fetches from Fastify server:
        ├── GET    /api/files              — directory tree (.ga, .gxwf.yml)
        ├── GET    /api/files/:path        — file contents (raw text)
        ├── PUT    /api/files/:path        — write-back (with body)
        ├── GET    /api/git/status         — repo-level git status
        └── GET    /api/git/diff/:path     — per-file git diff

Dev workflow: Vite dev server on :5173 with HMR, proxies /api/* to Fastify on :3001. In prod, Fastify serves built Vue assets from dist/ and API routes — single process via npx @galaxy-tool-util/studio ./my-workflows/.


Step 1: Rename packages/serverpackages/tool-cache-proxy

Step 2: Scaffold packages/studio

Create packages/studio/ with:

packages/studio/
├── package.json          — @galaxy-tool-util/studio
├── tsconfig.json
├── tsconfig.node.json    — for server-side TS (Fastify)
├── vite.config.ts
├── vitest.config.ts
├── index.html
├── src/
│   ├── client/           — Vue app
│   │   ├── main.ts
│   │   ├── App.vue
│   │   ├── components/
│   │   └── composables/
│   └── server/           — Fastify server
│       ├── index.ts      — entry point, CLI arg parsing
│       ├── routes/
│       │   ├── files.ts  — directory listing + read/write
│       │   └── git.ts    — git status/diff
│       └── static.ts     — serve built Vue assets in prod
├── bin/
│   └── galaxy-tool-studio.ts  — bin entry
└── test/

Dependencies:

Step 3: Fastify Server — File System Routes

Implement src/server/routes/files.ts:

Step 4: Fastify Server — Git Routes

Implement src/server/routes/git.ts using simple-git:

Step 5: Vue App Shell + File Browser

Implement the app shell in src/client/:

Step 6: Shiki File Viewer

Implement YAML viewer in main panel:

Step 7: Client-Side Validate Operation

Wire up validation in the browser:

Step 8: Client-Side Clean Operation

Wire up cleaning:

Step 9: Diff Preview Component

Reusable diff component for all mutating operations:

Step 10: CLI Entry Point + Prod Serving

Implement bin/galaxy-tool-studio.ts:

Usage: galaxy-tool-studio [options] <directory>

Options:
  -p, --port <port>   Server port (default: 3456)
  -h, --host <host>   Server host (default: 127.0.0.1)
  --open              Open browser on start

Step 11: Integration Tests


Post-MVP (Not in Scope)

Unresolved Questions

  1. PrimeVue unstyled theme — Tailwind-based preset or hand-rolled CSS?
  2. Bundle strategy for schema/core in browser — tree-shaking Effect? It’s large; may need to measure bundle size and decide if we need to split or lazy-load.
  3. Shiki grammar — stock YAML sufficient or custom Galaxy workflow TextMate grammar for richer highlighting (e.g., tool_id references, $link markers)?
  4. Install story — npx @galaxy-tool-util/studio ./dir or pnpm dlx? Need to test both work with the dual client/server build.