factory-close
Skill9 starsChanged 4 months agoMITView on GitHub
Close out a Linear issue — move to Done, add a closing comment, and clean up the local branch/worktree
In this repository42 other files it gives its agents.
- guidance/claude.mdCLAUDE.md
- factory-animationSkill
- factory-api-route-engineerSkill
- factory-apiSkill
- factory-authSkill
- factory-auth-wiring-specialistSkill
- factory-ciSkill
- factory-code-reviewerSkill
- factory-commitsSkill
- factory-data-layerSkill
- factory-data-pipeline-engineerSkill
- factory-data-pipelinesSkill
- factory-db-migration-engineerSkill
- factory-db-migrationSkill
- factory-db-schema-architectSkill
- factory-deploymentSkill
- factory-designSkill
- factory-entrySkill
- factory-feature-architectSkill
- factory-forms-builderSkill
- factory-formsSkill
- factory-frontend-engineerSkill
- factory-frontendSkill
- factory-kit-auditSkill
- factory-llm-workflow-engineerSkill
- factory-llm-workflowsSkill
- factory-observabilitySkill
- factory-pitfallsSkill
- factory-promptingSkill
- factory-promptSkill
- factory-releaseSkill
- factory-security-engineerSkill
- factory-securitySkill
- factory-setup-linearSkill
- factory-stackSkill
- factory-standupSkill
- factory-state-modelingSkill
- factory-submitSkill
- factory-testingSkill
- factory-verification-engineerSkill
- factory-verificationSkill
- factory-voiceSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Read project configuration: Prefer .factory-kit/linear.json.
- Distinctive: line 23
If nothing matches, ask the user.
- Distinctive: line 25
Pre-flight checks: Run these in parallel, surface what they show, and gate on user confirmation before mutating anything:
- Distinctive: line 50
If the current directory is a worktree (git rev-parse --show-toplevel differs from the main repo root), use the host's worktree-exit …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You're finishing a ticket. This command:
- Drafts a closing comment summarizing what shipped
- Moves the Linear issue to
Done - 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
- Read project configuration. Prefer
.factory-kit/linear.json; use legacy.claude/linear.jsononly as a migration fallback. If neither exists, stop and direct the user to setup-linear. PullteamKeyandstates.done(default"Done"). - Resolve the issue ID the same way
/submitdoes:- 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.
- Argument provided → normalize (prepend
- 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.
Draft the closing comment (≤ 150 words) in the
factory-voice.mdshape — 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.- Show the draft and ask for approval. The user can edit tone or pull anything sensitive before it lands in Linear.
- 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
donevalue. Resolve a state UUID by listing team statuses if names aren't accepted.
- 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-topleveldiffers 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) thengit branch -d <branch>. Use-Donly if-drefuses and the user explicitly approves (work is unmerged, confirm intent).
- If the current directory is a worktree (
- Confirm completion. Print:
<KEY-N> closed. Branch deleted. Worktree exited (if applicable).
Style
Follow factory-voice.md. Three gates: pre-flight review → closing comment approval → branch deletion confirmation. Don't skip any. The closing comment is the historical record — future readers will judge whether to revisit this decision based on what you write. Name principles, not symptoms. If the issue is already Done, still offer the cleanup steps (sometimes Linear gets updated before the branch does).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

