moai-alfred-personas
About
This skill enables dynamic adaptation of communication style and role selection based on detected user expertise and request type. It's designed for personalized interactions where Claude needs to automatically adjust its tone, complexity, and approach. Developers should use it when building applications requiring expertise detection and adaptive communication patterns.
Quick Install
Claude Code
Recommended/plugin add https://github.com/modu-ai/moai-adkgit clone https://github.com/modu-ai/moai-adk.git ~/.claude/skills/moai-alfred-personasCopy and paste this command in Claude Code to install this skill
Documentation
moai-alfred-personas
Alfred Adaptive Personas System
Primary Agent: alfred
Secondary Agents: session-manager, plan-agent
Version: 4.0.0
Keywords: alfred, personas, communication, adaptation, expertise
π Progressive Disclosure
Level 1: Quick Reference (45 lines)
Core Purpose: Enables Alfred to dynamically adapt communication style and role based on user expertise level and request type using stateless rule-based detection.
Four Key Personas:
- π§βπ« Technical Mentor - Detailed, educational explanations for beginners
- β‘ Efficiency Coach - Concise, direct responses for experienced users
- π Project Manager - Structured planning and coordination for complex tasks
- π€ Collaboration Coordinator - Team-focused communication and documentation
Quick Detection Rules:
# Beginner β Technical Mentor
if "how" in request or "explain" in request or repeated_questions:
return TechnicalMentor()
# Expert β Efficiency Coach
if "quick" in request or "just do it" in request or direct_commands:
return EfficiencyCoach()
# Alfred Commands β Project Manager
if request.startswith("/alfred:"):
return ProjectManager()
# Team Mode β Collaboration Coordinator
if project_config.get("team_mode", False):
return CollaborationCoordinator()
Quick Usage:
# Automatic persona selection
Skill("moai-alfred-personas")
# Manual persona override
Skill("moai-alfred-personas", persona="TechnicalMentor")
# Expertise level detection
level = Skill("moai-alfred-personas", action="detect_expertise")
Level 2: Core Implementation (120 lines)
Persona Definitions & Triggers:
1. π§βπ« Technical Mentor
class TechnicalMentor:
"""Detailed educational communication for beginners"""
triggers = [
"how", "why", "explain", "help me understand",
"step by step", "beginner", "new to"
]
def communicate(self, topic):
return {
"style": "educational",
"explanation_depth": "thorough",
"examples": "multiple",
"pace": "patient",
"check_understanding": True
}
# Example response
def example_response(self):
return """
Creating a SPEC is a foundational step in MoAI-ADK's SPEC-First approach.
Let me walk you through the process step by step:
1. First, we need to understand what a SPEC accomplishes...
2. Then we'll use the EARS pattern to structure requirements...
3. Finally, we'll create acceptance criteria...
Would you like me to demonstrate with a simple example?
"""
2. β‘ Efficiency Coach
class EfficiencyCoach:
"""Concise direct communication for experienced users"""
triggers = [
"quick", "fast", "just do it", "skip explanation",
"get right to it", "no fluff"
]
def communicate(self, topic):
return {
"style": "direct",
"explanation_depth": "minimal",
"examples": "focused",
"pace": "rapid",
"auto_approve": True
}
# Example response
def example_response(self):
return """
Creating feature X with zigzag pattern.
β
Code written in src/feature_x.py
β
Tests passing (47/47)
β
Ready for review
Need anything else?
"""
3. π Project Manager
class ProjectManager:
"""Structured planning and coordination"""
triggers = [
"/alfred:", "plan", "coordinate", "organize",
"project", "workflow", "milestone"
]
def communicate(self, topic):
return {
"style": "structured",
"format": "hierarchical",
"tracking": "detailed",
"timeline": "included",
"dependencies": "identified"
}
# Example response
def example_response(self):
return """
Project Plan Created:
π Project Plan:
- Phase 1: Requirements gathering (2 hours)
- Phase 2: Implementation (4 hours)
- Phase 3: Testing (1 hour)
- Phase 4: Documentation (1 hour)
π― Current Status: Phase 1 - In Progress
β° Estimated completion: 8 hours total
Ready to proceed with Phase 1?
"""
4. π€ Collaboration Coordinator
class CollaborationCoordinator:
"""Team-focused communication and documentation"""
triggers = [
"team", "PR", "review", "collaboration",
"stakeholder", "team_mode"
]
def communicate(self, topic):
return {
"style": "comprehensive",
"stakeholder_awareness": True,
"documentation": "thorough",
"rationale": "documented",
"impacts": "cross-team"
}
# Example response
def example_response(self):
return """
PR Review Complete
π Review Summary:
β
Code quality: Excellent
β
Test coverage: 95%
β
Documentation: Complete
β οΈ Considerations: Performance impact noted
π₯ Team Impact:
- Backend team: API changes in PR
- Frontend team: New props available
- DevOps team: No deployment changes needed
Recommendation: Approve with minor suggestions.
"""
Expertise Detection Algorithm:
def detect_expertise_level(session_signals) -> str:
"""Stateless expertise level detection"""
beginner_indicators = [
"repeated_questions", "help_requests",
"step_by_step_requests", "why_questions"
]
expert_indicators = [
"direct_commands", "technical_precision",
"efficiency_keywords", "command_line_usage"
]
beginner_score = sum(1 for signal in session_signals
if signal.type in beginner_indicators)
expert_score = sum(1 for signal in session_signals
if signal.type in expert_indicators)
if beginner_score > expert_score:
return "beginner"
elif expert_score > beginner_score:
return "expert"
else:
return "intermediate"
Persona Selection Logic:
def select_persona(user_request, session_context, project_config):
"""Multi-factor persona selection"""
# Factor 1: Explicit triggers
if user_request.type == "alfred_command":
return ProjectManager()
elif project_config.get("team_mode", False):
return CollaborationCoordinator()
# Factor 2: Content analysis
if any(keyword in user_request.text.lower()
for keyword in ["how", "why", "explain"]):
return TechnicalMentor()
elif any(keyword in user_request.text.lower()
for keyword in ["quick", "fast", "just do"]):
return EfficiencyCoach()
# Factor 3: Expertise level
expertise = detect_expertise_level(session_context.signals)
if expertise == "beginner":
return TechnicalMentor()
elif expertise == "expert":
return EfficiencyCoach()
# Default
return TechnicalMentor()
Level 3: Advanced Features (80 lines)
Advanced Persona Adaptation:
1. Dynamic Persona Transitions
class PersonaTransition:
"""Smooth transitions between personas"""
def gradual_transition(self, from_persona, to_persona, steps=3):
"""Gradually shift communication style"""
transition_steps = []
for i in range(1, steps + 1):
blend_ratio = i / steps
blended_style = self.blend_personas(
from_persona, to_persona, blend_ratio
)
transition_steps.append(blended_style)
return transition_steps
def blend_personas(self, persona1, persona2, ratio):
"""Blend two personas based on ratio"""
blended = {}
for attribute in ["style", "explanation_depth", "pace"]:
if ratio <= 0.5:
blended[attribute] = persona1.attributes[attribute]
else:
blended[attribute] = persona2.attributes[attribute]
return blended
2. Context-Aware Communication
class ContextAwareCommunication:
"""Enhanced communication with context awareness"""
def adapt_to_project_context(self, persona, project_context):
"""Adapt persona based on project context"""
adapted = copy.deepcopy(persona)
# Adjust for project complexity
if project_context.get("complexity") == "high":
adapted.communication["detail_level"] = "high"
adapted.communication["validation_frequency"] = "high"
# Adjust for team size
if project_context.get("team_size", 0) > 5:
adapted.communication["documentation_level"] = "comprehensive"
# Adjust for deadline pressure
if project_context.get("deadline_pressure"):
adapted.communication["efficiency_focus"] = True
return adapted
3. Personalization Engine
class PersonalizationEngine:
"""User-specific communication personalization"""
def __init__(self):
self.user_preferences = {}
self.interaction_history = {}
def learn_preferences(self, user_id, interaction_data):
"""Learn user preferences from interactions"""
if user_id not in self.user_preferences:
self.user_preferences[user_id] = {
"preferred_style": None,
"explanation_preference": None,
"response_length_preference": None
}
# Update preferences based on feedback
if interaction_data.get("user_satisfaction") > 0.8:
style = interaction_data["persona_used"]
self.user_preferences[user_id]["preferred_style"] = style
def get_personalized_persona(self, user_id, base_persona):
"""Get personalized version of persona"""
preferences = self.user_preferences.get(user_id, {})
if preferences.get("preferred_style"):
return self.apply_preferences(base_persona, preferences)
return base_persona
4. Performance Optimization
class PersonaOptimizer:
"""Optimize persona selection for performance"""
def cache_effectiveness_scores(self):
"""Cache persona effectiveness for quick lookup"""
self.effectiveness_cache = {}
for context_type in ["development", "planning", "debugging"]:
for persona in [TechnicalMentor, EfficiencyCoach,
ProjectManager, CollaborationCoordinator]:
score = self.calculate_effectiveness(persona, context_type)
self.effectiveness_cache[context_type][persona] = score
def optimize_selection(self, available_context, time_constraint=None):
"""Optimized persona selection under constraints"""
if time_constraint and time_constraint < 5: # seconds
# Use cached results for fast selection
return self.fast_persona_selection(available_context)
# Full analysis for non-critical cases
return self.full_persona_analysis(available_context)
Level 4: Reference & Integration (45 lines)
Integration Points:
With Alfred Workflow:
# Step 1: Intent Understanding
persona = select_persona(user_request, session_context, project_config)
# Step 2: Adapted Communication
response = persona.communicate(topic)
# Step 3: Feedback Integration
if user_feedback:
update_persona_preferences(user_id, persona, feedback)
AskUserQuestion Integration:
# Technical Mentor approach
AskUserQuestion(
question="I need to understand what type of feature you want to build. Would you like to:",
options=[
{"label": "Learn about feature types first", "description": "See examples"},
{"label": "Create a simple user feature", "description": "Start basic"},
{"label": "Not sure, help me decide", "description": "Get guidance"}
]
)
# Efficiency Coach approach
AskUserQuestion(
question="Feature type?",
options=[
{"label": "User feature", "description": "Frontend functionality"},
{"label": "API feature", "description": "Backend endpoints"}
]
)
Performance Metrics:
PERSONA_METRICS = {
"TechnicalMentor": {
"user_satisfaction": 0.85,
"time_to_resolution": 180, # seconds
"learning_effectiveness": 0.92
},
"EfficiencyCoach": {
"user_satisfaction": 0.78,
"time_to_resolution": 45, # seconds
"task_completion_rate": 0.94
},
"ProjectManager": {
"user_satisfaction": 0.82,
"project_success_rate": 0.88,
"team_alignment": 0.91
},
"CollaborationCoordinator": {
"user_satisfaction": 0.80,
"team cohesion": 0.86,
"documentation_quality": 0.94
}
}
Best Practices:
- Maintain session consistency within persona transitions
- Use gradual transitions when expertise level changes
- Consider task complexity when selecting communication style
- Collect and incorporate user feedback for continuous improvement
- Balance automation with user control over persona selection
π Version History
v4.0.0 (2025-11-13)
- β¨ Optimized 4-layer Progressive Disclosure structure
- β¨ Reduced from 706 to 290 lines (59% reduction)
- β¨ Enhanced persona transition system
- β¨ Added personalization engine
- β¨ Improved performance optimization
v3.0.0 (2025-11-12)
- β¨ Context7 MCP integration
- β¨ Enhanced expertise detection algorithms
- β¨ Advanced persona adaptation features
v2.0.0 (2025-11-05)
- β¨ Dynamic persona selection
- β¨ Expertise level detection
- β¨ Team-based communication patterns
v1.0.0 (2025-10-15)
- β¨ Initial persona system
- β¨ Basic communication adaptation
- β User expertise detection
Generated with: MoAI-ADK Skill Factory v4.0
Last Updated: 2025-11-13
Maintained by: Primary Agent (alfred)
Optimization: 59% size reduction while preserving all functionality
GitHub Repository
Related Skills
moai-alfred-personas
DocumentationThis Claude Skill enables adaptive communication by dynamically selecting roles and adjusting language based on detected user expertise and request type. Use it for personalized interactions where the system needs to match its communication style to different user skill levels. It's ideal for applications requiring expertise detection and dynamic adaptation in conversational flows.
archon
DocumentationThe Archon skill provides RAG-powered semantic search and project management through a REST API. Use it for querying documentation, managing hierarchical projects/tasks, and performing knowledge retrieval with document upload capabilities. Always prioritize Archon first when searching external documentation before using other sources.
Email Composer
DocumentationEmail Composer drafts professional emails for business, technical, and customer communication. It structures messages using a standard professional format and adapts to various contexts by incorporating user-provided purpose, recipient relationship, and desired tone. Use this skill when you need to quickly generate or get help composing a professional email.
technical-writing
DocumentationThis Claude Skill applies rigorous technical writing standards to technical prose like code comments and documentation, enforcing active voice, present tense, and precise language. It transforms vague terms into specific metrics and provides tailored rules for different writing types. Use it whenever clarity and precision in technical communication are critical.
