8000 feat: add comprehensive environment and trending analysis prompt temp… · loonghao/pypi-query-mcp-server@78cd2bc · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 78cd2bc

Browse files
committed
feat: add comprehensive environment and trending analysis prompt templates
Environment Analysis Templates: - analyze_environment_dependencies: Analyze current Python environment and dependencies - check_outdated_packages: Check for outdated packages with update priorities - generate_update_plan: Create comprehensive package update plans with strategies Trending Analysis Templates: - analyze_daily_trends: Analyze daily PyPI download trends and popular packages - find_trending_packages: Discover trending packages over different time periods - track_package_updates: Track recent package updates and releases Key Features: - Follow standard MCP workflow with {{parameter}} template variables - Support environment analysis (uvx pip list integration ready) - Enable trending package discovery and popularity analysis - Provide structured update planning with different strategies - Include comprehensive parameter validation and documentation - Add usage examples and integration guides All templates follow the established MCP prompt workflow: 1. User calls tool → MCP client sends request 2. Tool function executes → Collects necessary data and parameters 3. Call Prompt generator → Pass parameters to corresponding generator 4. Load template → Get template with {{parameter}} placeholders 5. Parameter replacement → Replace {{parameter_name}} with actual values 6. Return final prompt → As tool's response back to AI Updated documentation and README with new template examples and usage patterns. Signed-off-by: longhao <hal.long@outlook.com>
1 parent f30444f commit 78cd2bc

File tree

6 files changed

+989
-0
lines changed

6 files changed

+989
-0
lines changed

PROMPT_TEMPLATES.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,124 @@ Generate a detailed migration checklist prompt.
186186
}
187187
```
188188

189+
### Environment Analysis Templates
190+
191+
#### 9. `analyze_environment_dependencies`
192+
Generate a prompt for analyzing current environment dependencies.
193+
194+
**Parameters:**
195+
- `environment_type` (optional): Type of environment (local, virtual, docker, conda)
196+
- `python_version` (optional): Python version in the environment
197+
- `project_path` (optional): Path to the project directory
198+
199+
**Use Case:** When you need to analyze your current Python environment and check for outdated packages.
200+
201+
**Example:**
202+
```json
203+
{
204+
"environment_type": "virtual",
205+
"python_version": "3.11",
206+
"project_path": "/path/to/project"
207+
}
208+
```
209+
210+
#### 10. `check_outdated_packages`
211+
Generate a prompt for checking outdated packages with update priorities.
212+
213+
**Parameters:**
214+
- `package_filter` (optional): Filter packages by name pattern
215+
- `severity_level` (optional): Focus level (all, security, major, minor)
216+
- `include_dev_dependencies` (optional): Include development dependencies
217+
218+
**Use Case:** When you want to identify and prioritize package updates.
219+
220+
**Example:**
221+
```json
222+
{
223+
"package_filter": "django*",
224+
"severity_level": "security",
225+
"include_dev_dependencies": true
226+
}
227+
```
228+
229+
#### 11. `generate_update_plan`
230+
Generate a prompt for creating comprehensive package update plans.
231+
232+
**Parameters:**
233+
- `update_strategy` (optional): Update strategy (conservative, balanced, aggressive)
234+
- `environment_constraints` (optional): Environment constraints or requirements
235+
- `testing_requirements` (optional): Testing requirements before updates
236+
237+
**Use Case:** When you need a structured plan for updating packages in your environment.
238+
239+
**Example:**
240+
```json
241+
{
242+
"update_strategy": "balanced",
243+
"environment_constraints": "Production environment, zero downtime required",
244+
"testing_requirements": "Full test suite + integration tests"
245+
}
246+
```
247+
248+
### Trending Analysis Templates
249+
250+
#### 12. `analyze_daily_trends`
251+
Generate a prompt for analyzing daily PyPI download trends.
252+
253+
**Parameters:**
254+
- `date` (optional): Specific date to analyze (YYYY-MM-DD) or 'today'
255+
- `category` (optional): Package category to focus on (web, data, ml, etc.)
256+
- `limit` (optional): Number of top packages to analyze (5-50)
257+
258+
**Use Case:** When you want to understand what packages are trending on PyPI.
259+
260+
**Example:**
261+
```json
262+
{
263+
"date": "today",
264+
"category": "machine-learning",
265+
"limit": 20
266+
}
267+
```
268+
269+
#### 13. `find_trending_packages`
270+
Generate a prompt for discovering trending packages over time periods.
271+
272+
**Parameters:**
273+
- `time_period` (optional): Time period for trend analysis (daily, weekly, monthly)
274+
- `trend_type` (optional): Type of trends to focus on (rising, declining, new, all)
275+
- `domain` (optional): Specific domain or category (web, ai, data, etc.)
276+
277+
**Use Case:** When you want to discover packages that are gaining or losing popularity.
278+
279+
**Example:**
280+
```json
281+
{
282+
"time_period": "weekly",
283+
"trend_type": "rising",
284+
"domain": "web-development"
285+
}
286+
```
287+
288+
#### 14. `track_package_updates`
289+
Generate a prompt for tracking recent package updates and releases.
290+
291+
**Parameters:**
292+
- `time_range` (optional): Time range for update tracking (today, week, month)
293+
- `update_type` (optional): Type of updates to track (all, major, security, new)
294+
- `popular_only` (optional): Focus only on popular packages (>1M downloads)
295+
296+
**Use Case:** When you want to stay informed about recent package updates and releases.
297+
298+
**Example:**
299+
```json
300+
{
301+
"time_range": "week",
302+
"update_type": "security",
303+
"popular_only": true
304+
}
305+
```
306+
189307
## 🚀 Usage Examples
190308

191309
### In Claude Desktop

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ The server provides the following MCP tools:
217217
17. **plan_package_migration** - Generate comprehensive package migration plan prompts
218218
18. **generate_migration_checklist** - Generate detailed migration checklist prompts
219219

220+
### Environment Analysis Templates
221+
19. **analyze_environment_dependencies** - Generate prompts for analyzing current environment dependencies
222+
20. **check_outdated_packages** - Generate prompts for checking outdated packages with update priorities
223+
21. **generate_update_plan** - Generate prompts for creating comprehensive package update plans
224+
225+
### Trending Analysis Templates
226+
22. **analyze_daily_trends** - Generate prompts for analyzing daily PyPI download trends
227+
23. **find_trending_packages** - Generate prompts for discovering trending packages over time periods
228+
24. **track_package_updates** - Generate prompts for tracking recent package updates and releases
229+
220230
> 📖 **Learn more about prompt templates**: See [PROMPT_TEMPLATES.md](PROMPT_TEMPLATES.md) for detailed documentation and examples.
221231
222232
## Usage Examples
@@ -254,6 +264,18 @@ Once configured in your MCP client (Claude Desktop, Cline, Cursor, Windsurf), yo
254264
- "Help me resolve dependency conflicts with a structured prompt"
255265
- "Generate a security audit prompt for my production packages"
256266

267+
### Environment Analysis
268+
- "Analyze my current Python environment dependencies and check for outdated packages"
269+
- "Check which packages in my environment have security updates available"
270+
- "Generate an update plan for my production environment with conservative strategy"
271+
- "Help me identify packages that need immediate updates vs. planned updates"
272+
273+
### Trending Analysis
274+
- "What are the most downloaded Python packages today?"
275+
- "Show me trending packages in the machine learning domain this week"
276+
- "Track recent security updates and new package releases"
277+
- "Find rising packages in web development that I should consider"
278+
257279
### Example Conversations
258280

259281
**User**: "Check if Django 4.2 is compatible with Python 3.9"

pypi_query_mcp/prompts/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
plan_version_upgrade,
1010
resolve_dependency_conflicts,
1111
)
12+
from .environment_analysis import (
13+
analyze_environment_dependencies,
14+
check_outdated_packages,
15+
generate_update_plan,
16+
)
1217
from .migration_guidance import (
1318
generate_migration_checklist,
1419
plan_package_migration,
@@ -18,6 +23,11 @@
1823
compare_packages,
1924
suggest_alternatives,
2025
)
26+
from .trending_analysis import (
27+
analyze_daily_trends,
28+
find_trending_packages,
29+
track_package_updates,
30+
)
2131

2232
__all__ = [
2333
# Package Analysis
@@ -28,7 +38,15 @@
2838
"resolve_dependency_conflicts",
2939
"plan_version_upgrade",
3040
"audit_security_risks",
41+
# Environment Analysis
42+
"analyze_environment_dependencies",
43+
"check_outdated_packages",
44+
"generate_update_plan",
3145
# Migration Guidance
3246
"plan_package_migration",
3347
"generate_migration_checklist",
48+
# Trending Analysis
49+
"analyze_daily_trends",
50+
"find_trending_packages",
51+
"track_package_updates",
3452
]

0 commit comments

Comments
 (0)
0