Skip to content

feat(board): sync project.json milestones into board items on project init/extend#88

Merged
snipcodeit merged 1 commit intomainfrom
issue/73-sync-project-json-milestones-into-b
Mar 1, 2026
Merged

feat(board): sync project.json milestones into board items on project init/extend#88
snipcodeit merged 1 commit intomainfrom
issue/73-sync-project-json-milestones-into-b

Conversation

@snipcodeit
Copy link
Owner

Summary

  • Auto-populate board with issues on mgw:project init and extend
  • Sets Milestone, Phase, and GSD Route fields on each board item
  • Stores board_item_id in project.json for future updates
  • Non-blocking: board sync failure doesn't block project initialization

Closes #73

Milestone Context

  • Milestone: v2 — GitHub Projects Board Management
  • Phase: 13 — Board Foundation & Field Schema
  • Issue: 3 of 9 in milestone

Changes

  • Updated: commands/project.md (runtime: ~/.claude/commands/mgw/project.md) — added sync_milestone_to_board step between create_project_board and write_project_json

Implementation Details

The new sync_milestone_to_board step:

  1. Reads project.project_board.node_id and project.project_board.fields from project.json
  2. If board is configured with custom fields, iterates ISSUE_RECORDS (populated in create_issues)
  3. For each issue: resolves the GitHub node ID via GraphQL, calls addProjectV2ItemById, then calls updateProjectV2ItemFieldValue for Milestone (TEXT), Phase (TEXT), and GSD Route (SINGLE_SELECT) fields
  4. Collects board item IDs into ITEM_ID_MAP bash array
  5. After all issues processed, write_project_json decodes ITEM_ID_MAP into ITEM_ID_MAP_DICT and writes board_item_id per issue record

Skip conditions (silent):

  • PROJECT_NUMBER is empty (board not created)
  • BOARD_NODE_ID is empty (board exists but fields not configured via /mgw:board create)

Error handling: each GraphQL call uses || BOARD_SYNC_WARNINGS+=(...) to accumulate warnings. All warnings are printed after the loop. Pipeline never halts on board sync failure.

Test Plan

  • After mgw:project init, board items exist for all milestone issues
  • Milestone, Phase, GSD Route fields are set on each item
  • board_item_id stored in project.json for each issue
  • If board not configured (no node_id), sync is skipped silently with NOTE message
  • If board created but fields not configured, sync is skipped with NOTE message
  • If a single GraphQL call fails, remaining issues continue processing
  • Extend mode: only new milestone issues are synced (existing board items unchanged)

…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

slash-commands Changes to slash command files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync project.json milestones into board items on mgw:project init and extend

1 participant