tech-hub-skills 1.2.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/{LICENSE → .claude/LICENSE} +21 -21
  2. package/.claude/README.md +291 -0
  3. package/.claude/bin/cli.js +266 -0
  4. package/{bin → .claude/bin}/copilot.js +182 -182
  5. package/{bin → .claude/bin}/postinstall.js +42 -42
  6. package/{tech_hub_skills/skills → .claude/commands}/README.md +336 -336
  7. package/{tech_hub_skills/skills → .claude/commands}/ai-engineer.md +104 -104
  8. package/{tech_hub_skills/skills → .claude/commands}/aws.md +143 -143
  9. package/{tech_hub_skills/skills → .claude/commands}/azure.md +149 -149
  10. package/{tech_hub_skills/skills → .claude/commands}/backend-developer.md +108 -108
  11. package/{tech_hub_skills/skills → .claude/commands}/code-review.md +399 -399
  12. package/{tech_hub_skills/skills → .claude/commands}/compliance-automation.md +747 -747
  13. package/{tech_hub_skills/skills → .claude/commands}/compliance-officer.md +108 -108
  14. package/{tech_hub_skills/skills → .claude/commands}/data-engineer.md +113 -113
  15. package/{tech_hub_skills/skills → .claude/commands}/data-governance.md +102 -102
  16. package/{tech_hub_skills/skills → .claude/commands}/data-scientist.md +123 -123
  17. package/{tech_hub_skills/skills → .claude/commands}/database-admin.md +109 -109
  18. package/{tech_hub_skills/skills → .claude/commands}/devops.md +160 -160
  19. package/{tech_hub_skills/skills → .claude/commands}/docker.md +160 -160
  20. package/{tech_hub_skills/skills → .claude/commands}/enterprise-dashboard.md +613 -613
  21. package/{tech_hub_skills/skills → .claude/commands}/finops.md +184 -184
  22. package/{tech_hub_skills/skills → .claude/commands}/frontend-developer.md +108 -108
  23. package/{tech_hub_skills/skills → .claude/commands}/gcp.md +143 -143
  24. package/{tech_hub_skills/skills → .claude/commands}/ml-engineer.md +115 -115
  25. package/{tech_hub_skills/skills → .claude/commands}/mlops.md +187 -187
  26. package/{tech_hub_skills/skills → .claude/commands}/network-engineer.md +109 -109
  27. package/{tech_hub_skills/skills → .claude/commands}/optimization-advisor.md +329 -329
  28. package/{tech_hub_skills/skills → .claude/commands}/orchestrator.md +623 -623
  29. package/{tech_hub_skills/skills → .claude/commands}/platform-engineer.md +102 -102
  30. package/{tech_hub_skills/skills → .claude/commands}/process-automation.md +226 -226
  31. package/{tech_hub_skills/skills → .claude/commands}/process-changelog.md +184 -184
  32. package/{tech_hub_skills/skills → .claude/commands}/process-documentation.md +484 -484
  33. package/{tech_hub_skills/skills → .claude/commands}/process-kanban.md +324 -324
  34. package/{tech_hub_skills/skills → .claude/commands}/process-versioning.md +214 -214
  35. package/{tech_hub_skills/skills → .claude/commands}/product-designer.md +104 -104
  36. package/{tech_hub_skills/skills → .claude/commands}/project-starter.md +443 -443
  37. package/{tech_hub_skills/skills → .claude/commands}/qa-engineer.md +109 -109
  38. package/{tech_hub_skills/skills → .claude/commands}/security-architect.md +135 -135
  39. package/{tech_hub_skills/skills → .claude/commands}/sre.md +109 -109
  40. package/{tech_hub_skills/skills → .claude/commands}/system-design.md +126 -126
  41. package/{tech_hub_skills/skills → .claude/commands}/technical-writer.md +101 -101
  42. package/.claude/package.json +46 -0
  43. package/{tech_hub_skills → .claude}/roles/ai-engineer/skills/01-prompt-engineering/README.md +252 -252
  44. package/.claude/roles/ai-engineer/skills/01-prompt-engineering/prompt_ab_tester.py +356 -0
  45. package/.claude/roles/ai-engineer/skills/01-prompt-engineering/prompt_template_manager.py +274 -0
  46. package/.claude/roles/ai-engineer/skills/01-prompt-engineering/token_cost_estimator.py +324 -0
  47. package/{tech_hub_skills → .claude}/roles/ai-engineer/skills/02-rag-pipeline/README.md +448 -448
  48. package/.claude/roles/ai-engineer/skills/02-rag-pipeline/document_chunker.py +336 -0
  49. package/.claude/roles/ai-engineer/skills/02-rag-pipeline/rag_pipeline.sql +213 -0
  50. package/{tech_hub_skills → .claude}/roles/ai-engineer/skills/03-agent-orchestration/README.md +599 -599
  51. package/{tech_hub_skills → .claude}/roles/ai-engineer/skills/04-llm-guardrails/README.md +735 -735
  52. package/{tech_hub_skills → .claude}/roles/ai-engineer/skills/05-vector-embeddings/README.md +711 -711
  53. package/{tech_hub_skills → .claude}/roles/ai-engineer/skills/06-llm-evaluation/README.md +777 -777
  54. package/{tech_hub_skills → .claude}/roles/azure/skills/01-infrastructure-fundamentals/README.md +264 -264
  55. package/{tech_hub_skills → .claude}/roles/azure/skills/02-data-factory/README.md +264 -264
  56. package/{tech_hub_skills → .claude}/roles/azure/skills/03-synapse-analytics/README.md +264 -264
  57. package/{tech_hub_skills → .claude}/roles/azure/skills/04-databricks/README.md +264 -264
  58. package/{tech_hub_skills → .claude}/roles/azure/skills/05-functions/README.md +264 -264
  59. package/{tech_hub_skills → .claude}/roles/azure/skills/06-kubernetes-service/README.md +264 -264
  60. package/{tech_hub_skills → .claude}/roles/azure/skills/07-openai-service/README.md +264 -264
  61. package/{tech_hub_skills → .claude}/roles/azure/skills/08-machine-learning/README.md +264 -264
  62. package/{tech_hub_skills → .claude}/roles/azure/skills/09-storage-adls/README.md +264 -264
  63. package/{tech_hub_skills → .claude}/roles/azure/skills/10-networking/README.md +264 -264
  64. package/{tech_hub_skills → .claude}/roles/azure/skills/11-sql-cosmos/README.md +264 -264
  65. package/{tech_hub_skills → .claude}/roles/azure/skills/12-event-hubs/README.md +264 -264
  66. package/{tech_hub_skills → .claude}/roles/code-review/skills/01-automated-code-review/README.md +394 -394
  67. package/{tech_hub_skills → .claude}/roles/code-review/skills/02-pr-review-workflow/README.md +427 -427
  68. package/{tech_hub_skills → .claude}/roles/code-review/skills/03-code-quality-gates/README.md +518 -518
  69. package/{tech_hub_skills → .claude}/roles/code-review/skills/04-reviewer-assignment/README.md +504 -504
  70. package/{tech_hub_skills → .claude}/roles/code-review/skills/05-review-analytics/README.md +540 -540
  71. package/{tech_hub_skills → .claude}/roles/data-engineer/skills/01-lakehouse-architecture/README.md +550 -550
  72. package/.claude/roles/data-engineer/skills/01-lakehouse-architecture/bronze_ingestion.py +337 -0
  73. package/.claude/roles/data-engineer/skills/01-lakehouse-architecture/medallion_queries.sql +300 -0
  74. package/{tech_hub_skills → .claude}/roles/data-engineer/skills/02-etl-pipeline/README.md +580 -580
  75. package/{tech_hub_skills → .claude}/roles/data-engineer/skills/03-data-quality/README.md +579 -579
  76. package/{tech_hub_skills → .claude}/roles/data-engineer/skills/04-streaming-pipelines/README.md +608 -608
  77. package/{tech_hub_skills → .claude}/roles/data-engineer/skills/05-performance-optimization/README.md +547 -547
  78. package/{tech_hub_skills → .claude}/roles/data-governance/skills/01-data-catalog/README.md +112 -112
  79. package/{tech_hub_skills → .claude}/roles/data-governance/skills/02-data-lineage/README.md +129 -129
  80. package/{tech_hub_skills → .claude}/roles/data-governance/skills/03-data-quality-framework/README.md +182 -182
  81. package/{tech_hub_skills → .claude}/roles/data-governance/skills/04-access-control/README.md +39 -39
  82. package/{tech_hub_skills → .claude}/roles/data-governance/skills/05-master-data-management/README.md +40 -40
  83. package/{tech_hub_skills → .claude}/roles/data-governance/skills/06-compliance-privacy/README.md +46 -46
  84. package/{tech_hub_skills → .claude}/roles/data-scientist/skills/01-eda-automation/README.md +230 -230
  85. package/.claude/roles/data-scientist/skills/01-eda-automation/eda_generator.py +446 -0
  86. package/{tech_hub_skills → .claude}/roles/data-scientist/skills/02-statistical-modeling/README.md +264 -264
  87. package/{tech_hub_skills → .claude}/roles/data-scientist/skills/03-feature-engineering/README.md +264 -264
  88. package/{tech_hub_skills → .claude}/roles/data-scientist/skills/04-predictive-modeling/README.md +264 -264
  89. package/{tech_hub_skills → .claude}/roles/data-scientist/skills/05-customer-analytics/README.md +264 -264
  90. package/{tech_hub_skills → .claude}/roles/data-scientist/skills/06-campaign-analysis/README.md +264 -264
  91. package/{tech_hub_skills → .claude}/roles/data-scientist/skills/07-experimentation/README.md +264 -264
  92. package/{tech_hub_skills → .claude}/roles/data-scientist/skills/08-data-visualization/README.md +264 -264
  93. package/{tech_hub_skills → .claude}/roles/devops/skills/01-cicd-pipeline/README.md +264 -264
  94. package/{tech_hub_skills → .claude}/roles/devops/skills/02-container-orchestration/README.md +264 -264
  95. package/{tech_hub_skills → .claude}/roles/devops/skills/03-infrastructure-as-code/README.md +264 -264
  96. package/{tech_hub_skills → .claude}/roles/devops/skills/04-gitops/README.md +264 -264
  97. package/{tech_hub_skills → .claude}/roles/devops/skills/05-environment-management/README.md +264 -264
  98. package/{tech_hub_skills → .claude}/roles/devops/skills/06-automated-testing/README.md +264 -264
  99. package/{tech_hub_skills → .claude}/roles/devops/skills/07-release-management/README.md +264 -264
  100. package/{tech_hub_skills → .claude}/roles/devops/skills/08-monitoring-alerting/README.md +264 -264
  101. package/{tech_hub_skills → .claude}/roles/devops/skills/09-devsecops/README.md +265 -265
  102. package/{tech_hub_skills → .claude}/roles/finops/skills/01-cost-visibility/README.md +264 -264
  103. package/{tech_hub_skills → .claude}/roles/finops/skills/02-resource-tagging/README.md +264 -264
  104. package/{tech_hub_skills → .claude}/roles/finops/skills/03-budget-management/README.md +264 -264
  105. package/{tech_hub_skills → .claude}/roles/finops/skills/04-reserved-instances/README.md +264 -264
  106. package/{tech_hub_skills → .claude}/roles/finops/skills/05-spot-optimization/README.md +264 -264
  107. package/{tech_hub_skills → .claude}/roles/finops/skills/06-storage-tiering/README.md +264 -264
  108. package/{tech_hub_skills → .claude}/roles/finops/skills/07-compute-rightsizing/README.md +264 -264
  109. package/{tech_hub_skills → .claude}/roles/finops/skills/08-chargeback/README.md +264 -264
  110. package/{tech_hub_skills → .claude}/roles/ml-engineer/skills/01-mlops-pipeline/README.md +566 -566
  111. package/{tech_hub_skills → .claude}/roles/ml-engineer/skills/02-feature-engineering/README.md +655 -655
  112. package/{tech_hub_skills → .claude}/roles/ml-engineer/skills/03-model-training/README.md +704 -704
  113. package/{tech_hub_skills → .claude}/roles/ml-engineer/skills/04-model-serving/README.md +845 -845
  114. package/{tech_hub_skills → .claude}/roles/ml-engineer/skills/05-model-monitoring/README.md +874 -874
  115. package/{tech_hub_skills → .claude}/roles/mlops/skills/01-ml-pipeline-orchestration/README.md +264 -264
  116. package/{tech_hub_skills → .claude}/roles/mlops/skills/02-experiment-tracking/README.md +264 -264
  117. package/{tech_hub_skills → .claude}/roles/mlops/skills/03-model-registry/README.md +264 -264
  118. package/{tech_hub_skills → .claude}/roles/mlops/skills/04-feature-store/README.md +264 -264
  119. package/{tech_hub_skills → .claude}/roles/mlops/skills/05-model-deployment/README.md +264 -264
  120. package/{tech_hub_skills → .claude}/roles/mlops/skills/06-model-observability/README.md +264 -264
  121. package/{tech_hub_skills → .claude}/roles/mlops/skills/07-data-versioning/README.md +264 -264
  122. package/{tech_hub_skills → .claude}/roles/mlops/skills/08-ab-testing/README.md +264 -264
  123. package/{tech_hub_skills → .claude}/roles/mlops/skills/09-automated-retraining/README.md +264 -264
  124. package/{tech_hub_skills → .claude}/roles/platform-engineer/skills/01-internal-developer-platform/README.md +153 -153
  125. package/{tech_hub_skills → .claude}/roles/platform-engineer/skills/02-self-service-infrastructure/README.md +57 -57
  126. package/{tech_hub_skills → .claude}/roles/platform-engineer/skills/03-slo-sli-management/README.md +59 -59
  127. package/{tech_hub_skills → .claude}/roles/platform-engineer/skills/04-developer-experience/README.md +57 -57
  128. package/{tech_hub_skills → .claude}/roles/platform-engineer/skills/05-incident-management/README.md +73 -73
  129. package/{tech_hub_skills → .claude}/roles/platform-engineer/skills/06-capacity-management/README.md +59 -59
  130. package/{tech_hub_skills → .claude}/roles/product-designer/skills/01-requirements-discovery/README.md +407 -407
  131. package/{tech_hub_skills → .claude}/roles/product-designer/skills/02-user-research/README.md +382 -382
  132. package/{tech_hub_skills → .claude}/roles/product-designer/skills/03-brainstorming-ideation/README.md +437 -437
  133. package/{tech_hub_skills → .claude}/roles/product-designer/skills/04-ux-design/README.md +496 -496
  134. package/{tech_hub_skills → .claude}/roles/product-designer/skills/05-product-market-fit/README.md +376 -376
  135. package/{tech_hub_skills → .claude}/roles/product-designer/skills/06-stakeholder-management/README.md +412 -412
  136. package/{tech_hub_skills → .claude}/roles/security-architect/skills/01-pii-detection/README.md +319 -319
  137. package/{tech_hub_skills → .claude}/roles/security-architect/skills/02-threat-modeling/README.md +264 -264
  138. package/{tech_hub_skills → .claude}/roles/security-architect/skills/03-infrastructure-security/README.md +264 -264
  139. package/{tech_hub_skills → .claude}/roles/security-architect/skills/04-iam/README.md +264 -264
  140. package/{tech_hub_skills → .claude}/roles/security-architect/skills/05-application-security/README.md +264 -264
  141. package/{tech_hub_skills → .claude}/roles/security-architect/skills/06-secrets-management/README.md +264 -264
  142. package/{tech_hub_skills → .claude}/roles/security-architect/skills/07-security-monitoring/README.md +264 -264
  143. package/{tech_hub_skills → .claude}/roles/system-design/skills/01-architecture-patterns/README.md +337 -337
  144. package/{tech_hub_skills → .claude}/roles/system-design/skills/02-requirements-engineering/README.md +264 -264
  145. package/{tech_hub_skills → .claude}/roles/system-design/skills/03-scalability/README.md +264 -264
  146. package/{tech_hub_skills → .claude}/roles/system-design/skills/04-high-availability/README.md +264 -264
  147. package/{tech_hub_skills → .claude}/roles/system-design/skills/05-cost-optimization-design/README.md +264 -264
  148. package/{tech_hub_skills → .claude}/roles/system-design/skills/06-api-design/README.md +264 -264
  149. package/{tech_hub_skills → .claude}/roles/system-design/skills/07-observability-architecture/README.md +264 -264
  150. package/{tech_hub_skills → .claude}/roles/system-design/skills/08-process-automation/PROCESS_TEMPLATE.md +336 -336
  151. package/{tech_hub_skills → .claude}/roles/system-design/skills/08-process-automation/README.md +521 -521
  152. package/.claude/roles/system-design/skills/08-process-automation/ai_prompt_generator.py +744 -0
  153. package/.claude/roles/system-design/skills/08-process-automation/automation_recommender.py +688 -0
  154. package/.claude/roles/system-design/skills/08-process-automation/plan_generator.py +679 -0
  155. package/.claude/roles/system-design/skills/08-process-automation/process_analyzer.py +528 -0
  156. package/.claude/roles/system-design/skills/08-process-automation/process_parser.py +684 -0
  157. package/.claude/roles/system-design/skills/08-process-automation/role_matcher.py +615 -0
  158. package/.claude/skills/README.md +336 -0
  159. package/.claude/skills/ai-engineer.md +104 -0
  160. package/.claude/skills/aws.md +143 -0
  161. package/.claude/skills/azure.md +149 -0
  162. package/.claude/skills/backend-developer.md +108 -0
  163. package/.claude/skills/code-review.md +399 -0
  164. package/.claude/skills/compliance-automation.md +747 -0
  165. package/.claude/skills/compliance-officer.md +108 -0
  166. package/.claude/skills/data-engineer.md +113 -0
  167. package/.claude/skills/data-governance.md +102 -0
  168. package/.claude/skills/data-scientist.md +123 -0
  169. package/.claude/skills/database-admin.md +109 -0
  170. package/.claude/skills/devops.md +160 -0
  171. package/.claude/skills/docker.md +160 -0
  172. package/.claude/skills/enterprise-dashboard.md +613 -0
  173. package/.claude/skills/finops.md +184 -0
  174. package/.claude/skills/frontend-developer.md +108 -0
  175. package/.claude/skills/gcp.md +143 -0
  176. package/.claude/skills/ml-engineer.md +115 -0
  177. package/.claude/skills/mlops.md +187 -0
  178. package/.claude/skills/network-engineer.md +109 -0
  179. package/.claude/skills/optimization-advisor.md +329 -0
  180. package/.claude/skills/orchestrator.md +623 -0
  181. package/.claude/skills/platform-engineer.md +102 -0
  182. package/.claude/skills/process-automation.md +226 -0
  183. package/.claude/skills/process-changelog.md +184 -0
  184. package/.claude/skills/process-documentation.md +484 -0
  185. package/.claude/skills/process-kanban.md +324 -0
  186. package/.claude/skills/process-versioning.md +214 -0
  187. package/.claude/skills/product-designer.md +104 -0
  188. package/.claude/skills/project-starter.md +443 -0
  189. package/.claude/skills/qa-engineer.md +109 -0
  190. package/.claude/skills/security-architect.md +135 -0
  191. package/.claude/skills/sre.md +109 -0
  192. package/.claude/skills/system-design.md +126 -0
  193. package/.claude/skills/technical-writer.md +101 -0
  194. package/.gitattributes +2 -0
  195. package/GITHUB_COPILOT.md +106 -0
  196. package/README.md +192 -291
  197. package/package.json +16 -46
  198. package/bin/cli.js +0 -241
@@ -0,0 +1,744 @@
1
+ """
2
+ AI Prompt Generator - Generates prompts for AI-driven automation discovery.
3
+
4
+ Part of the Tech Hub Skills Library (sd-08: Process Automation).
5
+
6
+ This module generates optimized prompts for AI assistants (GitHub Copilot,
7
+ Claude, ChatGPT, etc.) to analyze processes and suggest automation solutions.
8
+ Designed for seamless VS Code integration.
9
+ """
10
+
11
+ from dataclasses import dataclass
12
+ from typing import List, Dict, Optional, Any
13
+ from enum import Enum
14
+ import json
15
+
16
+ try:
17
+ from process_parser import ParsedProcess, ProcessParser
18
+ from process_analyzer import ProcessAnalysis
19
+ except ImportError:
20
+ # Allow standalone usage
21
+ ParsedProcess = Any
22
+ ProcessAnalysis = Any
23
+
24
+
25
+ class PromptStyle(Enum):
26
+ """Different prompt styles for different AI assistants."""
27
+ CONCISE = "concise" # Short, focused prompts
28
+ DETAILED = "detailed" # Comprehensive analysis
29
+ STRUCTURED = "structured" # JSON/YAML output format
30
+ CONVERSATIONAL = "conversational" # Chat-style exploration
31
+ COPILOT = "copilot" # Optimized for GitHub Copilot
32
+ STEP_BY_STEP = "step_by_step" # Guided analysis
33
+
34
+
35
+ class AnalysisDepth(Enum):
36
+ """How deep the AI should analyze."""
37
+ QUICK = "quick" # High-level suggestions
38
+ STANDARD = "standard" # Balanced analysis
39
+ DEEP = "deep" # Comprehensive exploration
40
+ IMPLEMENTATION = "implementation" # Ready-to-implement details
41
+
42
+
43
+ @dataclass
44
+ class GeneratedPrompt:
45
+ """A generated prompt with metadata."""
46
+ prompt: str
47
+ style: PromptStyle
48
+ depth: AnalysisDepth
49
+ expected_output: str
50
+ follow_up_prompts: List[str]
51
+ context_variables: Dict[str, str]
52
+
53
+ def to_clipboard_format(self) -> str:
54
+ """Format for easy copy-paste."""
55
+ return f"""
56
+ {self.prompt}
57
+
58
+ ---
59
+ Expected Output: {self.expected_output}
60
+ Follow-up Questions:
61
+ {chr(10).join(f'- {q}' for q in self.follow_up_prompts)}
62
+ """
63
+
64
+
65
+ class AIPromptGenerator:
66
+ """
67
+ Generates optimized prompts for AI assistants to analyze automation.
68
+
69
+ Use this to create prompts that help AI assistants like GitHub Copilot
70
+ understand your process and suggest automation solutions.
71
+
72
+ Example workflow in VS Code:
73
+ 1. Write your process in PROCESS_TEMPLATE.md
74
+ 2. Run: prompt = generator.generate_discovery_prompt(parsed_process)
75
+ 3. Paste prompt into Copilot Chat
76
+ 4. Get automation suggestions
77
+ 5. Use follow-up prompts to drill deeper
78
+ """
79
+
80
+ # Tech Hub skill context for AI
81
+ TECH_HUB_CONTEXT = """
82
+ You have access to the following automation capabilities from the Tech Hub Skills Library:
83
+
84
+ **Data Engineering (de-*):**
85
+ - de-01: Lakehouse Architecture (Bronze-Silver-Gold medallion pattern)
86
+ - de-02: ETL/ELT Pipeline Orchestration (Airflow, Data Factory)
87
+ - de-03: Data Quality & Validation (Great Expectations)
88
+ - de-04: Real-Time Streaming (Kafka, Event Hubs)
89
+
90
+ **AI Engineering (ai-*):**
91
+ - ai-01: Prompt Engineering & Optimization
92
+ - ai-02: RAG Pipeline Builder (retrieval augmented generation)
93
+ - ai-03: LLM Agent Orchestration (multi-agent systems)
94
+ - ai-07: Production LLM API Integration
95
+
96
+ **ML Engineering (ml-*):**
97
+ - ml-01: MLOps Pipeline Automation
98
+ - ml-03: Model Training & Tuning
99
+ - ml-04: Model Serving & APIs
100
+
101
+ **DevOps (do-*):**
102
+ - do-01: CI/CD Pipeline Design
103
+ - do-03: Infrastructure as Code (Terraform, Bicep)
104
+ - do-08: Monitoring & Alerting
105
+
106
+ **Azure Services:**
107
+ - Azure Data Factory, Synapse, Databricks
108
+ - Azure OpenAI, Azure ML
109
+ - Azure Functions, Logic Apps, Power Automate
110
+ - Azure Event Hubs, Service Bus
111
+ """
112
+
113
+ def __init__(self, include_tech_hub_context: bool = True):
114
+ """Initialize the prompt generator."""
115
+ self.include_context = include_tech_hub_context
116
+
117
+ def generate_discovery_prompt(
118
+ self,
119
+ process: ParsedProcess,
120
+ style: PromptStyle = PromptStyle.DETAILED,
121
+ depth: AnalysisDepth = AnalysisDepth.STANDARD
122
+ ) -> GeneratedPrompt:
123
+ """
124
+ Generate a prompt for initial automation discovery.
125
+
126
+ This is the main entry point - use this to get AI suggestions
127
+ for how to automate a process.
128
+ """
129
+ if style == PromptStyle.COPILOT:
130
+ return self._generate_copilot_prompt(process, depth)
131
+ elif style == PromptStyle.STRUCTURED:
132
+ return self._generate_structured_prompt(process, depth)
133
+ elif style == PromptStyle.STEP_BY_STEP:
134
+ return self._generate_stepwise_prompt(process, depth)
135
+ else:
136
+ return self._generate_detailed_prompt(process, depth)
137
+
138
+ def _generate_copilot_prompt(
139
+ self,
140
+ process: ParsedProcess,
141
+ depth: AnalysisDepth
142
+ ) -> GeneratedPrompt:
143
+ """Generate prompt optimized for GitHub Copilot."""
144
+ prompt = f"""# Automation Analysis Request
145
+
146
+ ## Process to Analyze
147
+ **Name:** {process.name}
148
+ **Frequency:** {process.frequency}
149
+ **Current Pain Points:** {', '.join(process.pain_points) if process.pain_points else 'Not specified'}
150
+
151
+ ## Current Steps
152
+ {self._format_steps_for_prompt(process.steps)}
153
+
154
+ ## Current Tools
155
+ {', '.join(process.current_tools) if process.current_tools else 'Manual/unspecified'}
156
+
157
+ ## Goals
158
+ {chr(10).join(f'- {g}' for g in process.goals) if process.goals else '- Reduce manual effort\n- Improve accuracy\n- Save time'}
159
+
160
+ ## Analysis Request
161
+ Please analyze this process and provide:
162
+
163
+ 1. **Automation Score** (0-100): How automatable is this process?
164
+
165
+ 2. **Recommended Automation Approach:**
166
+ - Which steps can be fully automated?
167
+ - Which steps need human-in-the-loop?
168
+ - What's the optimal automation pattern? (RPA, Workflow, ML, AI-powered)
169
+
170
+ 3. **Technology Recommendations:**
171
+ - Primary tools/services to use
172
+ - Azure services that fit
173
+ - Open source alternatives
174
+
175
+ 4. **Implementation Roadmap:**
176
+ - Quick wins (< 1 week)
177
+ - Medium-term improvements (1-4 weeks)
178
+ - Long-term optimization
179
+
180
+ 5. **Code Snippets:** Provide starter code for the most impactful automation.
181
+ """
182
+
183
+ if self.include_context:
184
+ prompt = self.TECH_HUB_CONTEXT + "\n---\n\n" + prompt
185
+
186
+ follow_ups = [
187
+ "Show me the Python code to automate step [X]",
188
+ "How would I implement this using Azure Data Factory?",
189
+ "What's the error handling strategy for this automation?",
190
+ "How do I add monitoring and alerting?",
191
+ "What tests should I write for this automation?"
192
+ ]
193
+
194
+ return GeneratedPrompt(
195
+ prompt=prompt,
196
+ style=PromptStyle.COPILOT,
197
+ depth=depth,
198
+ expected_output="Structured automation analysis with code snippets",
199
+ follow_up_prompts=follow_ups,
200
+ context_variables={
201
+ "process_name": process.name,
202
+ "step_count": str(len(process.steps)),
203
+ "frequency": process.frequency
204
+ }
205
+ )
206
+
207
+ def _generate_structured_prompt(
208
+ self,
209
+ process: ParsedProcess,
210
+ depth: AnalysisDepth
211
+ ) -> GeneratedPrompt:
212
+ """Generate prompt for structured JSON/YAML output."""
213
+ prompt = f"""Analyze the following process for automation opportunities.
214
+
215
+ **INPUT PROCESS:**
216
+ ```json
217
+ {process.to_json()}
218
+ ```
219
+
220
+ **REQUIRED OUTPUT FORMAT:**
221
+ ```yaml
222
+ automation_analysis:
223
+ overall_score: <0-100>
224
+ complexity: <simple|moderate|complex|enterprise>
225
+ primary_approach: <rpa|workflow|data_pipeline|ml_based|ai_powered|hybrid>
226
+
227
+ step_analysis:
228
+ - step_number: <n>
229
+ automation_feasibility: <high|medium|low>
230
+ recommended_approach: <description>
231
+ tools: [<list of tools>]
232
+ effort: <hours/days>
233
+
234
+ recommended_architecture:
235
+ pattern: <description>
236
+ components:
237
+ - name: <component>
238
+ purpose: <why>
239
+ technology: <what>
240
+
241
+ implementation_phases:
242
+ - phase: 1
243
+ name: <phase name>
244
+ duration: <time>
245
+ deliverables: [<list>]
246
+
247
+ risks:
248
+ - risk: <description>
249
+ mitigation: <strategy>
250
+
251
+ roi_estimate:
252
+ time_savings_percent: <0-100>
253
+ payback_months: <n>
254
+ ```
255
+
256
+ Provide your analysis in exactly this YAML format.
257
+ """
258
+
259
+ if self.include_context:
260
+ prompt = self.TECH_HUB_CONTEXT + "\n---\n\n" + prompt
261
+
262
+ return GeneratedPrompt(
263
+ prompt=prompt,
264
+ style=PromptStyle.STRUCTURED,
265
+ depth=depth,
266
+ expected_output="YAML-formatted automation analysis",
267
+ follow_up_prompts=[
268
+ "Convert this to Terraform/Bicep infrastructure code",
269
+ "Generate the CI/CD pipeline YAML for this",
270
+ "Create the monitoring dashboard configuration"
271
+ ],
272
+ context_variables={"output_format": "yaml"}
273
+ )
274
+
275
+ def _generate_stepwise_prompt(
276
+ self,
277
+ process: ParsedProcess,
278
+ depth: AnalysisDepth
279
+ ) -> GeneratedPrompt:
280
+ """Generate step-by-step analysis prompt."""
281
+ prompt = f"""Let's analyze this process step by step for automation.
282
+
283
+ ## The Process: {process.name}
284
+
285
+ ### Step-by-Step Analysis Framework
286
+
287
+ For each step below, I'll ask you to evaluate:
288
+ - A: Automation feasibility (1-10)
289
+ - B: Technical approach
290
+ - C: Tools/services needed
291
+ - D: Implementation complexity
292
+ - E: Dependencies on other steps
293
+
294
+ ---
295
+
296
+ ### Current Process Steps:
297
+
298
+ {self._format_steps_for_prompt(process.steps)}
299
+
300
+ ---
301
+
302
+ ### Let's Start
303
+
304
+ **STEP 1 ANALYSIS:**
305
+ Please analyze the first step: "{process.steps[0].name if process.steps else 'N/A'}"
306
+
307
+ Provide:
308
+ 1. Automation feasibility score (1-10) and why
309
+ 2. Best technical approach for this specific step
310
+ 3. Recommended tools (prefer Azure-native when applicable)
311
+ 4. Estimated effort to automate
312
+ 5. What information flows into and out of this step
313
+
314
+ After analyzing Step 1, I'll ask about subsequent steps.
315
+ """
316
+
317
+ return GeneratedPrompt(
318
+ prompt=prompt,
319
+ style=PromptStyle.STEP_BY_STEP,
320
+ depth=depth,
321
+ expected_output="Iterative step-by-step analysis",
322
+ follow_up_prompts=[
323
+ f"Now analyze step {i+2}: {step.name}"
324
+ for i, step in enumerate(process.steps[1:5])
325
+ ],
326
+ context_variables={"analysis_mode": "iterative"}
327
+ )
328
+
329
+ def _generate_detailed_prompt(
330
+ self,
331
+ process: ParsedProcess,
332
+ depth: AnalysisDepth
333
+ ) -> GeneratedPrompt:
334
+ """Generate comprehensive detailed analysis prompt."""
335
+ depth_instructions = {
336
+ AnalysisDepth.QUICK: "Provide a high-level overview focusing on the top 3 automation opportunities.",
337
+ AnalysisDepth.STANDARD: "Provide a balanced analysis covering all major aspects.",
338
+ AnalysisDepth.DEEP: "Provide comprehensive analysis including edge cases, error handling, and optimization.",
339
+ AnalysisDepth.IMPLEMENTATION: "Provide implementation-ready details including code, configurations, and deployment steps."
340
+ }
341
+
342
+ prompt = f"""# Process Automation Analysis
343
+
344
+ ## Context
345
+ I need help automating a business process. Please analyze it thoroughly and suggest the best automation strategy.
346
+
347
+ ## Process Details
348
+
349
+ **Name:** {process.name}
350
+ **Description:** {process.description}
351
+ **Frequency:** {process.frequency}
352
+ **Stakeholders:** {', '.join(process.stakeholders) if process.stakeholders else 'Not specified'}
353
+
354
+ ### Current Workflow
355
+
356
+ {self._format_steps_for_prompt(process.steps)}
357
+
358
+ ### Pain Points
359
+ {chr(10).join(f'- {p}' for p in process.pain_points) if process.pain_points else '- Manual effort\n- Time-consuming'}
360
+
361
+ ### Current Tools in Use
362
+ {', '.join(process.current_tools) if process.current_tools else 'Mostly manual'}
363
+
364
+ ### Data Sources Involved
365
+ {', '.join(process.data_sources) if process.data_sources else 'Various'}
366
+
367
+ ### Goals for Automation
368
+ {chr(10).join(f'- {g}' for g in process.goals) if process.goals else '- Reduce time\n- Improve accuracy\n- Enable scaling'}
369
+
370
+ ### Constraints
371
+ {chr(10).join(f'- {c}' for c in process.constraints) if process.constraints else '- Standard enterprise constraints'}
372
+
373
+ ---
374
+
375
+ ## Analysis Request
376
+
377
+ {depth_instructions[depth]}
378
+
379
+ Please provide:
380
+
381
+ ### 1. Executive Summary
382
+ - Overall automation potential (score 0-100)
383
+ - Recommended approach in one sentence
384
+ - Expected benefits
385
+
386
+ ### 2. Detailed Step Analysis
387
+ For each step, evaluate:
388
+ - Can it be automated? (fully/partially/no)
389
+ - What technology fits best?
390
+ - What are the risks?
391
+
392
+ ### 3. Recommended Architecture
393
+ - High-level design
394
+ - Key components
395
+ - Data flow
396
+
397
+ ### 4. Technology Stack
398
+ - Primary tools and why
399
+ - Azure services to leverage
400
+ - Integration points
401
+
402
+ ### 5. Implementation Roadmap
403
+ - Phase 1: Quick wins
404
+ - Phase 2: Core automation
405
+ - Phase 3: Optimization
406
+
407
+ ### 6. Risk Assessment
408
+ - Technical risks
409
+ - Business risks
410
+ - Mitigation strategies
411
+
412
+ ### 7. Success Metrics
413
+ - How to measure success
414
+ - KPIs to track
415
+
416
+ {f"### 8. Starter Code" if depth == AnalysisDepth.IMPLEMENTATION else ""}
417
+ {f"Provide working code snippets for the key automation components." if depth == AnalysisDepth.IMPLEMENTATION else ""}
418
+ """
419
+
420
+ if self.include_context:
421
+ prompt = self.TECH_HUB_CONTEXT + "\n---\n\n" + prompt
422
+
423
+ return GeneratedPrompt(
424
+ prompt=prompt,
425
+ style=PromptStyle.DETAILED,
426
+ depth=depth,
427
+ expected_output="Comprehensive automation analysis document",
428
+ follow_up_prompts=[
429
+ "Elaborate on the architecture with a diagram",
430
+ "Provide the implementation code for [component]",
431
+ "How do I handle [specific edge case]?",
432
+ "What's the testing strategy?",
433
+ "How do I deploy this to production?"
434
+ ],
435
+ context_variables={
436
+ "analysis_depth": depth.value,
437
+ "process_name": process.name
438
+ }
439
+ )
440
+
441
+ def _format_steps_for_prompt(self, steps: List) -> str:
442
+ """Format steps for inclusion in prompt."""
443
+ if not steps:
444
+ return "*No steps defined*"
445
+
446
+ lines = []
447
+ for step in steps:
448
+ line = f"{step.sequence_number}. **{step.name}**"
449
+ if step.estimated_time:
450
+ line += f" ({step.estimated_time})"
451
+ if step.description and step.description != step.name:
452
+ line += f"\n {step.description[:200]}"
453
+ if step.pain_points:
454
+ line += f"\n ⚠️ Issues: {', '.join(str(p) for p in step.pain_points[:3])}"
455
+ if step.tools_mentioned:
456
+ line += f"\n 🔧 Tools: {', '.join(step.tools_mentioned)}"
457
+ lines.append(line)
458
+
459
+ return "\n\n".join(lines)
460
+
461
+ def generate_implementation_prompt(
462
+ self,
463
+ process: ParsedProcess,
464
+ target_step: int,
465
+ technology: str = "python"
466
+ ) -> GeneratedPrompt:
467
+ """Generate a prompt for implementing specific step automation."""
468
+ if target_step > len(process.steps) or target_step < 1:
469
+ target_step = 1
470
+
471
+ step = process.steps[target_step - 1]
472
+
473
+ prompt = f"""# Implementation Request
474
+
475
+ ## Context
476
+ I'm automating the "{process.name}" process and need to implement step {target_step}.
477
+
478
+ ## Step to Implement
479
+ **Name:** {step.name}
480
+ **Description:** {step.description}
481
+ **Current Duration:** {step.estimated_time or 'Unknown'}
482
+ **Tools Used:** {', '.join(step.tools_mentioned) if step.tools_mentioned else 'Manual'}
483
+ **Data Sources:** {', '.join(step.data_sources) if step.data_sources else 'Various'}
484
+
485
+ ## Requirements
486
+ - Technology: {technology}
487
+ - Must integrate with: {', '.join(process.current_tools) if process.current_tools else 'existing systems'}
488
+ - Error handling required
489
+ - Logging for observability
490
+
491
+ ## Implementation Request
492
+
493
+ Please provide:
494
+
495
+ 1. **Complete working code** for this step
496
+ 2. **Configuration/setup** needed
497
+ 3. **Dependencies** (requirements.txt or similar)
498
+ 4. **Unit tests**
499
+ 5. **Integration points** with previous/next steps
500
+ 6. **Error handling** strategy
501
+ 7. **Logging** approach
502
+
503
+ Make the code production-ready with proper:
504
+ - Type hints
505
+ - Docstrings
506
+ - Error handling
507
+ - Logging
508
+ - Configuration management
509
+ """
510
+
511
+ return GeneratedPrompt(
512
+ prompt=prompt,
513
+ style=PromptStyle.COPILOT,
514
+ depth=AnalysisDepth.IMPLEMENTATION,
515
+ expected_output=f"Working {technology} code for step {target_step}",
516
+ follow_up_prompts=[
517
+ "Add retry logic with exponential backoff",
518
+ "How do I test this in isolation?",
519
+ "Create a Docker container for this",
520
+ "Add Prometheus metrics",
521
+ "Implement the next step"
522
+ ],
523
+ context_variables={
524
+ "step_number": str(target_step),
525
+ "technology": technology
526
+ }
527
+ )
528
+
529
+ def generate_comparison_prompt(
530
+ self,
531
+ process: ParsedProcess,
532
+ approaches: List[str] = None
533
+ ) -> GeneratedPrompt:
534
+ """Generate prompt to compare different automation approaches."""
535
+ approaches = approaches or [
536
+ "Azure Logic Apps + Power Automate",
537
+ "Python + Airflow + Azure Functions",
538
+ "Azure Data Factory + Synapse",
539
+ "Custom microservices"
540
+ ]
541
+
542
+ prompt = f"""# Automation Approach Comparison
543
+
544
+ ## Process Overview
545
+ **Name:** {process.name}
546
+ **Steps:** {len(process.steps)}
547
+ **Frequency:** {process.frequency}
548
+
549
+ ## Approaches to Compare
550
+ {chr(10).join(f'{i+1}. {a}' for i, a in enumerate(approaches))}
551
+
552
+ ## Comparison Request
553
+
554
+ For the process described above, compare these {len(approaches)} approaches:
555
+
556
+ Create a comparison table with:
557
+ | Criteria | {' | '.join(approaches)} |
558
+ |----------|{'|'.join(['---' for _ in approaches])}|
559
+ | Initial Cost | | |
560
+ | Ongoing Cost | | |
561
+ | Time to Implement | | |
562
+ | Scalability | | |
563
+ | Maintainability | | |
564
+ | Flexibility | | |
565
+ | Learning Curve | | |
566
+ | Azure Integration | | |
567
+ | Error Handling | | |
568
+ | Monitoring | | |
569
+
570
+ Then provide:
571
+
572
+ 1. **Recommendation** - Which approach fits best and why
573
+ 2. **Trade-offs** - What you gain/lose with each
574
+ 3. **Migration Path** - How to evolve if needs change
575
+ 4. **Risk Comparison** - Risks unique to each approach
576
+ """
577
+
578
+ return GeneratedPrompt(
579
+ prompt=prompt,
580
+ style=PromptStyle.DETAILED,
581
+ depth=AnalysisDepth.STANDARD,
582
+ expected_output="Comparison table with recommendation",
583
+ follow_up_prompts=[
584
+ f"Show me how to implement with {approaches[0]}",
585
+ "What if budget is the primary constraint?",
586
+ "What if time-to-market is critical?",
587
+ "How would the architecture look for the recommended approach?"
588
+ ],
589
+ context_variables={"approaches_count": str(len(approaches))}
590
+ )
591
+
592
+
593
+ # Convenience functions for quick usage
594
+ def quick_analyze(process_text: str) -> str:
595
+ """
596
+ Quick analysis of a process from text.
597
+
598
+ Usage in VS Code:
599
+ 1. Write your process description
600
+ 2. Call: prompt = quick_analyze(your_description)
601
+ 3. Paste into Copilot Chat
602
+
603
+ Returns the prompt ready for copy-paste.
604
+ """
605
+ from process_parser import ProcessParser
606
+
607
+ parser = ProcessParser()
608
+ parsed = parser.parse(process_text)
609
+
610
+ generator = AIPromptGenerator()
611
+ result = generator.generate_discovery_prompt(parsed, PromptStyle.COPILOT)
612
+
613
+ return result.prompt
614
+
615
+
616
+ def get_implementation_prompt(process_text: str, step: int, tech: str = "python") -> str:
617
+ """Get implementation prompt for a specific step."""
618
+ from process_parser import ProcessParser
619
+
620
+ parser = ProcessParser()
621
+ parsed = parser.parse(process_text)
622
+
623
+ generator = AIPromptGenerator()
624
+ result = generator.generate_implementation_prompt(parsed, step, tech)
625
+
626
+ return result.prompt
627
+
628
+
629
+ # VS Code / Copilot integration example
630
+ VSCODE_USAGE = """
631
+ # How to Use with VS Code GitHub Copilot
632
+
633
+ ## Quick Start
634
+
635
+ 1. Create a new file: `my_process.md`
636
+ 2. Describe your process using the template (see PROCESS_TEMPLATE.md)
637
+ 3. Open a new Python file and run:
638
+
639
+ ```python
640
+ from ai_prompt_generator import quick_analyze
641
+
642
+ # Read your process description
643
+ with open('my_process.md', 'r') as f:
644
+ process_text = f.read()
645
+
646
+ # Generate the prompt
647
+ prompt = quick_analyze(process_text)
648
+
649
+ # Copy to clipboard (or print and copy)
650
+ print(prompt)
651
+ ```
652
+
653
+ 4. Open GitHub Copilot Chat (Ctrl+Shift+I)
654
+ 5. Paste the prompt
655
+ 6. Get automation suggestions!
656
+
657
+ ## Advanced Usage
658
+
659
+ ```python
660
+ from process_parser import ProcessParser
661
+ from ai_prompt_generator import AIPromptGenerator, PromptStyle, AnalysisDepth
662
+
663
+ # Parse your process
664
+ parser = ProcessParser()
665
+ parsed = parser.parse(process_text)
666
+
667
+ # Generate different types of prompts
668
+ generator = AIPromptGenerator()
669
+
670
+ # For quick overview
671
+ quick_prompt = generator.generate_discovery_prompt(
672
+ parsed,
673
+ style=PromptStyle.CONCISE,
674
+ depth=AnalysisDepth.QUICK
675
+ )
676
+
677
+ # For detailed implementation
678
+ impl_prompt = generator.generate_implementation_prompt(
679
+ parsed,
680
+ target_step=1,
681
+ technology="python"
682
+ )
683
+
684
+ # For comparing approaches
685
+ compare_prompt = generator.generate_comparison_prompt(
686
+ parsed,
687
+ approaches=["Azure Functions", "Airflow", "Logic Apps"]
688
+ )
689
+ ```
690
+ """
691
+
692
+
693
+ if __name__ == "__main__":
694
+ # Demo
695
+ sample_process = """
696
+ # Invoice Processing Workflow
697
+
698
+ ## Overview
699
+ Monthly invoice processing for vendor payments. Currently takes 2 days.
700
+
701
+ ## Steps
702
+ 1. **Receive invoices** via email (ongoing)
703
+ 2. **Extract invoice data** - manually type into Excel (2 hours)
704
+ 3. **Validate against PO** - check purchase orders (1 hour)
705
+ 4. **Get approvals** - email chains, very slow (4 hours wait)
706
+ 5. **Enter into ERP** - manual SAP entry (1 hour)
707
+ 6. **Schedule payment** - batch processing (30 mins)
708
+ 7. **Archive documents** - save to SharePoint (20 mins)
709
+
710
+ ## Pain Points
711
+ - Manual data entry is error-prone
712
+ - Approval delays are frustrating
713
+ - No visibility into status
714
+
715
+ ## Stakeholders
716
+ - Accounts Payable Team
717
+ - Finance Manager
718
+ - Department Heads (approvers)
719
+
720
+ ## Goals
721
+ - Reduce processing time by 80%
722
+ - Eliminate manual data entry errors
723
+ - Real-time status visibility
724
+ """
725
+
726
+ from process_parser import ProcessParser
727
+
728
+ parser = ProcessParser()
729
+ parsed = parser.parse(sample_process)
730
+
731
+ generator = AIPromptGenerator()
732
+
733
+ print("=" * 70)
734
+ print("GENERATED COPILOT PROMPT")
735
+ print("=" * 70)
736
+
737
+ result = generator.generate_discovery_prompt(parsed, PromptStyle.COPILOT)
738
+ print(result.prompt[:2000] + "...")
739
+
740
+ print("\n" + "=" * 70)
741
+ print("FOLLOW-UP PROMPTS")
742
+ print("=" * 70)
743
+ for p in result.follow_up_prompts:
744
+ print(f" → {p}")