diff --git a/docs/plans/2026-02-23-finish-up-implementation.md b/docs/plans/2026-02-23-finish-up-implementation.md new file mode 100644 index 0000000..acd0c49 --- /dev/null +++ b/docs/plans/2026-02-23-finish-up-implementation.md @@ -0,0 +1,155 @@ +# /finish-up Skill Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. + +**Goal:** Create a `/finish-up` Claude Code slash command that scans all projects for uncommitted/unpushed changes, reports findings, then dispatches parallel subagents to commit and push. + +**Architecture:** A bash scan script (`git-status-check.sh`) outputs structured CSV-like results. The skill file (`finish-up.md`) instructs Claude to run the script, parse results, present a report, confirm with the user, then spawn one Bash subagent per project for autonomous commit/push. + +**Tech Stack:** Bash (scan script), Claude Code skill markdown (command file) + +--- + +### Task 1: Create the git-status-check.sh scan script + +**Files:** +- Create: `C:/Users/aisaacs/Desktop/Projects/project-scripts/git-status-check.sh` + +**Step 1: Write the scan script** + +```bash +#!/usr/bin/env bash +# git-status-check.sh - Scan git repos for uncommitted changes and unpushed commits +# Usage: git-status-check.sh [directory] +# directory: path to scan (default: parent of script directory) +# Output: TAB-separated lines: project_name \t uncommitted_count \t unpushed_count \t branch + +set -euo pipefail + +SCAN_DIR="${1:-$(dirname "$(dirname "$(readlink -f "$0")")")}" + +for dir in "$SCAN_DIR"/*/; do + [ -d "$dir/.git" ] || continue + + name=$(basename "$dir") + branch=$(git -C "$dir" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown") + + # Count uncommitted changes + uncommitted=$(git -C "$dir" status --porcelain 2>/dev/null | wc -l | tr -d ' ') + + # Count unpushed commits (0 if no upstream) + unpushed=$(git -C "$dir" log @{u}..HEAD --oneline 2>/dev/null | wc -l | tr -d ' ' || echo "0") + + echo -e "${name}\t${uncommitted}\t${unpushed}\t${branch}" +done +``` + +**Step 2: Make it executable and test** + +Run: `chmod +x C:/Users/aisaacs/Desktop/Projects/project-scripts/git-status-check.sh` +Run: `bash C:/Users/aisaacs/Desktop/Projects/project-scripts/git-status-check.sh C:/Users/aisaacs/Desktop/Projects` + +Expected: TAB-separated output with one line per git repo, showing project name, uncommitted count, unpushed count, and branch. + +**Step 3: Verify edge cases** + +Run the script and confirm: +- Non-git directories (like loose `.py`/`.cs` files) are skipped +- Repos with no upstream tracking show `0` for unpushed (not an error) + +**Step 4: Commit** + +```bash +cd C:/Users/aisaacs/Desktop/Projects/project-scripts +git add git-status-check.sh +git commit -m "feat: add git-status-check.sh scan script + +Scans all git repos in a directory for uncommitted changes and +unpushed commits. Outputs structured TAB-separated results. +Replaces check_uncommitted.py with additional unpushed detection. + +Co-Authored-By: Claude Opus 4.6 " +``` + +--- + +### Task 2: Create the /finish-up skill file + +**Files:** +- Create: `C:/Users/aisaacs/.claude/commands/finish-up.md` + +**Step 1: Write the skill file** + +The skill markdown instructs Claude on how to execute the /finish-up workflow: + +1. Detect context (all projects vs single project) +2. Run `git-status-check.sh` and parse output +3. Present report table +4. Ask user which projects to process +5. Spawn parallel Bash subagents for commit/push +6. Collect results and present summary + +Key instructions for the skill: +- Use `Task` tool with `subagent_type="Bash"` for parallel work +- Each subagent: `git add -A && git diff --cached --stat` to review, craft commit message, commit, push with retry +- Handle Gitea cold-start (retry push after 5s on first failure) +- Never commit `.env`, `credentials`, `secrets` files +- Use conventional commit format +- Include `Co-Authored-By: Claude Opus 4.6 ` + +**Step 2: Test the skill** + +Run `/finish-up` in a Claude Code session from `C:\Users\aisaacs\Desktop\Projects` and verify: +- Script runs and output is parsed correctly +- Report is presented clearly +- Subagents are dispatched for selected projects + +**Step 3: Commit** + +```bash +cd C:/Users/aisaacs/Desktop/Projects/project-scripts +git add C:/Users/aisaacs/.claude/commands/finish-up.md +git commit -m "feat: add /finish-up Claude Code slash command + +Scans projects for uncommitted/unpushed changes, reports findings, +then dispatches parallel subagents to commit and push. + +Co-Authored-By: Claude Opus 4.6 " +``` + +--- + +### Task 3: Clean up old check_uncommitted.py + +**Files:** +- Delete: `C:/Users/aisaacs/Desktop/Projects/check_uncommitted.py` (loose copy in Projects root) +- Delete: `C:/Users/aisaacs/Desktop/Projects/project-scripts/check_uncommitted.py` + +**Step 1: Remove old scripts** + +```bash +rm C:/Users/aisaacs/Desktop/Projects/check_uncommitted.py +cd C:/Users/aisaacs/Desktop/Projects/project-scripts +git rm check_uncommitted.py +``` + +**Step 2: Commit** + +```bash +git commit -m "chore: remove check_uncommitted.py (replaced by git-status-check.sh) + +Co-Authored-By: Claude Opus 4.6 " +``` + +--- + +### Task 4: Push project-scripts to remote + +**Step 1: Push** + +```bash +cd C:/Users/aisaacs/Desktop/Projects/project-scripts +git push +``` + +If push fails (Gitea cold-start), wait 5 seconds and retry.