factory-setup-linear
Configure portable Linear workflow settings in `.factory-kit/linear.json`, migrating legacy `.claude/linear.json` settings when present.
SKILL.mdskills/factory-setup-linear/SKILL.md
GitHubYou're configuring this project to use the Factory Kit Linear workflows. The other workflows read .factory-kit/linear.json from the project root; this workflow creates or migrates it.
What to do
Check for configuration. Read
.factory-kit/linear.json. If it exists, show the current contents and ask whether the user wants to overwrite, edit, or abort. If it is absent but legacy.claude/linear.jsonexists, use that as a migration fallback, show it, and offer to write the equivalent canonical file.Discover Linear context. Use the connected Linear integration's available capabilities:
- List teams the user can access. Show
key — name (id)lines. - Ask which team to use through the host's user-interaction capability, or directly in chat when no structured prompt exists. Capture both
key(e.g.,NON) andid(UUID). - List projects filtered to the chosen team. Ask whether standup should be scoped to one active project; "no" means team-wide.
- If a project is chosen, capture
idandname.
- List teams the user can access. Show
Confirm state names. Defaults are
"Todo","In Progress","In Review"and"Done"; Todo and In Progress are the states that triggerfactory-prep.md. List issue statuses for the chosen team through the Linear integration and verify each name exists. If not, ask the user for the actual names.Agent-state labels (used by
factory-log.md). List the team's labels. If there's no label group for agent state, offer to create a group namedAgentwith the childrenWorking,Needs decisionandBlocked. A label group allows one label per issue, so the agent state is always exactly one of the three. Create it only on approval. Then suggest the user save a Linear view filtered onAgent: Needs decision. That view is their review queue.Learn surface. Ask whether learn-rep threads should run in this team's Linear (
"linear") or stay in the terminal ("local", the default). Point out that everyone in the workspace can see Linear threads; for a client's workspace,"local"is usually right.Write
.factory-kit/linear.jsonwith this shape:{ "teamKey": "NON", "teamId": "<uuid>", "projectId": "<uuid-or-omit>", "projectName": "<name-or-omit>", "states": { "todo": "Todo", "inProgress": "In Progress", "inReview": "In Review", "done": "Done" }, "branchPattern": "<owner>/<teamKey-lower>-<number>-<topic>", "agentLabels": { "group": "Agent", "working": "Working", "needsDecision": "Needs decision", "blocked": "Blocked" }, "learnSurface": "local" }projectId/projectNameare optional — omit the keys entirely if the user didn't pick a project.branchPatternis documentation-only —/submitand/closeparse the branch with a regex (-(\d+)-) and don't depend on this string. Include it so future readers know the convention.
Show the file path and confirm — print "Wrote .factory-kit/linear.json. Factory Kit's standup, prep, entry, log, submit, and close workflows are ready." Don't commit it; the user decides whether to check it in.
Style
Direct, minimal back-and-forth. If the user has only one team, skip the question — just use it. If they don't pick a project, that's fine — many repos don't have one.