skills/xt-end/SKILL.md
Autonomous session close flow for xt worktree sessions. Use this skill whenever the user says "done", "finished", "wrap up", "close session", "ship it", "I'm done", "ready to merge", or similar. Also activate when all beads issues in the session are closed, or when the user explicitly runs /xt-end. This skill is designed for headless/specialist use: it must make deterministic decisions, auto-remediate common anomalies, and avoid clarification questions unless execution is truly blocked.
npx skillsauth add jaggerxtrm/jaggers-agent-tools xt-endInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are closing an xt worktree session. The canonical CLI is xt end, but you must normalize the session first and automatically handle common anomalies.
Default to autonomous execution:
xt end --yes — never call xt end without this flag; the bare command prompts interactively for worktree removal which blocks autonomous executionUse these mental result classes while operating:
SUCCESS_PR_CREATEDSUCCESS_PR_CREATED_WITH_WARNINGSBLOCKED_UNCLOSED_SESSION_WORKBLOCKED_NO_COMMITSBLOCKED_AUTHBLOCKED_CONFLICTSBLOCKED_DIRTY_UNCLASSIFIED_CHANGESRun:
bd list --status=in_progress
bd list --status=open
git log --oneline @{upstream}..HEAD 2>/dev/null || git log --oneline origin/main..HEAD 2>/dev/null || git log --oneline
Rules:
in_progress issuesBLOCKED_UNCLOSED_SESSION_WORKThis skill is stricter about unfinished session work than about unrelated backlog.
Run:
git status --short
If clean, continue.
If dirty:
xt end with a dirty treePreferred automatic actions:
git add -A && git commit -m "<descriptive summary> (<issue-id>)"
# or
git stash push -m "xt-end:auto-stash before session close"
If changes cannot be classified safely, stop with BLOCKED_DIRTY_UNCLASSIFIED_CHANGES.
Before committing or pushing, verify that branch changes match the expected scope of the session's closed issues. Never skip this step — unreviewed scope is the primary source of oversized or unintended PRs.
Run:
git diff --stat origin/main..HEAD 2>/dev/null || git diff --stat $(git merge-base HEAD main)..HEAD
For each significantly changed symbol, check blast radius:
npx gitnexus impact <symbol-name> # upstream dependants — what else breaks
npx gitnexus impact <symbol-name> -d downstream # downstream dependencies
For Claude agents with MCP access, also run:
gitnexus_detect_changes({scope: "compare", base_ref: "main"})
Rules:
npx gitnexus impact returns HIGH or CRITICAL risk on a changed symbol → stop and report to user before continuingRun:
xt end --dry-run
Parse the preview and check for anomalies:
Treat these as invalid:
session changesupdateupdatesmiscwipwork in progressAuto-remediation:
Add docs cross-check command and testsIntegrate docs workflow with sync-docsUpdate docs workflow and CLI helpIf dry-run says no beads issues were found, but commit messages contain issue-like IDs, treat that as a tooling mismatch.
Auto-remediation:
If files like dist/ are included:
Use repository history/common practice as the heuristic; do not ask.
Classify the PR scope into buckets:
If all buckets support one coherent feature/change, continue.
If they look unrelated, continue but mark the PR as WITH_WARNINGS and mention overscope in the final report.
After auto-remediating anomalies, re-run:
xt end --dry-run
Repeat until the preview is acceptable or a hard blocker appears.
Before actual execution, ensure the branch really has changes:
git log --oneline @{upstream}..HEAD 2>/dev/null || git log --oneline origin/main..HEAD 2>/dev/null
If there are no commits ahead of base, stop with BLOCKED_NO_COMMITS.
Run:
xt end --yes
Use non-interactive mode by default for autonomous execution.
Capture:
Run:
git status
Resolve all conflict markers, then:
git add <resolved-files>
git rebase --continue
xt end --yes
If conflicts are too complex to resolve safely, stop with BLOCKED_CONFLICTS.
Try:
git fetch origin
xt end --yes
gh auth failsStop with BLOCKED_AUTH and report:
gh auth login
Default behavior: remove the worktree automatically after a successful PR creation.
Rationale:
If cleanup is needed after xt end --yes:
git worktree remove <path> --force
Keep the worktree only if an explicit keep policy exists (for example, known immediate follow-up work on the same branch).
Always report:
SUCCESS_PR_CREATED or SUCCESS_PR_CREATED_WITH_WARNINGS)If linkage had to be inferred from commits rather than detected by xt end, say so explicitly.
Already on main/master/default branch
No commits yet on branch
BLOCKED_NO_COMMITSDirty tree with unclear ownership
BLOCKED_DIRTY_UNCLASSIFIED_CHANGESgh not authenticated
BLOCKED_AUTHbeads unavailable
Multiple anomalies at once
The autonomous rule is simple:
development
Operational service-knowledge system for a project's services. One skill that creates, discovers, activates, updates, and scopes per-service expert skill packages (SKILL.md + diagnostic scripts + references), kept in sync with the code via a GitNexus-aware drift engine. Use when onboarding to a service, routing a task to the right expert, scaffolding a missing skill, or syncing a skill after the implementation drifted. Triggers: /service-skills, /creating-service-skills, /using-service-skills, /updating-service-skills, /scope, or any task that touches a registered service territory.
development
Bootstrap a complete security pipeline (Dependabot + OSV + Semgrep + gitleaks + pre-commit hooks + Codex review) on any GitHub repo. Designed for free user-private repos where GitHub Advanced Security is unavailable. Reusable across Python/TypeScript/Go/Rust stacks.
testing
Merges queued PRs from xt worktree sessions in the correct order (FIFO), maintaining linear history by rebasing remaining PRs after each merge. Use this skill whenever the user has multiple open PRs from xt worktrees, asks to "merge my PRs", "process the PR queue", "drain the queue", "merge worktree branches", or says "what PRs do I have open". Also activate after any xt-end completion when other PRs are already open, or when the user asks "can I merge yet" or "is CI green". Handles the full sequence: list → sort → CI check → merge oldest → rebase cascade → repeat until queue is empty.
development
Complete debugging workflow — error analysis, log interpretation, performance profiling, and GitNexus call-chain tracing. Use when investigating bugs, errors, crashes, or performance issues.