Skip to content

feat(assign): add mgw:assign command — claim issues and update board assignment#95

Merged
snipcodeit merged 19 commits intomainfrom
issue/80-mgw-assign-command
Mar 1, 2026
Merged

feat(assign): add mgw:assign command — claim issues and update board assignment#95
snipcodeit merged 19 commits intomainfrom
issue/80-mgw-assign-command

Conversation

@snipcodeit
Copy link
Owner

Summary

  • Adds mgw:assign <issue-number> [username] command to claim GitHub issues for a user (defaults to @me)
  • Assigns via gh issue edit --add-assignee, updates .mgw/active/ state, and emits board URL confirmation
  • Creates a minimal .mgw/active/ state entry on-demand if the issue has not yet been triaged — enabling assignment at any point in the pipeline
  • Relies on GitHub Projects v2's built-in issue-assignee propagation to board items, avoiding a fragile GraphQL mutation on a non-standard field

Closes #80

Milestone Context

  • Milestone: v2 — Team Collaboration & Lifecycle Orchestration
  • Phase: 16 — Team Awareness & Assignment
  • Issue: 1 of 6 in milestone

Changes

commands/assign.md (new)

  • parse_args — splits $ARGUMENTS into ISSUE_NUMBER + optional USERNAME, validates numeric
  • validate_and_load — initializes .mgw/ structure, loads existing state file or flags for creation
  • resolve_user — defaults to @me via gh api user; validates named user via gh api users/$USERNAME
  • fetch_issue — fetches issue metadata; detects if already assigned (idempotent path)
  • assign_github — calls gh issue edit --add-assignee; skips if already assigned
  • update_state — writes assignee to existing state file, or creates minimal pipeline_stage: new entry
  • check_board — reads project.json for board URL; emits URL for confirmation (no GraphQL mutation needed)
  • confirm — prints formatted assignment confirmation table

~/.claude/commands/mgw/assign.md (deployed)

  • Identical copy of commands/assign.md deployed to user's Claude commands directory

Test Plan

  • mgw:assign 80 — assigns issue Add mgw:assign command — claim issues and update board assignment #80 to authenticated user, state file updated
  • mgw:assign 80 snipcodeit — assigns to named user, confirms assignment
  • Re-run mgw:assign 80 — idempotent path: "already assigned" message, no error
  • Run on issue with no existing .mgw/active/ state — minimal state entry created
  • With board configured: board URL appears in confirmation output
  • Without board configured: board section absent from output
  • Invalid issue number (non-numeric) — error message, no side effects
  • Non-existent GitHub user — error message, no assignment attempted

Stephen Miller and others added 19 commits February 28, 2026 23:00
…ields

Add docs/BOARD-SCHEMA.md documenting the full GitHub Projects v2 board
field schema for MGW pipeline visibility. Defines 5 custom fields:
- Status (single-select, 13 options mapping 1:1 to pipeline_stage values)
- AI Agent State (text, shows active GSD agent)
- Milestone (text, from project.json)
- Phase (text, number + name format)
- GSD Route (single-select, 4 options for all known routes)

Includes GraphQL mutation templates, project.json board key schema,
and board view planning for downstream issues (#72-#79).

Closes #71

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement new /mgw:board command with three subcommands:
- create: idempotent board creation with 5 custom fields via GraphQL
- show: display board state with items grouped by Status field
- configure: compare field options against canonical schema

Custom fields follow board schema from #71 (docs/BOARD-SCHEMA.md):
- Status (SINGLE_SELECT, 13 options mapping 1:1 to pipeline_stage)
- AI Agent State (TEXT, updated during GSD execution)
- Milestone (TEXT, from project.json milestone name)
- Phase (TEXT, phase number + name format)
- GSD Route (SINGLE_SELECT, 4 options for all known routes)

Board metadata (node_id, field IDs, option IDs) stored in
project.json under project.project_board.fields for downstream
commands to read without re-querying GitHub.

Closes #72

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd extend

Adds sync_milestone_to_board step to mgw:project command. After issues are
created (both init and extend modes), each issue is added to the GitHub Projects
v2 board as an item with Milestone, Phase, and GSD Route fields set. Board item
IDs are stored in project.json per issue (board_item_id field). Non-blocking:
any GraphQL failure logs a warning and the pipeline continues. Sync is skipped
silently when board is not configured or custom fields are not set up.

Closes #73

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ions

Add update_board_status shared utility (board-sync.md) and hook into issue.md
and run.md stage transitions. All board updates are non-blocking — API failures
never prevent pipeline execution. Reads field/option IDs from board-schema.json
or project.json at runtime.

Closes #74

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add update_board_agent_state utility to board-sync.md and hook into
run.md at planner/executor/verifier spawn points for both quick and
plan-phase routes. Field is cleared after PR creation. All calls are
non-blocking — API failures never interrupt pipeline execution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add sync_pr_to_board utility to workflows/board-sync.md that calls
  addProjectV2ItemById to add a PR as a GitHub Projects v2 board item
- Hook sync_pr_to_board into run.md after PR creation (non-blocking)
- Hook sync_pr_to_board into pr.md update_state step (linked mode only)
- Add board_reconcile step to sync.md that iterates cross-refs and calls
  sync_pr_to_board for all issue→PR implements links (idempotent, non-blocking)
- Add board-sync.md to execution_context of pr.md and sync.md
- Pull forward board-sync.md, board.md, issue.md, and state.md from prior
  milestone board issues (#71-#75) as this branch is based on main

Closes #76

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add mgw:board views subcommand supporting kanban, table, and roadmap layouts.
Creates GitHub Projects v2 views via GraphQL and outputs user instructions for
setting group-by configuration in the GitHub UI (API limitation).

Create docs/BOARD-SCHEMA.md documenting custom fields, Status options, GSD
route options, and the three intended layout views with their configuration.

Closes #77

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename table view from "All Issues" to "Triage Table — Team Planning"
- Add step-by-step column configuration instructions for triage planning
- Column order: Status, Milestone, Phase, GSD Route, AI Agent State
- Sort by Status ascending surfaces active work at top
- Update BOARD-SCHEMA.md with triage table column order and sort config
- Document table view entry in project.json storage schema

Closes #78

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ine grouping

- Add mgw:board views roadmap subcommand — creates ROADMAP_LAYOUT view named
  "Roadmap — Milestone Timeline" via createProjectV2View GraphQL mutation
- View dispatch updated: roadmap case delivers milestone grouping instructions
  and documents date field limitation (MGW uses iteration-based tracking)
- Document milestone due date workaround for timeline bar rendering
- Store roadmap view ID in project.json alongside kanban and table entries
- Update docs/BOARD-SCHEMA.md with full roadmap view configuration reference:
  - Group by Milestone step-by-step UI instructions
  - Date field limitation explanation and gh api workaround
  - Updated views table and storage schema with roadmap entry
- Completes the views subcommand: kanban + table + roadmap all implemented

Closes #79

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements issue #80: new MGW command for claiming GitHub issues.

- Assigns issue via gh issue edit --add-assignee (defaults to @me)
- Updates .mgw/active/ state file with assignee field
- Creates minimal state entry if issue has not been triaged yet
- Emits board URL confirmation if GitHub Projects board is configured
- Idempotent: re-assigning same user confirms state without error
- Follows delegation boundary: only state and GitHub API operations

GitHub Projects v2 automatically syncs issue assignees to board items,
so no direct GraphQL mutation is needed for the board Assignee field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes slash-commands Changes to slash command files triage-pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add mgw:assign command — claim issues and update board assignment

1 participant