[GRV-33]: Sync the Human Handoff workspace issue template#50
Merged
github-actions[bot] merged 1 commit intoJun 6, 2026
Conversation
…late
Replace the GRV-31 scaffold createSyncTemplateUseCase with a real use case
that idempotently provisions the workspace-level "Human Handoff" issue
template — create when missing, update when the bundled body drifted, and
report no-change when already in sync. The use case stays pure (no fetch,
no fs, no env) and consumes the existing LinearWorkspace port; the CLI
reads the template body from disk and wires the GRV-32 Linear GraphQL
adapter at the edge, mirroring how `doctor` already plumbs auth.
Extend the GraphQL adapter to support workspace-level operations by
making `getTemplate({ name })` and `createTemplate({ name, ... })` work
without a `teamId`. Workspace-level `getTemplate` queries the top-level
`templates` field and filters to `type === 'issue'` with `!teamId` so a
same-named team template never shadows a missing workspace one. Existing
team-scoped behavior is preserved.
The CLI now accepts `--dry-run` (default off) and re-targets sync-template
through the real workspace, returning the standard Linear error → exit code
mapping. setup and bootstrap-project remain scaffold-only.
Tests cover create, update, no-change, dry-run (all three actions),
idempotent round-trip, every API failure path (auth, create-fail,
update-fail), port validation, body validation, and a custom template
name, plus new adapter tests for workspace-level `getTemplate`/
`createTemplate` and CLI integration tests for missing token, create,
dry-run, no-change, and API failure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createSyncTemplateUseCasewith a real, idempotent use case that provisions the workspace-levelHuman HandoffLinear issue template — create when missing, update when the bundled body drifted, report no-change when already in sync.sync-templateto the GRV-32 Linear GraphQL adapter (real workspace), add--dry-run, and surface the standard Linear → exit code mapping.setupandbootstrap-projectremain scaffold-only.LinearGraphqlWorkspace.getTemplate({ name })andcreateTemplate({ name, ... })to support workspace-level templates by omittingteamId. Team-scoped behavior is preserved.Acceptance criteria
human-handoff-linear sync-templatecreates a workspace-levelHuman Handofftemplate when none exists (src/use-cases/sync-template.mjs→runCreate; CLI wired insrc/cli/run-cli.mjs→runSyncTemplateCommand).runUpdate;no-changepath whenexisting.description === template.body).packages/human-handoff-linear/templates/human-handoff-issue-body.md(read by the CLI viaTEMPLATE_PATHand passed into the use case) and includes the six required sections in setup-safe public wording (already shipped in GRV-31; verified by existing testchecked-in template satisfies the Human Handoff body value contract).--dry-runreports the planned action (create,update, orno-change) without calling any Linear write mutation.LinearWorkspaceport —tests/sync-template.test.mjs(15 tests) plus CLI integration tests intests/cli.test.mjs(5 sync-template tests) and adapter tests for workspace-level operations intests/linear-graphql-workspace.test.mjs(4 new tests).Out of scope
Per the issue: no label creation, no per-project HH issue creation, no Linear project templates, no marketplace app install UX.
Test plan
npm testfrom the package directory — 86 passed, 0 failed.npm testfrom the workspace root — all packages green.node bin/human-handoff-linear.mjs --helprenders the new--dry-runflag and mutation note.LINEAR_API_KEY=… npx human-handoff-linear sync-template --dry-runagainst a real workspace (manual smoke test the human can run after merge).