Awesome-omni-skill bitrix24-agent
Design, implement, debug, and harden integrations between AI agents and Bitrix24 REST API (webhooks, OAuth 2.0, scopes, events, batch, limits, and REST 3.0). Use when asked to connect AI assistants/agents to Bitrix24, automate CRM/tasks/chats, process Bitrix24 events, choose an auth model, or resolve Bitrix24 API errors and performance issues.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/bitrix24-agent-vrtalex" ~/.claude/skills/diegosouzapw-awesome-omni-skill-bitrix24-agent-2d7f52 && rm -rf "$T"
skills/development/bitrix24-agent-vrtalex/SKILL.mdBitrix24 Agent (Lean + Reliable)
Use this skill to deliver correct Bitrix24 integrations with low token usage and production-safe defaults.
Quick Start
Use this flow unless the user asks for a different one:
- Pick intent + one minimal pack (
by default).core - Run a read probe first.
- For writes, use plan then execute with confirmation.
Read probe:
python3 skills/bitrix24-agent/scripts/bitrix24_client.py user.current --params '{}'
Safer write flow:
python3 skills/bitrix24-agent/scripts/bitrix24_client.py crm.lead.add \ --params '{"fields":{"TITLE":"Plan demo"}}' \ --packs core \ --plan-only python3 skills/bitrix24-agent/scripts/bitrix24_client.py \ --execute-plan <plan_id> \ --confirm-write
Runtime Prerequisites
Required environment:
B24_DOMAIN
=B24_AUTH_MODE
orwebhookoauth
Webhook mode:
B24_WEBHOOK_USER_IDB24_WEBHOOK_CODE
OAuth mode:
B24_ACCESS_TOKENB24_REFRESH_TOKEN
andB24_CLIENT_ID
(forB24_CLIENT_SECRET
)--auto-refresh
Useful safety/reliability flags:
for mandatory plan->execute on write/destructive callsB24_REQUIRE_PLAN=1
for default pack setB24_PACKS=core,...
withB24_RATE_LIMITER=file
andB24_RATE_LIMITER_RATEB24_RATE_LIMITER_BURST
Default Mode: Lean
Apply these limits unless the user asks for deep detail:
- Load at most 2 reference files before first actionable step.
- Start from
.references/packs.md - Then open only one target file:
.references/catalog-<pack>.md - Open
only if the user needs workflow steps.references/chains-<pack>.md - Open
only for auth architecture, limits, event reliability, or unknown errors.references/bitrix24.md
Response limits:
- Use concise output (goal + next action + one command).
- Do not retell documentation.
- Do not dump large JSON unless requested.
- Return only delta if guidance was already given.
Routing Workflow
- Determine intent:
- method call
- troubleshooting
- architecture decision
- event/reliability setup
- Normalize product vocabulary:
- "collabs", "workgroups", "projects", "social network groups" ->
(andcollab
for scrum).boards - "Copilot", "CoPilot", "BitrixGPT", "AI prompts" ->
(platform
).ai.* - "open lines", "contact center connectors", "line connectors" ->
(comms
,imopenlines.*
).imconnector.* - "feed", "live feed", "news feed" ->
(collab
).log.* - "sites", "landing pages", "landing" ->
(sites
).landing.* - "booking", "calendar", "work time", "time tracking" ->
(services
,booking.*
,calendar.*
).timeman.* - "orders", "payments", "catalog", "products" ->
(commerce
,sale.*
).catalog.* - "consents", "consent", "e-signature", "sign" ->
(compliance
,userconsent.*
).sign.*
- Choose auth quickly:
- one portal/internal integration: webhook
- app or multi-portal lifecycle: OAuth
- Select minimal packs:
- default
core - add only required packs:
,comms
,automation
,collab
,content
,boards
,commerce
,services
,platform
,sites
,compliancediagnostics
Execution Flow (Safe by Default)
Command template:
python3 skills/bitrix24-agent/scripts/bitrix24_client.py <method> \ --params '<json>' \ --packs core
Guardrails to enforce:
- allowlist via packs and
--method-allowlist - write gate with
--confirm-write - destructive gate with
--confirm-destructive - optional two-phase write with
and--plan-only--execute-plan - idempotency for writes (auto or
)--idempotency-key - audit trail unless
is explicitly needed--no-audit
Reliability and Performance
Pagination and sync safety:
- Never stop after first
page.*.list - Keep deterministic ordering and persist checkpoints after successful page persistence.
Batch rules:
- Maximum 50 commands per
.batch - No nested
.batch - Split oversized batches and parse per-command errors.
Limits and retries:
- Treat
andQUERY_LIMIT_EXCEEDED
as transient.5xx - Use exponential backoff with jitter (client default).
- Use shared rate limiter keyed by portal in multi-worker setups.
Events:
- Online events are not guaranteed delivery.
- For no-loss pipelines, use offline flow:
event.offline.get(clear=0)- process idempotently with retry budget
for failed itemsevent.offline.error
only for successful/DLQ'ed itemsevent.offline.clear
- Use
as baseline.scripts/offline_sync_worker.py
Error Handling
Fast mapping:
| Error code | Typical cause | Immediate action |
|---|---|---|
| method called with wrong auth model | switch webhook/OAuth model for this method |
| missing scope | add scope and reinstall/reissue auth |
| OAuth token expired | refresh token ( or external refresh flow) |
| burst above portal budget | backoff, queue, tune limiter, reduce concurrency |
| batch payload too large | split batch |
| unsupported method in batch | call directly |
Escalate to deep reference (
references/bitrix24.md) on:
- unknown auth/permission behavior
- recurring limit failures
- offline event loss concerns
- OAuth refresh race or tenant isolation issues
Quality Guardrails
- Never expose webhook/OAuth secrets.
- Enforce least-privilege scopes and tenant isolation.
- Keep writes idempotent where possible.
- Validate
in event handlers.application_token - Prefer REST v3 where compatible; fallback to v2 where needed.
Reference Loading Map
for pack and loading strategy.references/packs.md
for method shortlist.references/catalog-<pack>.md
for implementation chains.references/chains-<pack>.md
for protocol-level troubleshooting and architecture decisions.references/bitrix24.md
Useful search shortcuts:
rg -n "^# Catalog|^# Chains" references/catalog-*.md references/chains-*.md rg -n "WRONG_AUTH_TYPE|insufficient_scope|QUERY_LIMIT_EXCEEDED|expired_token" references/bitrix24.md rg -n "offline|event\\.bind|event\\.offline|application_token" references/bitrix24.md
Scripts
: method calls, packs, allowlist, confirmations, plans, idempotency, audit, rate limiting, retries.scripts/bitrix24_client.py
: offline queue polling, bounded retries, DLQ handling, safe clear flow, graceful shutdown.scripts/offline_sync_worker.py