원클릭으로
arch-analysis
Analyze LangGraph application architecture, identify bottlenecks, and propose multiple improvement strategies
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Analyze LangGraph application architecture, identify bottlenecks, and propose multiple improvement strategies
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Skill for creating parallel development plans with multiple developers. Leverages git worktree for branch strategy, task dependency analysis, critical path calculation, developer role assignment, and timeline creation. Use for requests like "create a parallel development plan", "I want to develop with multiple people simultaneously", "divide work with worktree", or "maximize development parallelization". Also supports on-demand parallel tasks for quick fixes with requests like "fix XX in parallel", "do YY with worktree", or "add parallel task".
複数開発者での並列開発計画書を作成するスキル。git worktree を活用したブランチ戦略、タスクの依存関係分析、クリティカルパス計算、開発者ロール割り当て、タイムライン作成を行う。「並列開発計画を作って」「複数人で同時開発したい」「worktree で分担したい」「開発を最大限並列化したい」などのリクエスト時に使用。また、「〇〇を並列で修正して」「worktree で△△をやって」「並列タスクを追加」などのリクエストで、オンデマンドの並列タスクを即座に開始できる。
Use for all blog writing tasks including creating articles (Zenn Japanese, dev.to/Medium English), managing ideas, and setting up blog projects. This is the unified entry point for technical blog writing workflow. Supports idea tracking with status management (backlog/in-progress/done).
Use when you need to fine-tune(ファインチューニング) and optimize LangGraph applications based on evaluation criteria. This skill performs iterative prompt optimization for LangGraph nodes without changing the graph structure.
MANDATORY specification writing skill. ONLY way to create/update specs. Auto-invoke when: - Creating specs: New projects, features ("I want to create XX") - Updating specs: Feature additions, requirement changes, architecture updates - Syncing specs: Major code changes (3+ files), refactoring, session end - Keywords: specifications/spec/design/architecture/requirements/PRD Outputs to .spec-manager/. Critical rules and workflow details in skill body.
Use when specifying or implementing LangGraph applications - from architecture planning and specification writing to actual code implementation. Also use for designing agent workflows or learning LangGraph patterns. This is a comprehensive guide for building AI agents with LangGraph, covering core concepts, architecture patterns, memory management, tool integration, and advanced features.
| name | arch-analysis |
| description | Analyze LangGraph application architecture, identify bottlenecks, and propose multiple improvement strategies |
A skill for analyzing LangGraph application architecture, identifying bottlenecks, and proposing multiple improvement strategies.
This skill analyzes existing LangGraph applications and proposes graph structure improvements:
Important:
Use this skill in the following situations:
When performance improvement of existing applications is needed
When considering architecture-level improvements
When you want to compare multiple improvement options
Purpose: Prepare for performance measurement
Actions:
.langgraph-master/evaluation/ or specified directory)Output: Evaluation program ready
Purpose: Establish baseline
Actions:
Output: baseline_performance.json
Purpose: Understand current architecture
Actions:
Identify graph definitions with Serena MCP
find_symbolgraph.py, main.py, etc.)Analyze node and edge structure
get_symbols_overviewUnderstand each node's role
Output: Graph structure documentation
Purpose: Identify performance problem areas
Actions:
Latency Bottlenecks
Cost Issues
Accuracy Issues
Output: List of issues
Purpose: Identify applicable LangGraph patterns
Actions:
Consider patterns based on problems
Reference langgraph-master skill
Output: List of applicable patterns
Purpose: Create 3-5 diverse improvement proposals (all candidates for parallel exploration)
Actions:
Create improvement proposals based on each pattern
Evaluate improvement proposals
Important: Output all improvement proposals. The arch-tune command will implement and evaluate all proposals in parallel.
Output: Improvement proposal document (including all proposals)
Purpose: Organize analysis results and proposals
Actions:
improvement_proposals.md (with priorities)Important: Output all proposals to improvement_proposals.md. The arch-tune command will read these and implement/evaluate them in parallel.
Output:
analysis_report.md - Current state analysis and issuesimprovement_proposals.md - All improvement proposals (Proposal 1, 2, 3, ...){
"iterations": 5,
"test_cases": 20,
"metrics": {
"accuracy": {
"mean": 75.0,
"std": 3.2,
"min": 70.0,
"max": 80.0
},
"latency": {
"mean": 3.5,
"std": 0.4,
"min": 3.1,
"max": 4.2
},
"cost": {
"mean": 0.020,
"std": 0.002,
"min": 0.018,
"max": 0.023
}
}
}
# Architecture Analysis Report
Execution Date: 2024-11-24 10:00:00
## Current Performance
| Metric | Mean | Std Dev | Target | Gap |
|--------|------|---------|--------|-----|
| Accuracy | 75.0% | 3.2% | 90.0% | -15.0% |
| Latency | 3.5s | 0.4s | 2.0s | +1.5s |
| Cost | $0.020 | $0.002 | $0.010 | +$0.010 |
## Graph Structure
### Current Configuration
\```
analyze_intent → retrieve_docs → generate_response
\```
- **Node Count**: 3
- **Edge Type**: Sequential only
- **Parallel Processing**: None
- **Conditional Branching**: None
### Node Details
#### analyze_intent
- **Role**: Classify user input intent
- **LLM**: Claude 3.5 Sonnet
- **Average Execution Time**: 0.5s
#### retrieve_docs
- **Role**: Search related documents
- **Processing**: Vector DB query + reranking
- **Average Execution Time**: 1.5s
#### generate_response
- **Role**: Generate final response
- **LLM**: Claude 3.5 Sonnet
- **Average Execution Time**: 1.5s
## Issues
### 1. Latency Bottleneck from Sequential Processing
- **Issue**: analyze_intent and retrieve_docs are sequential
- **Impact**: Total 2.0s delay (57% of total)
- **Improvement Potential**: -0.8s or more reduction possible through parallelization
### 2. All Requests Follow Same Flow
- **Issue**: Simple and complex questions go through same processing
- **Impact**: Unnecessary retrieve_docs execution (wasted Cost and Latency)
- **Improvement Potential**: -50% reduction possible for simple cases through routing
### 3. Use of Low-Relevance Documents
- **Issue**: retrieve_docs returns only top-k (no reranking)
- **Impact**: Low Accuracy (75%)
- **Improvement Potential**: +10-15% improvement possible through multi-stage RAG
## Applicable Architecture Patterns
1. **Parallelization** - Parallelize analyze_intent and retrieve_docs
2. **Routing** - Branch processing flow based on intent
3. **Subgraph** - Dedicated subgraph for RAG processing (retrieve → rerank → select)
4. **Orchestrator-Worker** - Execute multiple retrievers in parallel and integrate results
# Architecture Improvement Proposals
Proposal Date: 2024-11-24 10:30:00
## Proposal 1: Parallel Document Retrieval + Intent Analysis
### Changes
**Current**:
\```
analyze_intent → retrieve_docs → generate_response
\```
**After Change**:
\```
START → [analyze_intent, retrieve_docs] → generate_response
↓ parallel execution ↓
\```
### Implementation Details
1. Add parallel edges to StateGraph
2. Add join node to wait for both results
3. generate_response receives both results
### Expected Effects
| Metric | Current | Expected | Change | Change Rate |
|--------|---------|----------|--------|-------------|
| Accuracy | 75.0% | 75.0% | ±0 | - |
| Latency | 3.5s | 2.7s | -0.8s | -23% |
| Cost | $0.020 | $0.020 | ±0 | - |
### Implementation Complexity
- **Level**: Low
- **Estimated Time**: 1-2 hours
- **Risk**: Low (no changes to existing nodes required)
### Recommendation Level
⭐⭐⭐⭐ (High) - Effective for Latency improvement with low risk
---
## Proposal 2: Intent-Based Routing
### Changes
**Current**:
\```
analyze_intent → retrieve_docs → generate_response
\```
**After Change**:
\```
analyze_intent
├─ simple_intent → simple_response (lightweight)
└─ complex_intent → retrieve_docs → generate_response
\```
### Implementation Details
1. Conditional branching based on analyze_intent output
2. Create new simple_response node (using Haiku)
3. Routing with conditional_edges
### Expected Effects
| Metric | Current | Expected | Change | Change Rate |
|--------|---------|----------|--------|-------------|
| Accuracy | 75.0% | 82.0% | +7.0% | +9% |
| Latency | 3.5s | 2.8s | -0.7s | -20% |
| Cost | $0.020 | $0.014 | -$0.006 | -30% |
**Assumption**: 40% simple cases, 60% complex cases
### Implementation Complexity
- **Level**: Medium
- **Estimated Time**: 2-3 hours
- **Risk**: Medium (adding routing logic)
### Recommendation Level
⭐⭐⭐⭐⭐ (Highest) - Balanced improvement across all metrics
---
## Proposal 3: Multi-Stage RAG with Reranking Subgraph
### Changes
**Current**:
\```
analyze_intent → retrieve_docs → generate_response
\```
**After Change**:
\```
analyze_intent → [RAG Subgraph] → generate_response
↓
retrieve (k=20)
↓
rerank (top-5)
↓
select (best context)
\```
### Implementation Details
1. Convert RAG processing to dedicated subgraph
2. Retrieve more candidates in retrieve node (k=20)
3. Evaluate relevance in rerank node (Cross-Encoder)
4. Select optimal context in select node
### Expected Effects
| Metric | Current | Expected | Change | Change Rate |
|--------|---------|----------|--------|-------------|
| Accuracy | 75.0% | 88.0% | +13.0% | +17% |
| Latency | 3.5s | 3.8s | +0.3s | +9% |
| Cost | $0.020 | $0.022 | +$0.002 | +10% |
### Implementation Complexity
- **Level**: Medium-High
- **Estimated Time**: 3-4 hours
- **Risk**: Medium (introducing new model, subgraph management)
### Recommendation Level
⭐⭐⭐ (Medium) - Effective when Accuracy is priority, Latency will degrade
---
## Recommendations
**Note**: The following recommendations are for reference. The arch-tune command will **implement and evaluate all Proposals above in parallel** and select the best option based on actual results.
### 🥇 First Recommendation: Proposal 2 (Intent-Based Routing)
**Reasons**:
- Balanced improvement across all metrics
- Implementation complexity is manageable at medium level
- High ROI (effect vs cost)
**Next Steps**:
1. Run parallel exploration with arch-tune command
2. Implement and evaluate Proposals 1, 2, 3 simultaneously
3. Select best option based on actual results
### 🥈 Second Recommendation: Proposal 1 (Parallel Retrieval)
**Reasons**:
- Simple implementation with low risk
- Reliable Latency improvement
- Can be combined with Proposal 2
### 📝 Reference: Proposal 3 (Multi-Stage RAG)
**Reasons**:
- Effective when Accuracy is most important
- Only when Latency trade-off is acceptable
find_symbol: Search graph definitionsget_symbols_overview: Understand node structuresearch_for_pattern: Search specific patternsAnalysis Only
Evaluation Environment
Serena MCP