Use when analyzing another branch's iteration journals to extract findings, decisions, and insights from divergent work
Analyzes another branch's iteration journals to extract findings, decisions, and insights from divergent work.
npx claudepluginhub tilmon-engineering/claude-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Analyze another branch's iteration journals to extract key findings, decisions, and insights from work that diverged from the current branch.
Core principle: Learn from parallel explorations. Extract valuable insights from any branch, regardless of success or failure.
Use this skill when:
/analyze-branch commandDO NOT use for:
/review-progress instead)git diff directly)| Step | Action | Tool |
|---|---|---|
| 1. Parse arguments | Extract branch name and search criteria | Manual |
| 2. Find divergence | Use git merge-base to find common ancestor | Bash |
| 3. Extract iterations | Get autonomy tags from divergent commits | Bash |
| 4. Read journals | Read iteration files from target branch | Bash, Read |
| 5. Search and filter | Find relevant content based on criteria | Manual |
| 6. Generate report | Create markdown summary | Direct output |
Extract branch name and search criteria from command arguments:
Arguments format: "[branch-name] [search-description]"
Example: "experiment-a pricing experiments and revenue optimization"
Parse:
Verify goal exists:
# Use Glob to find goal
pattern: "autonomy/*/goal.md"
If no goal found:
"No autonomy goal found in this project. Branch analysis requires an autonomy goal."
Stop here.
Extract goal name from path for use in later steps.
Use git to find where branches diverged:
# Get current branch name
current_branch=$(git branch --show-current)
# Find common ancestor between current and target branch
merge_base=$(git merge-base "$current_branch" "$target_branch" 2>&1)
# Check if command succeeded
if [ $? -ne 0 ]; then
# Error handling - see Step 2a
fi
Step 2a: Handle Git Errors
If git merge-base fails, determine cause and prompt user:
Error: Branch not found
Error: Branch '$target_branch' does not exist.
Available branches:
$(git branch -a | sed 's/^..//; s/ -> .*//')
Please verify the branch name and try again.
Error: No common ancestor
Warning: Cannot find common ancestor between current branch and '$target_branch'.
This may mean:
- Branches have completely independent histories
- Branch was rebased and history was rewritten
Options:
1. Analyze entire branch history (may include duplicate work)
2. Specify iteration range manually
3. Specify common ancestor commit manually
Which would you like?
Use AskUserQuestion to let user choose:
merge_base="" and analyze all iterationsFind autonomy iteration tags on target branch after divergence:
# Get all autonomy iteration tags on target branch
if [ -n "$merge_base" ]; then
# Analyze only divergent work
commit_range="$merge_base..$target_branch"
else
# Analyze entire branch (fallback)
commit_range="$target_branch"
fi
# Extract iteration numbers from tags
iterations=$(git log "$commit_range" \
--pretty=format:"%D" \
| tr ',' '\n' \
| grep "tag: autonomy/iteration-" \
| sed 's/.*autonomy\/iteration-//' \
| sort -n)
# Count iterations found
iteration_count=$(echo "$iterations" | wc -w)
If no iterations found:
No autonomy iteration tags found on branch '$target_branch' after divergence.
Possible reasons:
- Branch hasn't used autonomy plugin
- All iterations are before the divergence point
- Iterations exist but weren't committed with git integration
Would you like to:
1. Analyze entire branch (all iterations)
2. Specify iteration range manually
Use AskUserQuestion for recovery.
For each iteration found, read the journal content:
# For each iteration number
for iter in $iterations; do
# Find journal file with this iteration number
# Format: iteration-NNNN-YYYY-MM-DD.md
journal_file=$(git ls-tree -r --name-only "$target_branch" \
"autonomy/$goal_name/" \
| grep "iteration-$(printf '%04d' $iter)-")
if [ -n "$journal_file" ]; then
# Read file content from target branch
journal_content=$(git show "$target_branch:$journal_file")
# Store for analysis in next step
fi
done
Build iteration data structure: For each iteration, extract:
Apply search criteria to find relevant iterations and content:
Search strategy:
# Convert search criteria to grep pattern
# Example: "pricing experiments" → "pricing|experiments"
search_pattern=$(echo "$search_criteria" | tr ' ' '|')
# For each iteration's content
# Score by relevance (number of search term matches)
# Prioritize sections: Key Decisions, Ending State, Reasoning & Strategy
Extract relevant sections:
If search finds nothing:
No iterations matched search criteria: "$search_criteria"
Analyzed $iteration_count iterations on '$target_branch'.
Would you like to:
1. Broaden search (show all iterations)
2. Refine search criteria
Use AskUserQuestion to offer alternatives.
Produce markdown report formatted for journal inclusion:
## Analysis of Branch: $target_branch
**Analyzed range:** Iterations $first_iter-$last_iter (diverged from iteration $divergence_iter)
**Search focus:** $search_criteria
**Common ancestor:** $merge_base
**Branch status:** [Active/Merged/Concluded - from latest iteration if stated]
---
### Key Findings
[For each significant finding extracted from journals:]
- **Iteration NNNN:** [Finding or insight]
- **Context:** [What problem was being addressed]
- **Approach taken:** [How it was implemented or explored]
- **Outcome:** [Results from Ending State]
- **Reference:** `$target_branch @ iteration-NNNN`
---
### Decisions and Rationale
[For each major decision from Key Decisions Made:]
- **Iteration NNNN:** [Decision]
- **Rationale:** [Why this choice was made]
- **Outcome:** [Result - success/failure/inconclusive/ongoing]
- **Takeaway:** [What this tells us]
---
### Ideas and Experiments
[For each experimental approach from Reasoning & Strategy Changes:]
- **Iteration NNNN:** [What was tried]
- **Results:** [What was learned]
- **Status:** [Validated/Invalidated/Needs more testing/Inconclusive]
- **Applicability:** [Could this apply to current branch?]
---
### Timeline of Branch Activity
| Iteration | Date | Summary | Status |
|-----------|------|---------|--------|
| NNNN | YYYY-MM-DD | [From Iteration Intention or Ending State] | [From Ending State] |
| NNNN | YYYY-MM-DD | [Summary] | [Status] |
---
**Analysis Summary:** [Neutral assessment of what was learned, key patterns, notable outcomes]
Output to user: Display the complete report. User can copy relevant sections into their current journal's "External Context Gathered" section.
Do NOT assume branch status:
Read-only operations:
git show to read historical filesInterpreting search criteria:
If criteria is very specific:
If criteria is broad:
Characteristics of good report:
For branches with many iterations:
| Mistake | Reality |
|---|---|
| "Branch is abandoned, so it failed" | NO. Don't assume status. Read journals for actual outcomes. |
| "I'll modify the target branch" | NO. Read-only operations only. Never checkout or modify target. |
| "Search found nothing, report empty" | NO. Offer to broaden search or show all iterations. |
| "I'll analyze current branch" | NO. Use /review-progress for current branch analysis. |
| "No common ancestor means I should fail" | NO. Offer alternatives: analyze all, manual range, manual ancestor. |
| "Report should only include successes" | NO. Balanced view - show what worked AND what didn't. |
Once analysis is complete:
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.