extract-skill
Reverse-engineer design systems, tokens, and components from live products or screenshots
Wrap up a branch — run tests, create PR, merge or discard — use when implementation is done
$ npx -y skills add nyldn/claude-octopus --skill skill-finish-branch --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/skill-finish-branchContext preview
The summary Claude sees to decide when to auto-load this skill.
Wrap up a branch — run tests, create PR, merge or discard — use when implementation is done
name: skill-finish-branch description: "Wrap up a branch — run tests, create PR, merge or discard — use when implementation is done" disable-model-invocation: true
> **Host: Codex CLI** — This skill was designed for Claude Code and adapted for Codex. > Cross-reference commands use installed skill names in Codex rather than `/octo:*` slash commands. > Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it. > For host tool equivalents, see `skills/blocks/codex-host-adapter.md`.
This generated Codex skill preserves an enforced workflow contract from the source skill.
**PROHIBITED:**
**Your first output line MUST be:** `🐙 **CLAUDE OCTOPUS ACTIVATED** - Branch Completion`
Full ship pipeline: tests → multi-provider review → version bump → changelog → commit → push → PR.
**Core principle:** Verify tests → Review diff → Bump version → Update changelog → Present options → Execute choice → Clean up.
**Before anything else, verify tests pass:**
# Detect and run project's test suite if [[ -f "package.json" ]]; then npm test elif [[ -f "pytest.ini" ]] || [[ -f "pyproject.toml" ]]; then pytest elif [[ -f "Cargo.toml" ]]; then cargo test elif [[ -f "go.mod" ]]; then go test ./... elif [[ -f "Makefile" ]] && grep -q '^test:' Makefile; then make test fi
**If tests fail:** STOP. Show failures. Do not proceed.
**If tests pass:** Continue to Step 2.
**Run a quick multi-provider review of the changes before shipping.** This catches issues before they reach PR reviewers.
# Get the diff summary DIFF_STAT=$(git diff --stat $(git merge-base HEAD main)..HEAD) DIFF_FILES=$(git diff --name-only $(git merge-base HEAD main)..HEAD)
**Always run a quick review — this is automatic, not optional:**
# Quick review via orchestrate.sh (uses available providers)
${HOME}/.claude-octopus/plugin/scripts/orchestrate.sh spawn reviewer "Review this diff for bugs, security issues, and code quality problems. Be concise — only flag real issues, not style preferences.
$(git diff $(git merge-base HEAD main)..HEAD | head -500)"**If critical issues found:** Present them and ask whether to fix or ship anyway. **If clean:** Continue to Step 3. Show a brief `✓ Review clean — no issues found`.
# Identify the base branch
BASE_BRANCH=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}')
[[ -z "$BASE_BRANCH" ]] && BASE_BRANCH="main"
# Check for VERSION file
VERSION_FILE=""
for f in VERSION version.txt package.json; do
[[ -f "$f" ]] && VERSION_FILE="$f" && break
done**If a VERSION file or package.json exists**, offer to bump:
AskUserQuestion({
questions: [{
question: "Version bump?",
header: "Version",
multiSelect: false,
options: [
{label: "Patch (Recommended)", description: "Bug fixes, minor changes (1.2.3 → 1.2.4)"},
{label: "Minor", description: "New features, backward compatible (1.2.3 → 1.3.0)"},
{label: "Major", description: "Breaking changes (1.2.3 → 2.0.0)"},
{label: "Skip", description: "Don't bump version"}
]
}]
})**If bumping:** Update the version file and prepend a changelog entry summarizing the diff:
# Generate changelog entry from commits COMMITS=$(git log --oneline $(git merge-base HEAD $BASE_BRANCH)..HEAD) # Prepend to CHANGELOG.md if it exists
Present exactly these 4 options:
✅ Ship ready. Tests passing. Review clean. What would you like to do? 1. **Create PR** (Recommended) - Push and create a Pull Request for review 2. **Merge locally** - Merge back to <base-branch> on this machine 3. **Keep as-is** - Leave the branch, I'll handle it later 4. **Discard** - Delete this work permanently Which option? (1-4)
**Keep options concise.** Don't add explanations unless asked.
# Get current branch name FEATURE_BRANCH=$(git branch --show-current) BASE_BRANCH="main" # or detected base # Switch to base branch git checkout $BASE_BRANCH # Pull latest git pull origin $BASE_BRANCH # Merge feature branch git merge $FEATURE_BRANCH # Verify tests on merged result npm test # or appropriate test command # If tests pass, delete feature branch git branch -d $FEATURE_BRANCH
**Report:**
✅ Merged $FEATURE_BRANCH into $BASE_BRANCH ✅ Tests pass on merged result ✅ Feature branch deleted Ready to push when you want: git push origin $BASE_BRANCH
# Get branch info
FEATURE_BRANCH=$(git branch --show-current)
# Push branch
git push -u origin $FEATURE_BRANCH
# Create PR with a validated description file
REPO_SLUG=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
PR_TITLE=${PR_TITLE:?Complete PR_TITLE before creating the pull request}
CHANGE_SUMMARY=${CHANGE_SUMMARY:?Complete CHANGE_SUMMARY before creating the pull request}
CHANGE_REASON=${CHANGE_REASON:?Complete CHANGE_REASON before creating the pull request}
PR_BODY=$(cat <<EOF
## Summary
- ${CHANGE_SUMMARY}
- ${CHANGE_REASON}
## Test Plan
- [x] Unit tests pass
- [x] Manual verification done
- [ ] Code review needed
EOF
)
if ! "${CLAUDE_PLUGIN_ROOT:-${HOME}/.claude-octopus/plugin}/scripts/safe-gh-commentEvery AI model has blind spots. Claude Octopus supports twelve external provider integrations — Codex, Antigravity CLI, Copilot, Qwen, Ollama, Perplexity, OpenRouter, OrcaRouter, OpenCode, Cursor CLI, Grok, and Kimi Code — alongside the built-in Claude Code
Repo: nyldn/claude-octopus
Reverse-engineer design systems, tokens, and components from live products or screenshots
Multi-AI requirements scoping using available external providers (Double Diamond Define phase). Priority triggers: octo define, octo scope, co-define,…
Multi-AI validation, scoring, and review using available external providers (Double Diamond Deliver phase)
Multi-AI implementation using available external providers (Double Diamond Develop phase). DO NOT use for simple code edits, reading/reviewing code, built-in…
Multi-AI research using available external providers (Double Diamond Discover phase)
Decompose and execute large changes, migrations, or multi-issue fixes in parallel with quality gates