Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions hubspot-crm-skill/.gitignore
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
Comment thread
Kurume98 marked this conversation as resolved.
.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.*
95 changes: 95 additions & 0 deletions hubspot-crm-skill/README.md
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
2 changes: 2 additions & 0 deletions hubspot-crm-skill/env.example
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
8 changes: 8 additions & 0 deletions hubspot-crm-skill/lua.skill.yaml
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
Loading