feat(dynamic): add devflow-dynamic plugin — MDS-composed dynamic workflow recipes#242
Merged
Conversation
Dream-Task: knowledge Dream-Session: bec47322-36b6-42ad-8fe7-b83592137071 Co-Authored-By: Devflow Dream <dream@devflow.local>
…olchain Introduces the `devflow-dynamic` plugin (opt-in) and the MDS-based build toolchain that compiles shared/recipes/*.mds partials into installable Claude Code command files at build time. Phase A delivers: - shared/recipes/ — 6 partials (_preamble, _roster, _engine, _plan_contract, _ticket_template, _wave) encoding the full single-ticket engine spine (§7), wave doctrine (§8–§11), evaluator panel (§12), agent roster, and authoring preamble; all @exported for selective import by Phase B commands - shared/recipes/dynamic-build.mds — the /devflow:dynamic-build command recipe (SINGLE + WAVE modes, full engine + wave blocks inlined via @import) - scripts/build-recipes.ts — MDS compiler invocation (build plumbing only; globs shared/recipes/*.mds, skips partials, hard-fails on mds::* errors, writes to plugins/devflow-dynamic/commands/) - plugins/devflow-dynamic/.claude-plugin/plugin.json — plugin manifest (11 shared agents + 4 skills, rules: []) - src/cli/plugins.ts — DEVFLOW_PLUGINS entry for devflow-dynamic - package.json — build:recipes script + chained into build - .gitignore — plugins/devflow-dynamic/commands/ excluded (generated) build exits 0; npm run build produces dynamic-build.md; devflow init --plugin devflow-dynamic --recommended installs the command and agents. Applies ADR-008 (LLM-vs-plumbing: zero deterministic feature code authored).
…ynamic-profile, dynamic-wave + _factory partial Completes the devflow-dynamic plugin with 4 remaining commands and one new partial: - dynamic-tickets: generalized ticket-factory pipeline (draft to 2-lens review to revise to cross-critic to amend to tracking-issue) - dynamic-plan: parallel planning + plan-challenge (§5.1 verbatim intent) + acceptance criteria contract + preference-profile auto-resolution + DECISIONS-NEEDED.md - dynamic-profile: decision-preference distiller mining past sessions via bounded grep+sample; writes ~/.devflow/preference-profile.md - dynamic-wave: thin human-gated driver sequencing tickets→plan→build with AskUserQuestion gates between runs (F4 compliant) - _factory.mds: factory_shape() partial generalizing the ticket-factory.js pipeline with DRAFT/REVIEW/REVISE/CRITIC schemas All 5 commands compile clean; no leaked MDS directives; no AskUserQuestion inside workflow scripts; all agentTypes from valid 11-agent roster; never auto-merges to main. Applies ADR-008.
- dynamic-plan.mds: remove duplicated "### Acceptance criteria + test plan
contract" heading (recipe emitted its own heading + intro immediately before
the _plan_contract partial re-emitted the same heading)
- dynamic-plan.mds: maintenance note interpolated the FULL contract macro inline
mid-sentence; replace {acceptance_criteria_contract()} with a literal
section-name reference so it stays a cross-reference, not an expansion
- build-recipes.ts: add main().catch() so non-compile errors (init/readdir
failure) hard-fail cleanly with a message instead of an unhandled rejection
Dream-Task: decisions Dream-Session: 2ce4cd2d-f535-4f49-af2f-05e2672630e4 Co-Authored-By: Devflow Dream <dream@devflow.local>
Dream-Task: knowledge Dream-Session: c822d576-bb7e-44dc-b28f-6f1f33bc6b7c Co-Authored-By: Devflow Dream <dream@devflow.local>
Owner
Author
Review Findings SummaryReview of PR #242 (feat/dynamic-workflow-recipes) | 11 reviewer reports analyzed. Blocking Issues (≥80% confidence)1. Missing marketplace.json entry — CRITICAL (97%)
2. Node engine floor mismatch — HIGH (88%)
3. Build script idempotency — HIGH (90%)
Should-Fix Issues (≥80%, merge-scoped)4. Stale README count (95%)
5. Consistency: "(optional)" divergence (88%)
6. Garbled timestamp note (90%)
7. Ambiguous DECISIONS-NEEDED path (85%)
Additional Notes
Recommendation: Merge only after addressing the 3 CRITICAL/HIGH blocking items (marketplace, node engine, idempotency). Issues 4-7 should be fixed while here as polish. Claude Code | devflow code-review (reliability, architecture, security, testing, documentation, consistency, dependencies, performance, complexity, typescript, regression) |
Address findings from the 11-reviewer code review (2026-06-12_1148):
- marketplace.json: add missing devflow-dynamic entry. Without it the
native `claude plugin install` path fails and silently downgrades the
whole session to file-copy install (regression + documentation, blocking)
- build-recipes.ts: clean OUTPUT_DIR of stale *.md before writing
(idempotency, mirrors build-plugins.ts) + assert output dir writable so
I/O errors aren't misreported as MDS compile errors (reliability)
- package.json / ci.yml: @mdscript/mds requires node>=22 — bump
engines.node to >=22, narrow CI matrix to node 22 (matches release
pipeline), exact-pin @mdscript/mds@0.2.0 (dependencies).
NOTE: drops node 18/20 from CI + engines floor.
- recipes: fix dynamic-plan F4 gate-skip (use OUTDIR-scoped
DECISIONS-NEEDED path), bound dynamic-build verification to a 3-agent
majority panel per ADR-020 (was unbounded per-finding fan-out), clarify
dynamic-tickets timestamp prose, add large-wave batching + untrusted-
input notes
- plugins.ts / plugin.json: drop redundant "(optional)" suffix, normalize
description separator (consistency)
- docs: README + release-process plugin count 21->22; register
.devflow/docs/{tickets,waves}/ roots in CLAUDE.md + docs-framework skill
- tests: add build-recipes exit-code/compile coverage,
declared-commands<->recipe-sources parity, and
marketplace.json<->DEVFLOW_PLUGINS parity (the test that would have
caught the missing marketplace entry)
Build green; 1824 tests pass.
The engine floor moved to node>=22 (dropping 18/20). Bump @types/node from ^20 to ^22 so dev type definitions match the runtime. tsc typecheck + full build green, 1824 tests pass under node 22.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
devflow-dynamic— a new opt-in plugin shipping 5 dynamic workflow recipe commands that teach the main model to author and run Claude Code dynamic Workflows (theWorkflowtool) at runtime, reusing devflow's existing agents viaagentType. It layers a tickets → plan → build → merge delivery pipeline on top of devflow's existing commands. Additive — nothing is replaced.Implements the design at
.devflow/docs/design/dynamic-workflow-recipes.2026-06-10_2347.md.Commands (all opt-in via
--plugin devflow-dynamic)/devflow:dynamic-tickets— generalized ticket-factory: initiative/spec → reviewed, wave-structured ticket slate + tracking issue/devflow:dynamic-plan— parallel wave planning + plan-challenge gate → per-ticket plans with acceptance criteria + test plan, oneDECISIONS-NEEDED.md; surfaces open decisions via AskUserQuestion at the command boundary/devflow:dynamic-build— single-ticket or dependency-ordered wave engine (implement → review → resolve → merge), Gate 1 after every code write + Gate 2 once at acceptance; never auto-merges to main/devflow:dynamic-profile— mines past sessions across all projects → prose~/.devflow/preference-profile.md/devflow:dynamic-wave— thin driver that sequences tickets→plan→build with human gates between runsArchitecture — MDS build-time composition
Recipes are authored as
.mds(mdscript) partials inshared/recipes/and composed at build time into self-contained command.mdfiles viascripts/build-recipes.ts(compiled output is gitignored, mirroring theshared/skills/→plugins/*/skills/precedent). Each command@imports only the@definedoctrine blocks it needs; the shared_plan_contractblock is imported by bothdynamic-plan(produces) anddynamic-buildGate 2 (consumes) → single source, no drift.Iron Rule (ADR-008): zero deterministic feature code. The only new executable is
scripts/build-recipes.ts— a markdown-compiler invocation that hard-fails the build on any MDS error. All issue-reading, dependency-reasoning, scheduling, and cycle-count is LLM judgment at runtime, performed by the workflow's agents.Changes
shared/recipes/(7 partials + 5 command sources),scripts/build-recipes.ts,plugins/devflow-dynamic/.claude-plugin/plugin.jsonsrc/cli/plugins.ts(DEVFLOW_PLUGINS entry + WORKFLOW_ORDER),package.json(build:recipeschained intobuild;@mdscript/mds@0.2.0devDep),.gitignore,CLAUDE.md(22 plugins),tests/plugins.test.ts+tests/skill-references.test.ts(register the new plugin/commands in the tests' known-good sets)Verification
npm run buildgreen (compiles all 5 commands);npm test1810 passed / 0 failedmds::undefined_var, exit 1; circular import → build fails)_plan_contract.mdsappears in bothdynamic-plan.mdanddynamic-build.md)init --plugin devflow-dynamicinstalls 5 commands + 11 agents; scoped uninstall removes them)AskUserQuestioninside workflow scripts, nomodel:+agentType, only roster agentTypes, no merge target ofmain/masterNotes
scripts/build-recipes.tshad an equivalent manual security review (noexec/child_process/eval;path.basenameprevents output-path traversal; no secrets; build-time only). Runsnyk auth+ a code scan on it in an interactive session if a Snyk gate is required..jscache and adevflow workflowsfeature toggle (plugin selection is the toggle).🤖 Generated with Claude Code