Mav github issue workflow

From thermiteau/maverick · View interactive version

Mav github issue workflow is an AI agent skill from the GitHub repository thermiteau/maverick. Standard patterns for interacting with GitHub issues — reading, commenting, updating, state tracking, branching, and PR creation. Use as a dependency from workflow skills, not directly.

How to use this skill

Skill file

GitHub Issue Workflow Patterns

Reusable patterns for GitHub issue interactions. Workflow skills (e.g., do-issue-guided, do-issue-solo) reference this skill for consistent GitHub operations.

Issue State

The **maverick-task-progress marker on the GitHub issue is the single

state surface** for issue-driven work. It records the current phase, the

working branch, and the artefact comment ids — durable on GitHub, shared

across instances, written only through the CLI. There is no local state

file; anything local is a derivable cache.

Read it:

uv run maverick task-progress read <repo> <issue>

Write phase checkpoints (merge semantics — accreted fields like the

branch and comment ids survive):

uv run maverick task-progress set <repo> <issue> <phase>
uv run maverick task-progress set <repo> <issue> branch --branch feat/42-add-export
uv run maverick task-progress set <repo> <issue> tasks --has-sub-issues

Never compose or edit the marker comment by hand — the CLI owns the

schema. For marker kinds without a dedicated verb, use

uv run maverick gh-state write.

Reading an Issue

Always fetch structured JSON to get the full picture including comments.

gh issue view $ISSUE_NUMBER --json title,body,labels,assignees,milestone,comments,state

Reading Specific Fields

# Just the body
gh issue view $ISSUE_NUMBER --json body -q '.body'

# Labels as comma-separated list
gh issue view $ISSUE_NUMBER --json labels -q '[.labels[].name] | join(", ")'

Posting Artefact Comments

One comment per artefact — design, plan, tasks, completion. Post and

update them only through the CLI, which returns the comment id from

the API response (never scraped from output that may carry warnings) and

records it in the task-progress marker automatically:

# Post — body written first with the Write tool
uv run maverick issue comment post <repo> <issue> --kind design --body-file .maverick/tmp/design-<issue>.md

# Revise later — updates the same comment, keeping one artefact per kind
uv run maverick issue comment update <repo> <issue> --kind design --body-file .maverick/tmp/design-<issue>.md

Where the body comes from. Write it with the Write tool to

.maverick/tmp/<kind>-<issue>.md inside the story's own checkout, then

pass that path. A short body may instead go on stdin (--body-file -

with a heredoc), but worktree-isolated agents have long heredocs refused

as too complex to verify, so use a file for anything longer than a few

lines.

Never name a body file without its issue number, and never put it where

other stories can see it — /tmp or the session scratchpad. Stories

running in parallel have posted another story's stale design.md to

their own issue: a cross-issue disclosure, not just noise (#159). If

writing the file fails, stop; never post a file you did not just write.

Two CLI safeguards back this up. issue comment post and update

refuse a body whose first heading names only other issue numbers, so

start each body with a heading that names its issue (e.g.

## Solution design: export (#42)). They also delete a body file under

.maverick/tmp/ once it is posted, so it is never committed or reused.

Identity

The CLI posts as the Maverick GitHub App when configured, so

Maverick-generated comments are visually distinct from the human user's.

Plain gh is fine for read operations.

Failure modes:

credentials automatically. Acceptable for solo / ad-hoc use; the

fallback applies to the whole session, never per-call.

the call fails with HTTP 403. This is a setup error: stop and tell

the user to grant the permission via the GitHub App settings, then

re-run. Do not retry as the human user.

Artefact templates

Design (--kind design):

## Solution Design

### Approach
<high-level description>

### Areas Affected
- <list of packages/files>

### Key Decisions
- <architectural choices and rationale>

### Risks / Open Questions
- <anything that might complicate implementation>

---
*Posted by Claude Code*

Plan (--kind plan): numbered steps, each with Files / Change /

Verify lines.

Completion (--kind completion): branch name, summary of changes,

verification status.

Branching

Follow the mav-git-workflow skill for branch naming

conventions, base branch identification, and branch creation. After

creating the branch, record it:

uv run maverick task-progress set <repo> <issue> branch --branch "$BRANCH_NAME"

Pull Requests

Create PR Referencing the Issue

PR_TARGET=$(uv run maverick git-workflow pr-target)
git push -u origin $BRANCH

gh pr create --base "$PR_TARGET" --title "<concise title>" --body "$(cat <<PR_EOF
## Summary
<1-3 bullet points>

Closes #$ISSUE_NUMBER

## Test Plan
- [ ] <verification steps>

---
*Created by Claude Code*
PR_EOF
)"

Closes #N must appear in the PR body **and survive into the squash

commit body** — in squash-merge repos GitHub scans the commit that lands

on the default branch, not the PR description at click-time (#56).

Whether the PR body becomes the squash body depends on the repository's

squash-commit default ("PR title and description" vs "commit details");

do not rely on it. do-issue-solo re-verifies the PR body before

merging, and maverick issue close-on-merge closes the issue explicitly

either way — GitHub's keyword auto-close is a bonus, not the mechanism.

Resuming Work

When resuming work on an issue (new session, after crash, subagent

picking up), do not reconstruct state by hand — ask the CLI:

uv run maverick coord resume-point <repo> <issue>

It reads the task-progress marker, finds the PR via the recorded branch,

inspects CI and the review verdict, and returns `{next, instruction,

evidence}`. Follow the instruction. If the evidence contradicts what you

observe locally, GitHub wins — local files are a cache.

<!-- maverick-plugin-version: 5.3.1 -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.