hatch3r 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -322
- package/agents/hatch3r-a11y-auditor.md +24 -6
- package/agents/hatch3r-architect.md +20 -1
- package/agents/hatch3r-ci-watcher.md +31 -8
- package/agents/hatch3r-context-rules.md +14 -2
- package/agents/hatch3r-dependency-auditor.md +21 -5
- package/agents/hatch3r-devops.md +37 -6
- package/agents/hatch3r-docs-writer.md +19 -3
- package/agents/hatch3r-fixer.md +171 -0
- package/agents/hatch3r-implementer.md +84 -11
- package/agents/hatch3r-learnings-loader.md +69 -13
- package/agents/hatch3r-lint-fixer.md +19 -14
- package/agents/hatch3r-perf-profiler.md +18 -1
- package/agents/hatch3r-researcher.md +440 -5
- package/agents/hatch3r-reviewer.md +97 -5
- package/agents/hatch3r-security-auditor.md +23 -5
- package/agents/hatch3r-test-writer.md +21 -10
- package/checks/README.md +49 -0
- package/checks/code-quality.md +49 -0
- package/checks/performance.md +58 -0
- package/checks/security.md +58 -0
- package/checks/testing.md +53 -0
- package/commands/board/pickup-azure-devops.md +81 -0
- package/commands/board/pickup-delegation-multi.md +197 -0
- package/commands/board/pickup-delegation.md +100 -0
- package/commands/board/pickup-github.md +82 -0
- package/commands/board/pickup-gitlab.md +81 -0
- package/commands/board/pickup-modes.md +143 -0
- package/commands/board/pickup-post-impl.md +120 -0
- package/commands/board/shared-azure-devops.md +149 -0
- package/commands/board/shared-board-overview.md +215 -0
- package/commands/board/shared-github.md +169 -0
- package/commands/board/shared-gitlab.md +142 -0
- package/commands/hatch3r-agent-customize.md +40 -2
- package/commands/hatch3r-api-spec.md +294 -32
- package/commands/hatch3r-benchmark.md +386 -32
- package/commands/hatch3r-board-fill.md +161 -25
- package/commands/hatch3r-board-groom.md +595 -0
- package/commands/hatch3r-board-init.md +203 -46
- package/commands/hatch3r-board-pickup.md +79 -457
- package/commands/hatch3r-board-refresh.md +98 -27
- package/commands/hatch3r-board-shared.md +87 -238
- package/commands/hatch3r-bug-plan.md +16 -3
- package/commands/hatch3r-codebase-map.md +43 -10
- package/commands/hatch3r-command-customize.md +6 -0
- package/commands/hatch3r-context-health.md +5 -0
- package/commands/hatch3r-cost-tracking.md +5 -0
- package/commands/hatch3r-debug.md +426 -0
- package/commands/hatch3r-dep-audit.md +7 -1
- package/commands/hatch3r-feature-plan.md +74 -12
- package/commands/hatch3r-healthcheck.md +17 -1
- package/commands/hatch3r-hooks.md +16 -10
- package/commands/hatch3r-learn.md +15 -9
- package/commands/hatch3r-migration-plan.md +333 -33
- package/commands/hatch3r-onboard.md +327 -38
- package/commands/hatch3r-project-spec.md +46 -10
- package/commands/hatch3r-quick-change.md +336 -0
- package/commands/hatch3r-recipe.md +6 -0
- package/commands/hatch3r-refactor-plan.md +29 -13
- package/commands/hatch3r-release.md +13 -3
- package/commands/hatch3r-revision.md +395 -0
- package/commands/hatch3r-roadmap.md +18 -3
- package/commands/hatch3r-rule-customize.md +6 -0
- package/commands/hatch3r-security-audit.md +17 -1
- package/commands/hatch3r-skill-customize.md +6 -0
- package/commands/hatch3r-test-plan.md +532 -0
- package/commands/hatch3r-workflow.md +113 -38
- package/dist/cli/index.js +5184 -2593
- package/dist/cli/index.js.map +1 -0
- package/github-agents/hatch3r-docs-agent.md +1 -0
- package/github-agents/hatch3r-lint-agent.md +1 -0
- package/github-agents/hatch3r-security-agent.md +1 -0
- package/github-agents/hatch3r-test-agent.md +1 -0
- package/hooks/hatch3r-ci-failure.md +30 -0
- package/hooks/hatch3r-file-save.md +22 -0
- package/hooks/hatch3r-post-merge.md +23 -0
- package/hooks/hatch3r-pre-commit.md +23 -0
- package/hooks/hatch3r-pre-push.md +22 -0
- package/hooks/hatch3r-session-start.md +22 -0
- package/mcp/mcp.json +22 -3
- package/package.json +4 -7
- package/prompts/hatch3r-bug-triage.md +1 -0
- package/prompts/hatch3r-code-review.md +1 -0
- package/prompts/hatch3r-pr-description.md +1 -0
- package/rules/hatch3r-accessibility-standards.md +1 -0
- package/rules/hatch3r-agent-orchestration.md +326 -53
- package/rules/hatch3r-agent-orchestration.mdc +225 -0
- package/rules/hatch3r-api-design.md +4 -1
- package/rules/hatch3r-browser-verification.md +33 -1
- package/rules/hatch3r-browser-verification.mdc +29 -0
- package/rules/hatch3r-ci-cd.md +5 -1
- package/rules/hatch3r-ci-cd.mdc +4 -1
- package/rules/hatch3r-code-standards.md +18 -0
- package/rules/hatch3r-code-standards.mdc +10 -1
- package/rules/hatch3r-component-conventions.md +4 -1
- package/rules/hatch3r-data-classification.md +1 -0
- package/rules/hatch3r-deep-context.md +94 -0
- package/rules/hatch3r-deep-context.mdc +69 -0
- package/rules/hatch3r-dependency-management.md +13 -0
- package/rules/hatch3r-feature-flags.md +4 -1
- package/rules/hatch3r-git-conventions.md +1 -0
- package/rules/hatch3r-i18n.md +4 -1
- package/rules/hatch3r-learning-consult.md +4 -2
- package/rules/hatch3r-learning-consult.mdc +3 -2
- package/rules/hatch3r-migrations.md +12 -0
- package/rules/hatch3r-observability.md +293 -1
- package/rules/hatch3r-performance-budgets.md +5 -2
- package/rules/hatch3r-performance-budgets.mdc +1 -1
- package/rules/hatch3r-secrets-management.md +11 -3
- package/rules/hatch3r-secrets-management.mdc +10 -3
- package/rules/hatch3r-security-patterns.md +23 -3
- package/rules/hatch3r-security-patterns.mdc +8 -2
- package/rules/hatch3r-testing.md +1 -0
- package/rules/hatch3r-theming.md +4 -1
- package/rules/hatch3r-tooling-hierarchy.md +42 -15
- package/rules/hatch3r-tooling-hierarchy.mdc +27 -4
- package/skills/hatch3r-a11y-audit/SKILL.md +1 -0
- package/skills/hatch3r-agent-customize/SKILL.md +3 -0
- package/skills/hatch3r-api-spec/SKILL.md +1 -0
- package/skills/hatch3r-architecture-review/SKILL.md +6 -2
- package/skills/hatch3r-bug-fix/SKILL.md +4 -1
- package/skills/hatch3r-ci-pipeline/SKILL.md +1 -0
- package/skills/hatch3r-command-customize/SKILL.md +1 -0
- package/skills/hatch3r-context-health/SKILL.md +2 -1
- package/skills/hatch3r-cost-tracking/SKILL.md +1 -0
- package/skills/hatch3r-dep-audit/SKILL.md +6 -2
- package/skills/hatch3r-feature/SKILL.md +9 -2
- package/skills/hatch3r-gh-agentic-workflows/SKILL.md +130 -21
- package/skills/hatch3r-incident-response/SKILL.md +11 -5
- package/skills/hatch3r-issue-workflow/SKILL.md +12 -7
- package/skills/hatch3r-logical-refactor/SKILL.md +1 -0
- package/skills/hatch3r-migration/SKILL.md +1 -0
- package/skills/hatch3r-perf-audit/SKILL.md +2 -1
- package/skills/hatch3r-pr-creation/SKILL.md +20 -10
- package/skills/hatch3r-qa-validation/SKILL.md +2 -1
- package/skills/hatch3r-recipe/SKILL.md +1 -0
- package/skills/hatch3r-refactor/SKILL.md +7 -1
- package/skills/hatch3r-release/SKILL.md +15 -11
- package/skills/hatch3r-rule-customize/SKILL.md +1 -0
- package/skills/hatch3r-skill-customize/SKILL.md +1 -0
- package/skills/hatch3r-visual-refactor/SKILL.md +1 -0
- package/dist/cli/hooks-ZOTFDEA3.js +0 -59
- package/rules/hatch3r-error-handling.md +0 -17
- package/rules/hatch3r-error-handling.mdc +0 -15
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-board-pickup-post-impl
|
|
3
|
+
type: command
|
|
4
|
+
description: Post-implementation steps for board-pickup (Steps 7-10). Covers quality verification, commit/push, PR/MR creation, label transitions, board sync, dashboard refresh, reconciliation, and learnings capture.
|
|
5
|
+
tags: [board, team]
|
|
6
|
+
---
|
|
7
|
+
# Board Pickup — Post-Implementation Steps (7-10)
|
|
8
|
+
|
|
9
|
+
Post-implementation workflow for `hatch3r-board-pickup`. Referenced from the core command file.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Step 7: Quality Verification
|
|
14
|
+
|
|
15
|
+
Run the project's quality checks (linting, type checking, tests). Refer to the project's `AGENTS.md`, `README.md`, or `package.json` scripts for the appropriate commands.
|
|
16
|
+
|
|
17
|
+
Verify: all AC met, tests passing, no lint errors, dead code removed, project-specific invariants respected.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Step 7a: Commit & Push
|
|
22
|
+
|
|
23
|
+
Stage, commit, and push all changes so the branch exists on the remote before PR creation.
|
|
24
|
+
|
|
25
|
+
**Single issue or epic:**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git add -A
|
|
29
|
+
git commit -m "{type}: {short description} (#{issue})"
|
|
30
|
+
git push -u origin {branch-name}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- Use the branch type prefix (`feat`, `fix`, `refactor`, `qa`) matching the branch name.
|
|
34
|
+
- Reference the issue number in the commit message.
|
|
35
|
+
- If `git push` fails (e.g., branch already exists on remote), use `git push` without `-u`.
|
|
36
|
+
|
|
37
|
+
**Batch mode:** Create one commit covering all issues in the batch.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git add -A
|
|
41
|
+
git commit -m "batch: {short description} (#N, #M, #K)"
|
|
42
|
+
git push -u origin {branch-name}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- List all issue numbers in the commit message.
|
|
46
|
+
- If all issues share a type, use that type prefix instead of `batch`.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Step 8: Create Pull Request / Merge Request
|
|
51
|
+
|
|
52
|
+
> Platform-specific details: see `commands/board/pickup-github.md` (Step 8)
|
|
53
|
+
> Platform-specific details: see `commands/board/pickup-azure-devops.md` (Step 8)
|
|
54
|
+
> Platform-specific details: see `commands/board/pickup-gitlab.md` (Step 8)
|
|
55
|
+
|
|
56
|
+
Follow the project's PR/MR creation skill or conventions:
|
|
57
|
+
|
|
58
|
+
1. **Title:** `{type}: {short description} (#issue)` — for batch mode: `batch: {short description} (#N, #M, #K)`.
|
|
59
|
+
2. **Determine epic link type:** If working on an epic's sub-issues, check whether ALL sub-issues of the parent epic are addressed by this PR/MR (listed as `Closes #N`) or are already closed. If yes → use `Closes #<epic-number>` so the epic auto-closes on merge. If some sub-issues remain open and unaddressed → use `Relates to #<epic-number>`.
|
|
60
|
+
3. **Body:** Use the repository's PR/MR template if available (see platform sub-file for template location). Fill: Summary, Type, Changes, Testing, Rollout plan. Include a **Related Issues** section listing:
|
|
61
|
+
- `Closes #N` for each issue addressed by this PR/MR (including all batch issues).
|
|
62
|
+
- `Closes #<epic>` (all sub-issues addressed) OR `Relates to #<epic>` (partial) for the parent epic.
|
|
63
|
+
- Always list both the epic and all sub-issues in the Related Issues section regardless of partial/full completion.
|
|
64
|
+
- **Batch mode:** List `Closes #N` for every issue in the batch. Include a per-issue summary of changes in the body.
|
|
65
|
+
4. **Create PR/MR** using the platform CLI (see platform sub-file for exact command).
|
|
66
|
+
5. **Link PR/MR to epic** using the platform-specific method (see platform sub-file).
|
|
67
|
+
6. **Verify PR body linkage** and auto-fix missing `Closes #N` references (see platform sub-file).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step 8a: Post-PR/MR Label Transition & Board Sync
|
|
72
|
+
|
|
73
|
+
> Platform-specific details: see `commands/board/pickup-github.md` (Step 8a)
|
|
74
|
+
> Platform-specific details: see `commands/board/pickup-azure-devops.md` (Step 8a)
|
|
75
|
+
> Platform-specific details: see `commands/board/pickup-gitlab.md` (Step 8a)
|
|
76
|
+
|
|
77
|
+
1. **Transition labels to `status:in-review`:** For each `Closes #N` issue (including all batch issues), update status labels using the platform CLI (see platform sub-file). If ALL sub-issues addressed, also transition the parent epic.
|
|
78
|
+
2. **Sync Board:** Run the full **Board Sync Procedure** from `hatch3r-board-shared` for each item (see platform sub-file for specific targets).
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Step 9: Post-PR Housekeeping
|
|
83
|
+
|
|
84
|
+
1. If all sub-issues addressed, confirm the PR body uses `Closes #<epic-number>` so the epic will auto-close on merge and transition to Done.
|
|
85
|
+
2. Remind user `Closes #N` auto-closes on merge.
|
|
86
|
+
3. If partial:
|
|
87
|
+
|
|
88
|
+
**ASK:** "PR created. N remaining sub-issues on epic #X. Continue with next sub-issue or stop?"
|
|
89
|
+
|
|
90
|
+
### 9a. Refresh Board Dashboard
|
|
91
|
+
|
|
92
|
+
**This step is mandatory. Do not skip.**
|
|
93
|
+
|
|
94
|
+
If a `meta:board-overview` issue exists on the board, refresh it now using cached board data updated with mutations from Steps 4, 8, and 8a. Include the `Recommended Model` column in all issue listings per the Board Overview section in `hatch3r-board-shared`. Do NOT re-fetch all issues; use cached data. Skip silently if no `meta:board-overview` issue exists.
|
|
95
|
+
|
|
96
|
+
### 9b. End-of-Run Reconciliation
|
|
97
|
+
|
|
98
|
+
**This step is mandatory. Do not skip.**
|
|
99
|
+
|
|
100
|
+
Run the **End-of-Run Reconciliation Procedure** from `hatch3r-board-shared`. This verifies board sync, sub-issue links, label consistency, and PR linkage for all issues modified during this pickup run. Output the reconciliation report before proceeding to Step 10.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Step 10: Capture Learnings
|
|
105
|
+
|
|
106
|
+
After PR creation, capture learnings from this development session.
|
|
107
|
+
|
|
108
|
+
1. Reflect on the implementation:
|
|
109
|
+
- Were there any unexpected challenges or blockers?
|
|
110
|
+
- Did any patterns or approaches work particularly well?
|
|
111
|
+
- Were there decisions made that future developers should know about?
|
|
112
|
+
- Were any pitfalls discovered that should be avoided next time?
|
|
113
|
+
|
|
114
|
+
2. If learnings are identified:
|
|
115
|
+
- Create learning files in `.agents/learnings/` following the learning file format (see `hatch3r-learn` command).
|
|
116
|
+
- Include the issue number as `source-issue`.
|
|
117
|
+
- Tag with relevant area labels from the issue.
|
|
118
|
+
- **ASK:** "Learnings captured: {list}. Anything else to note? (add more / done)"
|
|
119
|
+
|
|
120
|
+
3. If no significant learnings: skip silently. Not every task produces learnings. Do not prompt in this case.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-board-shared-azure-devops
|
|
3
|
+
type: shared-context
|
|
4
|
+
description: Azure DevOps-specific platform details for board shared context. Covers Work Items, Azure Boards, az CLI, and MCP tools.
|
|
5
|
+
tags: [board, team, azure-devops]
|
|
6
|
+
---
|
|
7
|
+
# Board Shared Reference — Azure DevOps Platform Details
|
|
8
|
+
|
|
9
|
+
Platform-specific procedures for Azure DevOps. Referenced from `hatch3r-board-shared`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Platform Detection — Azure DevOps
|
|
14
|
+
|
|
15
|
+
Use `az devops` / `az boards` / `az repos` CLI. Issues = Work Items. PRs = Pull Requests. Board = Azure Boards. Requires `az login` or `AZURE_DEVOPS_PAT`.
|
|
16
|
+
|
|
17
|
+
### CLI Command Reference
|
|
18
|
+
|
|
19
|
+
| Action | Command |
|
|
20
|
+
|--------|---------|
|
|
21
|
+
| Create work item | `az boards work-item create --org https://dev.azure.com/{namespace} --project {project} --type "User Story" --title "..."` |
|
|
22
|
+
| List work items | `az boards query --org https://dev.azure.com/{namespace} --project {project} --wiql "SELECT..."` |
|
|
23
|
+
| View work item | `az boards work-item show --org https://dev.azure.com/{namespace} --id N` |
|
|
24
|
+
| Update work item | `az boards work-item update --org https://dev.azure.com/{namespace} --id N` |
|
|
25
|
+
| Close work item | `az boards work-item update --org https://dev.azure.com/{namespace} --id N --state Closed` |
|
|
26
|
+
| Create PR | `az repos pr create --org https://dev.azure.com/{namespace} --project {project}` |
|
|
27
|
+
| Add tag | `az boards work-item update --id N --fields "System.Tags=x"` |
|
|
28
|
+
| Add comment | `az boards work-item update --id N --discussion "..."` |
|
|
29
|
+
| Board sync | Board column = Work Item State |
|
|
30
|
+
|
|
31
|
+
### MCP Tool Reference
|
|
32
|
+
|
|
33
|
+
| Action | MCP Tool |
|
|
34
|
+
|--------|----------|
|
|
35
|
+
| Create work item | `create_work_item` |
|
|
36
|
+
| Read work item | `get_work_item` |
|
|
37
|
+
| List work items | `list_work_items` |
|
|
38
|
+
| Search work items | `search_work_items` |
|
|
39
|
+
| Add relation | Work Item parent-child relation |
|
|
40
|
+
| Create PR | `create_pull_request` |
|
|
41
|
+
|
|
42
|
+
### Terminology
|
|
43
|
+
|
|
44
|
+
| Concept | Azure DevOps Term |
|
|
45
|
+
|---------|-------------------|
|
|
46
|
+
| Work unit | Work Item |
|
|
47
|
+
| Code review | Pull Request (PR) |
|
|
48
|
+
| Board | Azure Boards |
|
|
49
|
+
| Labels | Tags + Area Paths |
|
|
50
|
+
| Project identifier | `project` name |
|
|
51
|
+
| Status tracking | Work Item State |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Azure DevOps Context
|
|
56
|
+
|
|
57
|
+
Derived from `.agents/hatch.json` board config:
|
|
58
|
+
|
|
59
|
+
- **Organization:** top-level `owner` (maps to Azure DevOps organization name)
|
|
60
|
+
- **Project:** top-level `repo` (maps to Azure DevOps project name)
|
|
61
|
+
- **Default branch:** `board.defaultBranch` (fallback: `"main"`)
|
|
62
|
+
- **Type labels → Work Item Tags:** `board.labels.types` (applied as Tags on work items)
|
|
63
|
+
- **Executor labels → Tags:** `board.labels.executors`
|
|
64
|
+
- **Status labels → Work Item State:** `board.labels.statuses` (mapped to Work Item State field)
|
|
65
|
+
- **Area Paths:** `board.areas` (mapped to Azure DevOps Area Paths)
|
|
66
|
+
- **PR template:** Check `.azuredevops/pull_request_template.md` if present.
|
|
67
|
+
|
|
68
|
+
### Azure DevOps Project Reference (cache for the full run)
|
|
69
|
+
|
|
70
|
+
- **Organization URL:** `https://dev.azure.com/{namespace}`
|
|
71
|
+
- **Project name:** `board.projectNumber` (repurposed as Azure DevOps project name)
|
|
72
|
+
- **Work Item States:** `Backlog` → `New`, `Ready` → `Active`, `In Progress` → `Active`, `In Review` → `Resolved`, `Done` → `Closed`
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Azure Boards Work Item State Sync
|
|
77
|
+
|
|
78
|
+
Azure Boards syncs via Work Item State changes. There is no separate "add to board" step -- work items appear on the board automatically based on their State and Area Path.
|
|
79
|
+
|
|
80
|
+
**Status label → Work Item State mapping:**
|
|
81
|
+
|
|
82
|
+
| Label | Work Item State |
|
|
83
|
+
| -------------------- | --------------- |
|
|
84
|
+
| `status:triage` | `New` |
|
|
85
|
+
| `status:ready` | `Active` |
|
|
86
|
+
| `status:in-progress` | `Active` |
|
|
87
|
+
| `status:in-review` | `Resolved` |
|
|
88
|
+
| `status:blocked` | `New` |
|
|
89
|
+
| (done) | `Closed` |
|
|
90
|
+
|
|
91
|
+
**Steps for each work item to sync:**
|
|
92
|
+
|
|
93
|
+
1. **Update Work Item State:** `az boards work-item update --org https://dev.azure.com/{namespace} --id {N} --state "{state}"` using the label→state mapping above.
|
|
94
|
+
2. **Update Area Path (if area labels changed):** `az boards work-item update --org https://dev.azure.com/{namespace} --id {N} --area-path "{project}\\{area}"`.
|
|
95
|
+
3. **Update Tags:** `az boards work-item update --org https://dev.azure.com/{namespace} --id {N} --fields "System.Tags={comma-separated tags}"`.
|
|
96
|
+
|
|
97
|
+
**MCP fallback:** If `az` CLI fails, fall back to Azure DevOps MCP `update_work_item` with the corresponding state and field values.
|
|
98
|
+
|
|
99
|
+
**For PRs:** PRs are managed via `az repos pr update --id {N} --status active|completed`. Board sync for PRs is automatic in Azure DevOps when linked to work items.
|
|
100
|
+
|
|
101
|
+
**Resilience:** If any call fails, retry once. If it still fails, surface a warning and continue. If `az` CLI and MCP are both unavailable, warn: "Azure Boards sync skipped -- run `az login` or set AZURE_DEVOPS_PAT."
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Sub-Issue Linking — Azure DevOps
|
|
106
|
+
|
|
107
|
+
### Three-Tier Fallback Chain
|
|
108
|
+
|
|
109
|
+
1. **Primary — CLI relation:**
|
|
110
|
+
`az boards work-item relation add --id {child_id} --relation-type "System.LinkTypes.Hierarchy-Reverse" --target-id {parent_id}`.
|
|
111
|
+
Record link status as `native`.
|
|
112
|
+
|
|
113
|
+
2. **Fallback 1 — Comment trace:**
|
|
114
|
+
If relation add fails:
|
|
115
|
+
`az boards work-item update --id {epic} --discussion "Sub-issue: #{child} — {title} (linking failed)"`.
|
|
116
|
+
Record link status as `comment-only`.
|
|
117
|
+
|
|
118
|
+
### Verification
|
|
119
|
+
|
|
120
|
+
After linking, verify via `az boards work-item relation list --id {epic}` and check parent-child relations.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Board Sync Enforcement — Azure DevOps
|
|
125
|
+
|
|
126
|
+
1. **Status updates:** Set via `az boards work-item update --state`.
|
|
127
|
+
2. **Fallback escalation:** `az boards work-item update` CLI → Azure DevOps MCP → surface error to user. Silent skipping is prohibited.
|
|
128
|
+
3. **Board item tracking:** After updating a work item, store the work item ID in the run cache keyed by issue number.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Cross-Cutting Tooling — Azure DevOps CLI-First
|
|
133
|
+
|
|
134
|
+
**Prerequisites:** `az login` must be completed, or `AZURE_DEVOPS_PAT` environment variable set. Run `az devops configure --defaults organization=https://dev.azure.com/{namespace} project={project}` to set defaults.
|
|
135
|
+
|
|
136
|
+
| Operation | Primary (`az` CLI) | Fallback (MCP) |
|
|
137
|
+
| -------------------- | ---------------------------------------------------------------------------------------------- | ---------------------- |
|
|
138
|
+
| List work items | `az boards query --wiql "SELECT [System.Id] FROM WorkItems WHERE [System.State] <> 'Closed'"` | `list_work_items` |
|
|
139
|
+
| Read work item | `az boards work-item show --id N` | `get_work_item` |
|
|
140
|
+
| Create work items | `az boards work-item create --type "User Story" --title "..." --description "..."` | `create_work_item` |
|
|
141
|
+
| Update work items | `az boards work-item update --id N --fields "field=value"` | `update_work_item` |
|
|
142
|
+
| Search work items | `az boards query --wiql "SELECT ... WHERE [System.Title] CONTAINS '...'"` | `search_work_items` |
|
|
143
|
+
| Manage relations | `az boards work-item relation add --id N --relation-type "System.LinkTypes.Hierarchy-Forward" --target-id M` | Work Item relation API |
|
|
144
|
+
| Add comments | `az boards work-item update --id N --discussion "..."` | N/A |
|
|
145
|
+
| Create PRs | `az repos pr create --title "..." --source-branch "..." --target-branch "..."` | `create_pull_request` |
|
|
146
|
+
| Read PR details | `az repos pr show --id N` | N/A |
|
|
147
|
+
| Manage tags | `az boards work-item update --id N --fields "System.Tags=tag1; tag2"` | N/A |
|
|
148
|
+
| Board sync | Work Item State updates (automatic board placement) | N/A |
|
|
149
|
+
| CI/Pipelines | `az pipelines run list` / `az pipelines run show` | N/A |
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-board-shared-overview
|
|
3
|
+
type: shared-context
|
|
4
|
+
description: Board overview dashboard template, model pool, model selection heuristic, and lane computation algorithm. Referenced from hatch3r-board-shared.
|
|
5
|
+
tags: [board, team]
|
|
6
|
+
---
|
|
7
|
+
# Board Overview Reference
|
|
8
|
+
|
|
9
|
+
If `meta:board-overview` is included in `board.labels.meta`, board commands will look for an open issue with that label to use as a live dashboard. This dashboard is auto-maintained and MUST be regenerated at the end of every board command run that mutates issues. For on-demand regeneration without running a full board command, use `hatch3r-board-refresh`.
|
|
10
|
+
|
|
11
|
+
Teams can extend the dashboard with project-specific sections, but the following structure and model recommendations are required.
|
|
12
|
+
|
|
13
|
+
## Frontier Model Pool
|
|
14
|
+
|
|
15
|
+
When populating the board overview, assign a recommended model to each issue. The pool uses aliases that map to the project's configured model versions in `hatch.json`. Specific model IDs are intentionally omitted here to avoid staleness as model versions change — configure actual model IDs in `hatch.json` under `models`.
|
|
16
|
+
|
|
17
|
+
| Alias | Strength | Use When |
|
|
18
|
+
| ----- | -------- | -------- |
|
|
19
|
+
| `opus` | Code quality, multi-file refactoring, security, deep reasoning | Complex refactors, security-critical, architectural changes, `risk:high` |
|
|
20
|
+
| `codex` | Agentic coding, long-running tasks, tool orchestration | Multi-step implementations, polyglot codebases, complex tool integrations |
|
|
21
|
+
| `gemini-pro` | Large context windows, multimodal, web development | Massive context needs (large epics), web/frontend work |
|
|
22
|
+
| `sonnet` | Balance of quality and speed | Standard features, bugs, docs, QA — when the top-tier model is overkill |
|
|
23
|
+
|
|
24
|
+
## Model Selection Heuristic (Quality-First)
|
|
25
|
+
|
|
26
|
+
1. **Default:** `opus` — highest code quality baseline.
|
|
27
|
+
2. **Override to `codex`** if the issue involves heavy agentic coding, long-running multi-step tasks, or multi-language requirements.
|
|
28
|
+
3. **Override to `gemini-pro`** if the issue requires processing very large context (large epic with many sub-issues spanning many files) or is primarily web/frontend work.
|
|
29
|
+
4. **Downgrade to `sonnet`** ONLY for straightforward issues: simple bugs (`risk:low`), documentation (`type:docs`), QA validation (`type:qa`), or issues with clear bounded scope and no architectural impact.
|
|
30
|
+
|
|
31
|
+
## Board Overview Issue Format
|
|
32
|
+
|
|
33
|
+
Issue listings in the board overview MUST include a `Model` column. All board commands that regenerate the dashboard MUST use this canonical template. Omit any status section that has zero issues (except Status Summary, which always appears). Omit Board Health sub-sections that have no findings. Sort issues within each status group by priority (`P0` first), then by issue number.
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
## Board Overview
|
|
37
|
+
|
|
38
|
+
**Project:** {owner}/{repo}
|
|
39
|
+
**Last refreshed:** {ISO date}
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Status Summary
|
|
44
|
+
|
|
45
|
+
| Status | Count |
|
|
46
|
+
|--------|-------|
|
|
47
|
+
| Backlog / Triage | {count} |
|
|
48
|
+
| Ready | {count} |
|
|
49
|
+
| In Progress | {count} |
|
|
50
|
+
| In Review | {count} |
|
|
51
|
+
| Externally Blocked | {count} |
|
|
52
|
+
| **Total Open** | **{count}** |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## In Progress
|
|
57
|
+
|
|
58
|
+
| # | Title | Type | Pri | Executor | Model | PR |
|
|
59
|
+
|---|-------|------|-----|----------|-------|----|
|
|
60
|
+
| #{N} | {title} | {type} | {pri} | {executor} | {model} | #{pr_number} or -- |
|
|
61
|
+
|
|
62
|
+
## In Review
|
|
63
|
+
|
|
64
|
+
| # | Title | Type | Pri | Executor | Model | PR |
|
|
65
|
+
|---|-------|------|-----|----------|-------|----|
|
|
66
|
+
| #{N} | {title} | {type} | {pri} | {executor} | {model} | #{pr_number} or -- |
|
|
67
|
+
|
|
68
|
+
## Implementation Lanes
|
|
69
|
+
|
|
70
|
+
Issues grouped into work streams with dependency-aware phasing.
|
|
71
|
+
Lanes in the same phase can be worked concurrently; within a lane, follow the listed order.
|
|
72
|
+
Lanes in later phases should start after their prerequisite lanes complete or reach a stable state.
|
|
73
|
+
|
|
74
|
+
### Lane Dependency Map
|
|
75
|
+
|
|
76
|
+
| Lane | Phase | Prerequisites | Relationship |
|
|
77
|
+
|------|-------|---------------|--------------|
|
|
78
|
+
| Lane 1: {name} | 1 | -- | Independent |
|
|
79
|
+
| Lane 2: {name} | 2 | Lane 1 (resolved-hard) | Depends on Lane 1 output |
|
|
80
|
+
| Lane 3: {name} | 2 | Lane 1 (soft) | Recommended after Lane 1 |
|
|
81
|
+
|
|
82
|
+
When 4+ lanes have inter-lane edges, also render a **Mermaid diagram**:
|
|
83
|
+
- Solid arrows (`-->`) for resolved-hard edges
|
|
84
|
+
- Dashed arrows (`-.->`) for soft edges
|
|
85
|
+
- Phase 1 nodes = green, Phase 2 = yellow, Phase 3+ = orange
|
|
86
|
+
- Omit diagram when all lanes are Phase 1 or fewer than 4 lanes exist
|
|
87
|
+
|
|
88
|
+
### Lane 1: {area/theme} [Phase 1]
|
|
89
|
+
|
|
90
|
+
| Order | # | Title | Type | Pri | Executor | Model |
|
|
91
|
+
|-------|---|-------|------|-----|----------|-------|
|
|
92
|
+
| 1 | #{N} | {title} | {type} | {pri} | {executor} | {model} |
|
|
93
|
+
| 2 | #{M} | {title} | {type} | {pri} | {executor} | {model} |
|
|
94
|
+
|
|
95
|
+
### Lane 2: {area/theme} [Phase 2]
|
|
96
|
+
> After: Lane 1 (API creates endpoints this lane consumes)
|
|
97
|
+
|
|
98
|
+
| Order | # | Title | Type | Pri | Executor | Model |
|
|
99
|
+
|-------|---|-------|------|-----|----------|-------|
|
|
100
|
+
| 1 | #{N} | {title} | {type} | {pri} | {executor} | {model} |
|
|
101
|
+
|
|
102
|
+
## Cross-Epic Dependencies
|
|
103
|
+
|
|
104
|
+
Dependency relationships between epics. Omit if no cross-epic dependencies exist.
|
|
105
|
+
|
|
106
|
+
| Upstream Epic | Downstream Epic | Via |
|
|
107
|
+
|---------------|-----------------|-----|
|
|
108
|
+
| #{epicA} {title} | #{epicB} {title} | #{subX} blocks #{subY} |
|
|
109
|
+
|
|
110
|
+
## Cross-Lane Dependencies
|
|
111
|
+
|
|
112
|
+
Inter-lane dependency edges from the Lane Dependency Map. Omit if no cross-lane dependencies exist.
|
|
113
|
+
|
|
114
|
+
| From (Lane) | Issue | To (Lane) | Issue | Type | Reason |
|
|
115
|
+
|-------------|-------|-----------|-------|------|--------|
|
|
116
|
+
| Lane 1: API | #{N} | Lane 3: Integration | #{M} | resolved-hard | #{M} was blocked by #{N} (now closed) |
|
|
117
|
+
| Lane 1: API | #{N} | Lane 2: Auth | #{K} | soft | Shared area overlap, reduced merge conflict risk |
|
|
118
|
+
|
|
119
|
+
## Waiting on Dependencies
|
|
120
|
+
|
|
121
|
+
`status:ready` issues with one or more unsatisfied blockers. Not yet available for pickup.
|
|
122
|
+
|
|
123
|
+
| # | Title | Type | Waiting On | Model |
|
|
124
|
+
|---|-------|------|------------|-------|
|
|
125
|
+
| #{N} | {title} | {type} | #{blocker} ({blocker status}) | {model} |
|
|
126
|
+
|
|
127
|
+
## Externally Blocked
|
|
128
|
+
|
|
129
|
+
Issues with `status:blocked` -- waiting on external factors (approvals, environments, third-party services).
|
|
130
|
+
|
|
131
|
+
| # | Title | Type | Reason | Model |
|
|
132
|
+
|---|-------|------|--------|-------|
|
|
133
|
+
| #{N} | {title} | {type} | {blocker reason} | {model} |
|
|
134
|
+
|
|
135
|
+
## Backlog / Triage
|
|
136
|
+
|
|
137
|
+
| # | Title | Type | Pri | Executor | Model |
|
|
138
|
+
|---|-------|------|-----|----------|-------|
|
|
139
|
+
| #{N} | {title} | {type} | {pri} | {executor} | {model} |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Board Health
|
|
144
|
+
|
|
145
|
+
**Missing metadata:**
|
|
146
|
+
- {list or "None -- all issues have required labels."}
|
|
147
|
+
|
|
148
|
+
**Stale issues:**
|
|
149
|
+
- {list or "None -- all issues are active."}
|
|
150
|
+
|
|
151
|
+
**Blocked chains:**
|
|
152
|
+
- {list or "None -- no blocked dependencies."}
|
|
153
|
+
|
|
154
|
+
**Epic ordering discrepancies:**
|
|
155
|
+
- {list or "None -- all epic Implementation Order sections match sub-issue Dependencies."}
|
|
156
|
+
|
|
157
|
+
**Lane sequencing warnings:**
|
|
158
|
+
- {list or "None -- all lane phase assignments are clear."}
|
|
159
|
+
|
|
160
|
+
Flag: Phase 2+ lanes with 0 prerequisite work completed, lanes with bidirectional soft deps (review independence), lanes sharing 4+ soft deps (consider merging).
|
|
161
|
+
|
|
162
|
+
**Unlinked sub-issues:**
|
|
163
|
+
- {list or "None -- all sub-issues are natively linked."}
|
|
164
|
+
|
|
165
|
+
**Unlinked in-progress work:**
|
|
166
|
+
- {list or "None -- all active issues have PRs."}
|
|
167
|
+
|
|
168
|
+
**Board sync drift:**
|
|
169
|
+
- {list or "None -- all labels match board state."}
|
|
170
|
+
|
|
171
|
+
**Dependency format inconsistencies:**
|
|
172
|
+
- {list using `Depends on` instead of `Blocked by`, or "None -- all use canonical format."}
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
*This issue is auto-maintained by hatch3r board commands. Do not close.*
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Dependency Data Model
|
|
182
|
+
|
|
183
|
+
`## Dependencies` sections in individual issue bodies are the **single authoritative source** of dependency data. Every issue (epic, sub-issue, standalone) tracks its own blockers in its `## Dependencies` section using two reference types:
|
|
184
|
+
|
|
185
|
+
- **Hard:** `Blocked by #N` -- this issue cannot start until #N is closed. Used for true producer/consumer relationships (A creates what B consumes) and explicit sequencing requirements.
|
|
186
|
+
- **Soft:** `Recommended after #N` -- this issue can proceed in parallel with #N, but sequential execution is recommended (e.g., shared area overlap, reduced merge conflict risk). Soft dependencies are advisory; they do not block pickup or exclude issues from Implementation Lanes.
|
|
187
|
+
|
|
188
|
+
When no dependencies exist, the section contains `None`.
|
|
189
|
+
|
|
190
|
+
**Canonical format:** `Blocked by #N` is the only hard dependency format board commands generate. `Depends on #N` is accepted as a legacy alias when parsing but MUST NOT be written. `board-groom` normalizes `Depends on #N` → `Blocked by #N` during dependency refresh.
|
|
191
|
+
|
|
192
|
+
`## Implementation Order` sections in epic bodies are a **derived convenience view** -- they visualize the dependency DAG among an epic's sub-issues as numbered levels. Board commands that create or update epics MUST regenerate `## Implementation Order` from the sub-issues' `## Dependencies` sections, not the other way around. When the two diverge, `## Dependencies` wins.
|
|
193
|
+
|
|
194
|
+
## Lane Computation Algorithm
|
|
195
|
+
|
|
196
|
+
Used by `board-fill`, `board-groom`, and `board-refresh` when generating the Implementation Lanes and Waiting on Dependencies sections. Input: all `status:ready` issues and their dependency data (from `## Dependencies` sections).
|
|
197
|
+
|
|
198
|
+
1. **Collect** all `status:ready` issues.
|
|
199
|
+
2. **Partition by hard-blocker satisfaction** -- for each collected issue, check all **hard** dependency references (`Blocked by #N`) in its `## Dependencies` section against the full board. An issue is **dependency-waiting** if any hard blocker is still open (regardless of the blocker's status). Soft dependencies (`Recommended after #N`) do not affect this partition. Separate into two sets:
|
|
200
|
+
- **Available** -- all hard blockers satisfied (closed) or no hard blockers. These proceed to lane computation (step 3+).
|
|
201
|
+
- **Dependency-waiting** -- one or more hard blockers still open. These are excluded from Implementation Lanes and listed in the **Waiting on Dependencies** section of the overview instead.
|
|
202
|
+
3. **Build the available sub-graph** -- retain **both** hard and soft dependency edges among available issues (from parsed `## Dependencies` sections). Hard edges determine intra-lane ordering. Soft edges are tracked for inter-lane computation in steps 10-12.
|
|
203
|
+
4. **Group by dependency chains** -- issues with sequential dependencies go in the same lane, ordered topologically within the chain.
|
|
204
|
+
5. **Group by area overlap** -- independent issues (no inter-dependencies) that share `area:*` labels go in the same lane. This avoids merge conflicts on the same files when multiple agents work in parallel.
|
|
205
|
+
6. **General lane** -- issues with no dependencies and no area overlap form their own single-issue lanes. If three or more such issues exist, group them into a single "General" lane.
|
|
206
|
+
7. **Name lanes** by the dominant `area:*` label or shared theme of the issues in the lane. Use "General" for the catch-all lane.
|
|
207
|
+
8. **Sort lanes** by the highest-priority issue in each lane (`P0`-lane first, then `P1`, etc.). Break ties by lowest issue number.
|
|
208
|
+
9. **Sort within lanes** by dependency order (blockers before dependents), then by priority, then by issue number.
|
|
209
|
+
10. **Compute inter-lane dependency edges:** After lanes are formed, scan all soft dependencies (`Recommended after #N`) and resolved hard dependencies (`Blocked by #N` where #N is closed) where the blocker and dependent are in *different* lanes. Record: source lane, target lane, edge type (`soft` / `resolved-hard`), issue pair.
|
|
210
|
+
11. **Compute lane phases:** Build a lane-level DAG from step 10 edges. Assign phase numbers via topological ordering:
|
|
211
|
+
- Phase 1: lanes with no incoming inter-lane edges (can start immediately).
|
|
212
|
+
- Phase 2+: lanes whose predecessors are all in earlier phases.
|
|
213
|
+
- Soft-only edges are annotated but do not enforce phasing (advisory).
|
|
214
|
+
- If all lanes have no edges → all Phase 1 (truly parallel).
|
|
215
|
+
12. **Build Lane Dependency Map:** Produce summary: lane phase assignments, inter-lane edges with types, whether the board is fully parallel or phased. This summary populates the Lane Dependency Map and Cross-Lane Dependencies sections of the board overview.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-board-shared-github
|
|
3
|
+
type: shared-context
|
|
4
|
+
description: GitHub-specific platform details for board shared context. Covers GitHub Issues, Projects V2, gh CLI, and MCP tools.
|
|
5
|
+
tags: [board, team, github]
|
|
6
|
+
---
|
|
7
|
+
# Board Shared Reference — GitHub Platform Details
|
|
8
|
+
|
|
9
|
+
Platform-specific procedures for GitHub. Referenced from `hatch3r-board-shared`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Platform Detection — GitHub
|
|
14
|
+
|
|
15
|
+
Use `gh` CLI and GitHub MCP tools. Issues = GitHub Issues. PRs = Pull Requests. Board = Projects V2.
|
|
16
|
+
|
|
17
|
+
### CLI Command Reference
|
|
18
|
+
|
|
19
|
+
| Action | Command |
|
|
20
|
+
|--------|---------|
|
|
21
|
+
| Create issue | `gh issue create -R {owner}/{repo}` |
|
|
22
|
+
| List issues | `gh issue list -R {owner}/{repo}` |
|
|
23
|
+
| View issue | `gh issue view N -R {owner}/{repo}` |
|
|
24
|
+
| Update issue | `gh issue edit N -R {owner}/{repo}` |
|
|
25
|
+
| Close issue | `gh issue close N -R {owner}/{repo}` |
|
|
26
|
+
| Create PR | `gh pr create -R {owner}/{repo}` |
|
|
27
|
+
| Add label | `gh issue edit N --add-label "x"` |
|
|
28
|
+
| Add comment | `gh issue comment N -R {owner}/{repo}` |
|
|
29
|
+
| Board sync | `gh project item-add`, GraphQL |
|
|
30
|
+
|
|
31
|
+
### MCP Tool Reference
|
|
32
|
+
|
|
33
|
+
| Action | MCP Tool |
|
|
34
|
+
|--------|----------|
|
|
35
|
+
| Create issue | `issue_write` |
|
|
36
|
+
| Read issue | `issue_read` |
|
|
37
|
+
| List issues | `list_issues` |
|
|
38
|
+
| Search issues | `search_issues` |
|
|
39
|
+
| Add sub-issue | `sub_issue_write` |
|
|
40
|
+
| Create PR | `create_pull_request` |
|
|
41
|
+
|
|
42
|
+
### Terminology
|
|
43
|
+
|
|
44
|
+
| Concept | GitHub Term |
|
|
45
|
+
|---------|------------|
|
|
46
|
+
| Work unit | Issue |
|
|
47
|
+
| Code review | Pull Request (PR) |
|
|
48
|
+
| Board | Projects V2 |
|
|
49
|
+
| Labels | Labels |
|
|
50
|
+
| Project identifier | `projectNumber` |
|
|
51
|
+
| Status tracking | Projects V2 Status field |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## GitHub Context
|
|
56
|
+
|
|
57
|
+
Derived from `.agents/hatch.json` board config:
|
|
58
|
+
|
|
59
|
+
- **Owner:** top-level `owner` (fallback: `board.owner`)
|
|
60
|
+
- **Repository:** top-level `repo` (fallback: `board.repo`)
|
|
61
|
+
- **Default branch:** `board.defaultBranch` (fallback: `"main"`)
|
|
62
|
+
- **Type labels:** `board.labels.types`
|
|
63
|
+
- **Executor labels:** `board.labels.executors`
|
|
64
|
+
- **Status labels:** `board.labels.statuses`
|
|
65
|
+
- **Dependency label:** `has-dependencies`
|
|
66
|
+
- **Meta labels:** `board.labels.meta`
|
|
67
|
+
- **Branch convention:** `board.branchConvention`
|
|
68
|
+
- **Issue templates:** Check `.github/ISSUE_TEMPLATE/` if present in the repository.
|
|
69
|
+
- **PR template:** Check `.github/PULL_REQUEST_TEMPLATE.md` if present.
|
|
70
|
+
|
|
71
|
+
### GitHub Project Reference (cache for the full run)
|
|
72
|
+
|
|
73
|
+
If `board.projectNumber` is not null, verify via `gh project view {board.projectNumber} --owner {board.owner}` or `gh project field-list {board.projectNumber} --owner {board.owner}` on first use.
|
|
74
|
+
|
|
75
|
+
- **Owner:** `board.owner`, **owner type:** infer from context (`org` or `user`)
|
|
76
|
+
- **Project number:** `board.projectNumber`
|
|
77
|
+
- **Status field ID:** `board.statusFieldId`
|
|
78
|
+
- **Status option IDs:** Read from `board.statusOptions` (keys: `backlog`, `ready`, `inProgress`, `inReview`, `done`)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## GitHub Projects V2 Sync
|
|
83
|
+
|
|
84
|
+
> **Skip entirely if `board.projectNumber` is null.**
|
|
85
|
+
|
|
86
|
+
**Prerequisites:** `gh auth refresh -s project` (Projects v2 via gh requires the `project` scope). gh CLI 2.40+ recommended.
|
|
87
|
+
|
|
88
|
+
**Status label → Projects v2 option mapping:**
|
|
89
|
+
|
|
90
|
+
Read the mapping from `board.statusOptions` in `.agents/hatch.json`:
|
|
91
|
+
|
|
92
|
+
| Label | Option ID from hatch.json |
|
|
93
|
+
| -------------------- | ---------------------------------- |
|
|
94
|
+
| `status:triage` | `board.statusOptions.backlog` |
|
|
95
|
+
| `status:ready` | `board.statusOptions.ready` |
|
|
96
|
+
| `status:in-progress` | `board.statusOptions.inProgress` |
|
|
97
|
+
| `status:in-review` | `board.statusOptions.inReview` |
|
|
98
|
+
| `status:blocked` | `board.statusOptions.backlog` |
|
|
99
|
+
|
|
100
|
+
**Steps for each issue to sync (gh CLI primary):**
|
|
101
|
+
|
|
102
|
+
1. **Resolve project node ID** (once per run, cache for the run): `gh project view {board.projectNumber} --owner {board.owner} --format json -q '.id'`. Required for step 3.
|
|
103
|
+
2. **Add to board + capture item ID:** `gh project item-add {board.projectNumber} --owner {board.owner} --url https://github.com/{board.owner}/{board.repo}/issues/{N} --format json -q '.id'`. **Capture the item ID from the output.** This call is idempotent -- if the item already exists on the board it returns the existing item with its ID.
|
|
104
|
+
3. **Update status:** `gh project item-edit --id {item_id} --project-id {project_node_id} --field-id {board.statusFieldId} --single-select-option-id {option_id}` using the label→option mapping from the table above.
|
|
105
|
+
4. **Verify (first sync per run only):** After step 3, optionally confirm via `gh project item-list {board.projectNumber} --owner {board.owner} --format json` that the item's status matches. If it does not, retry step 3 once.
|
|
106
|
+
|
|
107
|
+
**For PRs:** Use `--url https://github.com/{board.owner}/{board.repo}/pull/{N}` in step 2.
|
|
108
|
+
|
|
109
|
+
**Fallback (rare):** If item-add does not return an item ID, use `gh project item-list {board.projectNumber} --owner {board.owner} --format json` and match by issue/PR content to obtain the item ID. Then proceed with step 3.
|
|
110
|
+
|
|
111
|
+
**MCP fallback:** If gh CLI fails, `project` scope is unavailable, or gh version is too old, fall back to `projects_write` / `projects_get` / `projects_list` with `method: add_project_item`, `method: update_project_item`, `method: get_project_item`, `method: list_project_items` as in the legacy procedure.
|
|
112
|
+
|
|
113
|
+
**Resilience:** If any call fails, retry once. If it still fails, surface a warning to the user and continue with the next item. If gh CLI and MCP are both unavailable, skip sync silently and warn: "Projects v2 sync skipped -- run `gh auth refresh -s project` or enable the `projects` toolset in your MCP configuration."
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Sub-Issue Linking — GitHub
|
|
118
|
+
|
|
119
|
+
### Three-Tier Fallback Chain
|
|
120
|
+
|
|
121
|
+
1. **Primary — MCP native link:**
|
|
122
|
+
`sub_issue_write` MCP with `method: add` using the parent `issue_number` and child's internal numeric `id`.
|
|
123
|
+
Record link status as `native`.
|
|
124
|
+
|
|
125
|
+
2. **Fallback 1 — CLI body-reference:**
|
|
126
|
+
If MCP linking fails, establish an advisory link:
|
|
127
|
+
- Prepend `> Parent: #{epic}` to the child issue body via `gh issue edit {child} --body "..."`.
|
|
128
|
+
- Add `- [ ] #{child} {title}` to the epic's sub-issue checklist via `gh issue edit {epic} --body "..."`.
|
|
129
|
+
- Record link status as `advisory`.
|
|
130
|
+
|
|
131
|
+
3. **Fallback 2 — Comment trace:**
|
|
132
|
+
If both primary and Fallback 1 fail:
|
|
133
|
+
`gh issue comment {epic} --body "Sub-issue: #{child} — {title} (linking failed)"`.
|
|
134
|
+
Record link status as `comment-only`.
|
|
135
|
+
|
|
136
|
+
### Verification
|
|
137
|
+
|
|
138
|
+
After linking, verify via `issue_read` with `method: get_sub_issues` on the parent epic.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Board Sync Enforcement — GitHub
|
|
143
|
+
|
|
144
|
+
1. **Status updates:** Set via Projects V2 GraphQL mutation or `gh project item-edit`.
|
|
145
|
+
2. **Fallback escalation:** GraphQL mutation → `gh project item-edit` CLI → MCP `projects_write` → surface error to user. Silent skipping is prohibited.
|
|
146
|
+
3. **Board item tracking:** After adding an item to the board, store the returned item ID in the run cache keyed by issue number.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Cross-Cutting Tooling — GitHub CLI-First
|
|
151
|
+
|
|
152
|
+
**Prerequisites:** `gh auth login` must be completed, or `GITHUB_TOKEN` environment variable set. For Projects v2: `gh auth refresh -s project`.
|
|
153
|
+
|
|
154
|
+
| Operation | Primary (`gh` CLI) | Fallback (MCP) |
|
|
155
|
+
| -------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
156
|
+
| List issues | `gh issue list` | `list_issues` |
|
|
157
|
+
| Read issue details | `gh issue view` | `issue_read` |
|
|
158
|
+
| Create/update issues | `gh issue create` / `gh issue edit` | `issue_write` |
|
|
159
|
+
| Search issues | `gh search issues` | `search_issues` / `semantic_issues_search` |
|
|
160
|
+
| Manage sub-issues | `sub_issue_write` (MCP only — no CLI equivalent) | `sub_issue_write` |
|
|
161
|
+
| Add comments | `gh issue comment` | `add_issue_comment` |
|
|
162
|
+
| Create PRs | `gh pr create` | `create_pull_request` |
|
|
163
|
+
| Read PR details | `gh pr view` | `pull_request_read` |
|
|
164
|
+
| Manage labels | `gh label create` / `gh label list` | `issue_write` (with labels) |
|
|
165
|
+
| Projects v2 | `gh project item-add`, `gh project item-edit`, `gh project item-list`, `gh project field-list`, `gh project view` | `projects_write` / `projects_get` / `projects_list` |
|
|
166
|
+
| CI/Actions | `gh run list` / `gh run view` | N/A |
|
|
167
|
+
| Releases | `gh release create` | N/A |
|
|
168
|
+
|
|
169
|
+
Fallback to MCP only for operations the `gh` CLI cannot handle: sub-issue management (`sub_issue_write`).
|