Work on GitHub Issue (Guided)
Work on GitHub issue $ARGUMENTS interactively. Follow every phase in order. Do not skip phases. Proceed autonomously through routine work, but pause for user confirmation at key decision points marked with 🔲 Checkpoint.
Preflight (mandatory)
Run this first. If it exits non-zero, halt and report the stderr output to the user verbatim. Do not proceed.
uv run maverick preflight do-issue-guided
The check verifies the project is initialised and required tools (gh, git, uv) are on PATH. PR code review runs locally as the agent-code-reviewer subagent (see Phase 8); the optional CI-side re-run described in mav-bp-remote-code-review is not required.
Before You Begin
If $ARGUMENTS is empty or not a valid issue number, ask the user for the issue number before proceeding. Do not attempt any phase without it.
Entry check: run uv run maverick coord read <repo> $ARGUMENTS.
If another instance holds a live claim, or the issue carries a
blocked-by:#N label, stop and report to the user — guided mode does not
take a claim of its own, but it must not silently work an issue an
autonomous instance already owns.
State for this workflow lives in the maverick-task-progress marker on
the issue (see mav-github-issue-workflow); there is no local
state file.
Phase 1-2: Understand the Issue and Solution Design (subagent)
Run Phases 1 and 2 as a subagent to keep the main context window clean for implementation.
- Dispatch the agent-issue-analyst agent with:
- Issue number:
$ARGUMENTS - Mode:
guided
- When the agent returns, verify the design landed durably —
uv run maverick task-progress read <repo> $ARGUMENTS shows
comments.design set to a comment ID.
- If the agent flagged ambiguities, present them to the user and wait for answers before continuing.
🔲 Checkpoint — Design review: Present a brief summary of the solution design to the user. Include the key approach, main components affected, and any trade-offs. Ask the user to confirm or suggest changes before proceeding. Do not continue until the user approves.
Phase 3: Create Tasks (subagent)
Run Phase 3 as a subagent to keep the main context window clean for implementation.
- Dispatch the agent-github-issue-planner agent with:
- Issue number:
$ARGUMENTS - Design comment ID from the task-progress marker (
comments.design)
- When the agent returns, verify the tasks landed durably —
uv run maverick task-progress read <repo> $ARGUMENTS shows:
- If < 5 tasks:
comments.tasksset to a comment ID - If >= 5 tasks: sub-issues exist on the issue
- If the agent flagged scope concerns, present them to the user.
🔲 Checkpoint — Tasks review: Present the task list to the user — each task title and description, their order, and any dependencies. Ask the user to confirm, reorder, add, or remove tasks. Do not continue until the user approves.
Phase 4: Create Branch
- Derive the branch name per the mav-github-issue-workflow skill (branching conventions).
- Resolve the base branch from config:
```bash
STORY_BASE=$(uv run maverick git-workflow story-base)
```
Create the branch from $STORY_BASE.
- Record it:
uv run maverick task-progress set <repo> $ARGUMENTS branch --branch <branch>.
Phase 5: Execute Tasks
- Check for project-level skills in
docs/maverick/skills/. For each topic directory that contains aSKILL.md, read it. These project skills provide codebase-specific guidance (libraries, patterns, configuration) that supplements the best-practice skills. If none exist, continue without them.
If the tasks were created as sub-issues (>= 5 tasks):
- Read the tasks summary comment on the parent issue for the execution order
- For each sub-issue in execution order:
1. Read the sub-issue description
2. Implement the change described
3. Run verification (lint, typecheck, tests) per the mav-local-verification skill
4. Commit with a conventional commit referencing the parent issue
5. Update the tasks summary comment: mark the sub-issue as complete
6. Close the sub-issue
- After all sub-issues are complete, run the full verification suite
Otherwise (checklist tasks):
- Read the tasks comment on the issue
- For each task in order:
1. Implement the change described
2. Run verification (lint, typecheck, tests) per the mav-local-verification skill
3. Commit with a conventional commit referencing the issue number
4. Check the task off durably: uv run maverick tasks check <repo> $ARGUMENTS <n>
- After all tasks are complete, run the full verification suite
Follow the mav-plan-execution skill for the execution loop, verification discipline (including the canonical retry budget), failure handling, and crash recovery. In guided mode, it will:
- Provide brief progress checkpoints every 3-4 tasks.
- Pause and ask the user when uncertain about an implementation approach.
- Pause and discuss with the user when a design assumption proves wrong.
- Ask the user for help when a task exhausts the retry budget.
Phase 6: Documentation Review (mandatory)
This phase always runs before push. The agent decides whether any
docs work is needed; the workflow does not skip the analysis based on
its own heuristic.
- Build the diff and candidate-doc shortlist in one deterministic step:
```bash
uv run maverick docs shortlist \
--base "$(uv run maverick git-workflow story-base)" --issue $ARGUMENTS
```
The JSON output names the files it wrote (diff, shortlist,
detail) in a per-worktree directory — use those paths, not a fixed
/tmp path. Candidates come from words in the diff, docs/ paths the
issue cites, and the repo's docs.shortlist_commands; owned lists
shortlisted docs that belong to a docs.owners entry. An empty
shortlist is valid — the agent is dispatched with a pre-filtered
shortlist rather than an open-ended "audit every doc" brief.
- Dispatch the agent-tech-docs-writer agent with:
- Mode:
update(perdo-docs) - Diff: the
diffpath from step 1 - Candidate docs: the contents of the
shortlistfile. If it is
empty, pass the literal string
<empty — scan only for gaps requiring new coverage>.
- Owned docs (report only, never edit): the
ownedmap, if any. - Instructions:
- Read each candidate doc. Update only sections rendered stale by
the diff; do not refactor unrelated content.
- Never edit an owned doc unless its owner entry says
editable: true. Report what is stale in it instead.
- If the diff introduces a component, subsystem, or architectural
change with no coverage anywhere in docs/, create the new
document.
- If you find a doc outside the candidate list that you
believe is impacted, **list its path in your return payload —
do not edit it.** One-pass dispatch: no widen-and-retry.
- Return three lists: docs changed, owned docs with drift (path +
what is stale), other impacted docs not edited. Returning "no doc
changes required" is a valid outcome and must be reported
explicitly.
- 🔲 Checkpoint — Review docs outcome with the user: show what was
updated or created (or the explicit no-op decision), and the drift
the agent reported but did not fix, with each path's owner from
uv run maverick docs owners <path> .... Agree with the user how to
route it: dispatch the owner's agent if one is configured, or open
a follow-up issue labelled with the owner's label (default
docs-drift). If updates are inaccurate or out of scope, push back
and ask the agent to revise.
- Commit any doc changes with a
docs:conventional commit.
Phase 7: Pre-push Security Review (mandatory, independent)
This phase always runs before push. The review is done by
agent-security-reviewer, a read-only agent with a fresh
context — not by you, because you wrote the code. It applies the
project's security checklist from docs/maverick/skills/, runs the
project's invariant checks (maverick checks run), and reviews the
changed code plus its impact set.
- Refresh the diff: re-run the
docs shortlistcommand from Phase 6
and use the diff path it prints.
- Dispatch agent-security-reviewer with:
- Mode:
diff - Diff: the
diffpath from step 1 - Base: the story base branch
- Spec: the issue title and acceptance criteria
Do not explain your design choices to it; it must reach its own
conclusions from the code.
- The verdict is the reply's final
MAVERICK_SECURITY_VERDICT: PASS|FINDINGS|BLOCKING
line. Missing or ambiguous → treat as BLOCKING.
- 🔲 Checkpoint — Review security outcome with the user: show the verdict and any findings. If BLOCKING, route back to Phase 5 (implement) to resolve the issues, then re-run this phase. If FINDINGS or PASS, confirm with the user before proceeding.
- If FINDINGS, fold the security findings into the PR description draft so they are visible to the human reviewer.
Phase 8: Code Review
The review runs after docs and security so the diff the reviewer
approves is the diff that ships — reviewing before those phases meant
their commits landed unreviewed.
- Dispatch the agent-code-reviewer agent with the issue requirements and the diff (
git diff $(uv run maverick git-workflow story-base)...HEAD). - The reviewer performs two-stage review: spec compliance first, then code quality. Its reply ends with a
MAVERICK_VERDICT: PASS|FAILmarker line — that line is the verdict. If the marker is missing or ambiguous, treat the review as FAIL; do not infer a verdict from the prose. - If spec compliance fails, stop — fix the gaps before requesting re-review.
- Process code quality feedback per the do-pullrequest-review skill:
- Read all items before acting.
- Clarify unclear items before implementing any.
- Verify each suggestion against the codebase.
- Push back with reasoning when a suggestion is incorrect.
- Implement valid fixes one at a time, verifying after each.
- If fixes changed the implementation approach, update the tasks comment on the issue.
- Request re-review if there were critical or spec compliance issues — and re-run this phase whenever review fixes produced new commits, so the approved diff stays the shipped diff. Repeat until approved.
- Checkpoint:
uv run maverick task-progress set <repo> $ARGUMENTS review.
🔲 Checkpoint — Review results: Present a summary of the review outcome to the user — what was flagged, what was fixed, and what was pushed back on. If there were significant changes during review, highlight them.
Phase 9: Push and Verify CI
- Run pre-push verification per the mav-local-verification skill (lint, typecheck, tests). Fix any failures before pushing.
- Push the branch to remote.
- Monitor CI per the mav-bp-cicd skill. If CI fails, read the failure logs, fix locally, and push again. Do not proceed until CI passes. (After the PR exists,
uv run maverick pr wait <repo> <pr-num> --checks --timeout 30mgives a bounded wait.)
Phase 10: Update Issue and Create PR
- Post a completion comment:
uv run maverick issue comment post <repo> $ARGUMENTS --kind completion --body-file <file>. - Create a pull request per the mav-github-issue-workflow skill (PR pattern — the body must carry
Closes #$ARGUMENTS). - Checkpoint:
uv run maverick task-progress set <repo> $ARGUMENTS completed
(recorded as the complete phase; worktree-isolated agents have the
bare word refused, #160).
🔲 Checkpoint — Done: Present the PR URL to the user and summarise what was delivered.
Rules
- Pause at checkpoints — every phase marked with 🔲 requires user confirmation before continuing.
- Work autonomously between checkpoints — do not ask for permission on routine implementation work. Only ask when uncertain, blocked, or at a checkpoint.
- Run verification after each task and after all tasks. Do not declare success if checks fail.
- Never commit directly to the story base branch.
- Use conventional commits that reference the issue number (e.g.,
feat: add rubric export (#42)). - Always create a PR at the end — deliver a complete result.
<!-- maverick-plugin-version: 5.3.1 -->