recover-branch-context▌
casper-studios/casper-marketplace · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
You are tasked with understanding the intent and current state of an existing branch so you can resume or continue work effectively. The code state is your primary source of truth - it may have drifted from any associated Linear ticket.
Recover Branch Context
You are tasked with understanding the intent and current state of an existing branch so you can resume or continue work effectively. The code state is your primary source of truth - it may have drifted from any associated Linear ticket.
Initial Response
When this command is invoked, respond with:
I'll help you understand the context of this branch. Let me analyze the commits and changes.
Do you have a Linear ticket ID or URL for this work? (optional - I can proceed without it)
Then wait briefly for the user's response. If they provide a ticket, fetch it. If they say no or don't respond quickly, proceed with the analysis.
Process Steps
Step 1: Determine the Base Branch
-
Check common base branch names:
git branch -a | grep -E "(main|master|dev|develop)" | head -5 -
Find the merge base:
# Try dev first (common in this repo), then main/master git merge-base HEAD dev 2>/dev/null || git merge-base HEAD main 2>/dev/null || git merge-base HEAD master -
Get current branch name:
git branch --show-current
Step 2: Gather Commit History Since Divergence
-
Get all commits since diverging from base:
git log --oneline $(git merge-base HEAD dev)..HEAD -
Get detailed commit messages for understanding intent:
git log --format="%h %s%n%b" $(git merge-base HEAD dev)..HEAD -
Get files changed across all commits:
git diff --name-status $(git merge-base HEAD dev)..HEAD
Step 3: Gather Uncommitted Changes
-
Get staged changes:
git diff --name-status --cached -
Get unstaged changes:
git diff --name-status -
Get untracked files:
git ls-files --others --exclude-standard -
Full working tree status:
git status --short
Step 4: Fetch Linear Ticket (If Provided)
If the user provides a Linear ticket:
- Use the
mcp__linear__get_issuetool to fetch the ticket details - Note: The ticket represents the original requirements but the code may have evolved
Step 5: Analyze and Group Changes by Intent
CRITICAL: Do not just list files. Group them by logical feature area or intent.
- Read key changed files to understand what they do
- Identify patterns in the changes:
- New feature additions
- Bug fixes
- Refactoring
- Configuration changes
- Test additions
- Group files by their purpose, not by directory
Step 6: Output Summary
Present findings in this structure:
# Branch Context: [branch-name]
**Base branch**: [dev/main]
**Commits since divergence**: [count]
**Linear ticket**: [ID if provided, or "None provided"]
## Intent Summary
[1-3 sentences describing the overall goal of this branch based on commits and changes]
## Feature Areas
### [Feature/Intent Area 1]
**Purpose**: [What this group of changes accomplishes]
**Status**: [Complete/In Progress/Not Started]
**Committed changes**:
- `path/to/file.ext:lines` - [brief description]
- `path/to/another.ext` - [brief description]
**Uncommitted changes**:
- `path/to/wip.ext` - [brief description]
### [Feature/Intent Area 2]
...
## Uncommitted Work
**Staged** (ready to commit):
- [files]
**Modified** (not staged):
- [files]
**Untracked** (new files):
- [files]
## Code vs Ticket Drift
[If a Linear ticket was provided, note any discrepancies between what the ticket describes and what the code actually implements. The code is the source of truth.]
## Suggested Next Steps
[Based on the analysis, what appears to be remaining work or natural next actions]
Important Guidelines
-
Code is the source of truth: The branch's commits and changes represent what's actually being built, which may differ from the original ticket description.
-
Group by intent, not structure: Don't just list files by directory. Understand what each change accomplishes and group related changes together.
-
Include file:line references: When describing changes, point to specific locations in files so the user can quickly navigate.
-
Identify work-in-progress: Distinguish between completed (committed) work and in-progress (uncommitted) work.
-
Note drift from ticket: If a Linear ticket was provided, explicitly call out where the implementation has evolved beyond or differs from the ticket description.
-
Be concise but complete: The summary should give someone enough context to immediately start working, without overwhelming them with every detail.
Example Output
# Branch Context: feat/comment-threads
**Base branch**: main
**Commits since divergence**: 3
**Linear ticket**: TASK-142
## Intent Summary
This branch adds threaded comments to tasks, allowing users to start discussion threads on individual tasks and reply to existing comments. The implementation includes a new database table, API routes for CRUD operations, and a collapsible thread UI in the task detail view.
## Feature Areas
### Comments Data Layer
**Purpose**: Database schema and API routes for storing and retrieving comment threads
**Status**: Complete
**Committed changes**:
- `src/db/schema/comments.ts` - New comments table with parent_id for threading
- `src/db/migrations/0012_add_comments.sql` - Migration file
- `src/api/routes/comments.ts` - CRUD endpoints for comments
### Thread UI Components
**Purpose**: Components for displaying and composing threaded comments on tasks
**Status**: In Progress
**Committed changes**:
- `src/components/tasks/CommentThread.tsx` - Recursive thread display component
**Uncommitted changes**:
- `src/components/tasks/CommentComposer.tsx` - Reply/new comment input box
- `src/hooks/useCommentThread.ts` - Data fetching hook for thread state
## Code vs Ticket Drift
The ticket scoped comments as flat (non-threaded), but the implementation adds full threading support with nested replies via a parent_id column.
## Suggested Next Steps
1. Complete the CommentComposer component and wire it into CommentThread
2. Add optimistic updates to useCommentThread for snappy UX
3. Add tests for the comment API routes
How to use recover-branch-context on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add recover-branch-context
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches recover-branch-context from GitHub repository casper-studios/casper-marketplace and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate recover-branch-context. Access the skill through slash commands (e.g., /recover-branch-context) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.6★★★★★36 reviews- ★★★★★Shikha Mishra· Dec 8, 2024
Keeps context tight: recover-branch-context is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Sophia Robinson· Dec 8, 2024
Useful defaults in recover-branch-context — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Ganesh Mohane· Dec 4, 2024
Useful defaults in recover-branch-context — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Yash Thakker· Nov 27, 2024
Registry listing for recover-branch-context matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Evelyn Brown· Nov 15, 2024
Keeps context tight: recover-branch-context is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Dhruvi Jain· Oct 18, 2024
recover-branch-context reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Ira Bansal· Oct 6, 2024
recover-branch-context is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Ama Desai· Sep 25, 2024
recover-branch-context fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Harper Garcia· Sep 9, 2024
Solid pick for teams standardizing on skills: recover-branch-context is focused, and the summary matches what you get after install.
- ★★★★★Harper Thompson· Sep 5, 2024
recover-branch-context has been reliable in day-to-day use. Documentation quality is above average for community skills.
showing 1-10 of 36