factory-close

factory-close is a skill for Claude Code, Codex from nonlinear-xyz/factory-kit. It costs 26 tokens per session (981 once invoked), scanned A, original, MIT.

A workflow for closing a Linear issue, a tracked development task, after its code has already shipped.

In plain words
What is it for?
Use it to close a ticket, add a summary comment, and remove its local branch and worktree after confirming the changes are committed.
Why use it?
It helps finish the administrative work by recording the outcome, moving the issue to Done, and cleaning up local development branches.

Skill for Claude CodeCodex

Part of the factory-kit plugin — 37 skills, 8 commands, 12 agents, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nonlinear-xyz/factory-kit/factory-close
Any agent
npx skills add nonlinear-xyz/factory-kit --skill factory-close
Clone the repo
git clone --depth 1 https://github.com/nonlinear-xyz/factory-kit

Made for: Claude Code, Codex.

Or install factory-kit, the plugin that ships this one along with the rest of its 37 skills, 8 commands, 12 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for factory-close

README.md
[![agentmods](https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-close.svg)](https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-close)
Your own site
<a href="https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-close"><img src="https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-close.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 981 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00026 $0.00981
Opus 5 $0.00013 $0.00491
Sonnet 5 $0.00005 $0.00196
Haiku 4.5 $0.00003 $0.00098

Measured 4d ago against content hash 1e1166b9150d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

factory-close scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/factory-close/SKILL.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You're finishing a ticket. This command:

  1. Drafts a closing comment summarizing what shipped
  2. Moves the Linear issue to Done
  3. Cleans up the local branch and worktree

It does not merge a PR or push code — that's expected to have happened already.

Invocation input: an optional issue identifier. If omitted, auto-detect it from the current branch name.

What to do

  1. Read project configuration. Prefer .factory-kit/linear.json; use legacy .claude/linear.json only as a migration fallback. If neither exists, stop and direct the user to setup-linear. Pull teamKey and states.done (default "Done").

  2. Resolve the issue ID the same way /submit does:

    • Argument provided → normalize (prepend <teamKey>- if numeric).
    • Otherwise → parse current branch (git rev-parse --abbrev-ref HEAD) for <teamKey>-<num> (case-insensitive).
    • If nothing matches, ask the user.
  3. Pre-flight checks. Run these in parallel, surface what they show, and gate on user confirmation before mutating anything:

    • git status — any uncommitted changes? If yes, warn and ask before proceeding.
    • git log <main-or-default>..HEAD --oneline — commits since divergence. Use this for the closing comment.
    • git diff --stat <main-or-default>...HEAD — top-level files touched.
    • Linked PR state if discoverable (inspect Linear issue attachments through the connected integration, or run gh pr list --head <branch>). If a PR exists and isn't merged, warn — close is normally a post-merge action.
  4. Draft the closing comment (≤ 150 words) in the factory-voice.md shape — bold labels, short sentences, omit empty sections. The closing comment is the densest node in the decision graph for this issue; link liberally.

    **Outcome:** <one or two lines on what shipped — not a diff dump>
    **Why:** <the underlying constraint or principle the work satisfied>
    **Tradeoff:** <non-obvious tradeoffs worth recording — omit if the diff is self-explanatory>
    **Open:** <deferred work or follow-ups; file each as its own issue if substantial and link the IDs here>
    **Refs:** <PR # / merge commit SHA / related issue IDs / customer feedback URL if this resolved a customer ask>
    

    The reader is someone scanning the issue six months from now to understand why this exists. Skip the play-by-play; record the load-bearing decisions. If a follow-up was punted, prefer "filed as <KEY-N>" over "TBD" — convert open questions into graph nodes.

  5. Show the draft and ask for approval. The user can edit tone or pull anything sensitive before it lands in Linear.

  6. On approval, in this order:

    • Post the comment through the Linear integration with the issue ID and body.
    • Move the issue to Done through the Linear integration, using the configured done value. Resolve a state UUID by listing team statuses if names aren't accepted.
  7. Clean up local state. Confirm once more before any branch-deletion step — destructive operations aren't pre-authorized.

    • If the current directory is a worktree (git rev-parse --show-toplevel differs from the main repo root), use the host's worktree-exit capability when available; otherwise use safe git worktree commands matching the user's confirmed merge-or-discard choice.
    • Otherwise: git checkout main (or the project's default branch) then git branch -d <branch>. Use -D only if -d refuses and the user explicitly approves (work is unmerged, confirm intent).
  8. Confirm completion. Print: <KEY-N> closed. Branch deleted. Worktree exited (if applicable).

Read the full file on GitHub · 58 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 58 lines · 26 tokens per session scan A 1e1166b9150d

Subscribe to this mod's changes

factory-close is a skill published in the GitHub repository nonlinear-xyz/factory-kit (9 stars, last pushed 1mo ago), licensed MIT. It adds 26 tokens to every session and 981 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories