diff --git a/README.md b/README.md index daf1eb9..54db302 100644 --- a/README.md +++ b/README.md @@ -1,353 +1,273 @@ # General Bots Templates -Pre-built templates for bots, apps, prompts, and UI components. Everything you need to get started quickly. +Pre-built bot packages for common business use cases. Templates are organized by category for easy discovery. --- -## Repository Structure +## Complete Template List (Flat Reference) -``` -bottemplates/ -├── bots/ # Complete bot packages (.gbai) -│ ├── core/ # Essential starter bots -│ ├── sales/ # CRM, marketing, lead management -│ ├── compliance/ # LGPD, GDPR, HIPAA -│ ├── finance/ # Banking, payments, invoicing -│ ├── healthcare/ # Patient communication, appointments -│ ├── hr/ # Employee management, onboarding -│ ├── it/ # Helpdesk, IT service management -│ ├── nonprofit/ # Donor management, volunteers -│ ├── education/ # Courses, training, LMS -│ └── integration/ # External API integrations -├── apps/ # HTMX web application templates -│ ├── dashboard/ # Analytics and KPI dashboards -│ ├── crud/ # Generic CRUD interfaces -│ ├── kanban/ # Board-style project management -│ ├── admin/ # Admin panel templates -│ └── components/ # Reusable UI components -├── prompts/ # System prompts and LLM configurations -│ ├── assistants/ # Role-specific assistant prompts -│ ├── tools/ # Tool description templates -│ └── personas/ # Bot personality definitions -├── dialogs/ # Reusable BASIC dialog scripts -│ ├── auth/ # Authentication flows -│ ├── notifications/ # Email, SMS, WhatsApp patterns -│ ├── data/ # CRUD operation patterns -│ └── integrations/ # API integration patterns -└── themes/ # UI themes (.gbtheme) - ├── default/ # Standard theme - ├── dark/ # Dark mode theme - └── corporate/ # Business-focused themes -``` +| # | Template | Category | Folder | Key Features | +|---|----------|----------|--------|--------------| +| 1 | Default | Core | `default.gbai` | Minimal starter bot | +| 2 | Template | Core | `template.gbai` | Reference implementation | +| 3 | AI Search | Search | `ai-search.gbai` | QR codes, document search | +| 4 | Announcements | Communications | `announcements.gbai` | Company news, multiple KB | +| 5 | Analytics Dashboard | Platform | `analytics-dashboard.gbai` | Metrics, Reports | +| 6 | Backup | Platform | `backup.gbai` | Server backup scripts | +| 7 | Bank | Finance | `bank.gbai` | Banking services | +| 8 | BI | Platform | `bi.gbai` | Dashboards, role separation | +| 9 | Bling | Integration | `bling.gbai` | Bling ERP integration | +| 10 | Broadcast | Communications | `broadcast.gbai` | Mass messaging | +| 11 | Crawler | Search | `crawler.gbai` | Web indexing | +| 12 | CRM | Sales | `sales/crm.gbai` | Customer management | +| 13 | Attendance CRM | Sales | `sales/attendance-crm.gbai` | Event attendance tracking | +| 14 | Marketing | Sales | `sales/marketing.gbai` | Campaign tools | +| 15 | Education | Education | `edu.gbai` | Course management | +| 16 | ERP | Operations | `erp.gbai` | Process automation | +| 17 | HIPAA Medical | Compliance | `compliance/hipaa-medical.gbai` | HIPAA, HITECH | +| 18 | Privacy | Compliance | `compliance/privacy.gbai` | LGPD, GDPR, CCPA | +| 19 | Law | Legal | `law.gbai` | Document templates | +| 20 | LLM Server | AI | `llm-server.gbai` | Model hosting | +| 21 | LLM Tools | AI | `llm-tools.gbai` | TOOL-based LLM examples | +| 22 | Store | E-commerce | `store.gbai` | Product catalog | +| 23 | Talk to Data | Platform | `talk-to-data.gbai` | Natural language SQL | +| 24 | WhatsApp | Messaging | `whatsapp.gbai` | WhatsApp Business | --- -## Quick Start +## Categories -### Install a Bot Template +### `/sales` +Customer relationship and marketing templates. -```bash -# From CLI -botserver --install-template crm +| Template | Description | Features | +|----------|-------------|----------| +| `crm.gbai` | Full CRM system | Leads, Contacts, Accounts, Opportunities | +| `marketing.gbai` | Marketing automation | Campaigns, Lead capture, Email sequences | +| `attendance-crm.gbai` | Event attendance | Check-ins, Tracking | -# Or copy manually -cp -r bottemplates/bots/sales/crm.gbai /path/to/your/packages/ -``` +### `/compliance` +Privacy and regulatory compliance templates. -### Use an App Template +| Template | Description | Regulations | +|----------|-------------|-------------| +| `privacy.gbai` | Data subject rights portal | LGPD, GDPR, CCPA | +| `hipaa-medical.gbai` | Healthcare privacy management | HIPAA, HITECH | -```basic -' Generate a CRM app from template -CREATE SITE "my-crm", "bottemplates/apps/crud", "Build a customer management system" -``` +### `/platform` +Platform administration and analytics templates. -### Apply a Prompt Template +| Template | Description | Features | +|----------|-------------|----------| +| `analytics-dashboard.gbai` | Platform analytics bot | Metrics, Reports, AI insights | +| `bi.gbai` | Business intelligence | Dashboards, role separation | +| `backup.gbai` | Backup automation | Server backup scripts | +| `talk-to-data.gbai` | Data queries | Natural language SQL | -```basic -' Load a sales assistant prompt -SET SYSTEM PROMPT FROM FILE "bottemplates/prompts/assistants/sales.md" -``` +### `/finance` +Financial services templates. ---- +| Template | Description | Features | +|----------|-------------|----------| +| `bank.gbai` | Banking services | Account management | -## Bots +### `/integration` +External API and service integrations. -Complete `.gbai` packages ready to deploy. +| Template | Description | APIs | +|----------|-------------|------| +| `bling.gbai` | Bling ERP | Brazilian ERP integration | -### Core +### `/productivity` +Office and personal productivity templates. + +| Template | Description | Features | +|----------|-------------|----------| +| `office.gbai` | Office automation | Document management, Scheduling | +| `reminder.gbai` | Reminder system | Scheduled alerts, Follow-ups | + +### `/hr` +Human resources templates. + +| Template | Description | Features | +|----------|-------------|----------| +| `employees.gbai` | Employee management | Directory, Onboarding | + +### `/it` +IT service management templates. + +| Template | Description | Features | +|----------|-------------|----------| +| `helpdesk.gbai` | IT helpdesk ticketing | Tickets, Knowledge base | + +### `/healthcare` +Healthcare-specific templates. + +| Template | Description | Features | +|----------|-------------|----------| +| `patient-comm.gbai` | Patient communication | Appointments, Reminders | + +### `/nonprofit` +Nonprofit organization templates. + +| Template | Description | Features | +|----------|-------------|----------| +| `donor-mgmt.gbai` | Donor management | Donations, Communications | + +### Root Level +Core and utility templates. | Template | Description | |----------|-------------| -| `default.gbai` | Minimal starter bot | -| `template.gbai` | Reference implementation for creating new bots | - -### Sales & Marketing - -| Template | Description | -|----------|-------------| -| `crm.gbai` | Full CRM with leads, contacts, opportunities | -| `marketing.gbai` | Campaign management, email sequences | -| `attendance-crm.gbai` | Event attendance tracking | - -### Compliance - -| Template | Description | -|----------|-------------| -| `privacy.gbai` | LGPD, GDPR, CCPA data subject rights | -| `hipaa-medical.gbai` | HIPAA/HITECH healthcare compliance | - -### Finance - -| Template | Description | -|----------|-------------| -| `bank.gbai` | Banking services bot | -| `invoicing.gbai` | Invoice generation and tracking | - -### Platform - -| Template | Description | -|----------|-------------| -| `analytics-dashboard.gbai` | Platform metrics and reports | -| `bi.gbai` | Business intelligence dashboards | -| `talk-to-data.gbai` | Natural language SQL queries | -| `backup.gbai` | Server backup automation | - -### AI & LLM - -| Template | Description | -|----------|-------------| -| `llm-server.gbai` | LLM model hosting | -| `llm-tools.gbai` | TOOL-based LLM examples | +| `default.gbai` | Starter template | +| `template.gbai` | Template for creating templates | | `ai-search.gbai` | AI-powered document search | +| `announcements.gbai` | Company announcements | +| `backup.gbai` | Backup automation | +| `broadcast.gbai` | Message broadcasting | +| `crawler.gbai` | Web crawling | +| `edu.gbai` | Education/training | +| `erp.gbai` | ERP integration | +| `law.gbai` | Legal document processing | +| `llm-server.gbai` | LLM server management | +| `llm-tools.gbai` | LLM tool definitions | +| `store.gbai` | E-commerce | +| `whatsapp.gbai` | WhatsApp-specific features | --- -## Apps +## Template Structure -HTMX web application templates for use with `CREATE SITE`. +Each `.gbai` template follows this structure: -### Dashboard Templates - -```basic -CREATE SITE "metrics", "bottemplates/apps/dashboard", " -Executive dashboard with: -- Revenue KPI cards -- Monthly trend charts -- Top performers table -" ``` - -### CRUD Templates - -```basic -CREATE SITE "contacts", "bottemplates/apps/crud", " -Contact management with: -- Searchable list view -- Add/edit forms -- Import/export buttons -" -``` - -### Kanban Templates - -```basic -CREATE SITE "projects", "bottemplates/apps/kanban", " -Project board with: -- Drag and drop cards -- Status columns -- Assignee filtering -" -``` - -### Components - -Reusable HTML components: - -| Component | File | Description | -|-----------|------|-------------| -| Data Table | `data-table.html` | Sortable, filterable tables | -| Form Modal | `form-modal.html` | Modal dialog with form | -| KPI Card | `kpi-card.html` | Metric display card | -| Chart | `chart.html` | Chart.js container | -| Search | `search-filter.html` | Search with filters | - ---- - -## Prompts - -System prompts and LLM configuration templates. - -### Assistant Prompts - -| Prompt | Description | -|--------|-------------| -| `sales.md` | Sales assistant persona | -| `support.md` | Customer support agent | -| `analyst.md` | Data analyst assistant | -| `developer.md` | Technical assistant | - -### Tool Templates - -Templates for creating LLM-invokable tools: - -```basic -' From bottemplates/dialogs/tools/template.bas -PARAM input AS STRING DESCRIPTION "Description of input" -DESCRIPTION "What this tool does. When to use it." - -' Your tool logic here -result = PROCESS input -RETURN result +template-name.gbai/ +├── README.md # Template documentation +├── template-name.gbdialog/ # BASIC dialog scripts +│ ├── start.bas # Entry point +│ └── *.bas # Additional dialogs (auto-discovered as TOOLs) +├── template-name.gbot/ # Bot configuration +│ └── config.csv # Settings +├── template-name.gbkb/ # Knowledge base (optional) +│ └── docs/ # Documents for RAG +├── template-name.gbdrive/ # File storage (optional) +└── template-name.gbui/ # Custom UI (optional) + └── index.html ``` --- -## Dialogs +## Event-Driven Patterns -Reusable BASIC script patterns. - -### Authentication +Templates should use **ON** triggers instead of polling loops: ```basic -' bottemplates/dialogs/auth/oauth-flow.bas -INCLUDE "bottemplates/dialogs/auth/oauth-flow.bas" -``` - -### Notifications - -```basic -' Send multi-channel notification -INCLUDE "bottemplates/dialogs/notifications/multi-channel.bas" -NOTIFY user, "Your order shipped!", channels: ["email", "whatsapp"] -``` - -### Data Operations - -```basic -' CRUD with validation -INCLUDE "bottemplates/dialogs/data/validated-crud.bas" -CREATE_VALIDATED "contacts", contact_data, validation_rules -``` - ---- - -## Themes - -UI customization packages. - -### Using a Theme - -``` -my-bot.gbai/ -└── my-bot.gbtheme/ # Copy theme files here - ├── colors.css - ├── fonts.css - └── components.css -``` - -### Available Themes - -| Theme | Description | -|-------|-------------| -| `default` | Clean, modern appearance | -| `dark` | Dark mode with accent colors | -| `corporate` | Professional business styling | -| `minimal` | Stripped-down, fast-loading | - ---- - -## Bot Package Structure - -Every `.gbai` bot follows this structure: - -``` -my-bot.gbai/ -├── README.md # Documentation -├── my-bot.gbdialog/ # BASIC scripts -│ ├── start.bas # Entry point -│ └── tools/ # LLM-invokable tools -├── my-bot.gbot/ # Configuration -│ └── config.csv # Bot settings -├── my-bot.gbkb/ # Knowledge base (optional) -│ └── docs/ # Documents for RAG -├── my-bot.gbdrive/ # File storage (optional) -└── my-bot.gbtheme/ # UI customization (optional) -``` - ---- - -## Best Practices - -### Event-Driven Design - -Use `ON` triggers instead of polling: - -```basic -' ✅ Good - Event-driven -ON INSERT OF "leads" - lead = GET LAST "leads" - NOTIFY sales_team, "New lead: " + lead.name -END ON - -' ❌ Bad - Polling loop +' ❌ OLD WAY - Polling (avoid) mainLoop: - leads = FIND "leads", "new = true" + leads = FIND "leads", "processed = false" WAIT 5 GOTO mainLoop + +' ✅ NEW WAY - Event-Driven +ON INSERT OF "leads" + lead = GET LAST "leads" + score = SCORE LEAD lead + TALK TO "whatsapp:" + sales_phone, "New lead: " + lead.name +END ON ``` -### LLM-Invokable Tools +--- -Add `PARAM` and `DESCRIPTION` to make scripts callable by LLM: +## TOOL-Based LLM Integration + +Every `.bas` file with `PARAM` and `DESCRIPTION` becomes an LLM-invokable tool: ```basic ' score-lead.bas -PARAM email AS STRING LIKE "john@example.com" DESCRIPTION "Lead email" -PARAM company AS STRING DESCRIPTION "Company name" +PARAM email AS STRING LIKE "john@company.com" DESCRIPTION "Lead email" +PARAM name AS STRING LIKE "John Smith" DESCRIPTION "Lead name" -DESCRIPTION "Score and qualify a sales lead" +DESCRIPTION "Score a new lead. Use when user mentions a prospect." -score = AI SCORE LEAD email, company -RETURN score -``` +lead = NEW OBJECT +lead.email = email +lead.name = name -### HTMX Patterns +score = AI SCORE LEAD lead -Generated apps should use HTMX for server communication: +IF score.status = "hot" THEN + TALK TO "whatsapp:+5511999887766", "🔥 Hot lead: " + name +END IF -```html -
Exercise your data protection rights under LGPD, GDPR, and other privacy regulations
+Request a complete copy of all personal data we hold about you in a portable format.
+ LGPD Art. 18 / GDPR Art. 15 +Request correction of inaccurate or incomplete personal data we hold about you.
+ LGPD Art. 18 III / GDPR Art. 16 +Request deletion of your personal data (Right to be Forgotten).
+ LGPD Art. 18 VI / GDPR Art. 17 +Download your data in a machine-readable format to transfer to another service.
+ LGPD Art. 18 V / GDPR Art. 20 +Review and update your data processing consents and preferences.
+ LGPD Art. 8 / GDPR Art. 7 +Object to certain types of data processing or opt-out of specific activities.
+ LGPD Art. 18 IV / GDPR Art. 21 +