sdlc:complete
Finish work and reset local environment for next task. Use this when the user is done with a feature branch, wants to clean up after a merged PR, or needs to reset their workspace.
What this skill does
# Complete Work Finish the current task and reset the local environment for the next piece of work. In all bash steps below, substitute placeholder names (like BASE_BRANCH, CURRENT_BRANCH, etc.) with the actual values you stored earlier. ## Workflow 1. **Verify PR is merged** to confirm the work is done 2. **Update Linear issue** to Done (if applicable) 3. **Detect environment and cleanup** worktree or branch 4. **Prune stale branches** that have been merged remotely 5. **Confirm clean state** ## Step 1: Verify PR is Merged Follow [Branch Verification](../../reference/common-patterns.md#branch-verification). If CURRENT_BRANCH equals BASE_BRANCH, note "Already on default branch" and skip to Step 4. Otherwise, check PR status: ```bash gh pr view --json state --jq '.state' ``` Store the output as PR_STATE (or "NONE" if the command fails). - If OPEN: warn the user the PR is still open and ask if they want to continue anyway - If MERGED: note "PR merged successfully" - If NONE: note "No PR found for branch" and proceed ## Step 2: Update Linear Issue Try to extract a Linear issue ID from the branch name: ```bash ../../scripts/get-linear-issue-id.sh "CURRENT_BRANCH" ``` If it succeeds, store the output as ISSUE_ID and update: ```bash linear issue update ISSUE_ID -s "Done" ``` If the Linear CLI is not available or the command fails, continue silently. ## Step 3: Detect Environment and Cleanup Follow [Linked Worktree Detection](../../reference/common-patterns.md#linked-worktree-detection) to determine if the current directory is a linked worktree. Then follow the matching case below. ### Case A: Linked worktree with SDLC marker Applies when worktree detection indicates a linked worktree AND the marker file exists: ```bash test -f .sdlc-worktree ``` Get the current worktree path: ```bash git rev-parse --show-toplevel ``` Store as WORKTREE_PATH. Get the main worktree path: ```bash git worktree list --porcelain ``` The first line has the format `worktree /path/to/main`. Extract the path and store as MAIN_WORKTREE. Remove the worktree: ```bash git -C "MAIN_WORKTREE" worktree remove "WORKTREE_PATH" ``` If this fails because the worktree has uncommitted changes, inform the user and advise manual cleanup. Do not force-remove, as that risks losing work. ### Case B: Linked worktree without SDLC marker This worktree was not created by `sdlc:design`. Warn the user and advise manual cleanup. Do not attempt any removal. ### Case C: Main working tree Switch back to the default branch and clean up the feature branch: ```bash git checkout "BASE_BRANCH" ``` ```bash git pull origin "BASE_BRANCH" ``` ```bash git branch -d "CURRENT_BRANCH" ``` The `-d` flag (lowercase) only deletes if the branch is fully merged, which is a safety net against accidental deletion of unmerged work. ## Step 4: Prune Stale Branches From the main worktree, clean up remote tracking branches that no longer exist: ```bash git fetch --prune ``` List branches to identify those whose remote was deleted after merge: ```bash git branch -vv ``` For each branch showing `[gone]` in the output, delete it: ```bash git branch -d <branch-name-here> ``` ## Step 5: Confirm Reset ```bash git worktree list ``` ```bash git branch --show-current ``` ```bash git status --short ``` ## Output ``` Environment reset complete Branch: main Status: (clean) Ready for next task. Use /sdlc:design <issue-id> to start. ```
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.