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
- User comments
/revise <feedback text> on the issue
- Leonidas runs in
mode: "revise"
- Claude reads existing plan comment + user feedback
- 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
Problem Statement
When a plan doesn't meet expectations, users must remove and re-add the
leonidaslabel 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
/revisecommand that lets users provide feedback on the plan. Claude reads the existing plan +user feedback and updates the plan comment in-place.
Workflow
/revise <feedback text>on the issuemode: "revise"Technical Approach
New files:
src/prompts/revise.ts— Revise prompt builderFiles to modify:
src/types.ts— Add"revise"toLeonidasMode, addcomment_body: stringtoGitHubContextsrc/main.ts— AddhandleReviseMode(), extendreadGitHubContext()to readevent.comment.body, extendisValidLeonidasMode()src/github.ts— AddfindPlanCommentWithId()(returns{ body: string; id: number } | null), addupdateComment(commentId, body)src/i18n.ts— Add keys:revise_starting,revise_no_plansrc/comment_builder.ts— AddbuildFailureComment()handling for revise mode (same as plan)src/post_process_cli.ts— Extend mode validation inrunPostFailure()Security:
wrapUserContent()before prompt inclusionwrapUserContent()github.event.comment.bodyviaenv:(never inline${{ }}in bash)Constraints:
gh apifor comment editing)authorized_approverscheck as execute modeleonidas-${{ github.event.issue.number }}group with cancel-in-progressCross-cutting changes (shared with A3):
action.yml: Update mode input description, add composite step conditions for reviseifcondition to match/revise, add mode detection stepAcceptance Criteria
/revise <feedback>triggers plan revisionwrapUserContent()handleReviseMode(),findPlanCommentWithId(),updateComment(), prompt builder