clean-branch
Clean up merged branches, close issues, and extract compound learning insights
What this skill does
# Branch Cleanup & PR Retrospective You've just merged a PR. Now complete the post-merge cleanup workflow. ## Workflow ### Phase 1: Identify Current State **CRITICAL**: The current branch from the shell is authoritative. Ignore any prior conversation context referencing other PRs or branches — only clean up the PR associated with the CURRENT branch as reported by `git branch --show-current`. First, determine what branch you're on and find the associated merged PR and issue: ```bash # Get current branch name — this is the ONLY source of truth CURRENT_BRANCH=$(git branch --show-current) echo "Current branch: $CURRENT_BRANCH" # Find merged PR for this branch — extract number and title as separate variables PR_NUMBER=$(gh pr list --state merged --head "$CURRENT_BRANCH" --limit 1 --json number --jq '.[0].number // empty') PR_TITLE=$(gh pr list --state merged --head "$CURRENT_BRANCH" --limit 1 --json title --jq '.[0].title // empty') echo "Merged PR: #$PR_NUMBER — $PR_TITLE" # Guard: stop if no merged PR found for this branch if [ -z "$PR_NUMBER" ]; then echo "ERROR: No merged PR found for branch '$CURRENT_BRANCH'." echo "This skill only cleans up branches that have a merged PR." echo "If the PR was merged from a different branch name, switch to that branch first." exit 1 fi ``` **If no merged PR is found for the current branch, stop immediately and report:** > No merged PR found for branch `$CURRENT_BRANCH`. This skill only cleans up branches that have a merged PR. If the PR was merged from a different branch name, switch to that branch first. Do NOT fall back to guessing, searching other branches, or using PRs from prior conversation context. ```bash # Get full PR details to find issue number (only if merged PR was found) gh pr view "$PR_NUMBER" --json number,title,body ``` ### Phase 2: Branch Cleanup Dynamically detect the repository's default branch — do NOT hardcode `dev` or `main`: ```bash # Detect the default branch dynamically (with fallback matching lfg/work skills) DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' 2>/dev/null || echo "main") echo "Default branch: $DEFAULT_BRANCH" # Switch to default branch and pull latest git checkout "$DEFAULT_BRANCH" git pull origin "$DEFAULT_BRANCH" # Delete local feature branch (use $CURRENT_BRANCH captured in Phase 1) git branch -d "$CURRENT_BRANCH" # Delete remote feature branch git push origin --delete "$CURRENT_BRANCH" ``` ### Phase 3: Close Associated Issue Close the GitHub issue with a summary of what was completed: ```bash # View issue to understand what was done gh issue view <ISSUE_NUMBER> # Close issue with comment summarizing the work gh issue close <ISSUE_NUMBER> --comment "Completed in PR #$PR_NUMBER. <Brief 1-2 sentence summary of what was implemented/fixed> Changes merged to $DEFAULT_BRANCH." ``` ## Important Notes - **PR Analysis**: Compound engineering analysis happens automatically via the Stop hook - **No manual telemetry**: The telemetry system will detect this command and analyze the PR for learning opportunities - **Summary format**: Keep issue close comments concise but informative - **Branch authority**: Always trust `git branch --show-current` over any conversation context ## What Happens Automatically After you complete the cleanup, the telemetry system will: 1. Analyze the merged PR for patterns (review iterations, fix commits, common themes) 2. Identify compound engineering opportunities (automation, systematization, delegation) 3. Save insights to `meta/telemetry.json` in the `compound_learnings[]` array 4. Log suggestions for preventing similar issues in future PRs This analysis looks for: - **Delegation opportunities**: When specialized agents could have helped - **Automation candidates**: Recurring manual processes - **Systematization targets**: Knowledge for documentation - **Prevention patterns**: Issues needing earlier intervention
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.