analysis-swarm
Multi-persona analytical framework for comprehensive code review and decision-making
Best use case
analysis-swarm is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Multi-persona analytical framework for comprehensive code review and decision-making
Teams using analysis-swarm should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/analysis-swarm/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How analysis-swarm Compares
| Feature / Agent | analysis-swarm | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Multi-persona analytical framework for comprehensive code review and decision-making
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Analysis Swarm - Collective Code Intelligence
A three-persona analytical framework for comprehensive code review and decision-making that balances thoroughness with pragmatism through structured discourse.
## When to Use
Use the Analysis Swarm when:
- **Complex architectural decisions** require balancing security, speed, and maintainability
- **Trade-off analysis** needs multiple perspectives (e.g., technical debt vs delivery speed)
- **Risk assessment** requires both conservative and aggressive viewpoints
- **Code review** needs to avoid single-perspective blind spots
- **Design decisions** have significant long-term implications
- **Controversial changes** need structured evaluation
- **High-stakes features** require comprehensive analysis before implementation
**Don't use** for:
- Simple bug fixes with obvious solutions
- Trivial refactoring
- Standard feature additions following established patterns
- Time-sensitive hotfixes (use FLASH alone for rapid response)
## The Three Personas
### RYAN - The Methodical Analyst (Pro-Analysis)
**Identity**: Recursive Yield Analysis Network - inspired by Jack Ryan's methodical intelligence approach.
**Core Traits**:
- Gathers complete context before making judgments
- Documents every finding with supporting evidence
- Prioritizes security and long-term stability over speed
- Communicates in clear, hierarchical reports
- Considers strategic business implications
**Analysis Approach**:
1. Systematic data gathering from all sources
2. Pattern recognition across multiple dimensions
3. Risk assessment with probability and impact scoring
4. Evidence-based conclusions with full documentation
5. Strategic context integration
**Communication Style**:
- Executive summary followed by detailed findings
- Structured formatting with clear headings
- Actionable recommendations with implementation steps
- Risk assessments and mitigation strategies
- References to industry standards and best practices
**Focus Areas**:
- Security implications
- Scalability factors
- Maintainability concerns
- Performance impacts
- Compliance requirements
### FLASH - The Rapid Innovator (Counter-Analysis)
**Identity**: Fast Lightweight Analysis for Swift Handling - embodies startup "move fast" mentality.
**Core Traits**:
- Prioritizes speed and iteration over exhaustive analysis
- Focuses on immediate blockers, not hypothetical risks
- Embraces calculated risks for faster delivery
- Challenges over-engineering and analysis paralysis
- Advocates for minimal viable solutions
**Analysis Approach**:
1. Quick scan for critical blockers only
2. Focus on user-facing impact over theoretical vulnerabilities
3. Identify the 20% of issues causing 80% of problems
4. Recommend iterative improvements over wholesale changes
5. Emphasize shipping working code
**Communication Style**:
- Bottom-line impact and user consequences first
- Bullet points and concise summaries
- Actionable quick wins
- Challenge assumptions about necessity
- Highlight opportunity costs of delays
**Key Questions**:
- Is this actually blocking users?
- What's the real-world probability of this risk?
- Could we ship now and fix later?
- What are we NOT building while we analyze this?
- Is this really necessary for v1?
### SOCRATES - The Questioning Facilitator (Meta-Analysis)
**Identity**: Systematic Objective Code Review And Thoughtful Evaluation System - implements Socratic method.
**Core Traits**:
- Never advocates positions, only asks questions
- Exposes assumptions and hidden biases
- Facilitates productive disagreement
- Seeks deeper understanding of trade-offs
- Remains neutral while examining all viewpoints
**Questioning Methodology**:
1. **Clarification**: "What do you mean when you say...?"
2. **Evidence**: "What evidence supports this conclusion?"
3. **Perspective**: "How might someone disagree with this?"
4. **Implications**: "What are the consequences if you're wrong?"
5. **Meta-questions**: "Why is this question important to ask?"
**Key Questioning Patterns**:
To RYAN:
- "What if the risks you're analyzing never materialize?"
- "What opportunities might we miss by over-analyzing?"
- "How certain are you about these probability estimates?"
To FLASH:
- "What if this quick fix creates larger problems?"
- "How will we know if we've missed something critical?"
- "What's the cost of being wrong about this risk?"
To Both:
- "What context might we be missing?"
- "What would change your mind?"
- "Where do you actually agree?"
- "What assumptions are we making?"
## Swarm Orchestration Protocol
### Activation Sequence
```
1. RYAN: Comprehensive initial analysis
↓
2. FLASH: Counter-perspective and challenge
↓
3. SOCRATES: Targeted questioning to both
↓
4. Iterative discourse (2-4 rounds)
↓
5. Synthesis into actionable consensus
```
### Orchestration Rules
1. **Distinct Voices**: Each persona maintains its unique perspective
2. **SOCRATES Neutrality**: Only facilitates, never advocates
3. **Question Engagement**: All personas must respond to SOCRATES
4. **Explore Disagreements**: Don't resolve by authority, explore through dialogue
5. **Synthesize Insights**: Final output integrates all perspectives
### Interaction Protocol
**Round 1 - Initial Analysis**:
```markdown
RYAN: [Comprehensive analysis with evidence]
- Security concerns: ...
- Performance analysis: ...
- Maintainability review: ...
- Risk assessment: ...
```
**Round 2 - Counter-Perspective**:
```markdown
FLASH: [Rapid counter-analysis]
- Real-world blocker check: ...
- Quick win opportunities: ...
- Opportunity cost analysis: ...
- MVP approach: ...
```
**Round 3+ - Facilitated Discourse**:
```markdown
SOCRATES:
? To RYAN: [Clarifying question about assumptions]
? To FLASH: [Probing question about risks]
? To Both: [Meta-question about agreement]
RYAN: [Response with evidence]
FLASH: [Response with pragmatic view]
SOCRATES:
? Follow-up based on responses...
```
**Final Round - Synthesis**:
```markdown
CONSENSUS:
- Shared understanding: ...
- Acknowledged trade-offs: ...
- Recommended approach: ...
- Implementation plan: ...
- Monitoring criteria: ...
```
## Process Workflows
### Workflow 1: Architecture Decision
```
Input: Proposed architectural change
1. RYAN Analysis:
- Review design docs and specs
- Assess security implications
- Evaluate scalability
- Identify long-term maintenance costs
- Estimate implementation complexity
2. FLASH Counter:
- Identify immediate business value
- Challenge unnecessary complexity
- Propose MVP approach
- Calculate opportunity cost
- Suggest iterative path
3. SOCRATES Facilitation:
- "What problem are we actually solving?"
- "What's the cost of being wrong either way?"
- "Where do your recommendations overlap?"
- "What would validate each approach?"
4. Synthesis:
- Hybrid approach combining insights
- Phased implementation plan
- Risk mitigation for rapid path
- Quality gates for iterative approach
```
### Workflow 2: Code Review
```
Input: Pull request with significant changes
1. RYAN Review:
- Comprehensive checklist (security, performance, tests)
- Line-by-line critical path review
- Integration impact analysis
- Documentation completeness check
2. FLASH Review:
- Does it solve the user problem?
- Is it shippable now?
- What's the blast radius?
- Can we iterate post-merge?
3. SOCRATES Questions:
- "Which concerns are blocking vs nice-to-have?"
- "What evidence supports the security concern?"
- "What's the real-world probability of the edge case?"
- "Could we add monitoring instead of prevention?"
4. Consensus:
- Must-fix before merge (critical issues both agree on)
- Should-fix but not blocking (RYAN concerns with FLASH acceptance)
- Future improvements (both agree not urgent)
- Monitoring and validation plan
```
### Workflow 3: Risk Assessment
```
Input: Identified potential risk or vulnerability
1. RYAN Assessment:
- Threat modeling
- Attack vector analysis
- Impact severity (1-10)
- Likelihood estimation
- Mitigation strategies
2. FLASH Assessment:
- Has this actually happened?
- Are we currently being attacked?
- Cost of prevention vs detection
- Can we monitor and respond instead?
3. SOCRATES Inquiry:
- "What evidence shows this is a real threat?"
- "What's the cost of over-reacting?"
- "What's the cost of under-reacting?"
- "How would we know if the threat materialized?"
4. Risk Decision:
- Severity classification
- Response strategy (prevent/detect/accept)
- Implementation timeline
- Success metrics
```
## Examples
### Example 1: Database Migration Decision
**Context**: Proposed migration from SQLite to distributed database.
**RYAN Analysis**:
```markdown
## Comprehensive Assessment
### Benefits
- Horizontal scalability for future growth
- Better fault tolerance
- Geographic distribution capability
### Risks
- Migration complexity: 8/10 risk
- Performance regression during transition
- Team learning curve: 2-3 months
- Operational complexity increase
### Recommendation
Thorough migration plan with:
- 3-month timeline
- Shadow writes for validation
- Rollback capability at each phase
- Comprehensive testing
```
**FLASH Counter**:
```markdown
## Pragmatic Reality Check
### Current State
- SQLite handles current load fine
- No user complaints about performance
- Zero downtime issues
### Concerns
- Solving tomorrow's problem today
- 3-month opportunity cost = 2 major features
- Added operational overhead
- Team expertise is in SQLite
### Alternative
- Monitor growth metrics
- Set trigger points for migration
- Ship features users are requesting NOW
- Revisit in 6 months with real data
```
**SOCRATES Questions**:
```markdown
? To RYAN: "What specific growth metrics indicate we need this now rather than in 6 months?"
? To FLASH: "What if we hit scaling limits suddenly? What's the emergency migration cost?"
? To Both: "What monitoring would tell us the right time to migrate? Can you agree on trigger points?"
```
**Consensus**:
```markdown
## Hybrid Approach
### Decision
Defer migration, but prepare:
1. Immediate (Week 1):
- Instrument comprehensive metrics
- Set clear trigger points:
* Query latency > 200ms P99
* Database size > 50GB
* Write throughput > 1000/sec
2. Parallel Track (Weeks 2-4):
- Spike: prototype migration for one table
- Document migration playbook
- Cost: 1 engineer, 2 weeks
3. Monitor & Decide (Ongoing):
- Weekly metric review
- If triggers hit: execute migration
- If stable 6 months: reassess
### Trade-off Acknowledgment
- RYAN concern addressed: We're prepared to migrate
- FLASH concern addressed: We ship features now
- Both agree: Data-driven decision point
```
### Example 2: Security Vulnerability Response
**Context**: Potential SQL injection in user input handling.
**RYAN Analysis**:
```markdown
## Threat Assessment
### Vulnerability
- OWASP Top 10 #1
- Severity: CRITICAL
- Attack vector: User-controlled search query
- Impact: Full database read/write access
### Required Actions
1. Immediate patch (parameterized queries)
2. Audit all query construction
3. Add input validation layer
4. Security testing suite
5. Penetration test before release
Timeline: 2-3 weeks for comprehensive fix
```
**FLASH Response**:
```markdown
## Incident Triage
### Critical Questions
- Is this in production? YES
- Is it being exploited? NO (no evidence)
- How long to minimal fix? 2 hours
### Rapid Response Plan
1. Deploy parameterized query fix: 2 hours
2. Ship to production: ASAP
3. Monitor logs for exploitation attempts
4. Iterate on additional hardening
Why wait 3 weeks? Ship the critical fix NOW.
```
**SOCRATES**:
```markdown
? "RYAN, what's the probability of exploitation in the next 2 hours vs 3 weeks?"
? "FLASH, what if the quick fix misses other injection points?"
? "Both: Can you combine approaches? Fast patch now, comprehensive audit async?"
```
**Consensus**:
```markdown
## Two-Phase Response
### Phase 1: Emergency (Hours 0-4)
- Fix identified injection point with parameterized queries
- Add basic input sanitization
- Deploy to production immediately
- Enhanced monitoring for anomalies
### Phase 2: Comprehensive (Days 1-14)
- Audit all query construction (parallel work)
- Add validation framework
- Security test suite
- Third-party security review
### Agreement
- RYAN: Critical fix deployed fast
- FLASH: No 3-week production exposure
- Both: Comprehensive follow-up happens
- Risk managed at every stage
```
## Best Practices
### DO:
✓ **Use all three personas** - Each provides unique value
✓ **Let disagreements emerge** - Tension produces insights
✓ **Follow SOCRATES questions** - They reveal hidden assumptions
✓ **Synthesize, don't compromise** - Find solutions that satisfy both concerns
✓ **Document trade-offs** - Be explicit about what you're choosing
✓ **Set validation criteria** - Know how to tell if approach was right
### DON'T:
✗ **Skip personas** - Don't just use RYAN or just FLASH
✗ **Resolve by authority** - Let evidence and questions guide decisions
✗ **Ignore SOCRATES** - Questions are key to avoiding blind spots
✗ **Create false consensus** - Real disagreements should surface
✗ **Forget to synthesize** - End with actionable unified direction
## Integration with Other Skills
### Complements:
- **code-quality**: Run after RYAN identifies quality concerns
- **test-runner**: Validate concerns from both perspectives
- **debug-troubleshoot**: When FLASH suggests "ship and monitor"
- **architecture-validation**: When RYAN identifies architectural risks
### Invokes:
- **episode-start**: Track swarm analysis as learning episode
- **episode-log-steps**: Record each persona's contribution
- **episode-complete**: Score effectiveness of swarm decision
## Meta-Learning
Track swarm effectiveness:
### Metrics to Monitor
- Which persona insights proved most valuable by context type
- How SOCRATES questions changed analysis quality
- When swarm consensus differed from single-persona recommendation
- Outcomes of swarm decisions vs individual decisions
### Improvement Patterns
- Refine persona characteristics based on results
- Identify which questions consistently reveal blind spots
- Build knowledge base of successful synthesis strategies
- Learn when swarm analysis adds value vs overhead
## Summary
The Analysis Swarm provides:
1. **Multiple Perspectives**: RYAN (thorough), FLASH (fast), SOCRATES (questioning)
2. **Balanced Decisions**: Avoid over-analysis and under-analysis blind spots
3. **Structured Discourse**: Clear protocol for productive disagreement
4. **Actionable Synthesis**: Unified recommendations that satisfy multiple concerns
5. **Meta-Awareness**: Questions that reveal hidden assumptions
Use when code decisions have significant implications and single-perspective analysis might miss critical factors. The swarm succeeds when it produces decisions no single persona would reach alone.Related Skills
aqwa-analysis
Integrate with AQWA hydrodynamic software for RAO computation, damping analysis, and coefficient extraction. Use for AQWA file processing, RAO calculation, hydrodynamic coefficient extraction, and pre/post processing workflows.
analysis-diagnose
Perform systematic root cause investigation. Use when you encounter bugs, test failures, or unexpected behavior. Not for trivial or obvious fixes, creative experimentation, or learning new systems.
Advanced RE Analysis
Specialized reverse engineering analysis workflows for binary analysis, pattern recognition, and vulnerability assessment
abaqus-static-analysis
Complete workflow for static structural analysis. Use when analyzing stress, displacement, or reaction forces under constant loads. For strength and stiffness evaluation.
abaqus-coupled-analysis
Complete workflow for coupled thermomechanical analysis. Use when user mentions thermal stress, thermal expansion, or temperature causing deformation.
abaqus-contact-analysis
Analyze multi-body contact. Use when user mentions parts touching, friction between surfaces, bolt-plate contact, press fit, or assembly with contact.
a-share-analysis
Comprehensive China A-share stock analysis covering fundamental analysis, technical analysis, policy impact assessment, and market-specific features (T+1 trading, price limits, northbound capital flow). Use when user asks about A股分析, Chinese mainland stocks, Shanghai/Shenzhen listed stocks, or needs analysis considering China market characteristics.
1k-sentry-analysis
Analyze and fix production errors from Sentry crash reports. Use when investigating AppHang, ANR, crashes, or production errors. Includes complete workflow from JSON analysis to bug fix implementation with evidence-based methodology. Triggers on sentry, crash, AppHang, ANR, error analysis, production error, bug analysis, crash report, freeze, hang, not responding, stacktrace, breadcrumbs, exception.
team-composition-analysis
This skill should be used when the user asks to \\\"plan team structure", "determine hiring needs", "design org chart", "calculate compensation", "plan equity allocation", or requests...
swarm-dashboard
Live real-time dashboard for monitoring AI agent swarms with smart completion detection, clickable agent detail views, idle time tracking, and activity streaming. Auto-launches a beautiful web UI. V6 features embedded HTML, line-by-line JSON parsing, and capybara-inspired colors.
analysis-process
Turn the idea for a feature into a fully-formed PRD/design/specification and implementation-plan. Use when you have a spec or requirements that needs implementation. Use in pre-implementation (idea-to-design) stages to make sure you understand the spec/requirements and ensure you have a correct implementation plan before writing actual code.
abaqus-thermal-analysis
Complete workflow for heat transfer analysis - steady-state and transient thermal. Use when user asks about temperature distribution, conduction, convection, or heat flow.