AI Integration
Feed this file to your AI assistant and it will understand the entire Hira SDK — then you just describe what flow you want and the AI generates the code.
How to use
- Download the AI context file below
- Add it to your AI assistant:
- Cursor → Add to
.cursorrulesor Project Rules - ChatGPT → Upload as file in a new chat
- Claude → Add to Project Knowledge
- GitHub Copilot → Add to
.github/copilot-instructions.md
- Cursor → Add to
- Prompt the AI:
Write me a flow to login to Facebook:
- Open URL facebook.com
- Enter email, password from profileInput
- Click the login button
- Wait for page to load
- Check if login was successful
- Write output: loginStatus, userNameThe AI will generate a complete flow with correct types, imports, and patterns.
Download
đź“„ Open hira-sdk-ai-rules.md
[!TIP] Open the file → Select All (Ctrl+A) → Copy (Ctrl+C) → Paste into your AI assistant. Or right-click the link → “Save link as…” to download.
What’s inside?
The AI context file includes:
| Section | Content |
|---|---|
| Imports | All exports from @hira-core/sdk |
| AntidetectProvider | GPM, Hidemium, GenLogin, AdsPower |
| defineFlowConfig() | Input types, output schema, validation rules |
| Flow Class | AntidetectBaseFlow, constructor, script() |
| IScriptContext | browser, page, profile, globalInput, profileInput, output, logger |
| BrowserUtils | All 21 methods with full signatures, parameters, defaults, and examples |
| ExcelStorage | Setup at runner level, column mapping, parseProfileSettings |
| Dev Runner | Complete main.dev.ts template |
| Complete Example | Full login flow with error handling + popup pattern |
| Project Structure | Single flow + multi-flow with versioning |
| Key Rules | 18 rules AI must follow |
Example: What AI generates
After feeding the context file, you can prompt:
“Write a flow to scrape product info from shopee.vn — get name, price, rating, and write to output”
The AI will generate:
import {
AntidetectBaseFlow, AntidetectProvider, BrowserUtils,
FlowLogger, IScriptContext, defineFlowConfig,
} from '@hira-core/sdk'
const config = defineFlowConfig({
globalInput: [
{ key: 'productUrl', label: 'Product URL', type: 'text', required: true },
],
profileInput: [],
output: [
{ index: 0, key: 'productName', label: 'Product Name' },
{ index: 1, key: 'price', label: 'Price' },
{ index: 2, key: 'rating', label: 'Rating' },
],
})
type Config = typeof config
export class ShopeeScraperFlow extends AntidetectBaseFlow<Config> {
constructor(provider: AntidetectProvider = AntidetectProvider.GPM) {
super(provider, new FlowLogger('ShopeeScraperFlow'), config)
}
async script(context: IScriptContext<Config>) {
const browser = new BrowserUtils(context)
await browser.goto(context.globalInput.productUrl)
await browser.sleep(3000) // wait for dynamic content
const name = await browser.getText('.product-title')
const price = await browser.getText('.product-price')
const rating = await browser.getText('.product-rating')
await browser.writeOutput('productName', name ?? 'N/A')
await browser.writeOutput('price', price ?? 'N/A')
await browser.writeOutput('rating', rating ?? 'N/A')
}
}✅ Correct imports, types, patterns — all generated automatically!
Last updated on