diff --git a/src/plugins/comparative_analysis.py b/plugins/comparative_analysis.py similarity index 100% rename from src/plugins/comparative_analysis.py rename to plugins/comparative_analysis.py diff --git a/plugins/complex_problem_solving_plugin.py b/plugins/complex_problem_solving_plugin.py new file mode 100644 index 0000000..28605db --- /dev/null +++ b/plugins/complex_problem_solving_plugin.py @@ -0,0 +1,31 @@ +from src.plugin_manager import hookimpl + + +class ComplexProblemSolvingPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Generates prompts for solving complex, multifaceted problems requiring diverse expertise.""" + return f""" + Analyze and develop a comprehensive solution for the following complex problem: + + Objective: {objective} + + Break down this problem into several key areas of focus. For each area: + 1. Identify the core challenges and opportunities + 2. Propose potential solutions or strategies + 3. Consider interdependencies with other areas + 4. Suggest metrics for measuring success + + Your analysis should cover multiple perspectives, such as: + - Strategic implications + - Financial considerations + - Operational logistics + - Market dynamics + - Technological aspects + - Human resources impact + + Provide a holistic approach that addresses the complexity of the problem while ensuring all components work together cohesively. + """ + + +complex_problem_solving_plugin = ComplexProblemSolvingPlugin() diff --git a/plugins/content_creation_plugin.py b/plugins/content_creation_plugin.py new file mode 100644 index 0000000..d6b68d4 --- /dev/null +++ b/plugins/content_creation_plugin.py @@ -0,0 +1,36 @@ +from src.plugin_manager import hookimpl + + +class ContentCreationPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Assists in creating comprehensive, multi-faceted content on various topics.""" + return f""" + Create comprehensive content on the following topic: + + Objective: {objective} + + Develop a detailed outline for the content, including: + 1. An engaging introduction that sets the context + 2. Main sections, each covering a key aspect of the topic + 3. Subsections that delve into specific details + 4. A conclusion that summarizes key points and provides a call to action + + For each section, consider including: + - Relevant data and statistics + - Expert opinions or quotes + - Case studies or real-world examples + - Visual elements (describe what kind of charts, graphs, or images would be useful) + + Ensure the content: + - Is well-researched and factually accurate + - Presents a balanced view of the topic + - Engages the target audience effectively + - Follows a logical flow of ideas + - Incorporates current trends and future outlooks + + Suggest ways to repurpose this content for different formats (e.g., blog post, white paper, infographic, video script). + """ + + +content_creation_plugin = ContentCreationPlugin() diff --git a/plugins/customer_support_plugin.py b/plugins/customer_support_plugin.py new file mode 100644 index 0000000..5977364 --- /dev/null +++ b/plugins/customer_support_plugin.py @@ -0,0 +1,64 @@ +from src.plugin_manager import hookimpl + + +class CustomerSupportPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Helps handle complex customer inquiries requiring input from multiple departments.""" + return f""" + Develop a comprehensive response strategy for the following customer support scenario: + + Objective: {objective} + + Create a detailed plan to address this complex customer inquiry, considering the following aspects: + + 1. Issue Understanding: + - Break down the customer's problem into its core components + - Identify which departments or areas of expertise are involved + - Prioritize the issues based on urgency and impact + + 2. Information Gathering: + - List the key questions to ask the customer for clarification + - Identify the internal sources of information needed (e.g., documentation, databases) + - Outline a process for collecting input from different departments + + 3. Technical Support: + - Provide step-by-step troubleshooting instructions + - Suggest potential solutions based on common issues + - Outline escalation procedures for complex technical problems + + 4. Billing and Account Management: + - Address any billing-related concerns + - Explain relevant policies and procedures + - Suggest potential account adjustments or solutions + + 5. Product Functionality: + - Clarify product features and capabilities + - Provide usage instructions or best practices + - Suggest alternative features or workarounds if needed + + 6. Cross-departmental Coordination: + - Outline a workflow for involving multiple departments + - Suggest methods for efficient information sharing between teams + - Define responsibilities and timelines for each involved department + + 7. Customer Communication: + - Draft a clear and empathetic initial response to the customer + - Plan follow-up communications and progress updates + - Prepare answers to potential follow-up questions + + 8. Resolution and Follow-up: + - Outline steps to implement the solution + - Create a plan to verify the customer's satisfaction + - Suggest proactive measures to prevent similar issues in the future + + 9. Knowledge Base Update: + - Identify key learnings from this case + - Suggest updates to internal documentation or FAQs + - Outline training recommendations for support staff + + Ensure the response strategy is comprehensive, customer-centric, and efficiently utilizes internal resources to resolve the complex inquiry. + """ + + +customer_support_plugin = CustomerSupportPlugin() diff --git a/plugins/educational_content_plugin.py b/plugins/educational_content_plugin.py new file mode 100644 index 0000000..0cffc90 --- /dev/null +++ b/plugins/educational_content_plugin.py @@ -0,0 +1,69 @@ +from src.plugin_manager import hookimpl + + +class EducationalContentPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Aids in developing comprehensive educational materials and lesson plans.""" + return f""" + Develop comprehensive educational content for the following topic: + + Objective: {objective} + + Create a detailed plan for educational content that covers the following aspects: + + 1. Learning Objectives: + - Define clear, measurable learning outcomes + - Align objectives with relevant educational standards + - Consider cognitive, affective, and psychomotor domains + + 2. Content Outline: + - Break down the topic into main themes and subtopics + - Ensure a logical progression of ideas + - Include key concepts, theories, and practical applications + + 3. Historical Context: + - Provide relevant historical background + - Highlight significant developments or changes in understanding + - Connect historical context to current knowledge + + 4. Theoretical Concepts: + - Explain core theories or models related to the topic + - Compare and contrast different theoretical approaches + - Discuss the evolution of theoretical understanding + + 5. Practical Applications: + - Provide real-world examples and case studies + - Include hands-on activities or experiments + - Discuss current and potential future applications + + 6. Interdisciplinary Connections: + - Identify links to other subjects or fields of study + - Explore how the topic relates to broader themes or global issues + - Encourage critical thinking across disciplines + + 7. Multimedia Resources: + - Suggest relevant videos, animations, or simulations + - Recommend interactive tools or websites + - Include ideas for infographics or visual aids + + 8. Assessment Strategies: + - Develop diverse assessment methods (e.g., quizzes, projects, discussions) + - Include both formative and summative assessments + - Align assessments with learning objectives + + 9. Differentiation and Accessibility: + - Provide strategies for adapting content to different learning styles + - Suggest modifications for various ability levels + - Ensure content is accessible to learners with diverse needs + + 10. Extended Learning: + - Recommend additional resources for further study + - Suggest topics for independent research or projects + - Provide discussion questions to encourage deeper exploration + + Ensure the educational content is comprehensive, engaging, and adaptable to different learning environments and student needs. Consider how to balance theoretical knowledge with practical skills and critical thinking development. + """ + + +educational_content_plugin = EducationalContentPlugin() diff --git a/plugins/innovation_management_plugin.py b/plugins/innovation_management_plugin.py new file mode 100644 index 0000000..95e1935 --- /dev/null +++ b/plugins/innovation_management_plugin.py @@ -0,0 +1,94 @@ +from src.plugin_manager import hookimpl + + +class InnovationManagementPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Assists in developing strategies to foster, manage, and implement innovation within an organization.""" + return f""" + Develop a comprehensive innovation management strategy for the following objective: + + Objective: {objective} + + Create a detailed innovation management plan that covers the following aspects: + + 1. Innovation Vision and Goals: + - Define a clear vision for innovation within the organization + - Set specific, measurable innovation goals aligned with business objectives + - Identify key areas or domains for innovation focus + + 2. Innovation Culture: + - Outline strategies to foster a culture of creativity and experimentation + - Suggest ways to encourage risk-taking and learning from failures + - Develop approaches to break down silos and promote cross-functional collaboration + + 3. Idea Generation and Capture: + - Design processes for soliciting ideas from employees, customers, and partners + - Suggest tools or platforms for capturing and organizing ideas + - Develop criteria for initial idea evaluation and prioritization + + 4. Innovation Portfolio Management: + - Create a framework for categorizing innovation projects (e.g., core, adjacent, transformational) + - Develop a balanced portfolio approach to manage risk and potential returns + - Suggest methods for allocating resources across different types of innovation + + 5. Innovation Process: + - Outline a stage-gate process for moving ideas from concept to implementation + - Define key milestones, deliverables, and decision points in the innovation journey + - Suggest agile methodologies for rapid prototyping and iterative development + + 6. Open Innovation Strategies: + - Develop approaches for engaging external partners in the innovation process + - Suggest methods for identifying and managing strategic partnerships or collaborations + - Outline strategies for participating in innovation ecosystems or clusters + + 7. Innovation Metrics and KPIs: + - Define key performance indicators to measure innovation success + - Suggest both leading and lagging indicators for innovation performance + - Develop a dashboard for tracking and reporting innovation metrics + + 8. Funding and Resource Allocation: + - Outline strategies for securing funding for innovation projects + - Suggest models for allocating resources (e.g., dedicated innovation budget, time allocation) + - Develop approaches for managing innovation project portfolios + + 9. Talent Management for Innovation: + - Identify key skills and competencies needed for innovation + - Suggest strategies for attracting, developing, and retaining innovative talent + - Outline approaches for building diverse, cross-functional innovation teams + + 10. Innovation Governance: + - Design an innovation governance structure (e.g., innovation council, chief innovation officer) + - Define roles and responsibilities for managing the innovation process + - Develop decision-making frameworks for innovation investments + + 11. Intellectual Property Strategy: + - Outline approaches for protecting and managing intellectual property + - Suggest strategies for leveraging IP for competitive advantage + - Develop guidelines for IP sharing in collaborative innovation efforts + + 12. Innovation Training and Education: + - Design programs to develop innovation skills across the organization + - Suggest methods for sharing innovation best practices and case studies + - Outline approaches for continuous learning and skill development in innovation + + 13. Technology and Tools: + - Recommend technologies to support the innovation process (e.g., idea management software, collaboration tools) + - Suggest approaches for leveraging emerging technologies in the innovation process + - Outline strategies for maintaining technological competitiveness + + 14. Innovation Communication and Recognition: + - Develop strategies for communicating innovation successes and learnings + - Suggest approaches for recognizing and rewarding innovative contributions + - Outline methods for storytelling and celebrating innovation within the organization + + 15. Scaling and Implementation: + - Design processes for scaling successful innovations + - Suggest strategies for overcoming resistance to change and driving adoption + - Develop approaches for integrating innovations into existing operations + + Ensure the innovation management strategy is comprehensive, adaptable to the organization's specific context, and provides actionable plans for fostering and managing innovation effectively. + """ + + +innovation_management_plugin = InnovationManagementPlugin() diff --git a/plugins/product_development_plugin.py b/plugins/product_development_plugin.py new file mode 100644 index 0000000..4b792db --- /dev/null +++ b/plugins/product_development_plugin.py @@ -0,0 +1,59 @@ +from src.plugin_manager import hookimpl + + +class ProductDevelopmentPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Guides through the process of developing new products from ideation to launch.""" + return f""" + Develop a comprehensive plan for the following product: + + Objective: {objective} + + Create a detailed product development strategy covering the following areas: + + 1. Market Analysis: + - Target audience and their needs + - Competitive landscape + - Market trends and opportunities + + 2. Product Conceptualization: + - Core features and functionalities + - Unique selling propositions + - Product vision and long-term roadmap + + 3. Technical Architecture: + - High-level system design + - Technology stack recommendations + - Scalability and performance considerations + + 4. User Experience (UX) Design: + - User personas and journey maps + - Key user interfaces and interactions + - Accessibility and usability guidelines + + 5. Development Planning: + - Sprint planning and milestones + - Resource allocation + - Risk assessment and mitigation strategies + + 6. Quality Assurance: + - Testing strategies (unit, integration, user acceptance) + - Performance benchmarks + - Security and compliance considerations + + 7. Launch Strategy: + - Go-to-market plan + - Marketing and promotion strategies + - Customer onboarding and support plans + + 8. Post-launch Considerations: + - Maintenance and update schedules + - User feedback collection and analysis + - Performance monitoring and optimization + + Ensure each area is thoroughly addressed and consider interdependencies between different aspects of the product development process. + """ + + +product_development_plugin = ProductDevelopmentPlugin() diff --git a/plugins/project_planning_plugin.py b/plugins/project_planning_plugin.py new file mode 100644 index 0000000..d4593e4 --- /dev/null +++ b/plugins/project_planning_plugin.py @@ -0,0 +1,69 @@ +from src.plugin_manager import hookimpl + + +class ProjectPlanningPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Assists in creating detailed project plans covering all aspects of project management.""" + return f""" + Develop a comprehensive project plan for the following objective: + + Objective: {objective} + + Create a detailed project plan that covers the following areas: + + 1. Project Scope and Objectives: + - Clear definition of project goals + - Key deliverables and success criteria + - Project boundaries and constraints + + 2. Stakeholder Analysis: + - Identify key stakeholders + - Define roles and responsibilities + - Communication plan for each stakeholder group + + 3. Work Breakdown Structure (WBS): + - Break down the project into manageable tasks + - Identify major milestones + - Estimate time and resources for each task + + 4. Timeline and Schedule: + - Develop a Gantt chart or similar timeline visualization + - Identify critical path and dependencies + - Include buffer time for unforeseen circumstances + + 5. Resource Allocation: + - Human resources required (roles and skills) + - Material and equipment needs + - Budget allocation for each project phase + + 6. Risk Management: + - Identify potential risks and their impact + - Develop mitigation strategies for each risk + - Create a contingency plan for high-priority risks + + 7. Quality Management: + - Define quality standards and metrics + - Outline quality control processes + - Plan for regular quality audits + + 8. Communication Plan: + - Establish communication channels and frequency + - Define reporting structure and templates + - Plan for status updates and review meetings + + 9. Change Management: + - Process for handling change requests + - Impact assessment procedures + - Approval and implementation guidelines + + 10. Monitoring and Evaluation: + - Key performance indicators (KPIs) + - Tools and methods for tracking progress + - Plan for regular project evaluations and adjustments + + Ensure the project plan is comprehensive, realistic, and aligned with the overall objective. Consider interdependencies between different aspects of the project and provide strategies for successful execution. + """ + + +project_planning_plugin = ProjectPlanningPlugin() diff --git a/plugins/research_analysis_plugin.py b/plugins/research_analysis_plugin.py new file mode 100644 index 0000000..4bd5b80 --- /dev/null +++ b/plugins/research_analysis_plugin.py @@ -0,0 +1,59 @@ +from src.plugin_manager import hookimpl + + +class ResearchAnalysisPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Facilitates comprehensive research and analysis on complex topics.""" + return f""" + Conduct a comprehensive research and analysis on the following topic: + + Objective: {objective} + + Develop a detailed research plan that covers the following aspects: + + 1. Background and Context: + - Historical overview of the topic + - Current state of knowledge and key debates + + 2. Research Questions: + - Formulate 3-5 key research questions + - Identify sub-questions for each main question + + 3. Methodology: + - Propose appropriate research methods (quantitative, qualitative, mixed) + - Identify data sources and collection strategies + - Outline analysis techniques + + 4. Literature Review: + - Identify key academic papers, books, and reports + - Summarize main theories and findings + - Highlight gaps in current research + + 5. Data Analysis: + - Describe how you would analyze the data + - Suggest visualizations or statistical tests + - Propose ways to ensure validity and reliability + + 6. Multidisciplinary Perspectives: + - Analyze the topic from various angles (e.g., social, economic, environmental, technological) + - Consider potential interdisciplinary connections + + 7. Ethical Considerations: + - Identify potential ethical issues in the research + - Propose mitigation strategies + + 8. Potential Impact: + - Discuss the potential implications of the research + - Consider short-term and long-term effects + - Identify stakeholders who might be affected + + 9. Future Directions: + - Suggest areas for future research + - Discuss potential applications of the findings + + Ensure the research plan is comprehensive, methodologically sound, and addresses the complexity of the topic from multiple perspectives. + """ + + +research_analysis_plugin = ResearchAnalysisPlugin() diff --git a/plugins/scenario_planning_plugin.py b/plugins/scenario_planning_plugin.py new file mode 100644 index 0000000..eadb73b --- /dev/null +++ b/plugins/scenario_planning_plugin.py @@ -0,0 +1,83 @@ +from src.plugin_manager import hookimpl + + +class ScenarioPlanningPlugin: + @hookimpl + def get_use_case_prompt(self, objective: str) -> str: + """Guides the process of developing and analyzing multiple future scenarios for strategic decision-making.""" + return f""" + Develop a comprehensive scenario planning analysis for the following objective: + + Objective: {objective} + + Create a detailed scenario planning process that covers the following aspects: + + 1. Focal Issue Identification: + - Clearly define the central issue or decision to be addressed + - Specify the time horizon for the scenarios (e.g., 5, 10, or 20 years) + - Identify the key stakeholders involved + + 2. Key Drivers Analysis: + - Identify the major forces shaping the future environment (PESTLE analysis) + - Distinguish between predetermined elements and critical uncertainties + - Prioritize the most impactful and uncertain drivers + + 3. Scenario Framework Development: + - Select two critical uncertainties as axes for a 2x2 scenario matrix + - Define four distinct, plausible future scenarios + - Provide a brief narrative description for each scenario + + 4. Scenario Detailing: + For each of the four scenarios, elaborate on: + - Political landscape + - Economic conditions + - Social and demographic trends + - Technological advancements + - Legal and regulatory environment + - Environmental factors + + 5. Implications Analysis: + For each scenario: + - Identify potential opportunities and threats + - Analyze the impact on the organization's strategy and operations + - Consider implications for different stakeholders + + 6. Indicator Development: + - Develop a set of early warning indicators for each scenario + - Specify trigger points that signal a scenario is becoming more likely + + 7. Strategy Development: + - Identify robust strategies that perform well across multiple scenarios + - Develop contingency plans for specific scenarios + - Suggest ways to increase organizational flexibility and adaptability + + 8. Scenario Testing: + - Stress-test current strategies against each scenario + - Identify potential vulnerabilities and blind spots + - Suggest modifications to improve strategic resilience + + 9. Stakeholder Implications: + - Analyze how different stakeholders might react in each scenario + - Identify potential winners and losers in each future + - Suggest engagement strategies for key stakeholders + + 10. Monitoring System: + - Develop a system for tracking relevant trends and indicators + - Establish a process for regularly updating and refining scenarios + - Suggest methods for incorporating scenario insights into ongoing strategic planning + + 11. Communication Plan: + - Outline how to effectively communicate scenarios to different audiences + - Suggest ways to use scenarios in strategic conversations and decision-making + - Develop visual aids or other tools to help stakeholders engage with the scenarios + + 12. Action Planning: + - Identify immediate actions based on scenario insights + - Develop a timeline for strategy implementation and review + - Suggest ways to maintain strategic flexibility while taking decisive action + + Ensure the scenario planning process is comprehensive, creative yet grounded in current trends, and provides actionable insights for strategic decision-making. + """ + + +scenario_planning_plugin = ScenarioPlanningPlugin() diff --git a/src/main.py b/src/main.py index 784eae6..8a7044d 100644 --- a/src/main.py +++ b/src/main.py @@ -3,6 +3,8 @@ import typer from rich import print as rprint +from rich.console import Console +from rich.table import Table from src.config import settings from src.orchestrator import Orchestrator, OrchestratorSettings @@ -10,9 +12,18 @@ app = typer.Typer() +# Define and create plugin folder +current_dir = os.path.dirname(os.path.abspath(__file__)) +project_root = os.path.dirname(current_dir) +plugin_folder = os.path.join(project_root, "plugins") +os.makedirs(plugin_folder, exist_ok=True) + + # Load plugins -plugin_folder = os.path.join(os.path.dirname(__file__), "..", "plugins") -plugin_manager.load_plugins(plugin_folder) +try: + plugin_manager.load_plugins(plugin_folder) +except Exception as e: + rprint(f"[bold red]Error loading plugins: {str(e)}[/bold red]") @app.command() @@ -69,5 +80,37 @@ def run_workflow( rprint(f"[bold red]An error occurred:[/bold red] {str(e)}") +@app.command() +def list_plugins(): + """ + List all available plugins. + """ + console = Console() + + rprint(f"[bold]Plugin folder:[/bold] {plugin_folder}") + + plugins = plugin_manager.get_use_case_prompts() + + if not plugins: + rprint( + "[yellow]No plugins found. Make sure plugin files end with '_plugin.py' and contain a valid plugin class.[/yellow]" + ) + return + + table = Table(title="Available Plugins") + table.add_column("Plugin Name", style="cyan", no_wrap=True) + table.add_column("Description", style="magenta") + + for plugin_name, plugin_func in plugins.items(): + description = ( + plugin_func.__doc__.strip().split("\n")[0] + if plugin_func.__doc__ + else "No description available" + ) + table.add_row(plugin_name, description) + + console.print(table) + + if __name__ == "__main__": app() diff --git a/src/plugin_manager.py b/src/plugin_manager.py index 8efeabc..8bffc1d 100644 --- a/src/plugin_manager.py +++ b/src/plugin_manager.py @@ -1,3 +1,5 @@ +import importlib.util +import os from typing import Callable, Dict import pluggy @@ -21,12 +23,30 @@ def register_plugin(self, plugin): self.manager.register(plugin) def load_plugins(self, plugin_folder: str): - self.manager.load_setuptools_entrypoints("saa_orchestrator_plugins") + if not os.path.exists(plugin_folder): + return + + for filename in os.listdir(plugin_folder): + if filename.endswith("_plugin.py"): + module_name = filename[:-3] # Remove '.py' + module_path = os.path.join(plugin_folder, filename) + try: + spec = importlib.util.spec_from_file_location(module_name, module_path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + for item_name in dir(module): + item = getattr(module, item_name) + if isinstance(item, type) and item_name.endswith("Plugin"): + plugin_instance = item() + self.register_plugin(plugin_instance) + except Exception: + pass # Silently ignore any loading errors def get_use_case_prompts(self) -> Dict[str, Callable]: prompts = {} for hook_impl in self.manager.hook.get_use_case_prompt.get_hookimpls(): - prompts[hook_impl.plugin_name] = hook_impl.function + plugin_name = hook_impl.plugin.__class__.__name__ + prompts[plugin_name] = hook_impl.function return prompts