Skip to content

Instantly share code, notes, and snippets.

@verioussmith
Created November 25, 2024 02:53
Show Gist options
  • Save verioussmith/e2a314810c1d6d5bb3f0a6bf4b250ed1 to your computer and use it in GitHub Desktop.
Save verioussmith/e2a314810c1d6d5bb3f0a6bf4b250ed1 to your computer and use it in GitHub Desktop.
# .cursorrules for VoiceSpot.Link
# Complete specification maintaining all original requirements
project:
name: VoiceSpot.Link
type: browser-extension
version: "0.1.0"
description: |
Browser extension that integrates Google Voice and Hubspot CRM.
Provides synchronization and workflow automation for users including
contact sync, interaction logging, one-click calls, and call transcription.
important_notes: |
The Tech Stack outlined below is final. Do not change, add, or remove any
technology or component without explicit permission. All code must be written
in the specified tech stack. Solutions should be brief and complete.
Never delegate tasks back to the user.
performance_boundaries:
response_time: "2 seconds maximum"
storage_limit: "5MB per user"
api_rate_limits: "100 requests/minute"
background_sync: "Every 5-15 minutes"
tech_stack:
locked: true
frontend:
framework: "SvelteKit"
language:
type: "JavaScript"
restrictions: "NO TypeScript allowed under any circumstances"
styling: "Tailwind CSS"
components: "ShadcN"
build_requirements: |
When exporting the SvelteKit project to a browser extension,
ensure that the output is a web extension and not a packaged app
by using the scripts/prepare-extension.js file.
storage:
primary:
type: "Browser Extension Local Storage"
data_types:
- "Contact data"
- "Merged data"
- "Additional miscellaneous data"
secondary:
type: "WordPress"
phase: "Later implementation"
storage_types:
- "Profile data"
- "Sync preferences"
- "Logs"
- "Settings"
technologies:
- name: "GraphQL for WordPress"
purpose: "Data queries and mutations"
- name: "Advanced Custom Fields (ACF)"
purpose: "Custom field management"
apis:
primary:
- name: "Google People API"
purpose: "Contact data access (due to Google Voice API limitations)"
- name: "Custom API"
purpose: "Page scraping data access"
note: "Will be built custom for this project"
- name: "Hubspot API"
purpose: "CRM data management"
features:
- "Contact management"
- "Interaction logging"
- "Tag management"
- name: "Google Cloud Speech-to-Text API"
purpose: "Call transcription services"
authentication:
methods:
- "OAuth 2.0"
- "JWT"
purpose: "Secure access to Google Voice and Hubspot data"
extension_apis:
primary:
name: "Chrome Extensions API"
purpose: "Primary API for browser extension creation"
secondary:
name: "Web Extensions API"
purpose: "Multi-platform compatibility"
data_flow:
pattern: "Google Voice <--> VoiceSpot.Link Extension (Local Storage) <--> HubSpot"
synchronization:
steps:
- name: "Initial Data Capture"
input: "Google Voice contact data (calls, messages, voicemails)"
process: "Scrape and store"
output: "Local storage data"
- name: "Data Merging"
input: "Local storage + Google People API data"
process: "Merge and deduplicate"
output: "Unified contact records"
- name: "Final Sync"
input: "Unified contact records"
process: "Sync to Hubspot"
output: "Updated CRM data"
core_features:
display_integration:
priority: 1
name: "Display Hubspot Contact Info + Activities in Google Voice"
requirements:
- "Inject panel in Google Voice UI"
- "Show Hubspot contact details"
- "Display tags"
- "Show engagement history"
sync_management:
priority: 1
name: "Google Voice & Hubspot Sync"
requirements:
- "Synchronize merged contact data"
- "Handle duplicate detection"
- "Manage contact data between platforms"
- "Real-time sync capabilities"
communication_tracking:
priority: 2
name: "Track Calls & Messages"
requirements:
- "Log all Google Voice calls"
- "Track incoming/outgoing messages"
- "Capture call duration"
- "Store timestamps"
- "Record caller ID"
- "Save message content"
calling_features:
priority: 2
name: "One-Click Calling"
requirements:
- "Enable click-to-call from extension popup"
- "Support calling from sidebar panel"
- "Log calls to Hubspot"
- "Track call status and duration"
contact_management:
priority: 3
name: "Add Hubspot Tags"
requirements:
- "UI elements in browser tab"
- "Tag management capabilities"
- "Real-time tag sync"
transcription:
priority: 3
name: "Call Transcription"
requirements:
- "Automatic voicemail transcription retrieval"
- "Call recording transcription"
- "Log transcriptions to Hubspot"
error_handling:
categories:
type: "Comprehensive"
requirements:
- "Handle API failures"
- "Manage sync errors"
- "Provide user feedback"
- "Implement retry logic"
recovery_strategies:
- "Automatic retry with exponential backoff"
- "Offline data caching"
- "User notification system"
workflow:
user_steps:
- "Install browser extension"
- "OAuth login to Google Voice and Hubspot"
- "Perform initial Google Voice scrape"
- "Sync with Google People API Data"
- "Sync with User profile"
- "View Hubspot details in Google Voice panel"
- "Manage tags and calls"
- "Automatic logging and transcription"
additional_requirements:
background_sync:
requirements:
- "Automatic sync between platforms"
- "Configurable sync intervals"
- "Resource usage optimization"
performance:
requirements:
- "Optimize API calls"
- "Respect rate limits"
- "Efficient data storage"
- "Quick UI responses"
security:
requirements:
- "HTTPS communication only"
- "OAuth 2.0 implementation"
- "Secure data transfer"
- "Token management"
- "Data encryption"
compatibility:
browsers:
- "Chrome"
- "Firefox"
- "Edge"
requirements: "Full functionality across all supported browsers"
key_api_endpoints:
custom_api:
purpose: "Managing contacts, call logs, and messages"
note: "To be built custom for this project"
hubspot_api:
features:
- "Contact creation/update"
- "Contact tagging"
- "Interaction logging"
- "Activity tracking"
wordpress_graphql:
purpose: "Store and retrieve:"
data_types:
- "Sync settings"
- "User preferences"
- "Activity logs"
version_control:
requirements:
- "Semantic versioning"
- "Detailed changelogs"
- "Version tagging"
- "Code review process"
testing:
requirements:
- "Unit testing"
- "Integration testing"
- "Cross-browser testing"
- "Performance testing"
- "Security testing"
cross_browser_compatibility:
polyfill_requirements:
- name: "WebExtension browser API Polyfill"
purpose: "Ensure consistent API behavior across browsers"
runtime_checks:
implementation: |
Use runtime checks for browser-specific features rather than
browser detection to ensure forward compatibility
manifest_handling:
strategy: "Separate manifests per browser"
requirements:
- "Chrome manifest.json"
- "Firefox manifest.json"
- "Edge manifest.json"
security_hardening:
account_protection:
requirements:
- "Mandatory 2FA for developer accounts"
- "Security key authentication"
- "Advanced Protection Program enrollment"
code_signing:
requirements:
- "Sign extension packages"
- "Verify integrity of updates"
- "Secure update distribution"
monitoring_and_updates:
release_channels:
- name: "Chrome Canary"
purpose: "Early testing of changes"
- name: "Beta Channel"
purpose: "Pre-release validation"
- name: "Stable Channel"
purpose: "Production releases"
update_monitoring:
sources:
- "Chromium Extensions Group"
- "Browser release notes"
- "Security advisories"
response_time:
critical_updates: "24 hours"
security_patches: "48 hours"
feature_updates: "2 weeks"
store_deployment:
chrome_web_store:
requirements:
- "Manifest V3 compliance"
- "Privacy policy"
- "Store listing assets"
firefox_addons:
requirements:
- "Source code submission"
- "Add-on signing"
- "Listing requirements"
edge_addons:
requirements:
- "Store policies compliance"
- "Partner Center registration"
content_script_handling:
execution_contexts:
firefox:
- "Xray vision implementation"
- "Object sharing APIs"
chrome:
- "Isolated worlds implementation"
- "Message passing patterns"
security_policies:
csp_requirements:
- "Content Security Policy definition"
- "Browser-specific CSP rules"
ai_integration:
transcription_handling:
requirements:
- "Real-time transcription processing"
- "Background noise filtering"
- "Speaker identification"
- "Multi-language support"
structured_data:
output_format:
- "JSON standardization"
- "Call metadata extraction"
- "Sentiment analysis"
- "Action item detection"
prompt_engineering:
templates:
call_analysis: |
Define structured response format for:
- Issue summary (128 chars max)
- Resolution status (closed/escalated/opened)
- Action items
- Customer satisfaction score
- Keywords
contact_merge: |
Define matching criteria for:
- Phone number normalization
- Name variations
- Company associations
- Interaction history
accessibility:
requirements:
- "WCAG 2.1 AA compliance"
- "Screen reader compatibility"
- "Keyboard navigation support"
- "High contrast mode support"
- "Font size adjustments"
error_recovery:
strategies:
sync_failures:
- "Offline data caching"
- "Background retry queue"
- "Conflict resolution rules"
api_issues:
- "Graceful degradation"
- "Fallback endpoints"
- "User notification system"
performance_monitoring:
metrics:
- "API response times"
- "Sync completion rates"
- "Storage usage trends"
- "Error frequency"
- "User interaction patterns"
logging:
levels:
- "Error"
- "Warning"
- "Info"
- "Debug"
retention: "30 days"
data_privacy:
compliance:
- "GDPR"
- "CCPA"
- "HIPAA"
data_handling:
encryption:
- "In-transit encryption"
- "At-rest encryption"
- "End-to-end encryption for sensitive data"
retention:
- "Configurable retention periods"
- "Automated data cleanup"
- "Data export capabilities"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment