| disable-model-invocation | true |
| name | onboard-branch |
| description | Onboard onto the current Git branch. Explores recent commits, diffs, uncommitted changes, and handoffs, then summarizes the state and asks clarifying questions to get up to speed.
|
Onboard Branch
Use this skill when you want a fresh agent to get up to speed on the current Git branch and pick up work where a previous agent or session left off.
IMPORTANT: DO NOT run any tests or compiler.
Assume that the project is valid. You will be told if anything is failing.
Step 1: Gather Git Context
Run the following commands to understand the current Git state:
-
Current Branch:
git branch --show-current
-
Recent Commits: Find commits unique to this branch. Attempt to identify the base branch (origin/main, origin/master, main, or master) and log the commits:
git log --oneline --graph $(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null || git merge-base HEAD origin/master 2>/dev/null || git merge-base HEAD master 2>/dev/null)..HEAD 2>/dev/null || git log --oneline --graph -n 5
Note: If the commit history is tangled, no base branch is found, or it is unclear which commits represent the current work, ask the user directly.
-
Uncommitted Changes Status:
git status --porcelain
-
Capture Full Diff: Get the diff of all changes (committed on this branch + uncommitted) against the base branch:
BASE_COMMIT=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null || git merge-base HEAD origin/master 2>/dev/null || git merge-base HEAD master 2>/dev/null || git rev-parse HEAD~1 2>/dev/null || echo HEAD)
git diff --stat $BASE_COMMIT
git diff $BASE_COMMIT
Step 2: Look for Handoffs or Active Plans
Check if there are any active plans or handoffs in the project root that might provide high-level context:
- Locate the Git root and list files:
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
ls -la "$GIT_ROOT/.todos/" 2>/dev/null || true
- If any files exist, read the most recently modified ones.
Step 3: Analyze and Formulate Questions
Examine the commits, diffs, and documents to construct:
- Goal Summary: A clear statement of what this branch is trying to achieve.
- Work Done So Far: A list of changes already made (based on commits and diffs).
- Current State: Where the code stands, including any obvious compilation errors, lint issues, or incomplete sections.
- Comprehension Gaps & Questions: List any questions you need answered to continue work, such as:
- What are the immediate next steps?
- Are there specific design patterns or decisions to keep in mind?
- Are there any blocker issues or unresolved questions?
Step 5: Present to the User
Present the summary to the user. Ask them to answer the clarifying questions and confirm if they are ready for you to proceed (and with what task, e.g., continuing development, code review, etc.).