-
Notifications
You must be signed in to change notification settings - Fork 3
Add HubSpot CRM skill example #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Kurume98
wants to merge
3
commits into
lua-ai-global:master
Choose a base branch
from
Kurume98:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Build output | ||
| dist/ | ||
| build/ | ||
|
|
||
| # Environment variables | ||
| .env | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
|
|
||
| # IDE files | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS generated files | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| ehthumbs.db | ||
| Thumbs.db | ||
|
|
||
| # Logs | ||
| logs | ||
| *.log | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Coverage directory used by tools like istanbul | ||
| coverage/ | ||
|
|
||
| # nyc test coverage | ||
| .nyc_output | ||
|
|
||
| # Dependency directories | ||
| jspm_packages/ | ||
|
|
||
| # Optional npm cache directory | ||
| .npm | ||
|
|
||
| # Optional REPL history | ||
| .node_repl_history | ||
|
|
||
| # Output of 'npm pack' | ||
| *.tgz | ||
|
|
||
| # Yarn Integrity file | ||
| .yarn-integrity | ||
|
|
||
| # dotenv environment variables file | ||
| .env | ||
|
|
||
| # parcel-bundler cache (https://parceljs.org/) | ||
| .cache | ||
| .parcel-cache | ||
|
|
||
| # next.js build output | ||
| .next | ||
|
|
||
| # nuxt.js build output | ||
| .nuxt | ||
|
|
||
| # vuepress build output | ||
| .vuepress/dist | ||
|
|
||
| # Serverless directories | ||
| .serverless | ||
|
|
||
| # FuseBox cache | ||
| .fusebox/ | ||
|
|
||
| # DynamoDB Local files | ||
| .dynamodb/ | ||
|
|
||
| # TernJS port file | ||
| .tern-port | ||
|
|
||
| # Lua CLI generated files | ||
| template/.lua/ | ||
| **/.lua/ | ||
| *.lua.skill.toml | ||
| lua.skill.toml | ||
| *.prompt.* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| HubSpot CRM Skill - Lua AI Agent | ||
| A production-ready Lua AI Agent skill for comprehensive HubSpot CRM integration. Manage contacts, companies, deals, and track sales/marketing activity with fail-safe duplicate prevention. | ||
|
|
||
| Features | ||
| 10 CRM Tools - Complete contact, company, and deal management | ||
| Fail-Safe Duplicate Prevention - Blocks creation if duplicate-check fails (network error, rate limit, auth error) | ||
| Consistent Architecture - All tools use shared configuration helpers | ||
| Production Ready - Comprehensive error handling and input validation | ||
| Quick Start | ||
| # Install dependencies | ||
| npm install | ||
| # Build TypeScript | ||
| npm run build | ||
| # Test interactively | ||
| lua chat | ||
| # Deploy to Lua | ||
| lua push | ||
|
|
||
| Available Tools (10) | ||
| Contact Management | ||
| Tool Description | ||
| createContact Create new contact with duplicate prevention by email | ||
| searchContacts Search contacts by email, name, or company | ||
| getContact Get full contact details by ID | ||
| updateContact Update existing contact properties | ||
| getContactActivitySummary Summarize recent calls, emails, notes, tasks, meetings | ||
|
|
||
| Company Management | ||
| Tool Description | ||
| createCompany Create new company with duplicate prevention by domain | ||
| searchCompanies Search companies by name or domain | ||
| getCompany Get full company details by ID | ||
|
|
||
| Deal Management | ||
| Tool Description | ||
| getDealPipelines Get available pipelines and stage IDs | ||
| updateDealStage Update deal stage after sales calls | ||
|
|
||
| Environment Variables | ||
| # Required | ||
| HUBSPOT_PRIVATE_APP_TOKEN=your-private-app-token | ||
| # Optional (defaults to HubSpot production API) | ||
| HUBSPOT_API_BASE_URL=https://api.hubapi.com | ||
|
|
||
| Required HubSpot Scopes | ||
| Your HubSpot Private App must have these scopes: | ||
|
|
||
| crm.objects.contacts.read | ||
| crm.objects.contacts.write | ||
| crm.objects.companies.read | ||
| crm.objects.companies.write | ||
| crm.objects.deals.read | ||
| crm.objects.deals.write | ||
| crm.schemas.deals.read | ||
|
|
||
| Project Structure | ||
| src/ | ||
| ├── index.ts # Agent configuration | ||
| ├── skills/ | ||
| │ └── hubspotCRM.skill.ts # Skill definition with context | ||
| ├── tools/ | ||
| │ ├── createContact.tool.ts | ||
| │ ├── searchContacts.tool.ts | ||
| │ ├── getContact.tool.ts | ||
| │ ├── updateContact.tool.ts | ||
| │ ├── getContactActivitySummary.tool.ts | ||
| │ ├── searchCompanies.tool.ts | ||
| │ ├── createCompany.tool.ts | ||
| │ ├── getCompany.tool.ts | ||
| │ ├── getDealPipelines.tool.ts | ||
| │ └── updateDealStage.tool.ts | ||
| └── utils/ | ||
| └── hubspotHelpers.ts # Shared configuration and helpers | ||
|
|
||
| Architecture Notes | ||
| Lua CLI Bundler Compliant: Each tool uses export default class with inline inputSchema | ||
| Fail-Safe Duplicate Prevention: If HubSpot API fails during duplicate check, creation is blocked | ||
| Consistent Configuration: All tools use getHubSpotConfig() helper | ||
| Native Fetch: No external HTTP dependencies (uses Node.js native fetch) | ||
| Error Handling | ||
| All tools return consistent response objects: | ||
|
|
||
| // Success | ||
| { ok: true, ... } | ||
| // Failure | ||
| { ok: false, error: "Human-readable error message" } | ||
| // Duplicate found | ||
| { ok: true, alreadyExists: true, contactId: "123", ... } | ||
|
|
||
| Resources | ||
| Lua Documentation | ||
| HubSpot API Reference | ||
| HubSpot Private Apps | ||
| License | ||
| MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| HUBSPOT_PRIVATE_APP_TOKEN=pat-xxxx-xxxx | ||
| HUBSPOT_API_BASE_URL=https://api.hubapi.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| agent: | ||
| agentId: baseAgent_agent_1765454965048_797aisf7r | ||
| orgId: 1cf84b23-c310-4b4c-9a31-81e8b3a9617d | ||
| persona: Sophie Connect - Lead CRM Integration Specialist. Builds and operates CRM integrations and semantic middleware for context-aware routing. | ||
| skills: | ||
| - name: hubspotCRM | ||
| version: 1.0.0 | ||
| skillId: fd3a8dce-503f-4dbd-9197-8e5ecf342655 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.