.cursor/skills/develop-b24-python/SKILL.md
Develop backend applications for Битрикс24 using Python, Django, and b24pysdk. Use this skill when you need to create API endpoints, work with Битрикс24 data, or manage authentication in Python.
npx skillsauth add rustams/inbound develop-b24-pythonInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The Python backend is built with Django and uses b24pysdk for Битрикс24 interaction.
backends/python/api/main/views.py: API endpoints.backends/python/api/main/models.py: Database models (Bitrix24Account).backends/python/api/main/utils/: Decorators and helpers.Use the @auth_required decorator to handle authentication (JWT or OAuth).
from django.http import JsonResponse
from django.views.decorators.http import require_GET
from django.views.decorators.clickjacking import xframe_options_exempt
from .utils.decorators import auth_required, log_errors
from .utils import AuthorizedRequest
@xframe_options_exempt
@require_GET
@log_errors("my_endpoint")
@auth_required
def my_endpoint(request: AuthorizedRequest):
# Access Битрикс24 account
b24_account = request.bitrix24_account
# Use the client to call Битрикс24 API
client = b24_account.client
deals = client.call("crm.deal.list", {"select": ["ID", "TITLE"]})
return JsonResponse({"data": deals})
The request.bitrix24_account.client provides a wrapper around b24pysdk.
# Call a single method
result = client.call("crm.deal.get", {"id": 123})
# Batch request (if supported by SDK wrapper, otherwise use call_batch)
# Check b24pysdk documentation for specific batch syntax
/api/install receives OAuth data, creates Bitrix24Account./api/getToken issues a JWT for the frontend.Authorization header. @auth_required validates it and populates request.bitrix24_account.main/models.py.python manage.py makemigrations / migrate.@xframe_options_exempt, @log_errors, and @auth_required for API views.AuthorizedRequest for type hinting.log_errors catches exceptions, but handle specific logic errors within the view.instructions/queues/python.md).When applying a captured media template to a new smart process (strict_full), custom intermediate stages (e.g. MEDIA_EXPIRING) may fail on the first run with Bitrix errors such as (RU) «Нельзя создать промежуточную стадию после успешной» — API rejects crm.status.add.
Cause: Bitrix compares SORT of the new stage to existing terminal stages (SUCCESS / FAIL). The snapshot may carry high SORT values from the reference process while the target portal already has SUCCESS at a lower SORT. An intermediate with SORT ≥ that terminal is treated as “after success” and is rejected, even if application order neutralizes terminals (SEMANTICS P) first.
Implementation in this repo: main/services/media_template_apply.py — _apply_stages computes the minimum SORT among target rows whose suffix matches template terminals (S/F semantics), then clamps SORT on new intermediate crm.status.add calls so they sit strictly below that floor. Related helpers: neutralize S/F → P, _delete_uc_placeholder_intermediates, _wait_for_category_stages_ready before stage sync. Unit tests: main/tests/test_media_template_stage_sync.py (including sort-clamp case).
Do not assume the snapshot is empty on first apply if stages are missing — confirm with API warnings / logs. A misleading theory is “card_views-only snapshot with empty stages_by_category”; runtime evidence may show a full crm_template_snapshot and a SORT rejection instead.
The api container usually mounts only backends/python/api. Paths like repo .cursor/debug-*.log are not visible inside the container, so file-based debug logs there fail silently unless you also log to stdout. Prefer django.conf.settings.BASE_DIR for writable NDJSON under the mounted tree, and/or logger.info(...) so docker compose logs api shows lines during reproduction.
tools
This skill should be used when the user asks to "design agent tools", "create tool descriptions", "reduce tool complexity", "implement MCP tools", or mentions tool consolidation, architectural reduction, tool naming conventions, or agent-tool interfaces.
development
This skill should be used when the user asks to "start an LLM project", "design batch pipeline", "evaluate task-model fit", "structure agent project", or mentions pipeline architecture, agent-assisted development, cost estimation, or choosing between LLM and traditional approaches.
development
PM skill for Claude Code, Codex, Cursor, and Windsurf. Diagnoses SaaS metrics, critiques PRDs, plans roadmaps, runs discovery, coaches PM career transitions, and pressure-tests AI product decisions. Six knowledge domains, 12 templates, 30+ frameworks, and an opinionated interaction style that labels assumptions and names tradeoffs.
development
Understand the Битрикс24 Starter Kit project structure. Use this skill to find where specific code (frontend, backend, infrastructure) is located.