Skip to content

Commit 063ad28

Browse files
committed
Adding prompt tool with first 9 prompts for onboarding
1 parent 5172054 commit 063ad28

File tree

6 files changed

+511
-2
lines changed

6 files changed

+511
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"bump": "node scripts/sync-version.js --bump",
2828
"bump:minor": "node scripts/sync-version.js --bump --minor",
2929
"bump:major": "node scripts/sync-version.js --bump --major",
30-
"build": "tsc && shx cp setup-claude-server.js uninstall-claude-server.js track-installation.js dist/ && shx chmod +x dist/*.js",
30+
"build": "tsc && shx cp setup-claude-server.js uninstall-claude-server.js track-installation.js dist/ && shx chmod +x dist/*.js && shx mkdir -p dist/data && shx cp src/data/onboarding-prompts.json dist/data/",
3131
"watch": "tsc --watch",
3232
"start": "node dist/index.js",
3333
"start:debug": "node --inspect-brk=9229 dist/index.js",

src/data/onboarding-prompts.json

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"version": "1.0.0",
3+
"description": "Desktop Commander onboarding prompts for first-time users",
4+
"prompts": [
5+
{
6+
"id": "onb_001",
7+
"title": "Organize my Downloads folder",
8+
"description": "Clean up and organize your messy Downloads folder into relevant subfolders automatically.",
9+
"prompt": "I want you to help me organize my Downloads folder. Let's do this step by step:\n\n**Phase 1: Analysis**\n1. First, analyze what's in my Downloads folder to understand the types of files\n2. Show me what file types and categories I have\n\n**Phase 2: Planning** \n3. Based on what you find, propose a logical folder structure\n4. Ask for my approval of the organization plan before proceeding\n\n**Phase 3: Organization**\n5. After I approve, create the necessary subfolders\n6. Move files into appropriate categories (documents, images, videos, software, etc.)\n7. Provide a summary of what was organized\n\n**Important**: Don't move any files until I approve your proposed organization structure.\n\nStart by exploring my Downloads folder and showing me what you find, then wait for my approval before organizing.",
10+
"categories": ["onboarding"],
11+
"votes": 0,
12+
"gaClicks": 0,
13+
"icon": "FolderOpen",
14+
"author": "DC team",
15+
"verified": true
16+
},
17+
{
18+
"id": "onb_002",
19+
"title": "Get my IP address and system info",
20+
"description": "Quickly get your IP address and basic system information.",
21+
"prompt": "Please help me get my system information:\n\n1. Get my current IP address (both local and public if possible)\n2. Show basic system information like:\n - Operating system and version\n - Available disk space\n - Memory usage\n - Current date and time\n - Network connectivity status\n\nProvide this information in a clear, easy-to-read format.",
22+
"categories": ["onboarding"],
23+
"votes": 0,
24+
"gaClicks": 0,
25+
"icon": "Monitor",
26+
"author": "DC team",
27+
"verified": true
28+
},
29+
{
30+
"id": "onb_003",
31+
"title": "Create organized knowledge/documents folder",
32+
"description": "Set up a well-structured knowledge base or document organization system with templates and suggested categories.",
33+
"prompt": "I want to help you create a well-organized knowledge base and document system. Let me understand your needs first:\n\n**Option 1: Create New Knowledge Base**\n- What type of work or projects do you typically do?\n- What subjects or topics would you like to organize knowledge about?\n- Do you prefer a general-purpose system or something specialized?\n\n**Option 2: Organize Existing Documents**\n- Do you have an existing folder with documents that needs organization?\n- What's the path to the folder you'd like me to analyze?\n\n**My Process:**\n1. **Assessment**: Understand your needs and existing content\n2. **Structure Design**: Propose a folder hierarchy tailored to your work\n3. **Template Creation**: Create useful template files (notes, project plans, etc.)\n4. **Organization**: Set up the complete system with guidelines\n\nWhich option sounds better - creating a new knowledge base from scratch, or organizing existing documents? And what type of work/subjects do you focus on?",
34+
"categories": ["onboarding"],
35+
"votes": 0,
36+
"gaClicks": 0,
37+
"icon": "BookOpen",
38+
"author": "DC team",
39+
"verified": true
40+
},
41+
{
42+
"id": "onb_004",
43+
"title": "Explain codebase or repository to me",
44+
"description": "Analyze and explain any codebase - local project or GitHub repository - including architecture, dependencies, and how it works.",
45+
"prompt": "I'll help you understand a codebase thoroughly. Let me know what you'd like to analyze:\n\n**Option 1: Local Project**\n- What's the folder path to your local project?\n\n**Option 2: GitHub Repository**\n- What's the GitHub repository URL you'd like me to analyze?\n- If you don't have git/gh installed, I'll help you set them up\n- If needed, I'll help you log in to GitHub\n\n**What I'll do:**\n1. **Setup**: Install git/gh CLI tools if needed and help with GitHub login\n2. **Code Retrieval**: Clone the repo or analyze your local folder\n3. **Initial Analysis**: Examine project structure, files, and technologies\n4. **Architecture Overview**: Explain the overall design and patterns\n5. **Key Components**: Break down main modules and features\n6. **Dependencies**: Document libraries and frameworks used\n7. **Setup Guide**: Provide step-by-step setup and running instructions\n8. **Code Flow**: Explain how the main functionality works\n9. **Summary Document**: Create comprehensive documentation\n\nPlease provide either:\n- Local folder path: `/path/to/your/project`\n- GitHub URL: `https://github.com/user/repo` or `[email protected]:user/repo.git`",
46+
"categories": ["onboarding"],
47+
"votes": 0,
48+
"gaClicks": 0,
49+
"icon": "Code",
50+
"author": "DC team",
51+
"verified": true
52+
},
53+
{
54+
"id": "onb_005",
55+
"title": "Clean up unused code in my project",
56+
"description": "Scan your codebase to find unused imports, dead functions, and redundant code that can be safely removed.",
57+
"prompt": "I'll help you clean up unused and dead code in your project. Let's start safely:\n\n**First, I need to know:**\n- What's the folder path to your project?\n- What programming language/framework is it? (JavaScript, Python, Java, etc.)\n\n**My systematic approach:**\n\n**Phase 1: Analysis**\n1. **Project Understanding**: Analyze structure and main technologies\n2. **Dependency Mapping**: Understand how files reference each other\n3. **Code Scanning**: Identify potential unused code:\n - Unused imports and dependencies\n - Dead/unreferenced functions and variables\n - Unreachable code blocks\n - Unused configuration files\n\n**Phase 2: Safety & Backup**\n4. **Impact Assessment**: Explain what each finding does and removal safety\n5. **Backup Strategy**: Recommend backup before making changes\n6. **Show Before Remove**: Present everything I plan to remove\n\n**Phase 3: Cleanup (Only with your approval)**\n7. **Selective Removal**: Remove only what you approve\n8. **Testing**: Suggest running tests after cleanup\n9. **Summary Report**: Document what was cleaned and space saved\n\n**Safety Promise**: I will NEVER remove code without your explicit approval for each change.\n\nWhat's the path to your project folder?",
58+
"categories": ["onboarding"],
59+
"votes": 0,
60+
"gaClicks": 0,
61+
"icon": "Trash2",
62+
"author": "DC team",
63+
"verified": true
64+
},
65+
{
66+
"id": "onb_006",
67+
"title": "Build shopping list app and deploy online",
68+
"description": "Create a complete shopping list web application from scratch, run it locally, and deploy it to GitHub Pages.",
69+
"prompt": "Let's build and deploy a complete shopping list web application! I'll guide you step-by-step:\n\n**Step 1: Project Setup**\nFirst, where would you like to work on this project? Please provide a folder path where I should create the shopping list app.\n\n**My Complete Process:**\n\n**Phase 1: Planning & Setup**\n1. Create project folder and basic structure\n2. Plan app features (add/remove items, mark as bought, categories)\n3. Set up HTML, CSS, and JavaScript foundation\n\n**Phase 2: Development**\n4. Build clean, modern user interface\n5. Implement core functionality (CRUD operations)\n6. Add local storage for persistence\n7. Create a simple local development server\n8. Open the app in your browser for testing\n\n**Phase 3: GitHub & Deployment** \n9. Check if you have git/gh CLI installed (install if needed)\n10. Help you log in to GitHub\n11. Create a new GitHub repository\n12. Commit and push your code\n13. Set up GitHub Pages hosting\n14. Deploy your app online with a live URL\n\n**App Features:**\n- Add/remove shopping items\n- Mark items as purchased with checkboxes\n- Organize items by categories\n- Persistent storage (survives browser refresh)\n- Responsive design (works on mobile)\n- Modern, clean interface\n\nReady to start? What folder should I use for your shopping list app project?",
70+
"categories": ["onboarding"],
71+
"votes": 0,
72+
"gaClicks": 0,
73+
"icon": "ShoppingCart",
74+
"author": "DC team",
75+
"verified": true
76+
},
77+
{
78+
"id": "onb_007",
79+
"title": "Analyze my data file",
80+
"description": "Upload or point to any data file (CSV, JSON, Excel, etc.) and get comprehensive analysis including patterns, insights, and summary reports.",
81+
"prompt": "I have a data file that I'd like to understand better. Please help me analyze it:\n\n1. **File Examination**: First, let me know the path to your data file or describe what kind of data it contains\n2. **Data Overview**: Analyze the structure, size, and format of the data\n3. **Content Analysis**: Examine what columns/fields exist and their data types\n4. **Pattern Detection**: Look for interesting patterns, trends, or anomalies\n5. **Statistical Summary**: Provide key statistics (counts, averages, distributions, etc.)\n6. **Data Quality**: Identify any missing data, duplicates, or quality issues\n7. **Key Insights**: Highlight the most interesting findings\n8. **Summary Report**: Create a clear, non-technical summary of what the data shows\n\nWhat's the path to your data file, or would you like to tell me what kind of data you're working with first?",
82+
"categories": ["onboarding"],
83+
"votes": 0,
84+
"gaClicks": 0,
85+
"icon": "BarChart3",
86+
"author": "DC team",
87+
"verified": true
88+
},
89+
{
90+
"id": "onb_008",
91+
"title": "Check system health and resources",
92+
"description": "Analyze your system's health, resource usage, running processes, and generate a comprehensive system status report.",
93+
"prompt": "Let me perform a comprehensive system health check and resource analysis:\n\n**System Resource Analysis:**\n1. **CPU Usage**: Current and recent CPU utilization patterns\n2. **Memory Usage**: RAM usage, available memory, swap usage\n3. **Disk Space**: Storage usage across all drives/partitions\n4. **Network Status**: Network interfaces, connectivity, and usage\n\n**Process Analysis:**\n5. **Running Processes**: Top resource-consuming processes\n6. **System Services**: Critical service status\n7. **Port Usage**: Open ports and listening services\n\n**Health Indicators:**\n8. **System Load**: Overall system performance indicators\n9. **Uptime**: System uptime and stability\n10. **Temperature**: System temperature if available\n11. **Logs**: Recent system errors or warnings\n\n**Deliverable:**\n- Comprehensive system health report\n- Resource usage summary with recommendations\n- Identification of potential issues\n- Performance optimization suggestions\n\nI'll gather all this information using system commands and present it in a clear, actionable format.",
94+
"categories": ["onboarding"],
95+
"votes": 0,
96+
"gaClicks": 0,
97+
"icon": "Activity",
98+
"author": "DC team",
99+
"verified": true
100+
},
101+
{
102+
"id": "onb_009",
103+
"title": "Find Patterns and Errors in Log Files",
104+
"description": "Analyze log files to identify errors, patterns, performance issues, and security concerns with detailed insights and recommendations.",
105+
"prompt": "I'll help you analyze log files to find patterns, errors, and insights. Let me know which approach you prefer:\n\n**Option 1: Analyze Specific Log File**\n- Do you have a specific log file you want me to analyze?\n- What's the full path to your log file?\n\n**Option 2: Find Log Files on Your System**\n- I can search your system for common log file locations\n- What type of application/service logs are you interested in? (web server, database, application, system logs, etc.)\n\n**What I'll analyze:**\n\n**Error Detection:**\n1. **Critical Errors**: Fatal errors, exceptions, crashes\n2. **Warning Patterns**: Recurring warnings that might indicate issues\n3. **Error Frequency**: How often specific errors occur\n4. **Error Trends**: Are errors increasing over time?\n\n**Performance Analysis:**\n5. **Response Times**: Slow queries, long-running operations\n6. **Resource Usage**: Memory, CPU, disk I/O patterns\n7. **Traffic Patterns**: Peak usage times, load distribution\n8. **Bottlenecks**: Identify performance constraints\n\n**Security & Anomalies:**\n9. **Failed Login Attempts**: Potential security threats\n10. **Unusual Access Patterns**: Suspicious activity\n11. **IP Analysis**: Frequent visitors, geographic patterns\n12. **Rate Limiting**: Abuse detection\n\n**Deliverables:**\n- **Error Summary Report**: Top errors with occurrence counts\n- **Timeline Analysis**: When issues happen most frequently\n- **Pattern Recognition**: Recurring themes and root causes\n- **Actionable Recommendations**: Specific steps to fix identified issues\n- **Monitoring Suggestions**: What to watch for in the future\n\nWhich option would you prefer? Please provide either:\n- **Specific file**: `/path/to/your/logfile.log`\n- **Search request**: \"Find web server logs\" or \"Look for application logs\"",
106+
"categories": ["onboarding"],
107+
"votes": 0,
108+
"gaClicks": 0,
109+
"icon": "Search",
110+
"author": "DC team",
111+
"verified": true
112+
}
113+
]
114+
}

src/server.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ import {
4343
GetMoreSearchResultsArgsSchema,
4444
StopSearchArgsSchema,
4545
ListSearchesArgsSchema,
46+
GetPromptsArgsSchema,
4647
} from './tools/schemas.js';
4748
import {getConfig, setConfigValue} from './tools/config.js';
4849
import {getUsageStats} from './tools/usage.js';
4950
import {giveFeedbackToDesktopCommander} from './tools/feedback.js';
51+
import {getPrompts} from './tools/prompts.js';
5052
import {trackToolCall} from './utils/trackTools.js';
5153
import {usageTracker} from './utils/usageTracker.js';
5254
import {processDockerPrompt} from './utils/dockerPrompt.js';
@@ -676,6 +678,36 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
676678
${CMD_PREFIX_DESCRIPTION}`,
677679
inputSchema: zodToJsonSchema(GiveFeedbackArgsSchema),
678680
},
681+
{
682+
name: "get_prompts",
683+
description: `
684+
Browse and retrieve curated Desktop Commander prompts for various tasks and workflows.
685+
686+
IMPORTANT: When displaying prompt lists to users, do NOT show the internal prompt IDs (like 'onb_001').
687+
These IDs are for your reference only. Show users only the prompt titles and descriptions.
688+
The IDs will be provided in the response metadata for your use.
689+
690+
ACTIONS:
691+
- list_categories: Show all available prompt categories
692+
- list_prompts: List prompts (optionally filtered by category)
693+
- get_prompt: Retrieve and execute a specific prompt by ID
694+
695+
WORKFLOW:
696+
1. Use list_categories to see available categories
697+
2. Use list_prompts to browse prompts in a category
698+
3. Use get_prompt with promptId to retrieve and start using a prompt
699+
700+
EXAMPLES:
701+
- get_prompts(action='list_categories') - See all categories
702+
- get_prompts(action='list_prompts', category='onboarding') - See onboarding prompts
703+
- get_prompts(action='get_prompt', promptId='onb_001') - Get a specific prompt
704+
705+
The get_prompt action will automatically inject the prompt content and begin execution.
706+
Perfect for discovering proven workflows and getting started with Desktop Commander.
707+
708+
${CMD_PREFIX_DESCRIPTION}`,
709+
inputSchema: zodToJsonSchema(GetPromptsArgsSchema),
710+
},
679711
],
680712
};
681713
} catch (error) {
@@ -742,6 +774,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request: CallToolRequest)
742774
}
743775
break;
744776

777+
case "get_prompts":
778+
try {
779+
result = await getPrompts(args || {});
780+
} catch (error) {
781+
capture('server_request_error', {message: `Error in get_prompts handler: ${error}`});
782+
result = {
783+
content: [{type: "text", text: `Error: Failed to retrieve prompts`}],
784+
isError: true,
785+
};
786+
}
787+
break;
788+
745789
case "give_feedback_to_desktop_commander":
746790
try {
747791
result = await giveFeedbackToDesktopCommander(args);

0 commit comments

Comments
 (0)