Use at development completion - guides branch integration with Shannon 3-tier validation (0.00-1.00 readiness score), MCP merge pattern analysis, and Serena risk assessment
Quantitative branch completion validation using 3-tier scoring (tests, code quality, integration). Triggers at development end to calculate 0.00-1.00 readiness score and guide safe merge/PR decisions.
/plugin marketplace add krzemienski/shannon-framework/plugin install shannon@shannon-frameworkThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Structured branch completion with quantitative readiness validation.
Verify → 3-tier validation → Present options → Execute → Cleanup.
Shannon enhancement: Numerical readiness scoring, merge pattern analysis via MCP, Serena risk assessment.
Readiness Score (0.00-1.00):
# Run full test suite
readiness_score_tier1 = 0.0
if test_suite_passes:
readiness_score_tier1 = 1.0
log to Serena: {test_count, coverage_pct, duration}
else:
readiness_score_tier1 = (tests_passed / total_tests)
log failures: "[list failing tests]"
STOP: Cannot proceed with Tiers 2-3
GATE: If Tier 1 < 0.90, must fix before continuing.
# Metrics gathering (Serena)
code_quality = {
files_modified: count,
lines_added: count,
lines_deleted: count,
commits: count,
test_coverage_change: delta_pct
}
# MCP pattern analysis: compare to historical merges
pattern_match = compare_to_historical_merges({
scope_size: files_modified,
change_magnitude: lines_added,
test_coverage_delta: coverage_change
})
readiness_score_tier2 = pattern_match.risk_assessment_inverse
# 1.0 = safe pattern, 0.0 = high-risk pattern
Log to Serena:
historical_similar_merges: N (count)
avg_merge_success_rate: X.XX (from history)
risk_level: "low|medium|high"
GATE: If Tier 2 < 0.75, alert but can override.
# Final checklist validation
integration_checks = {
base_branch_exists: bool, # +0.1
branch_synced_with_base: bool, # +0.2
no_conflicting_changes: bool, # +0.3
commit_messages_compliant: bool, # +0.2
no_breaking_changes_detected: bool # +0.2
}
readiness_score_tier3 = sum(passing_checks) / total_checks
# Range: 0.0-1.0
GATE: If Tier 3 < 0.80, prompt for manual fixes.
readiness_score = (
readiness_score_tier1 * 0.5 + # Tests are mandatory
readiness_score_tier2 * 0.25 + # Code quality important
readiness_score_tier3 * 0.25 # Integration critical
)
Range: 0.00-1.00
Interpretation:
# Run project's full test suite
npm test / cargo test / pytest / go test ./...
If tests_fail:
readiness_score = test_pass_rate
Report: "[N failing tests]"
STOP - Cannot proceed to Tiers 2-3
Else:
readiness_score_tier1 = 1.0
Continue to Tier 2
# MCP pattern analysis
git diff base_branch...HEAD | MCP analyze
scope_size: files_modified count
magnitude: lines_added + lines_deleted
coverage: test coverage delta
# Serena historical comparison
Find similar merges in history
readiness_score_tier2 = inverse(risk_score)
Log alert if tier2 < 0.75
# Base branch check
git merge-base HEAD main || git merge-base HEAD master
# Sync check
git status | grep "ahead|behind"
# Conflict check
git merge --no-commit --no-ff base_branch
# Commit message check (conventional commits)
git log base_branch...HEAD --format="%B"
# Calculate tier3_score from checks
Overall readiness_score = [calculated above]
If readiness_score >= 0.90:
"✓ READY TO INTEGRATE"
Else:
"⚠ CAUTION NEEDED [score: X.XX]"
Alert on which tier failed
Present 4 options:
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is
4. Discard this work
Option 1: Merge Locally
git checkout <base-branch>
git pull
git merge <feature-branch>
<test-command> # Re-verify Tier 1
git branch -d <feature-branch>
# Cleanup worktree
Option 2: Push and Create PR
git push -u origin <feature-branch>
# Create PR with readiness_score in description
gh pr create --title "[readiness: X.XX] Title" \
--body "Readiness: Tier1=X.XX Tier2=X.XX Tier3=X.XX"
# Keep worktree
Option 3: Keep As-Is
Report: "Keeping branch. Readiness: X.XX"
# Don't cleanup
Option 4: Discard
# Confirm first (typed confirmation: "discard")
git checkout <base-branch>
git branch -D <feature-branch>
# Cleanup worktree
❌ Skip test verification ✅ Always Tier 1 first
❌ Merge with failing tests ✅ Tier 1 must be 1.0
❌ Ignore readiness_score ✅ Alert if score < 0.90
❌ Force push without reason ✅ Only if explicitly requested
Track across all branches:
Use to improve future predictions.
Called by:
Pairs with:
Example branch completion:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.