#!/usr/bin/env python3 """ Extract all MVP tasks from full_plan.md and create comprehensive batch file for GitHub issues. This script systematically extracts tasks from each MVP and sprint in the full plan. """ import json from typing import Any def extract_mvp_tasks(): """Extract all MVP tasks from full_plan.md.""" # Read the full plan with open("full_plan.md", encoding="utf-8") as f: content = f.read() # Define MVP task patterns to extract mvp_tasks = {} # MVP 1: KG-Powered Tool Suggester (Day 1-2) mvp_tasks[1] = { "name": "KG-Powered Tool Suggester", "duration": "Day 1-2", "sprints": [ { "sprint": 1, "name": "Foundation & Core Components", "tasks": [ { "id": "KG_Structure", "name": "Create in-memory Knowledge Graph structure", "description": "Implement InMemoryKG class for storing MCP Tool metadata and embeddings", }, { "id": "Tool_Data_Loading", "name": "Load initial MCP Tools from JSON", "description": "Load 3-5 diverse tools into KG with structured and vector storage", }, { "id": "Embedder_Service", "name": "Implement embedding generation service", "description": "Create EmbeddingService using LLM APIs for tool descriptions", }, { "id": "Semantic_Search", "name": "Implement cosine similarity search", "description": "Add vector search for finding relevant tools based on query embeddings", }, { "id": "Simple_Planner", "name": "Create SimplePlannerAgent", "description": "Agent that embeds queries and searches for relevant tools", }, { "id": "Basic_Gradio_UI", "name": "Build basic Gradio interface", "description": "UI with query input and tool suggestions display", }, ], } ], } # MVP 2: KG Suggests Actionable Tool with Prompt Template (Day 2-3) mvp_tasks[2] = { "name": "KG Suggests Actionable Tool with Prompt Template", "duration": "Day 2-3", "sprints": [ { "sprint": 1, "name": "Prompt Integration", "tasks": [ { "id": "Prompt_Ontology", "name": "Define MCPPrompt dataclass", "description": "Extend KG to store prompt templates with tool linkage", }, { "id": "Prompt_Data_Loading", "name": "Load initial prompts from JSON", "description": "Link prompt templates to tools in the KG", }, { "id": "Enhanced_Planner", "name": "Enhance planner for tool+prompt selection", "description": "Select both tools and associated prompts based on query", }, { "id": "UI_Prompt_Display", "name": "Update UI to display prompt templates", "description": "Show selected prompt templates with placeholders", }, { "id": "PlannedStep_Structure", "name": "Create PlannedStep dataclass", "description": "Represent tool+prompt selections", }, ], } ], } # MVP 3: Interactive Prompt Filling & Simulated Execution (Day 3-4) mvp_tasks[3] = { "name": "Interactive Prompt Filling & Simulated Execution", "duration": "Day 3-4", "sprints": [ { "sprint": 1, "name": "Dynamic UI Generation", "tasks": [ { "id": "Dynamic_Input_Fields", "name": "Implement dynamic Gradio input field generation", "description": "Generate interactive gr.Textbox components based on prompt variables", }, { "id": "Input_Collection", "name": "Create user input collection mechanism", "description": "Collect user inputs from dynamic fields", }, { "id": "UI_State_Management", "name": "Implement UI state transitions", "description": "Manage planning and execution phases", }, ], }, { "sprint": 2, "name": "User Input Collection", "tasks": [ { "id": "Input_Validation", "name": "Add input validation for dynamic fields", "description": "Validate inputs based on prompt requirements", }, { "id": "Stub_Executor", "name": "Create StubExecutorAgent", "description": "Basic simulate_execution method", }, { "id": "Execute_Button", "name": "Add Execute Plan button", "description": "Wire button to input collection", }, ], }, { "sprint": 3, "name": "Integrate Executor & Display Results", "tasks": [ { "id": "Tool_Specific_Mocks", "name": "Enhance executor for tool-specific responses", "description": "Return different mock responses based on tool_id", }, { "id": "Executor_Integration", "name": "Integrate StubExecutorAgent into app.py", "description": "Wire executor into main workflow", }, { "id": "Result_Display", "name": "Format and display simulated results", "description": "Show execution results in UI", }, ], }, { "sprint": 4, "name": "Refine Simulated Outputs", "tasks": [ { "id": "Input_Aware_Mocks", "name": "Make mock responses input-sensitive", "description": "Generate responses based on user inputs", }, { "id": "Error_Simulation", "name": "Add simulated error states", "description": "Handle edge cases and failures", }, { "id": "UI_Polish", "name": "Improve execution result display", "description": "Better formatting and user experience", }, ], }, { "sprint": 5, "name": "MVP3 Finalization", "tasks": [ { "id": "E2E_Testing", "name": "Comprehensive end-to-end testing", "description": "Test MVP1-3 features integration", }, { "id": "Documentation_Update", "name": "Update all READMEs for MVP3", "description": "Document MVP3 functionality", }, { "id": "Code_Cleanup", "name": "Final code review and cleanup", "description": "Prepare MVP3 for deployment", }, ], }, ], } # MVP 4: Real MCP Tool Execution via Gradio Server (Day 4-5) mvp_tasks[4] = { "name": "Real MCP Tool Execution via Gradio Server", "duration": "Day 4-5", "sprints": [ { "sprint": 1, "name": "First MCP Server (Summarizer)", "tasks": [ { "id": "Summarizer_Project", "name": "Create separate project for MCP Summarizer", "description": "New project directory with environment setup", }, { "id": "Summarizer_Logic", "name": "Implement text summarization", "description": "Use HF Inference API for summarization", }, { "id": "Summarizer_MCP", "name": "Create Gradio UI and MCP server", "description": "Gradio app exposed as MCP server", }, { "id": "Summarizer_Deploy", "name": "Deploy Summarizer to HF Space", "description": "Live deployment with documentation", }, ], }, { "sprint": 2, "name": "Second MCP Server (Sentiment)", "tasks": [ { "id": "Sentiment_Project", "name": "Create separate project for MCP Sentiment Analyzer", "description": "New project directory with environment setup", }, { "id": "Sentiment_Logic", "name": "Implement sentiment analysis", "description": "Use HF Inference API for sentiment", }, { "id": "Sentiment_MCP", "name": "Create Gradio UI and MCP server", "description": "Gradio app exposed as MCP server", }, { "id": "Sentiment_Deploy", "name": "Deploy Sentiment Analyzer to HF Space", "description": "Live deployment with documentation", }, ], }, { "sprint": 3, "name": "Update Main KG & Executor", "tasks": [ { "id": "Tool_Ontology_Update", "name": "Add execution_type field to MCPTool", "description": "Distinguish live vs simulated tools", }, { "id": "Live_URLs_Update", "name": "Update initial_tools.json with live URLs", "description": "Point to deployed MCP server endpoints", }, { "id": "MCP_Executor", "name": "Refactor executor for real HTTP calls", "description": "Make actual calls to live MCP servers", }, { "id": "Error_Handling", "name": "Implement robust error handling", "description": "Handle network failures and parsing errors", }, ], }, { "sprint": 4, "name": "E2E Testing & UI Polish", "tasks": [ { "id": "Live_Testing", "name": "Test live MCP tool integration", "description": "End-to-end testing with real tools", }, { "id": "UI_Live_Indicator", "name": "Differentiate live vs simulated results", "description": "Visual indicators in UI", }, { "id": "Error_Display", "name": "Improve display of live MCP errors", "description": "User-friendly error messaging", }, ], }, { "sprint": 5, "name": "Final Documentation & Submission", "tasks": [ { "id": "Track1_Documentation", "name": "Update all READMEs for MVP4", "description": "Document live tool integration", }, { "id": "Demo_Videos", "name": "Record demo videos", "description": "Main demo and Track 1 tool demos", }, { "id": "HF_Spaces_Final", "name": "Finalize all HF Spaces", "description": "Configure secrets, tags, READMEs", }, ], }, ], } # MVP 5: KG-Informed Model Preferences for Sampling (Day 5-6) mvp_tasks[5] = { "name": "KG-Informed Model Preferences for Sampling", "duration": "Day 5-6", "sprints": [ { "sprint": 1, "name": "Enhance KG Ontology for Model Preferences", "tasks": [ { "id": "Sampling_Ontology", "name": "Add sampling preference fields to MCPPrompt", "description": "Model hints, cost/speed/intelligence priorities", }, { "id": "Sampling_Data", "name": "Update initial_prompts.json with preferences", "description": "Add diverse sampling preferences to prompts", }, { "id": "KG_Loading_Update", "name": "Update InMemoryKG loading for new fields", "description": "Load sampling preference metadata", }, ], }, { "sprint": 2, "name": "Planner Logic for Sampling Requests", "tasks": [ { "id": "Sampling_Construction", "name": "Implement sampling request construction", "description": "Generate MCP sampling/createMessage params from KG", }, { "id": "Model_Preferences", "name": "Populate modelPreferences dynamically", "description": "Use KG data to set model hints and priorities", }, { "id": "Sampling_Agent_Logic", "name": "Add sampling logic to planner agent", "description": "Method to construct conceptual sampling requests", }, ], }, { "sprint": 3, "name": "Gradio UI for Sampling Requests", "tasks": [ { "id": "Sampling_UI_Elements", "name": "Add sampling UI components", "description": "Button and JSON display for sampling requests", }, { "id": "Sampling_Handler", "name": "Implement sampling request handler", "description": "Gradio handler to trigger and display sampling JSON", }, { "id": "Sampling_Integration", "name": "Wire sampling button to backend", "description": "Connect UI to sampling construction logic", }, ], }, { "sprint": 4, "name": "LLM Refinement (Optional)", "tasks": [ { "id": "LLM_Refinement_Logic", "name": "Add LLM refinement suggestions", "description": "Use LLM to suggest model hints based on preferences", }, { "id": "Refinement_UI", "name": "Display LLM refinement in UI", "description": "Show LLM-generated suggestions", }, { "id": "Chat_Completion_Service", "name": "Extend EmbeddingService for chat", "description": "Add chat completion capability", }, ], }, { "sprint": 5, "name": "Final Testing & Innovation Demo", "tasks": [ { "id": "Sampling_Testing", "name": "Test conceptual sampling features", "description": "Validate sampling request generation", }, { "id": "Innovation_Documentation", "name": "Update READMEs for innovation showcase", "description": "Highlight innovative MCP usage", }, { "id": "Final_Submission_Prep", "name": "Final hackathon submission preparation", "description": "Videos, docs, CI checks", }, ], }, ], } return mvp_tasks def create_github_batch_file(mvp_tasks: dict[int, Any]): """Create a comprehensive batch file for GitHub issue creation.""" batch_content = """# KGraph-MCP MVP Tasks - Complete Extraction from full_plan.md # Format: MVP|Sprint|Name|Objective # This file contains ALL tasks from the comprehensive 5-MVP plan """ task_list = [] for mvp_num, mvp_data in mvp_tasks.items(): batch_content += ( f"\n# MVP {mvp_num}: {mvp_data['name']} ({mvp_data['duration']})\n" ) for sprint_data in mvp_data["sprints"]: sprint_num = sprint_data["sprint"] sprint_name = sprint_data["name"] batch_content += f"# Sprint {sprint_num}: {sprint_name}\n" for task in sprint_data["tasks"]: task_line = f"{mvp_num}|{sprint_num}|{task['id']}|{task['description']}" batch_content += task_line + "\n" # Also add to task list for JSON creation task_list.append( { "mvp": mvp_num, "sprint": sprint_num, "name": task["id"], "title": task["name"], "description": task["description"], "objective": task["description"], } ) # Write batch file with open("full_plan_mvp_tasks_complete.txt", "w") as f: f.write(batch_content) # Write JSON file for detailed processing with open("full_plan_mvp_tasks_complete.json", "w") as f: json.dump(task_list, f, indent=2) print(f"āœ… Created comprehensive batch file with {len(task_list)} tasks") print("šŸ“„ Files created:") print(" - full_plan_mvp_tasks_complete.txt (batch format)") print(" - full_plan_mvp_tasks_complete.json (detailed JSON)") return task_list def main(): """Main extraction and batch creation function.""" print("šŸ” Extracting MVP tasks from full_plan.md...") mvp_tasks = extract_mvp_tasks() task_list = create_github_batch_file(mvp_tasks) print("\nšŸ“Š Task Summary:") mvp_counts = {} for task in task_list: mvp = task["mvp"] mvp_counts[mvp] = mvp_counts.get(mvp, 0) + 1 for mvp, count in mvp_counts.items(): print(f" MVP {mvp}: {count} tasks") print("\nšŸŽÆ Next Steps:") print(" 1. Review the generated files") print( " 2. Use 'just mvp-batch-create full_plan_mvp_tasks_complete.txt' to create GitHub issues" ) print(" 3. Use 'just gh-sync-all' to sync with GitHub project") if __name__ == "__main__": main()