From hoangsa
This skill should be used when the user wants to start a new task, switch between tasks, park or resume work, finish a task (push + PR), clean up merged branches, or sync with upstream. Triggers on phrases like 'start task', 'new task', 'work on', 'switch to', 'park this', 'resume', 'continue where I left off', 'done with this', 'finish task', 'create PR', 'clean branches', 'delete merged', 'rebase', 'pull latest', or 'sync with main'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hoangsa:git-flowThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<objective>
Run once per session before any flow:
# 1. Detect base branch
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'
# Fallback: check for main, master, develop
# 2. Detect branching strategy from existing branches
git branch -a --format='%(refname:short)'
# 3. Detect naming convention from recent branches
git branch --sort=-committerdate --format='%(refname:short)' | head -20
# 4. Current state
git status --porcelain
git stash list
git log --oneline -5
Strategy detection rules:
develop, release/*, hotfix/* → gitflowmain/master + feature/* → trunk-basedNaming convention detection:
feature/, feat/, fix/, bugfix/, chore/-, _, /PROJ-123, #123, no IDdevelopmain/mastermain/mastergit checkout -b <branch-name> <base-branch>
git status --porcelain)/plate, then switchgit stash push -m "WIP: <current-task-context>"git checkout -- .git checkout <branch>Two strategies — ask user preference (save to config on first ask):
wip: <context> → can be squashed latergit stash push -m "PARK: <task-context> [<branch>]"# WIP commit approach
git add -A
git commit -m "wip: <task-description>"
# Stash approach
git stash push -m "PARK: <task-description> [$(git branch --show-current)]"
After parking, optionally switch to another branch (ask user).
Trigger: "resume", "continue", "back to task X", "where was I"# Check for WIP commits on branches
git branch --sort=-committerdate --format='%(refname:short)' | while read b; do
git log -1 --format='%s' "$b" 2>/dev/null | grep -q '^wip:' && echo "$b"
done
# Check stash list
git stash list | grep 'PARK:'
git stash popgit reset HEAD~1 to unstage, or keep working and squash later)
/plategit push -u origin $(git branch --show-current)
gh pr create --title "<title>" --body "<body>" --base <base-branch>
/serve if external task linked (update status to "In Review")# Find merged branches
git branch --merged <base-branch> --format='%(refname:short)' | grep -v -E '^(main|master|develop)$'
# Show list, confirm with user
# Delete confirmed branches
git branch -d <branch>
# Prune remote tracking
git remote prune origin
Trigger: "pull latest", "rebase", "sync", "update from main"
# If merge commits exist → merge strategy
git log --oneline --merges -5
# Rebase strategy (default for feature branches)
git fetch origin
git rebase origin/<base-branch>
# Merge strategy
git fetch origin
git merge origin/<base-branch>
Read/write via:
"$HOANGSA_ROOT/bin/hoangsa-cli" pref get . <key>
"$HOANGSA_ROOT/bin/hoangsa-cli" pref set . <key> <value>
This skill is integrated into HOANGSA workflows via the shared `git-context.md` module:
| Workflow | Integration Point | Behavior |
|---|---|---|
/menu | Step 1c (after session init) | Create branch for new feature |
/fix | Step 3 (after session init) | Create branch for bugfix |
/cook | Step 1c (before execution) | Verify correct branch |
/plate | Step 6 (after commit) | Push + PR + switch options |
The skill provides the knowledge; git-context.md provides the executable steps that workflows reference.
npx claudepluginhub unknown-studio-dev/hoangsa --plugin hoangsaCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.