Skip to content

feat(engine): workflow-adopt + workflow-sync — template-based workflow lifecycle#120

Closed
iamcxa wants to merge 4 commits into
spacedock-dev:mainfrom
iamcxa:feat/workflow-adopt-sync
Closed

feat(engine): workflow-adopt + workflow-sync — template-based workflow lifecycle#120
iamcxa wants to merge 4 commits into
spacedock-dev:mainfrom
iamcxa:feat/workflow-adopt-sync

Conversation

@iamcxa
Copy link
Copy Markdown
Contributor

@iamcxa iamcxa commented Apr 17, 2026

Problem

When a workflow plugin (e.g., ship-flow, spacedock-workflow) ships a workflow-template.yaml with pre-configured stages, there's no engine-level mechanism to:

  1. Discover installed workflow templates and bootstrap a project with one
  2. Sync an existing project's workflow README when the plugin template evolves

Users must manually run /spacedock:commission and re-enter all stage definitions, or hand-edit the README when templates update.

Solution: Two new engine skills

workflow-adopt — First-time bootstrap from plugin template

/spacedock:workflow-adopt [template-name] [--dir path]
  1. Detects existing workflow (stops if found)
  2. Scans ~/.claude/plugins/cache for workflow-template.yaml files
  3. Presents available templates to captain
  4. Invokes spacedock:commission in batch mode with template's stages, entity type, gates, and skill bindings

workflow-sync — Template drift detection + update

/spacedock:workflow-sync [workflow-dir]
  1. Finds the project's workflow README
  2. Identifies source plugin from skill: namespaces in stages
  3. Diffs README stages vs plugin's workflow-template.yaml
  4. Reports drift: new stages, changed skill bindings, property changes
  5. Captain accepts/rejects each change individually
  6. Never auto-removes stages (may be project customizations)

Design principles

  • Engine is template-agnostic. These skills discover any workflow-template.yaml from any installed plugin. No coupling to specific workflow plugins.
  • Pair pattern. adopt = first-time, sync = ongoing. Like commission + refit but for workflow template evolution, not engine version upgrades.
  • Commission batch mode. adopt delegates to commission via its existing batch mode — no commission changes needed (skill: support is in a separate PR feat(engine): stage skill: property — programmatic plugin skill binding #119).

Bug fix included

find command for workflow detection excludes node_modules/, .git/, vendor/ to prevent false negatives in projects with vendored directories (found via smoke test in a Next.js project with 131+ README.md files in node_modules).

Files

  • skills/workflow-adopt/SKILL.md — 75 lines
  • skills/workflow-sync/SKILL.md — 100 lines

Depends on

#119 (stage skill: binding) — workflow-adopt passes skill: fields to commission, which needs #119 to write them correctly into the README.

iamcxa added 4 commits April 18, 2026 00:12
…aml from installed plugins

Scans installed plugins for workflow-template.yaml files, presents
available templates to captain, then invokes spacedock:commission
in batch mode with the template's pre-configured stages.

Each workflow plugin ships its own template; the engine handles
discovery and routing. Zero coupling to any specific workflow.
adopt: discovers workflow-template.yaml from installed plugins,
  routes to commission in batch mode. Args: [template-name] [--dir path]

sync: diffs project README vs plugin template, reports drift,
  applies captain-approved updates. Args: [workflow-dir]

Pair replaces the old setup skill. adopt handles first-time bootstrap,
sync handles ongoing template evolution. Neither is tied to engine
version upgrades (that's refit's job).
…tion

find -exec grep exits with the last grep's exit code, which is 1
when the last file doesn't match. In projects with node_modules/
(131+ README.md files), this silently misses the actual workflow
README. Exclude vendored dirs to fix false-negative detection.

Found via smoke test in spacedock-ui project.
Clearer naming: these are workflow operations, distinct from
engine operations (commission, refit). Updated frontmatter name
fields and cross-references.
@iamcxa
Copy link
Copy Markdown
Contributor Author

iamcxa commented Apr 18, 2026

Reference: ship-flow — a working installable workflow built on this PR

ship-flow is a production workflow plugin that demonstrates the full template lifecycle this PR enables:

What it is: A ship-focused pipeline where captain SHARPs once, then agents autonomously plan → execute → verify → ship. One human gate, rest is autonomous.

Stages: draft → sharp (gate, manual) → plan → execute → verify (gate, feedback-to: execute) → ship → done (terminal)

Key files:

  • workflow-template.yaml — the template that workflow-adopt discovers and bootstraps from
  • plugin.json — plugin metadata
  • skills/ — per-stage skill bindings (ship-sharp, ship-plan, ship-execute, ship-verify, ship-review)

How it works with this PR:

# Install the plugin
claude plugin marketplace add https://github.com/iamcxa/spacedock-ui.git
claude plugin install ship-flow@spacedock-ui --scope project

# Bootstrap a workflow from the template (uses workflow-adopt from this PR)
/spacedock:workflow-adopt ship-flow

# Start shipping
/ship-flow:ship-sharp my-feature
# → agents take over from here

Battle-tested: 10+ entities shipped through this pipeline, including entity 009 (War Room redesign) and entity 011 (visual polish) — full autonomous plan→execute→verify→ship with real code changes.

@iamcxa
Copy link
Copy Markdown
Contributor Author

iamcxa commented Apr 20, 2026

Re-audited this PR's scope per your feedback on other PRs in this batch:

  • Commits: 4 (841e6608 adopt→workflow-adopt rename, 5c999b1c exclude node_modules/.git/vendor, 5ec2ebd7 setup→adopt + sync, 98d398af generic setup skill)
  • Files: skills/{setup,adopt,sync,workflow-adopt,workflow-sync}/SKILL.md
  • All 4 commits form one coherent rename + extraction; no infrastructure noise from other feature branches.

Ready for review when you get a chance. #134 and #135 have now been rebased independently (each containing only their claimed scope). #130 still pending a separate scope decision (your suggestion to move it to its own skill).

@clkao
Copy link
Copy Markdown
Collaborator

clkao commented Jun 2, 2026

not sure if this is still needed. you can ask commission to reference another workflow directly

@clkao clkao closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants