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.
npx agentmods add commands/jpm1118/threadwork/finish-and-closegit clone --depth 1 https://github.com/JPM1118/ThreadworkWrote 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.
[](https://agentmods.dev/commands/jpm1118/threadwork/finish-and-close)<a href="https://agentmods.dev/commands/jpm1118/threadwork/finish-and-close"><img src="https://agentmods.dev/badge/commands/jpm1118/threadwork/finish-and-close.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01668 |
| Opus 5 | $0.00000 | $0.00834 |
| Sonnet 5 | $0.00000 | $0.00334 |
| Haiku 4.5 | $0.00000 | $0.00167 |
Grade A, and why
finish-and-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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/finish-and-close - Complete Feature and Close Epic
Execute the landing strategy determined by the finishing skill. This command handles the actual merge/PR creation and cleanup.
Usage
/finish-and-close --epic {epic-id} --strategy {merge|pr}
Parameters
| Parameter | Required | Description |
|---|---|---|
--epic |
Yes | The Beads epic ID (e.g., bd-a3f) |
--strategy |
Yes | Landing strategy: merge or pr |
Prerequisites
This command should only be invoked by the finishing skill after verification:
- All tasks closed
- Tests passing
- Landing strategy determined
Execution Steps
Strategy: Merge
When --strategy merge:
Step 1: Ensure Clean State
# Check for uncommitted changes
git status --porcelain
# If changes exist, abort
# User should commit or stash first
Step 2: Update Base Branch
# Read config for base branch
base_branch=$(grep base_branch .threadwork.yaml | cut -d: -f2 | tr -d ' ')
# Fetch and update
git fetch origin
git checkout $base_branch
git pull origin $base_branch
Step 3: Merge Feature Branch
# Get current feature branch name
feature_branch=$(git rev-parse --abbrev-ref HEAD)
# Checkout base and merge
git checkout $base_branch
git merge --no-ff $feature_branch -m "Merge {feature_branch}: {epic title}
Closes epic {epic-id}
Tasks completed:
- {task-1-id}: {task-1-title}
- {task-2-id}: {task-2-title}
...
"
Step 4: Push to Remote
git push origin $base_branch
Step 5: Close Epic in Beads
bd --no-daemon close {epic-id} --reason "Merged to {base_branch}. {N} tasks completed."
Step 6: Cleanup
# Get worktree path
worktree_path=$(git worktree list | grep {feature_branch} | awk '{print $1}')
# Remove worktree (if exists and not current directory)
if [ -n "$worktree_path" ] && [ "$worktree_path" != "$(pwd)" ]; then
git worktree remove "$worktree_path"
fi
# Delete feature branch
git branch -d {feature_branch}
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.
- 3d ago First seen · 291 lines · 0 tokens per session scan A 87fe18a2612c
finish-and-close is a command published in the GitHub repository JPM1118/Threadwork (5 stars, last pushed 8mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,668 tokens. 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.
Other commands, from other repositories
changelog
Generate a new changelog entry by reading all changeset files and creating a properly formatted entry in .changelog/v3.mdx.
merge-and-status
Merge the current PR, pull main, surface any open contributor PRs and untriaged contributor issues, and show open milestone issues.
ship
Deliver the increment. Then go live with a rollback you have run.
update-changelog-and-tag
You are preparing a release. Follow these steps precisely.
release-tag
Create and push a version tag after a release PR has been merged.
release
Orchestrate a complete release workflow with quality gates, version bumping, and publishing automation.