Problem
create-ticket assumes the ticket being created belongs to the current branch. When a backlog or follow-up ticket is created while on a branch that already owns a different ticket, two coupled defects fire:
- Manifest clobber — step 5's
derive-session-context.mjs --set-ticket-url "$url" writes the new issue URL into the current branch's manifest, mislinking the unrelated ticket to the branch and misleading later ticket-source resolution.
- Frontmatter mismatch — step 6 (and the step-7 plan artifact) resolve
ticket_id/ticket_ref from the branch manifest, so the saved artifact's frontmatter carries the branch's id while its directory and heading use the new issue number.
Context
create-ticket is the only skill that runs gh issue create; wrap-up, save-plan, and respond-to-review delegate to it via {skill:create-ticket}, so a fix there propagates to all of them. wrap-up benefits most — its tickets are deferred/follow-up items that are structurally branch-unrelated.
Both fix mechanisms already exist: resolve-frontmatter.sh supports --override ticket_id=/--override ticket_ref=, and step 5's --set-ticket-url is a plain call the skill can gate. No helper-script changes are required.
Observed in KB events 01KVN3EYSVNN951VEJMSTASQFS and 01KVMVJHK1AECC6RYE51PK3B2F (same root cause, captured hours apart).
Proposed solution
Instruction-only changes in create-ticket/SKILL.md:
- Capture the branch-derived
ticket_id (for the guard only; the authoritative new id still comes from the platform).
- Gate
--set-ticket-url: persist to the branch manifest only when the branch has no ticket yet or its ticket equals the new one; otherwise skip and note the skip.
- Pass
--override ticket_id=/--override ticket_ref= (new id) when resolving frontmatter for both the ticket and plan artifacts; keep branch as authoring provenance.
The frontmatter override is unconditional (the artifact always describes the new ticket), not gated on the backlog case. No other skill changes.
Acceptance criteria
Must have
Nice to have
Problem
create-ticketassumes the ticket being created belongs to the current branch. When a backlog or follow-up ticket is created while on a branch that already owns a different ticket, two coupled defects fire:derive-session-context.mjs --set-ticket-url "$url"writes the new issue URL into the current branch's manifest, mislinking the unrelated ticket to the branch and misleading later ticket-source resolution.ticket_id/ticket_reffrom the branch manifest, so the saved artifact's frontmatter carries the branch's id while its directory and heading use the new issue number.Context
create-ticketis the only skill that runsgh issue create;wrap-up,save-plan, andrespond-to-reviewdelegate to it via{skill:create-ticket}, so a fix there propagates to all of them.wrap-upbenefits most — its tickets are deferred/follow-up items that are structurally branch-unrelated.Both fix mechanisms already exist:
resolve-frontmatter.shsupports--override ticket_id=/--override ticket_ref=, and step 5's--set-ticket-urlis a plain call the skill can gate. No helper-script changes are required.Observed in KB events
01KVN3EYSVNN951VEJMSTASQFSand01KVMVJHK1AECC6RYE51PK3B2F(same root cause, captured hours apart).Proposed solution
Instruction-only changes in
create-ticket/SKILL.md:ticket_id(for the guard only; the authoritative new id still comes from the platform).--set-ticket-url: persist to the branch manifest only when the branch has no ticket yet or its ticket equals the new one; otherwise skip and note the skip.--override ticket_id=/--override ticket_ref=(new id) when resolving frontmatter for both the ticket and plan artifacts; keepbranchas authoring provenance.The frontmatter override is unconditional (the artifact always describes the new ticket), not gated on the backlog case. No other skill changes.
Acceptance criteria
Must have
ticket_id/ticket_refin frontmatter, not the branch's.Nice to have
01KVN3EYSVNN951VEJMSTASQFSand01KVMVJHK1AECC6RYE51PK3B2Fmarked addressed-by the resulting PR.