원클릭으로
analyze-branch
Use when analyzing another branch's iteration journals to extract findings, decisions, and insights from divergent work
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when analyzing another branch's iteration journals to extract findings, decisions, and insights from divergent work
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when working in a project that has a `.agents/` directory or when the user asks about Conway Architecture, the conway-architecture plugin, domain agents, owned_paths enforcement, or how to coordinate a persistent subagent team that shadows the application's architecture
Use when reading or writing OST (Outcome / Strategy / Tactic) graph data in the `agents` TypeDB database - covers the falsifiability rubric, the three-layer discipline, ID conventions, lifecycle transitions, and the structured Task fields that replace generic descriptions
Use when interacting with a TypeDB 3.x database via the typedb MCP tools (typedb-query, typedb-database_schema, etc.) - covers schema-first workflow, transaction types, TypeQL 3.x syntax (which differs materially from 2.x), and the most common failure modes
Use when user wants detailed status report for single autonomy branch including iteration timeline and metrics progression
Use when saving current iteration progress mid-conversation, before context compaction, or at interim pause points
Use when user wants to compare two autonomy branches to see different approaches, metrics, and outcomes
| name | analyze-branch |
| description | Use when analyzing another branch's iteration journals to extract findings, decisions, and insights from divergent work |
| user-invocable | true |
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: