2026-01-22 20:24:01 -03:00
|
|
|
# botbook Development Guide
|
2025-12-04 12:30:06 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
**Version:** 6.2.0
|
|
|
|
|
**Purpose:** Documentation for General Bots (mdBook)
|
2025-12-04 12:30:06 -03:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 📚 CRITICAL: Keyword Naming Rules
|
2025-12-05 09:55:38 -03:00
|
|
|
|
|
|
|
|
**Keywords NEVER use underscores. Always use spaces.**
|
|
|
|
|
|
|
|
|
|
### ✅ Correct Syntax
|
|
|
|
|
```basic
|
|
|
|
|
SEND MAIL to, subject, body, attachments
|
|
|
|
|
GENERATE PDF template, data, output
|
|
|
|
|
MERGE PDF files, output
|
|
|
|
|
DELETE "url"
|
|
|
|
|
ON ERROR RESUME NEXT
|
|
|
|
|
SET BOT MEMORY key, value
|
|
|
|
|
KB STATISTICS
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### ❌ WRONG - Never Use Underscores
|
|
|
|
|
```basic
|
|
|
|
|
SEND_MAIL ' WRONG!
|
|
|
|
|
GENERATE_PDF ' WRONG!
|
|
|
|
|
DELETE_HTTP ' WRONG!
|
|
|
|
|
```
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
### Keyword Mappings
|
2025-12-05 09:55:38 -03:00
|
|
|
| Write This | NOT This |
|
|
|
|
|
|------------|----------|
|
|
|
|
|
| `SEND MAIL` | `SEND_MAIL` |
|
|
|
|
|
| `GENERATE PDF` | `GENERATE_PDF` |
|
|
|
|
|
| `MERGE PDF` | `MERGE_PDF` |
|
|
|
|
|
| `DELETE` | `DELETE_HTTP` |
|
|
|
|
|
| `SET HEADER` | `SET_HEADER` |
|
|
|
|
|
| `FOR EACH` | `FOR_EACH` |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 🎨 OFFICIAL ICONS - MANDATORY
|
|
|
|
|
|
|
|
|
|
**NEVER generate icons with LLM. Use official SVG icons from `botui/ui/suite/assets/icons/`**
|
2025-12-04 18:15:18 -03:00
|
|
|
|
|
|
|
|
### Usage in Documentation
|
|
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
|
<!-- Reference icons in docs -->
|
|
|
|
|

|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
<!-- With HTML for sizing -->
|
2025-12-04 18:15:18 -03:00
|
|
|
<img src="../assets/icons/gb-analytics.svg" alt="Analytics" width="24">
|
|
|
|
|
```
|
|
|
|
|
|
2025-12-04 12:30:06 -03:00
|
|
|
---
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 📁 STRUCTURE
|
2025-12-04 12:30:06 -03:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
botbook/
|
|
|
|
|
├── book.toml # mdBook configuration
|
|
|
|
|
├── src/
|
|
|
|
|
│ ├── SUMMARY.md # Table of contents
|
|
|
|
|
│ ├── README.md # Introduction
|
2026-01-22 20:24:01 -03:00
|
|
|
│ ├── 01-introduction/ # Quick Start
|
2025-12-12 12:34:56 -03:00
|
|
|
│ ├── 02-templates/ # Package System
|
|
|
|
|
│ ├── 03-knowledge-base/ # Knowledge Base
|
|
|
|
|
│ ├── 06-gbdialog/ # BASIC Dialogs
|
|
|
|
|
│ ├── 08-config/ # Configuration
|
|
|
|
|
│ ├── 10-rest/ # REST API
|
|
|
|
|
│ └── assets/ # Images, diagrams
|
2025-12-04 12:30:06 -03:00
|
|
|
├── i18n/ # Translations
|
|
|
|
|
└── book/ # Generated output
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 📖 DOCUMENTATION RULES
|
2025-12-04 12:30:06 -03:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
- All documentation MUST match actual source code
|
|
|
|
|
- Extract real keywords from botserver/src/basic/keywords/
|
|
|
|
|
- Use actual examples from botserver/templates/
|
2026-01-22 20:24:01 -03:00
|
|
|
- Version numbers must be 6.2.0
|
2025-12-04 12:30:06 -03:00
|
|
|
- No placeholder content - only verified features
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 🚫 NO ASCII DIAGRAMS — MANDATORY
|
2025-12-04 12:30:06 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
**NEVER use ASCII art diagrams. ALL diagrams must be SVG.**
|
2025-12-04 12:30:06 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
### ❌ Prohibited ASCII Patterns
|
2025-12-04 12:30:06 -03:00
|
|
|
```
|
2025-12-12 20:36:34 -03:00
|
|
|
┌─────────┐ ╔═══════╗ +-------+
|
|
|
|
|
│ Box │ ║ Box ║ | Box |
|
|
|
|
|
└─────────┘ ╚═══════╝ +-------+
|
2025-12-04 12:30:06 -03:00
|
|
|
```
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
### ✅ What to Use Instead
|
2025-12-12 20:36:34 -03:00
|
|
|
|
|
|
|
|
| Instead of... | Use... |
|
|
|
|
|
|---------------|--------|
|
|
|
|
|
| ASCII box diagrams | SVG diagrams in `assets/` |
|
|
|
|
|
| ASCII flow charts | SVG with arrows and boxes |
|
2026-01-22 20:24:01 -03:00
|
|
|
| ASCII directory trees | Markdown tables |
|
2025-12-12 20:36:34 -03:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 🎨 SVG DIAGRAM GUIDELINES
|
2025-12-12 20:36:34 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
All SVGs must support light/dark modes:
|
2025-12-12 20:36:34 -03:00
|
|
|
|
|
|
|
|
```xml
|
|
|
|
|
<style>
|
2026-01-22 20:24:01 -03:00
|
|
|
.title-text { fill: #1E1B4B; }
|
|
|
|
|
.main-text { fill: #334155; }
|
|
|
|
|
|
2025-12-12 20:36:34 -03:00
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
|
|
.title-text { fill: #F1F5F9; }
|
|
|
|
|
.main-text { fill: #E2E8F0; }
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
```
|
|
|
|
|
|
2025-12-15 16:36:25 -03:00
|
|
|
---
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 💬 CONVERSATION EXAMPLES
|
2025-12-15 16:36:25 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
Use WhatsApp-style HTML format for bot interactions:
|
2025-12-15 16:36:25 -03:00
|
|
|
|
|
|
|
|
```html
|
|
|
|
|
<div class="wa-chat">
|
2026-01-22 20:24:01 -03:00
|
|
|
<div class="wa-message bot">
|
2025-12-15 16:36:25 -03:00
|
|
|
<div class="wa-bubble">
|
2026-01-22 20:24:01 -03:00
|
|
|
<p>Hello! How can I help?</p>
|
2025-12-15 16:36:25 -03:00
|
|
|
<div class="wa-time">10:30</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-22 20:24:01 -03:00
|
|
|
<div class="wa-message user">
|
2025-12-15 16:36:25 -03:00
|
|
|
<div class="wa-bubble">
|
2026-01-22 20:24:01 -03:00
|
|
|
<p>I want to enroll</p>
|
|
|
|
|
<div class="wa-time">10:31</div>
|
2025-12-15 16:36:25 -03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
```
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
---
|
2025-12-15 16:36:25 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 📋 SOURCE CODE REFERENCES
|
2025-12-15 16:36:25 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
| Topic | Source Location |
|
|
|
|
|
|-------|-----------------|
|
|
|
|
|
| BASIC Keywords | `botserver/src/basic/keywords/` |
|
|
|
|
|
| Database Models | `botserver/src/shared/models.rs` |
|
|
|
|
|
| API Routes | `botserver/src/core/urls.rs` |
|
|
|
|
|
| Configuration | `botserver/src/core/config/` |
|
|
|
|
|
| Templates | `botserver/templates/` |
|
2025-12-15 16:36:25 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
---
|
2025-12-15 16:36:25 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 🔧 BUILDING DOCUMENTATION
|
2025-12-15 16:36:25 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
```bash
|
|
|
|
|
# Install mdBook
|
|
|
|
|
cargo install mdbook
|
|
|
|
|
|
|
|
|
|
# Build documentation
|
|
|
|
|
cd botbook && mdbook build
|
|
|
|
|
|
|
|
|
|
# Serve locally with hot reload
|
|
|
|
|
mdbook serve --open
|
2025-12-15 16:36:25 -03:00
|
|
|
```
|
|
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
---
|
2025-12-15 16:36:25 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
## 🔑 REMEMBER
|
2025-12-15 16:36:25 -03:00
|
|
|
|
2026-01-22 20:24:01 -03:00
|
|
|
- **Accuracy** - Must match botserver source code
|
|
|
|
|
- **Completeness** - No placeholder sections
|
|
|
|
|
- **Clarity** - Accessible to BASIC enthusiasts
|
|
|
|
|
- **Keywords** - NEVER use underscores - always spaces
|
|
|
|
|
- **NO ASCII art** - Use SVG diagrams only
|
|
|
|
|
- **Version 6.2.0** - Always reference 6.2.0
|
2026-01-25 15:22:02 -03:00
|
|
|
- **GIT WORKFLOW** - ALWAYS push to ALL repositories (github, pragmatismo)
|