feat(cli): add plan prompt command #830

Closed
opened 2026-03-13 20:15:28 +00:00 by freemo · 1 comment
Owner

Metadata

  • Commit Message: feat(cli): add plan prompt command
  • Branch: feature/cli-plan-prompt
  • Type: Feature
  • Priority: Medium
  • MoSCoW: Should have
  • Points: 3
  • Milestone: v3.6.0

Background and Context

The specification defines 15 plan subcommands. Currently, 14 are implemented in src/cleveragents/cli/commands/plan.py:

create, list, show, status, tree, explain, validate, apply, correct, rollback, checkpoint, diff, context, subplan

The missing command is plan prompt, which the specification defines as displaying the assembled LLM prompt that would be sent for the current plan phase. This is a debugging/transparency tool that lets users inspect exactly what context and instructions the system would send to the LLM before executing.

Acceptance Criteria

  • agents plan prompt <plan-id> displays the fully assembled LLM prompt for the plan's current phase
  • Prompt includes: system instructions, ACMS context fragments, plan definition of done, action context, tool descriptions
  • Output uses the output rendering framework (handle → materializer → format selection)
  • Supports --phase flag to preview prompts for phases other than current
  • Supports --format flag (text, json, yaml) for structured output
  • Returns appropriate error if plan has no active session or no context assembled

Definition of Done

This issue is complete when:

  • All subtasks below are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Subtasks

  • Add plan prompt command to CLI with Click decorator and help text
  • Implement prompt assembly by calling ACMS pipeline for the plan's current context
  • Add --phase flag for previewing non-current phase prompts
  • Add --format flag with text/json/yaml output modes
  • Wire output through rendering framework (handle + materializer)
  • Tests (Behave): Add scenarios for plan prompt display
  • Tests (Robot): Add integration test for plan prompt output format
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors
## Metadata - **Commit Message**: `feat(cli): add plan prompt command` - **Branch**: `feature/cli-plan-prompt` - **Type**: Feature - **Priority**: Medium - **MoSCoW**: Should have - **Points**: 3 - **Milestone**: v3.6.0 ## Background and Context The specification defines 15 `plan` subcommands. Currently, 14 are implemented in `src/cleveragents/cli/commands/plan.py`: `create`, `list`, `show`, `status`, `tree`, `explain`, `validate`, `apply`, `correct`, `rollback`, `checkpoint`, `diff`, `context`, `subplan` The missing command is `plan prompt`, which the specification defines as displaying the assembled LLM prompt that would be sent for the current plan phase. This is a debugging/transparency tool that lets users inspect exactly what context and instructions the system would send to the LLM before executing. ## Acceptance Criteria - [ ] `agents plan prompt <plan-id>` displays the fully assembled LLM prompt for the plan's current phase - [ ] Prompt includes: system instructions, ACMS context fragments, plan definition of done, action context, tool descriptions - [ ] Output uses the output rendering framework (handle → materializer → format selection) - [ ] Supports `--phase` flag to preview prompts for phases other than current - [ ] Supports `--format` flag (text, json, yaml) for structured output - [ ] Returns appropriate error if plan has no active session or no context assembled ## Definition of Done This issue is complete when: - All subtasks below are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. ## Subtasks - [ ] Add `plan prompt` command to CLI with Click decorator and help text - [ ] Implement prompt assembly by calling ACMS pipeline for the plan's current context - [ ] Add `--phase` flag for previewing non-current phase prompts - [ ] Add `--format` flag with text/json/yaml output modes - [ ] Wire output through rendering framework (handle + materializer) - [ ] Tests (Behave): Add scenarios for plan prompt display - [ ] Tests (Robot): Add integration test for plan prompt output format - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors
freemo added this to the v3.6.0 milestone 2026-03-13 20:20:01 +00:00
Author
Owner

Duplicate of #885.

This issue interprets plan prompt as displaying the assembled LLM prompt (a debug/inspection tool). However, the specification defines agents plan prompt <PLAN_ID> <GUIDANCE> with <GUIDANCE> as a positional argument — meaning the command sends guidance to a running plan, not displays a prompt. Issue #885 correctly captures this spec-defined behavior.

If a "display assembled LLM prompt" feature is desired as a separate debugging command (e.g., plan inspect-prompt or plan show-prompt), a new issue should be created for that distinct functionality.

Duplicate of #885. This issue interprets `plan prompt` as displaying the assembled LLM prompt (a debug/inspection tool). However, the specification defines `agents plan prompt <PLAN_ID> <GUIDANCE>` with `<GUIDANCE>` as a positional argument — meaning the command sends guidance to a running plan, not displays a prompt. Issue #885 correctly captures this spec-defined behavior. If a "display assembled LLM prompt" feature is desired as a separate debugging command (e.g., `plan inspect-prompt` or `plan show-prompt`), a new issue should be created for that distinct functionality.
freemo 2026-03-14 00:56:39 +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.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#830
No description provided.