.github/skills/kommo-integration/SKILL.md
Work with Kommo CRM integration in Clarin. Use when modifying the sync worker, API client, lead/contact/tag synchronization, or phone normalization. Covers the one-way Kommo to Clarin sync flow.
npx skillsauth add ricardoalejandro/clarin kommo-integrationInstall 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.
Kommo integration is a one-way sync (Kommo → Clarin) using the Kommo REST API v4.
backend/internal/kommo/
client.go → Rate-limited HTTP client for Kommo API
sync.go → SyncService: background worker (5s polling)
SyncService.Start() launches a goroutine that polls every 5 secondsrepository.golead_update via WebSocket after syncGetLeads() — Fetches leads with paginationGetContacts() — Fetches contacts with paginationGetTags() — Fetches ALL tags with full pagination (fixed: was only page 1)SyncService struct with client, repo, db, hubupsertLead() → creates/updates lead, calls syncLeadTags()upsertContact() → creates/updates contact, calls syncContactTags()syncLeadTags() → populates lead_tags junction tablesyncContactTags() → populates contact_tags junction tableNormalizePhone() → Exported function for phone normalization// Peru (51) is the only country supported
// 9-digit numbers starting with 9 get "51" prefix automatically
normalized := kommo.NormalizePhone("987654321") // → "51987654321"
normalized := kommo.NormalizePhone("51987654321") // → "51987654321" (unchanged)
ALWAYS use kommo.NormalizePhone() when handling phone numbers in:
api/server.go → handleCreateLead()service/service.go → CreateNewChat()kommo/sync.go → all sync operationsdomain/entities.godatabase.goupsertLead() or upsertContact() in sync.godevelopment
Enforce code quality, self-testing, and verification standards for Clarin CRM. Use this skill to ensure every change is compiled, deployed, and validated before presenting to the user. Acts as a senior engineer code review checklist.
development
Create beautiful, polished, and highly usable Next.js/React/TypeScript interfaces for Clarin CRM. Use when creating or modifying dashboard pages, components, API calls, WebSocket listeners, or UI styling. Enforces visual excellence, micro-interactions, accessibility, and the emerald/slate design system.
development
Make database schema changes for Clarin CRM. Use when adding tables, columns, indexes, or modifying the PostgreSQL schema. Migrations live in database.go InitDB() function.
development
Build, deploy, and verify changes for Clarin CRM. Use this skill after making any code change to compile, deploy, and validate that everything works correctly. Covers Docker-based builds for Go backend and Next.js frontend.