Skip to content

[Feature]: /revise command for iterating on implementation plans #250

Description

@JeremyDev87

Problem Statement

When a plan doesn't meet expectations, users must remove and re-add the leonidas label to regenerate it.
There's no way to provide feedback — each regeneration starts from scratch without context about what
should change.

Proposed Solution

Add a /revise command that lets users provide feedback on the plan. Claude reads the existing plan +
user feedback and updates the plan comment in-place.

Workflow

  1. User comments /revise <feedback text> on the issue
  2. Leonidas runs in mode: "revise"
  3. Claude reads existing plan comment + user feedback
  4. Claude edits the existing plan comment (not a new comment) with changes marked as [revised]

Technical Approach

New files:

  • src/prompts/revise.ts — Revise prompt builder

Files to modify:

  • src/types.ts — Add "revise" to LeonidasMode, add comment_body: string to GitHubContext
  • src/main.ts — Add handleReviseMode(), extend readGitHubContext() to read event.comment.body, extend isValidLeonidasMode()
  • src/github.ts — Add findPlanCommentWithId() (returns { body: string; id: number } | null), add updateComment(commentId, body)
  • src/i18n.ts — Add keys: revise_starting, revise_no_plan
  • src/comment_builder.ts — Add buildFailureComment() handling for revise mode (same as plan)
  • src/post_process_cli.ts — Extend mode validation in runPostFailure()

Security:

  • User feedback text MUST be wrapped with wrapUserContent() before prompt inclusion
  • Plan comment MUST also be wrapped with wrapUserContent()
  • Workflow YAML: pass github.event.comment.body via env: (never inline ${{ }} in bash)

Constraints:

  • allowed_tools: Same as plan mode (read-only + gh api for comment editing)
  • Max turns: 10
  • Authorization: Same authorized_approvers check as execute mode
  • Concurrency: leonidas-${{ github.event.issue.number }} group with cancel-in-progress

Cross-cutting changes (shared with A3):

  • action.yml: Update mode input description, add composite step conditions for revise
  • Workflow YAML: Extend if condition to match /revise, add mode detection step

Acceptance Criteria

  • /revise <feedback> triggers plan revision
  • Existing plan comment is edited in-place (not a new comment)
  • Changed steps are marked with [revised]
  • Authorization check applied
  • User feedback is sanitized with wrapUserContent()
  • Error comment posted when no plan exists
  • Tests cover handleReviseMode(), findPlanCommentWithId(), updateComment(), prompt builder

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestleonidasTrigger Leonidas automation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions