用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/CodySwannGT/lisa --skill lisa-linear-sync命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | lisa-linear-sync |
| description | Syncs plan progress to a linked… |
| allowed-tools | ["Bash","Skill"] |
Post milestone updates to the linked Linear Issue at key plan-lifecycle moments. This skill is the destination of the lisa-tracker-sync shim when tracker = "linear".
Reads linear.workspace, linear.teamKey from .lisa.config.json (with .local override).
Callers (planning skills, lifecycle skills) invoke this skill at:
| Milestone | What to post | Suggested role |
|---|---|---|
| Plan created | Plan contents (sections + ordered tasks) as a comment | ready |
| Implementation in progress | Branch URL + first commit | claimed |
| PR ready for review | PR URL + summary, the implementation handoff comment | review — optional; omitted by most projects, in which case there is no transition to suggest |
| PR merged | Merge SHA + deploy environment (if known) | env-keyed done, then run Phase 4b — mandatory when the merge target is a non-terminal env branch |
Roles, never literal state names. Resolve each through the shared resolver; the state names above are whatever the project configured, and a role the project did not configure has no suggestion at all:
resolve() {
node "${CLAUDE_PLUGIN_ROOT}/scripts/resolve-lifecycle-role.mjs" \
--role "$1" --vendor linear --intent read 2>/dev/null
}
This skill SUGGESTS transitions. It never writes the lane. That matches lisa-jira-sync ("suggest, but don't automatically perform") and lisa-github-sync ("this skill never relabels"), and it is what this skill's own dispatcher already advertises: lisa-tracker-sync's description reads "Suggests (never auto-transitions) the next status." Lane writes belong to the build-intake / agent owner, which is already true on the other two trackers.
--rollup is the one exception and is documented in Phase 4b — parent derivation is its entire purpose and is separately gated.
$ARGUMENTS is <IDENTIFIER> <milestone> where:
<IDENTIFIER> is the Linear Issue identifier (e.g. ENG-123). If not provided, the skill searches the active plan file for a linked Linear Issue.<milestone> is one of plan-created, implementation-in-progress, pr-ready, pr-merged.pr_url=<url> for the live pull request and merge_sha=<sha> once merged.$ARGUMENTS includes an identifier, parse it.plans/) and extract the linked Linear Issue identifier from its frontmatter.lisa-linear-access operation: get-issue to confirm it exists.Per the milestone, build the comment body. Include:
**Plan created** — <plan-file>)Example for plan-created:
**Plan created** — `plans/feat-X.md`
Sections:
- Phase 1: Schema doc
- Phase 2: Linear destination skills
- ...
Tasks: 7 ordered items.
Next: implementation begins. Suggested state: **Ready**.
Call lisa-linear-access operation: save-comment({issueId: <id>, body: <comment>}).
When $ARGUMENTS includes pr_url=<url> for pr-ready or pr-merged, ensure the Linear Issue has a durable ticket -> PR link:
Prefer Linear's native GitHub attachment / pull request link when the integration has attached the PR through the branch name, PR title, or PR body issue identifier. Verify by re-reading the Issue and its attachments / relations where the Linear access layer exposes them.
Establish the managed backlink comment by running the command that owns it — never by hand, and never by describing the procedure here:
node scripts/lisa-work-item.mjs backlink --ref <work-item> --pr-url <url>
It creates the [lisa-pr-link] comment or updates the one already present, instead of appending duplicates, so it is safe to run on every milestone. This is unconditional — run it whether or not native linkage exists or cannot be verified, because the required Work-Item Traceability check reads this comment and nothing else guarantees one. The comment carries the marker and the PR URL only; the milestone (pr-ready / pr-merged) and merge SHA belong in the milestone progress note, so that a rerun at a new milestone still converges on one backlink comment.
The PR branch/title/body identifier is the PR -> Linear side. This phase is the required Linear -> PR side.
Name the suggested next state in the milestone comment and stop. This skill does not set stateId. The lane write belongs to lisa-linear-build-intake / lisa-linear-agent, exactly as the status:* write belongs to lisa-github-build-intake on GitHub.
Resolve the suggestion by role, and say nothing when the role is unset:
| Milestone | Role to resolve | When the role is unset |
|---|---|---|
plan-created | ready | required — report a setup defect |
implementation-in-progress | claimed | required — report a setup defect |
pr-ready | review | optional — suggest no transition; the Issue stays in claimed |
pr-merged | done for the PR's target env (via deploy.branches) | required — report a setup defect |
If a resolved state doesn't exist on the team, that is a setup defect — report it and point at /lisa:setup:linear. Never create a workflow state here: a state carries a type and a board position, and guessing either puts the Issue somewhere no human sanctioned. Equally, never find one: resolving a role by scanning the team for a state whose name or type looks right picks by board position, not intent, and the states that surface that way are the human-only lanes a project deliberately left out of its config.
Removed:
--update-state. This flag previously let a caller make Phase 4 write the state. It was the only lane-write path in any sync skill, and combined with a defaultedreviewrole it moved Issues into review states that projects had never configured. Callers that relied on it should let the build-intake owner make the transition;--rollupis unaffected.
No single-lane verification is needed: an Issue holds exactly one workflow state by construction, so the two-lanes-at-once corruption the old label-driven lane could produce is unrepresentable. (It was not hypothetical — 16 issues carried two status:* labels at the time of the migration.)
Linear's per-team git automations complete a linked Issue on merge to any branch — unlike GitHub's default-branch-scoped Closes auto-close — so a magic word (Closes/Fixes/Resolves ENG-123) or branch-name linkage can move the Issue to a completed state at a non-terminal env merge, front-running the env-keyed ladder.
Since the build lane moved to native states, this phase is a BACKSTOP, not the primary defence. The lifecycle now writes the same field the automation writes, so the disagreement it repairs can only arise when something outside Lisa moves the Issue. The primary fix is upstream and structural: /lisa:setup:linear detects the team's merge → Done git automation and offers to delete it, because with this model that automation is a redundant second writer as well as a wrong one. Keep this phase — a workspace can always re-add the automation, and a magic word in a hand-written PR body still fires — but a recurrence here is a setup defect to report, not routine repair to absorb silently.
Run it whenever the resolved env is intermediate (below the production terminal done):
.lisa.config.json deploy.branches (config-resolution). If it maps to the production/terminal done, this phase is a no-op — native completion is correct there.done map is uniform — every environment resolves to the same Done, as in this repo (production: main only) — dev-merge == terminal, so native completion is correct. Do nothing. Only a non-uniform env→done map (distinct On Dev/On Stg/Done rungs) can desync.state. If it sits in a completed-typed state while the derived role is a lower env rung, re-open the native state by moving it back to the correct env rung (via lisa-linear-access operation: save-issue) and post a short [lisa-linear-sync] reconciliation comment naming the likely cause — a live merge → Done git automation, or a magic word in the PR body. This applies the leaf-only-lifecycle "Terminal native closure" rule — closure fires only at the production terminal done. Cite the rule by slug; do not restate it.done map), do not change the state — post a [lisa-linear-sync] reconciliation-suggestion comment and leave it untouched, mirroring the Phase 5 safe default.--rollup)When the caller passes --rollup, this skill derives a parent/container's workflow state from the roll-up of its children instead of acting on a leaf. A Project (the Epic equivalent) rolls up from its Issues; an Issue rolls up from its sub-Issues. This implements the Linear child-issue-status arm of the Parent status rollup (the state machine) section of the leaf-only-lifecycle rule — cite that rule, do not restate the policy.
Resolve the child set the same way lisa-linear-read-issue does — lisa-linear-access operation: list-issues({project: <id>}) for a Project's Issues, or lisa-linear-access operation: get-issue per child for an Issue's sub-Issues (via parentId). Capture each child's workflow state. If the item has no children it is a leaf — rollup is N/A; behave as a normal milestone sync.
Evaluate the required children over the env ladder in-progress < dev < staging < production (the ordered keys of the Linear env-keyed done map) and take the first match (canonical roles from config-resolution; the Linear state map is the configured blocked, claimed, optional review, and env-keyed done — resolve each by role, and treat an unset review as simply having no such rung):
| If among the required child leaves… | Derived parent role | Linear state |
|---|---|---|
any child carries Blocked | blocked | Blocked |
else every required child has shipped to some env (each at a done-map state, e.g. On Dev/On Stg/Done) | done[min-env] | the least-advanced env state among them (all On Stg → On Stg; mixed dev+staging → On Dev; all production → Done) |
else any child has started (at the claimed state, at the review state where the project configures one, or shipped to an env while a sibling has not) | claimed | the configured claimed state |
| else (children exist, none started) | — | unchanged — parent keeps its non-ready container state |
Blocked on the parent even while siblings progress. It never says which child or which kind of hold; resolve and run the shared classifier exactly as lisa-tracker-sync specifies, then carry its per-class report — blocking leaf, path, and who must act — into the rollup note. A missing classifier or non-zero exit is a strict no-write result: do not save parent state and do not post/update a rollup comment; report the failure, never an all-clear. See leaf-only-lifecycle → Classifying a hold.state to Done) fires only when the resolved env is the production Done, never at On Dev/On Stg.Canceled) children do not hold the parent open.ready state — ready is leaf-only. Rollup only moves the parent between non-ready container states.Single-environment collapse (this repo). The env rungs resolve via the env-keyed done logic in config-resolution. In this repo deploy.branches declares only production: main, so done collapses to the single Done state, the only env rung is production, and the lifecycle is ready → claimed → done with no dev/staging promotion hops and no configured review rung; the rollup never resolves a dev or staging done. Multi-environment projects keep the env-keyed map and roll a parent up to the intermediate env states.
Apply the derived state via lisa-linear-access operation: save-issue (Project or Issue), setting the parent's stateId to the derived role. Post an idempotent rollup comment naming the derived state and the child tally. Because the terminal done state is itself typed completed, a parent rolled to terminal is natively closed by the same write — there is no second closure step. Safe default: if the derived terminal cannot be resolved (ambiguous required-set or unresolvable env done), do not guess — post the derived suggestion as a comment and leave the parent's state untouched.
state from this skill except for the narrowly defined Phase 4b backstop that reopens a leaf auto-closed at an intermediate environment. --rollup remains the only other write path (parent derivation, per the leaf-only-lifecycle rule); every normal milestone SUGGESTS a transition in its comment and nothing more. The state is the lifecycle lane, so an unscoped write here would move the item in the build queue.type- or position-derived match may inform a read and must never supply a write target (config-resolution, R2).$READY). It cites the leaf-only-lifecycle rule by slug rather than restating the state machine.save_comment fails, retry once. If it fails again, surface the error.pr_url=<url> is present: native first, managed-comment fallback, never silently dropped.