Skip to content

feat(milestone): post board link to Discussions when milestone starts execution#96

Merged
snipcodeit merged 19 commits intomainfrom
issue/81-board-discussions-notification
Mar 1, 2026
Merged

feat(milestone): post board link to Discussions when milestone starts execution#96
snipcodeit merged 19 commits intomainfrom
issue/81-board-discussions-notification

Conversation

@snipcodeit
Copy link
Owner

Summary

  • Adds postMilestoneStartAnnouncement() to lib/github.cjs — posts a GitHub Discussion in the Announcements category when mgw:milestone begins executing, with milestone name, issue list (assignee + GSD route per issue), board URL, and total issue count
  • Falls back to a comment on the first milestone issue when Discussions are not enabled on the repo, ensuring the team signal is always delivered
  • Adds a post_start_hook step to commands/milestone.md that fires once before the per-issue execute loop; skipped entirely when --dry-run is set
  • All failure paths are non-blocking — a broken Discussions API or missing permissions logs a warning and continues milestone execution

Closes #81

Milestone Context

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

Changes

lib/github.cjs

  • New function postMilestoneStartAnnouncement(opts) using gh api graphql to call the createDiscussion mutation targeting the Announcements category
  • Dynamically looks up the Announcements category ID per-repo (no hardcoded IDs)
  • Two-layer fallback: Discussion → issue comment → { posted: false } return
  • Added to module.exports

commands/milestone.md

Test Plan

  • Load check: node -e "require('./lib/github.cjs').postMilestoneStartAnnouncement" exits 0 and logs function
  • Load via index: node -e "require('./lib/index.cjs').postMilestoneStartAnnouncement" exits 0 and logs function
  • Null-safety: calling with repo: null returns { posted: false, method: 'none', url: null } without throwing
  • Dry-run guard: mgw:milestone --dry-run prints Skipping milestone-start announcement (dry-run mode) and does not post
  • Discussion path: on a repo with Discussions enabled and an Announcements category, a Discussion appears when milestone starts
  • Fallback path: on a repo without Discussions, a comment appears on the first issue in the milestone
  • Step ordering: grep -n "post_start_hook\|rate_limit_guard\|dry_run" commands/milestone.md shows rate_limit_guard before post_start_hook before dry_run

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 <[email protected]>
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 <[email protected]>
…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 <[email protected]>
…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 <[email protected]>
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 <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
- 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 <[email protected]>
…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 <[email protected]>
When mgw:milestone begins executing a milestone, post a GitHub Discussion
in the Announcements category with milestone name, issue list (number,
title, assignee, GSD route), board URL, and issue count. Falls back to
a comment on the first issue if Discussions are not enabled. Hook is
non-blocking — announcement failures never stop milestone execution.

Implements Issue #81 (Phase 16 — Team Awareness & Assignment, v2 milestone).

Changes:
- lib/github.cjs: add postMilestoneStartAnnouncement() function that
  uses GraphQL createDiscussion mutation with Announcements category
  detection and graceful fallback to gh issue comment
- commands/milestone.md: add post_start_hook step between rate_limit_guard
  and dry_run; skipped when --dry-run is set

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@github-actions github-actions bot added documentation Documentation changes slash-commands Changes to slash command files core Changes to core library triage-pipeline labels Mar 1, 2026
@snipcodeit snipcodeit merged commit 45e5c30 into main Mar 1, 2026
1 check passed
@snipcodeit snipcodeit deleted the issue/81-board-discussions-notification branch March 1, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to core library 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.

Post board link to Discussions when a milestone starts execution

1 participant