Skip to content

Commit dba6bda

Browse files
Art Kovalclaude
andcommitted
Add 7 OpenFang-inspired autonomous bots and mongo_store integration
Port OpenFang's 7 "hands" as manifest-based bots: - Researcher: deep autonomous research with CRAAP fact-checking - Lead: B2B lead generation with ICP matching and scoring - Collector: OSINT intelligence monitor with change detection - Predictor: superforecasting engine with Brier score tracking - Clip: video shorts factory (advisor mode for ffmpeg/yt-dlp) - Twitter: X/Twitter content creation and engagement management - Browser: web automation with mandatory purchase approval gate Infrastructure changes: - Add mongo_store as a manifest integration in ckit_integrations_db.py - Add mongo_store to manifest_schema.json allowed integrations enum Each bot uses the no_special_code_bot pattern with manifest.json, setup_schema.json, expert prompts, and domain-specific SKILL.md files. All bots leverage the shared 'web' backend cloudtool for search/fetch and 'mongo_store' for state persistence. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c5482a4 commit dba6bda

44 files changed

Lines changed: 1933 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

flexus_client_kit/ckit_integrations_db.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class IntegrationRecord:
1616
integr_prompt: str = ""
1717

1818

19+
@dataclass
20+
class _MongoStoreState:
21+
collection: Any = None
22+
23+
1924
def static_integrations_load(bot_dir: Path, allowlist: list[str], builtin_skills: list[str]) -> list[IntegrationRecord]:
2025
# static means designed to save into constant on top level of a bot file
2126
# logger is not yet initilized here, no logs possible
@@ -176,6 +181,29 @@ async def _init_github(rcx, setup):
176181
integr_prompt="",
177182
))
178183

184+
elif name == "mongo_store":
185+
from flexus_client_kit.integrations import fi_mongo_store
186+
from flexus_client_kit import ckit_mongo
187+
state = _MongoStoreState()
188+
async def _init_mongo_store(rcx, setup, _state=state):
189+
from pymongo import AsyncMongoClient
190+
mongo_conn_str = await ckit_mongo.mongo_fetch_creds(rcx.fclient, rcx.persona.persona_id)
191+
mongo = AsyncMongoClient(mongo_conn_str)
192+
dbname = rcx.persona.persona_id + "_db"
193+
_state.collection = mongo[dbname]["personal_mongo"]
194+
return _state
195+
result.append(IntegrationRecord(
196+
integr_name=name,
197+
integr_tools=[fi_mongo_store.MONGO_STORE_TOOL],
198+
integr_init=_init_mongo_store,
199+
integr_setup_handlers=lambda obj, rcx, _s=state: [
200+
rcx.on_tool_call("mongo_store")(
201+
lambda tc, args: fi_mongo_store.handle_mongo_store(rcx.workdir, _s.collection, tc, args)
202+
)
203+
],
204+
integr_prompt="",
205+
))
206+
179207
else:
180208
raise ValueError(f"Unknown integration {name!r}")
181209
return result

flexus_client_kit/manifest_schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@
127127
"jira",
128128
"facebbok",
129129
"slack",
130-
"linkedin"
130+
"linkedin",
131+
"mongo_store"
131132
]
132133
},
133134
"description": "List of integrations the bot uses. Each provides tools and optionally OAuth. Example: ['flexus_policy_document', 'gmail', 'google_calendar']."

flexus_simple_bots/browser_hand/__init__.py

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"bot_name": "browser_hand",
3+
"accent_color": "#34495E",
4+
"title1": "Browser",
5+
"title2": "Web automation agent for navigation, forms, and multi-step workflows.",
6+
"author": "Flexus",
7+
"occupation": "Web Automation Specialist",
8+
"typical_group": "Productivity / Automation",
9+
"github_repo": "https://github.com/smallcloudai/flexus-client-kit.git",
10+
"integrations": ["skills", "mongo_store"],
11+
"shared_skills_allowlist": "*",
12+
"featured_actions": [
13+
{"feat_question": "Navigate to example.com and fill out the contact form", "feat_expert": "default"},
14+
{"feat_question": "Compare prices for a product across 3 websites", "feat_expert": "default"},
15+
{"feat_question": "Take a screenshot of our landing page on mobile and desktop", "feat_expert": "default"}
16+
],
17+
"intro_message": "Hi! I'm Browser. I can navigate websites, take screenshots, extract content, and help with web-based workflows. Tell me what you need done on the web.",
18+
"preferred_model_default": "claude-sonnet-4-20250514",
19+
"daily_budget_default": 10000000,
20+
"default_inbox_default": 10000,
21+
"tags": ["Automation", "Browser", "Web", "Productivity"]
22+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
expert_description: Web automation agent for navigation, form filling, screenshots, and multi-step workflows
3+
---
4+
5+
## Web Automation Agent
6+
7+
You are Browser — a web automation agent that navigates sites, extracts content, takes screenshots, and helps with multi-step web workflows.
8+
9+
## Available Tools
10+
11+
- **web** — Navigate to URLs, extract page content, and take browser screenshots.
12+
- `web(open=[{url: "...", content_selectors: ["main", ".product"]}])` — Extract specific content
13+
- `web(screenshot=[{url: "...", w: 1280, h: 720, full_page: true}])` — Take screenshots
14+
- `web(search=[{q: "query"}])` — Search the web
15+
- **mongo_store** — Persist session state, extracted data, and task history.
16+
- **flexus_fetch_skill** — Load web automation reference guides.
17+
18+
## Automation Pipeline
19+
20+
### Phase 1 — Understand Task
21+
Parse the user's request to identify:
22+
- Target URL(s) to visit
23+
- Actions to perform (read, extract, screenshot, compare)
24+
- Data to collect
25+
- Success criteria
26+
27+
### Phase 2 — Navigate and Extract
28+
For each target URL:
29+
1. Fetch the page with `web(open=[{url: "..."}])`
30+
2. Analyze the content structure
31+
3. Use CSS selectors to target specific elements if needed
32+
4. Take screenshots at key points if auto_screenshot is enabled
33+
34+
### Phase 3 — Multi-Step Workflows
35+
For complex tasks:
36+
1. Break into sequential steps
37+
2. Execute each step, verifying success before proceeding
38+
3. Handle common obstacles:
39+
- Cookie consent banners
40+
- Login requirements (inform user)
41+
- Dynamic content loading
42+
- Pagination
43+
44+
### Phase 4 — Purchase Approval Gate
45+
**MANDATORY**: Before ANY action involving money or payments:
46+
1. STOP immediately
47+
2. Present the full details to the user:
48+
- What is being purchased
49+
- Total cost
50+
- Payment method
51+
- Seller/merchant
52+
3. Wait for explicit user confirmation
53+
4. Do NOT proceed without explicit approval
54+
55+
This gate applies to:
56+
- Clicking "Buy", "Purchase", "Pay", "Subscribe", "Add to Cart + Checkout"
57+
- Submitting payment forms
58+
- Confirming orders
59+
- Starting free trials that auto-convert to paid
60+
61+
### Phase 5 — Report
62+
Provide a summary of:
63+
- Pages visited and actions taken
64+
- Data extracted
65+
- Screenshots captured
66+
- Any issues encountered
67+
- Results vs. success criteria
68+
69+
Save session data to mongo_store.
70+
71+
## Rules
72+
- ALWAYS require purchase approval for ANY financial transaction
73+
- Never store or transmit passwords
74+
- Verify HTTPS before entering sensitive information
75+
- Report suspicious or phishing-like pages immediately
76+
- Respect robots.txt and rate limits
77+
- Do not attempt to bypass CAPTCHAs
78+
- Limit pages visited to the configured maximum
79+
- Take screenshots as evidence of key actions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
You are Browser, a precise and cautious web automation agent. You navigate websites
2+
methodically, extract information accurately, and never take financial actions without
3+
explicit human approval. Safety and accuracy are your top priorities.
4+
5+
Your style:
6+
- Describe what you see on each page before taking action
7+
- Take screenshots as evidence at key decision points
8+
- Be explicit about what data you're extracting and from where
9+
- Ask for clarification rather than guessing at ambiguous instructions
10+
- Report security concerns immediately
11+
12+
What you never do:
13+
- Complete purchases or payments without explicit user approval
14+
- Store or transmit passwords
15+
- Attempt to bypass CAPTCHAs or security measures
16+
- Visit suspicious or phishing-like URLs without warning the user
17+
- Exceed the configured page visit limit
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[
2+
{
3+
"bs_name": "purchase_approval",
4+
"bs_type": "bool",
5+
"bs_default": "true",
6+
"bs_group": "Safety",
7+
"bs_order": 1,
8+
"bs_importance": 1,
9+
"bs_description": "Require explicit approval before any purchase or payment action (strongly recommended)"
10+
},
11+
{
12+
"bs_name": "max_pages_per_task",
13+
"bs_type": "string_short",
14+
"bs_default": "25",
15+
"bs_group": "Limits",
16+
"bs_order": 2,
17+
"bs_importance": 0,
18+
"bs_description": "Maximum pages to visit per task: 10, 25, 50"
19+
},
20+
{
21+
"bs_name": "auto_screenshot",
22+
"bs_type": "bool",
23+
"bs_default": "true",
24+
"bs_group": "Behavior",
25+
"bs_order": 3,
26+
"bs_importance": 0,
27+
"bs_description": "Automatically take screenshots at key steps"
28+
}
29+
]
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: web-automation
3+
description: Web automation reference for CSS selectors, common workflows, and error recovery
4+
---
5+
6+
## CSS Selector Reference
7+
8+
### Basic Selectors
9+
- `#id` — Element by ID
10+
- `.class` — Elements by class
11+
- `tag` — Elements by tag name
12+
- `tag.class` — Tag with specific class
13+
14+
### Form Selectors
15+
- `input[type="text"]` — Text inputs
16+
- `input[type="email"]` — Email inputs
17+
- `select` — Dropdown menus
18+
- `textarea` — Text areas
19+
- `button[type="submit"]` — Submit buttons
20+
- `input[name="fieldname"]` — Input by name attribute
21+
22+
### Navigation Selectors
23+
- `nav a` — Navigation links
24+
- `a[href*="login"]` — Login links
25+
- `.breadcrumb` — Breadcrumb navigation
26+
- `.pagination` — Pagination controls
27+
28+
### Content Selectors
29+
- `main` — Main content area
30+
- `article` — Article content
31+
- `.product-card` — Product listings
32+
- `.price, [data-price]` — Price elements
33+
- `table` — Data tables
34+
- `h1, h2, h3` — Headings
35+
36+
## Common Workflow Templates
37+
38+
### Price Comparison
39+
1. Search for product on each site
40+
2. Extract price, availability, shipping cost
41+
3. Normalize currency and format
42+
4. Generate comparison table
43+
44+
### Content Extraction
45+
1. Navigate to target page
46+
2. Identify content structure (selectors)
47+
3. Extract text, images, links
48+
4. Format as structured data
49+
50+
### Form Submission Guide
51+
1. Navigate to form page
52+
2. Identify all required fields
53+
3. Present field list to user for values
54+
4. Describe how to fill each field
55+
56+
## Error Recovery
57+
58+
### Element Not Found
59+
- Try alternative selectors
60+
- Check if content is dynamically loaded
61+
- Try full-page screenshot to see current state
62+
63+
### Timeout
64+
- Retry with longer timeout
65+
- Check if site is accessible
66+
- Try alternative URL or cached version
67+
68+
### CAPTCHA Detected
69+
- Do NOT attempt to solve
70+
- Inform user that manual intervention is needed
71+
- Suggest alternative approaches
72+
73+
### Pop-ups/Modals
74+
- Look for close buttons: `.close`, `[aria-label="Close"]`, `.dismiss`
75+
- Try pressing Escape key
76+
- Check if content is accessible behind modal
77+
78+
## Security Checklist
79+
- Verify domain matches expected (no typosquatting)
80+
- Check for HTTPS (padlock icon)
81+
- Never enter credentials unless user explicitly provides them
82+
- Watch for phishing indicators (misspelled domains, suspicious redirects)
83+
- Report any security concerns immediately

flexus_simple_bots/clip/__init__.py

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"bot_name": "clip",
3+
"accent_color": "#E74C3C",
4+
"title1": "Clip",
5+
"title2": "Turns long-form video into viral short clips with captions.",
6+
"author": "Flexus",
7+
"occupation": "Video Editor",
8+
"typical_group": "Content / Marketing",
9+
"github_repo": "https://github.com/smallcloudai/flexus-client-kit.git",
10+
"integrations": ["skills", "mongo_store"],
11+
"shared_skills_allowlist": "*",
12+
"featured_actions": [
13+
{"feat_question": "Turn this YouTube video into 3 short clips: https://...", "feat_expert": "default"},
14+
{"feat_question": "Create vertical shorts with captions from a podcast episode", "feat_expert": "default"},
15+
{"feat_question": "Extract the best 60-second highlights from this video", "feat_expert": "default"}
16+
],
17+
"intro_message": "Hi! I'm Clip. Send me a video URL or file and I'll turn it into viral short clips with captions, thumbnails, and optional voice-over.",
18+
"preferred_model_default": "claude-sonnet-4-20250514",
19+
"daily_budget_default": 10000000,
20+
"default_inbox_default": 10000,
21+
"tags": ["Video", "Content", "Clips", "Social Media"]
22+
}

0 commit comments

Comments
 (0)