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
2 changes: 2 additions & 0 deletions Hubspot-Marketing-CRM/.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
27 changes: 27 additions & 0 deletions Hubspot-Marketing-CRM/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dependencies
node_modules/

# Build output
dist/

# Environment files
.env
.env.local
.env.*.local

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Logs
*.log
npm-debug.log*

# TypeScript cache
*.tsbuildinfo
110 changes: 110 additions & 0 deletions Hubspot-Marketing-CRM/QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# 🚀 Quick Start Guide

You've initialized a minimal Lua AI Agent. Here's how to get started:

## Step 1: Chat with Your Agent

```bash
lua chat
```

Select **Sandbox** mode. Your agent is empty but functional - try chatting!

## Step 2: Create Your First Tool

### Create the folders and files:

```bash
mkdir -p src/skills/tools
```

### Create a tool (`src/skills/tools/MyTool.ts`):

```typescript
import { LuaTool } from "lua-cli";
import { z } from "zod";

export default class MyTool implements LuaTool {
name = "my_tool";
description = "Does something useful";

inputSchema = z.object({
input: z.string().describe("What to process")
});

async execute(input: z.infer<typeof this.inputSchema>) {
return { result: `Processed: ${input.input}` };
}
}
```

### Create a skill (`src/skills/my.skill.ts`):

```typescript
import { LuaSkill } from "lua-cli";
import MyTool from "./tools/MyTool";

export default new LuaSkill({
name: "my-skill",
description: "My custom skill",
context: "Use these tools when...",
tools: [new MyTool()],
});
```

### Add to your agent (`src/index.ts`):

```typescript
import { LuaAgent } from "lua-cli";
import mySkill from "./skills/my.skill";

const agent = new LuaAgent({
name: `My Agent`,
persona: `You are a helpful assistant.`,
skills: [mySkill],
});
```

## Step 3: Test Your Tool

```bash
lua test
```

Select your tool and provide test inputs.

## Step 4: Deploy

```bash
lua push all --force --auto-deploy
```

## 🎓 Need Examples?

Initialize a project with full examples:

```bash
mkdir my-examples && cd my-examples
lua init --with-examples
```

Or check the documentation: https://docs.heylua.ai/examples

## 📖 Commands Reference

| Command | What it does |
|---------|-------------|
| `lua test` | Test tools interactively |
| `lua chat` | Chat with your agent |
| `lua compile` | Compile your code |
| `lua push` | Upload to server |
| `lua deploy` | Deploy to production |
| `lua logs` | View logs |
| `lua env` | Manage environment variables |
| `lua persona` | Update agent persona |

## 🔗 Resources

- **Docs:** https://docs.heylua.ai
- **Examples:** https://docs.heylua.ai/examples
- **API:** https://docs.heylua.ai/api
82 changes: 82 additions & 0 deletions Hubspot-Marketing-CRM/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Marketing CRM HubSpot

This folder is a standalone marketing-focused Lua AI Agent workspace. It encapsulates the marketing persona, tools, and helpers so you can iterate on audience hygiene, automation, and ROI storytelling independently.

## Layout

```
Marketing CRM Hubspot/
├── src/
│ ├── index.ts # Marketing agent entry point
│ ├── skills/
│ │ └── hubspotMarketing.skill.ts # Marketing skill prompts + guardrails
│ ├── tools/ # Marketing tools for lists, workflows, and campaign reporting
│ └── utils/
│ └── hubspotMarketingHelpers.ts # Shared config + HubSpot Marketing helpers
└── README.md # This guide
```

### Tool catalog

| Tool | Purpose |
| --- | --- |
| `createMarketingList` | Build a static or dynamic list from CRM filters. |
| `refreshMarketingList` | Force list recalculation to capture the latest matching contacts. |
| `listMarketingLists` | Inventory the marketing audiences you already have. |
| `enrollContactsInWorkflow` | Enroll contacts in workflows for self-healing nurture. |
| `getWorkflowDetails` | Inspect workflow metadata before adjustments. |
| `pauseWorkflow` | Pause enrollments when manual review is required. |
| `resumeWorkflow` | Resume workflows once the underlying issue is resolved. |
| `summarizeCampaignROI` | Provide explainable campaign revenue/contact impact. |
| `searchContacts` | Retrieve contacts by email/name/company for segmentation. |
| `createContact` | Persist new leads before feeding them into automation. |

## Highlights

- `createMarketingList` builds audiences (static/dynamic) from CRM filters.
- `refreshMarketingList` reruns filters to capture new intent signals.
- `listMarketingLists` inventories existing audiences before creating new ones.
- `enrollContactsInWorkflow` keeps nurture systems autonomous and self-healing.
- `getWorkflowDetails` inspects workflow metadata before edits.
- `pauseWorkflow` halts enrollments when segments need manual review.
- `resumeWorkflow` restarts paused workflows once issues are resolved.
- `summarizeCampaignROI` surfaces explainable revenue/contact impact for campaigns.
- Marketing tools reuse `createContact`/`searchContacts` so the marketing skill remains self-contained.

## Tools (10 total)

| Tool | Purpose |
| --- | --- |
| `createMarketingList` | Build a static or smart list from contact filters. |
| `refreshMarketingList` | Force a list to refresh and capture the latest matching contacts. |
| `listMarketingLists` | Return the available marketing audiences plus metadata. |
| `enrollContactsInWorkflow` | Enroll multiple contacts into a workflow to trigger nurturing. |
| `getWorkflowDetails` | Fetch workflow configuration before making automation decisions. |
| `pauseWorkflow` | Temporarily stop enrollments when manual intervention is needed. |
| `resumeWorkflow` | Restart paused workflows once the issue is resolved. |
| `summarizeCampaignROI` | Summarize campaign ROI, revenue, and contact metrics for reporting. |
| `searchContacts` | Find contact IDs/properties needed for audiences or workflows. |
| `createContact` | Persist new leads before feeding them to the marketing automation. |

## Setup

1. From the repository root run `npm install` once; the marketing workspace shares the same `node_modules`.
2. Navigate into this folder: `cd "Marketing CRM Hubspot"`.
3. Run marketing-specific scripts using the root `package.json` commands, e.g., `npm run build` or `lua chat` (the marketing entry point expects the marketing skill to be compiled too).

## Environment

Use a HubSpot Private App token that includes the required scopes listed in the root README:

```bash
HUBSPOT_PRIVATE_APP_TOKEN=your-private-app-token
HUBSPOT_API_BASE_URL=https://api.hubapi.com
```

## Verification

- `npm run build` at the repo root compiles both the CRM and marketing TypeScript sources (the marketing folder sits under `src` for the standalone persona).

## Why this structure?

Keeping the marketing skill in its own folder avoids prompting conflicts and lets you deploy the marketing persona independently. Use this directory when you want a mission-critical marketing agent focused on lists, workflows, and ROI storytelling.
8 changes: 8 additions & 0 deletions Hubspot-Marketing-CRM/lua.skill.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
agent:
agentId: baseAgent_agent_1767897028375_3ojikz4jn
orgId: eb5c2b68-cc9b-4b0a-97ee-1c05f8bfa96f
persona: Aurora Marketing - HubSpot marketing automation strategist
skills:
- name: hubspotMarketing
version: 1.0.0
skillId: 2247b18a-8d12-4857-8c3a-a324c6a58299
Loading