[PR #6965] [CLOSED] feat(workflows): expose guided workflows through CLI and MCP #7478

Closed
opened 2026-11-01 21:48:07 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6965
Author: @Deepak-Kambala
Created: 10/24/2026
Status: ❌ Closed

Base: main ← Head: feat/6918-guided-workflows


📝 Commits (1)

  • 392af8b feat(workflows): expose guided prompts through CLI and MCP

📊 Changes

15 files changed (+704 additions, -15 deletions)

View changed files

📝 docs/mcp-prompts.md (+8 -0)
➕ src/application/GuidedWorkflowAccess.test.ts (+85 -0)
➕ src/application/GuidedWorkflowAccess.ts (+121 -0)
📝 src/cli.ts (+2 -0)
➕ src/cli/guidedWorkflowCommands.ts (+67 -0)
📝 src/cliCommandNames.ts (+1 -0)
📝 src/contracts/applicationToolContracts.ts (+46 -0)
📝 src/contracts/promptContracts.ts (+63 -0)
📝 src/contracts/toolEffects.ts (+2 -0)
➕ src/guidedWorkflowCli.test.ts (+114 -0)
📝 src/server/promptArguments.ts (+5 -5)
📝 src/server/registerApplicationTools.ts (+2 -0)
➕ src/server/registerGuidedWorkflowTool.test.ts (+171 -0)
➕ src/server/registerGuidedWorkflowTool.ts (+15 -0)
📝 src/server/registerPrompts.ts (+2 -10)

📄 Description

Summary

Fixes #6918 by making REA's existing guided workflows accessible through the CLI and MCP tools for clients that cannot consume MCP prompts.

Problem and expected behavior

The guided workflows already exist as native MCP prompts, but callers limited to CLI commands or MCP tools have no way to list or render them. The new access paths list the existing workflow contracts and render the same guidance for equivalent arguments.

Change and scope

Adds rea guided-workflows and the provider-free guided_workflows MCP tool. Both use the existing prompt contracts, shared argument validation, and renderer. This adds no templates or workflow execution behavior; native prompt registration and completion remain available.

Follow the contribution scope. This is a provider-neutral usability feature that renders existing guidance; no new provider or target-interaction capability is introduced. A separate maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: existing prompt contracts in src/contracts/promptContracts.ts; provider-free list/render access in src/application/GuidedWorkflowAccess.ts.
  • Contribution scope fit and linked maintainer decision: existing guided investigation workflows, with no target execution or mutation; separate decision not applicable.
  • CLI and MCP/tool-catalog contract: adds rea guided-workflows and guided_workflows (list/render); the tool is included in the canonical catalog. Existing native prompt names and catalog identity are preserved.
  • Provider, bridge, target-format, or platform compatibility: provider-independent; no target or platform compatibility changes.
  • Evidence, artifact, provenance, or reconstruction contract: renders guidance only and creates no analysis Evidence or artifact claims.
  • Target selection, authority, upstream behavior, and cleanup details: no target selection, session acquisition, provider startup, process launch, or cleanup lifecycle. Caller context is rendered as JSON data and is not authorization.
  • Generated metadata, package, or installation impact: canonical MCP catalog changes; generated catalog output is validated by the catalog check. No new dependency or installation change.

Expected effects:

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

  • Tests added or updated: public CLI list/render and error paths; shared application list/render, validation, and provider-free behavior; MCP tool listing/rendering, native prompt equivalence and completion, invalid inputs, hostile-looking context, no analysis execution, and catalog identity.
  • Base reproduction or other evidence: feature gap from issue #6918. Tests compare rendered output against the existing native MCP prompt for equivalent inputs.
  • User-visible CLI/MCP output (if applicable): rea guided-workflows --action render --workflow-id investigate_feature --arguments-json '{"feature":"offline search"}' returns a JSON result with action, workflow_id, and rendered_prompt. MCP callers use guided_workflows with action: "list" or action: "render".
  • Remaining proof gaps: tests used Node 24.14.0 because the repository-pinned Node 24.22.1 was unavailable. No real-provider run is applicable: these access paths do not invoke providers or analyze targets.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • PATH="/usr/local/bin:$PATH" npm run test:focused -- src/guidedWorkflowCli.test.ts src/application/GuidedWorkflowAccess.test.ts src/server/registerGuidedWorkflowTool.test.ts — 14 tests passed on Node 24.14.0.
  • npm run check:fast — passed in the push hook (typecheck and lint; 2 tasks, uncached).
  • npm run mcp-catalog:check — passed during review (cached tasks).
  • git diff --check — passed.
  • Commit hooks ran oxlint --fix and oxfmt on the staged files successfully.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; no providers or targets are accessed.
  • Package or release metadata impact: new MCP catalog entry; no dependency or install changes.
  • Security, privacy, process, or containment review: rendering is local and provider-free; caller-supplied context remains data and no target, process, network, or session state is accessed or changed.

Author readiness

Human owner: @Deepak-Kambala

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6965 **Author:** [@Deepak-Kambala](https://github.com/Deepak-Kambala) **Created:** 10/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/6918-guided-workflows` --- ### 📝 Commits (1) - [`392af8b`](https://github.com/morluto/rea/commit/392af8be821752331f902d54efa4f79ef589fc9c) feat(workflows): expose guided prompts through CLI and MCP ### 📊 Changes **15 files changed** (+704 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `docs/mcp-prompts.md` (+8 -0) ➕ `src/application/GuidedWorkflowAccess.test.ts` (+85 -0) ➕ `src/application/GuidedWorkflowAccess.ts` (+121 -0) 📝 `src/cli.ts` (+2 -0) ➕ `src/cli/guidedWorkflowCommands.ts` (+67 -0) 📝 `src/cliCommandNames.ts` (+1 -0) 📝 `src/contracts/applicationToolContracts.ts` (+46 -0) 📝 `src/contracts/promptContracts.ts` (+63 -0) 📝 `src/contracts/toolEffects.ts` (+2 -0) ➕ `src/guidedWorkflowCli.test.ts` (+114 -0) 📝 `src/server/promptArguments.ts` (+5 -5) 📝 `src/server/registerApplicationTools.ts` (+2 -0) ➕ `src/server/registerGuidedWorkflowTool.test.ts` (+171 -0) ➕ `src/server/registerGuidedWorkflowTool.ts` (+15 -0) 📝 `src/server/registerPrompts.ts` (+2 -10) </details> ### 📄 Description ## Summary Fixes #6918 by making REA's existing guided workflows accessible through the CLI and MCP tools for clients that cannot consume MCP prompts. ## Problem and expected behavior The guided workflows already exist as native MCP prompts, but callers limited to CLI commands or MCP tools have no way to list or render them. The new access paths list the existing workflow contracts and render the same guidance for equivalent arguments. ## Change and scope Adds `rea guided-workflows` and the provider-free `guided_workflows` MCP tool. Both use the existing prompt contracts, shared argument validation, and renderer. This adds no templates or workflow execution behavior; native prompt registration and completion remain available. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). This is a provider-neutral usability feature that renders existing guidance; no new provider or target-interaction capability is introduced. A separate maintainer scope decision is not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: existing prompt contracts in `src/contracts/promptContracts.ts`; provider-free list/render access in `src/application/GuidedWorkflowAccess.ts`. - Contribution scope fit and linked maintainer decision: existing guided investigation workflows, with no target execution or mutation; separate decision not applicable. - CLI and MCP/tool-catalog contract: adds `rea guided-workflows` and `guided_workflows` (`list`/`render`); the tool is included in the canonical catalog. Existing native prompt names and catalog identity are preserved. - Provider, bridge, target-format, or platform compatibility: provider-independent; no target or platform compatibility changes. - Evidence, artifact, provenance, or reconstruction contract: renders guidance only and creates no analysis Evidence or artifact claims. - Target selection, authority, upstream behavior, and cleanup details: no target selection, session acquisition, provider startup, process launch, or cleanup lifecycle. Caller context is rendered as JSON data and is not authorization. - Generated metadata, package, or installation impact: canonical MCP catalog changes; generated catalog output is validated by the catalog check. No new dependency or installation change. Expected effects: - [x] Documentation or usability only; no target interaction. ## Evidence and regression coverage - Tests added or updated: public CLI list/render and error paths; shared application list/render, validation, and provider-free behavior; MCP tool listing/rendering, native prompt equivalence and completion, invalid inputs, hostile-looking context, no analysis execution, and catalog identity. - Base reproduction or other evidence: feature gap from issue #6918. Tests compare rendered output against the existing native MCP prompt for equivalent inputs. - User-visible CLI/MCP output (if applicable): `rea guided-workflows --action render --workflow-id investigate_feature --arguments-json '{"feature":"offline search"}'` returns a JSON result with `action`, `workflow_id`, and `rendered_prompt`. MCP callers use `guided_workflows` with `action: "list"` or `action: "render"`. - Remaining proof gaps: tests used Node 24.14.0 because the repository-pinned Node 24.22.1 was unavailable. No real-provider run is applicable: these access paths do not invoke providers or analyze targets. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `PATH="/usr/local/bin:$PATH" npm run test:focused -- src/guidedWorkflowCli.test.ts src/application/GuidedWorkflowAccess.test.ts src/server/registerGuidedWorkflowTool.test.ts` — 14 tests passed on Node 24.14.0. - `npm run check:fast` — passed in the push hook (typecheck and lint; 2 tasks, uncached). - `npm run mcp-catalog:check` — passed during review (cached tasks). - `git diff --check` — passed. - Commit hooks ran `oxlint --fix` and `oxfmt` on the staged files successfully. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable; no providers or targets are accessed. - Package or release metadata impact: new MCP catalog entry; no dependency or install changes. - Security, privacy, process, or containment review: rendering is local and provider-free; caller-supplied context remains data and no target, process, network, or session state is accessed or changed. ## Author readiness Human owner: @Deepak-Kambala - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:48:07 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7478
No description provided.