UNPKG

breathe-api

Version:

Model Context Protocol server for Breathe HR APIs with Swagger/OpenAPI support - also works with custom APIs

487 lines (453 loc) 16.9 kB
export const breathePrompts = [ { name: 'setup-employee-onboarding', description: 'Generate code to implement employee onboarding workflow using Breathe HR APIs', arguments: [ { name: 'platform', description: 'Target platform (react, react-native, nextjs, ruby)', required: true, }, { name: 'features', description: 'Comma-separated list of features to include (profile, documents, leave-setup, training)', required: false, }, ], }, { name: 'implement-leave-management', description: 'Create a complete leave/absence management system using Breathe HR', arguments: [ { name: 'platform', description: 'Target platform for implementation', required: true, }, { name: 'include_approvals', description: 'Include approval workflow (true/false)', required: false, }, { name: 'include_calendar', description: 'Include calendar integration (true/false)', required: false, }, ], }, { name: 'setup-timesheet-system', description: 'Implement timesheet tracking and submission using Breathe HR APIs', arguments: [ { name: 'platform', description: 'Target platform', required: true, }, { name: 'include_projects', description: 'Include project tracking (true/false)', required: false, }, { name: 'approval_levels', description: 'Number of approval levels (1-3)', required: false, }, ], }, { name: 'kudos-recognition-system', description: 'Build an employee recognition system using Breathe HR Kudos API', arguments: [ { name: 'platform', description: 'Target platform', required: true, }, { name: 'include_leaderboard', description: 'Include kudos leaderboard (true/false)', required: false, }, { name: 'notification_type', description: 'Notification method (email, push, both)', required: false, }, ], }, { name: 'shift-scheduling', description: 'Create shift scheduling and management system using ELMO Roster API', arguments: [ { name: 'platform', description: 'Target platform', required: true, }, { name: 'schedule_view', description: 'Default view (daily, weekly, monthly)', required: false, }, { name: 'include_swaps', description: 'Allow shift swapping (true/false)', required: false, }, ], }, { name: 'hr-dashboard', description: 'Build a comprehensive HR dashboard with key metrics and reports', arguments: [ { name: 'platform', description: 'Target platform', required: true, }, { name: 'metrics', description: 'Comma-separated metrics to include (attendance, leave-balance, headcount, kudos)', required: false, }, { name: 'refresh_interval', description: 'Data refresh interval in minutes', required: false, }, ], }, { name: 'employee-directory', description: 'Create an employee directory with search and profile features', arguments: [ { name: 'platform', description: 'Target platform', required: true, }, { name: 'include_org_chart', description: 'Include organizational chart (true/false)', required: false, }, { name: 'profile_fields', description: 'Additional profile fields to display', required: false, }, ], }, { name: 'api-integration-guide', description: 'Get a step-by-step guide for integrating Breathe HR APIs', arguments: [ { name: 'api_type', description: 'Which API to integrate (main-hr, elmo-roster, both)', required: true, }, { name: 'auth_method', description: 'Authentication method to use', required: false, }, ], }, { name: 'troubleshoot-api', description: 'Troubleshoot common Breathe HR API issues', arguments: [ { name: 'issue_type', description: 'Type of issue (auth, rate-limit, data-format, cors)', required: true, }, { name: 'error_message', description: 'Specific error message received', required: false, }, ], }, { name: 'migrate-to-breathe', description: 'Guide for migrating HR data to Breathe HR system', arguments: [ { name: 'source_system', description: 'Current HR system name', required: true, }, { name: 'data_types', description: 'Types of data to migrate (employees, leave, timesheets)', required: true, }, { name: 'migration_approach', description: 'Migration approach (big-bang, phased, parallel-run)', required: false, }, ], }, ]; export function generatePromptMessage(promptName, args = {}) { const prompt = breathePrompts.find(p => p.name === promptName); if (!prompt) { throw new Error(`Prompt template '${promptName}' not found`); } const requiredArgs = prompt.arguments?.filter(arg => arg.required) || []; for (const arg of requiredArgs) { if (!args[arg.name]) { throw new Error(`Required argument '${arg.name}' not provided for prompt '${promptName}'`); } } let content = ''; switch (promptName) { case 'setup-employee-onboarding': content = generateOnboardingPrompt(args); break; case 'implement-leave-management': content = generateLeaveManagementPrompt(args); break; case 'setup-timesheet-system': content = generateTimesheetPrompt(args); break; case 'kudos-recognition-system': content = generateKudosPrompt(args); break; case 'shift-scheduling': content = generateShiftSchedulingPrompt(args); break; case 'hr-dashboard': content = generateDashboardPrompt(args); break; case 'employee-directory': content = generateDirectoryPrompt(args); break; case 'api-integration-guide': content = generateIntegrationGuidePrompt(args); break; case 'troubleshoot-api': content = generateTroubleshootPrompt(args); break; case 'migrate-to-breathe': content = generateMigrationPrompt(args); break; default: throw new Error(`No generator for prompt '${promptName}'`); } return [ { role: 'user', content: { type: 'text', text: content, }, }, ]; } function generateOnboardingPrompt(args) { const features = args.features?.split(',').map(f => f.trim()) || ['profile', 'documents']; return `I need to implement an employee onboarding workflow for ${args.platform} using Breathe HR APIs. The onboarding system should include: ${features.map(f => `- ${f}`).join('\n')} Please: 1. First, explain which Breathe HR APIs I'll need for this workflow 2. Generate the complete code implementation for ${args.platform} 3. Include proper error handling and loading states 4. Add comments explaining each step 5. Provide a usage example Make sure to handle authentication properly and follow ${args.platform} best practices.`; } function generateLeaveManagementPrompt(args) { const includeApprovals = args.include_approvals === 'true'; const includeCalendar = args.include_calendar === 'true'; return `I need to create a complete leave/absence management system for ${args.platform} using Breathe HR APIs. Requirements: - View leave balances and entitlements - Submit leave requests - View leave history ${includeApprovals ? '- Implement approval workflow for managers' : ''} ${includeCalendar ? '- Calendar view showing team absences' : ''} - Handle different leave types (annual, sick, other) Please: 1. Analyze the required Breathe HR endpoints 2. Create reusable components/modules for leave management 3. Implement proper state management 4. Add validation and error handling 5. Include UI examples for key features The solution should be production-ready with proper TypeScript types (if applicable).`; } function generateTimesheetPrompt(args) { const includeProjects = args.include_projects === 'true'; const approvalLevels = parseInt(args.approval_levels || '1'); return `I need to implement a timesheet tracking and submission system for ${args.platform} using Breathe HR ELMO Roster API. Features required: - Daily/weekly timesheet entry - Clock in/out functionality ${includeProjects ? '- Project/task allocation for time entries' : ''} - Timesheet submission workflow - ${approvalLevels} level(s) of approval - View historical timesheets - Export timesheet data Please provide: 1. API endpoint analysis for timesheet operations 2. Complete implementation with all CRUD operations 3. Approval workflow implementation 4. Data validation and business rules 5. Sample UI components/screens Ensure the solution handles timezone differences and follows Breathe HR's timesheet data structure.`; } function generateKudosPrompt(args) { const includeLeaderboard = args.include_leaderboard === 'true'; const notificationType = args.notification_type || 'email'; return `Build an employee recognition system using Breathe HR's Kudos API for ${args.platform}. Key features: - Give kudos to colleagues - View received kudos - Browse recent kudos in the organization ${includeLeaderboard ? '- Kudos leaderboard showing top recipients' : ''} - ${notificationType} notifications for new kudos - Kudos categories/types - Add comments to kudos Implementation should include: 1. Full API integration for kudos operations 2. User-friendly interface for giving/viewing kudos 3. Real-time updates (if supported by platform) 4. Proper permission handling 5. Analytics/reporting features Make it engaging and encourage regular use of the recognition system.`; } function generateShiftSchedulingPrompt(args) { const scheduleView = args.schedule_view || 'weekly'; const includeSwaps = args.include_swaps === 'true'; return `Create a shift scheduling and management system for ${args.platform} using the ELMO Roster API. Core functionality: - ${scheduleView} schedule view as default - Create and edit shifts - Assign employees to shifts - View personal shift schedule ${includeSwaps ? '- Shift swap requests between employees' : ''} - Shift templates for recurring schedules - Availability management - Shift notifications/reminders Please implement: 1. Complete shift CRUD operations 2. Interactive schedule UI (calendar/grid view) 3. Conflict detection and validation 4. Mobile-responsive design (if applicable) 5. Export functionality for schedules Consider shift rules, minimum rest periods, and maximum hours constraints.`; } function generateDashboardPrompt(args) { const metrics = args.metrics?.split(',').map(m => m.trim()) || ['attendance', 'leave-balance']; const refreshInterval = args.refresh_interval || '15'; return `Build a comprehensive HR dashboard for ${args.platform} using Breathe HR APIs. Dashboard metrics to include: ${metrics.map(m => `- ${m}`).join('\n')} Requirements: - Real-time data updates (refresh every ${refreshInterval} minutes) - Interactive charts and visualizations - Drill-down capabilities for detailed views - Export reports functionality - Responsive design for different screen sizes - Role-based access (HR vs Manager vs Employee views) Implementation details needed: 1. Efficient data fetching and caching strategy 2. Dashboard component architecture 3. Chart library integration 4. Performance optimization for large datasets 5. Accessibility compliance The dashboard should provide actionable insights at a glance.`; } function generateDirectoryPrompt(args) { const includeOrgChart = args.include_org_chart === 'true'; const profileFields = args.profile_fields?.split(',').map(f => f.trim()) || []; return `Create an employee directory application for ${args.platform} using Breathe HR APIs. Features: - Search employees by name, department, role - Employee profile cards with photos - Contact information display ${includeOrgChart ? '- Interactive organizational chart' : ''} - Filter by department, location, etc. ${profileFields.length > 0 ? `- Additional fields: ${profileFields.join(', ')}` : ''} - Quick actions (email, call, message) - Export directory to PDF/CSV Please provide: 1. Efficient search implementation 2. Lazy loading for large employee lists 3. Profile component with all employee details 4. Privacy controls for sensitive information 5. Offline capability (if applicable) Consider GDPR compliance and data privacy throughout the implementation.`; } function generateIntegrationGuidePrompt(args) { const apiType = args.api_type; const authMethod = args.auth_method || 'basic'; return `Provide a comprehensive step-by-step guide for integrating Breathe HR ${apiType} API(s). Cover the following: 1. Initial setup and authentication (${authMethod}) 2. Environment configuration 3. API endpoint overview and usage patterns 4. Common integration scenarios 5. Error handling strategies 6. Rate limiting and best practices 7. Testing approach 8. Security considerations 9. Deployment checklist Include: - Code examples for common operations - Troubleshooting tips - Performance optimization techniques - Webhook setup (if applicable) - API versioning strategy The guide should help developers get up and running quickly while avoiding common pitfalls.`; } function generateTroubleshootPrompt(args) { const issueType = args.issue_type; const errorMessage = args.error_message || ''; return `Help me troubleshoot a ${issueType} issue with Breathe HR API integration. ${errorMessage ? `Error message: "${errorMessage}"` : ''} Please provide: 1. Common causes for this type of issue 2. Step-by-step debugging approach 3. Specific things to check in my implementation 4. Code examples showing the correct approach 5. How to prevent this issue in the future Also include: - Relevant API documentation references - Testing strategies to catch these issues early - Monitoring/logging recommendations - When to contact Breathe HR support Focus on practical solutions that can be implemented immediately.`; } function generateMigrationPrompt(args) { const sourceSystem = args.source_system; const dataTypes = args.data_types.split(',').map(d => d.trim()); const approach = args.migration_approach || 'phased'; return `Create a migration plan and implementation guide for moving from ${sourceSystem} to Breathe HR. Data to migrate: ${dataTypes.map(d => `- ${d}`).join('\n')} Migration approach: ${approach} Please provide: 1. Pre-migration checklist and data analysis 2. Data mapping between ${sourceSystem} and Breathe HR 3. Migration scripts/tools implementation 4. Data validation and reconciliation process 5. Rollback strategy 6. Post-migration verification steps Include: - API endpoints for data import - Batch processing strategies - Error handling and logging - Progress tracking - User communication plan - Training requirements The plan should minimize disruption and ensure data integrity throughout the process.`; } //# sourceMappingURL=index.js.map