mergeon-mcp 1.62.0 → 1.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.js +9 -9
- package/dist/tools/flows.js +11 -2
- package/dist/tools/flows.js.map +1 -1
- package/dist/tools/forms.js +19 -19
- package/dist/tools/nurturing.js +7 -7
- package/dist/tools/webhooks.js +2 -2
- package/package.json +1 -1
- package/scripts/install-skills.js +149 -149
- package/skills/flows-creation.md +29 -0
- package/skills/forms-creation.md +196 -196
- package/skills/meta-events-debug.md +103 -103
- package/skills/nurturing-creation.md +190 -190
- package/skills/reviews-usage.md +78 -78
- package/skills/sales-analysis.md +93 -93
- package/skills/social-tracking.md +100 -100
- package/skills/webhooks-usage.md +184 -184
package/README.md
CHANGED
|
@@ -195,6 +195,8 @@ npx mergeon-mcp skills list
|
|
|
195
195
|
| `flows_execute` | Ejecuta flow manualmente con `crm`/`message`/`order`, opcional `template_placeholders` (overrides de campos manuales para `send_template`) y opcional `template_file_url` (override del header image/video/documento del template, ej. guía de envío específica del pedido). Opcional `session_id` + `source` para fijar la conversación destino exacta (evita que el canal se re-derive del contacto). Permite ejecutar flows inactivos manualmente. |
|
|
196
196
|
| `flows_get_catalog` | **Catálogo descubrible**: devuelve todos los `trigger_types` con sus condiciones válidas, todos los `action_types` con sus payloads, los `order_statuses` válidos y los `{{placeholders}}` disponibles (order/crm/message/event/time + aritmética). **Llamar antes de diseñar un flow** para no inventar triggers/actions. |
|
|
197
197
|
|
|
198
|
+
> **Nuevo en 1.63.0 (`follows_me`):** nueva condición de `default_message` que exige que la persona siga (`true`) o no siga (`false`) la cuenta de Instagram. Instagram **no tiene webhook de seguidor nuevo** —el disparador que usan otras herramientas es una beta privada de Meta, no la API pública— pero sí se puede consultar de a una persona, y solo de quien YA escribió al negocio (Meta exige ese consentimiento). Por eso no sirve en `ig_comment`: el camino es comentario → DM → responde → ahí se evalúa. Va en AND con las demás condiciones y, si no se puede averiguar, no se cumple. Habilita el patrón "sígueme y te paso el link".
|
|
199
|
+
|
|
198
200
|
> **Nuevo en 1.58.0 (botones):** nueva action `send_buttons` — texto + botones de enlace (`url`) o de respuesta rápida (`reply`). WhatsApp los manda como mensaje `interactive` (hasta 3 respuestas rápidas, o 1 enlace como `cta_url`); Instagram y Messenger como `quick_replies`. Cuando el cliente toca una respuesta rápida, el tap entra como mensaje normal con su `payload`, así que se encadena con un flow `default_message` + la nueva condición `button_payload`. Sirve también en `ig_comment` para mandar el DM con botones.
|
|
199
201
|
|
|
200
202
|
> **Nuevo en 1.58.0:** `flows_get_catalog` ya no devuelve una copia estática: lee el catálogo del backend (`app/flows/catalog.py`), la misma fuente con la que se valida al crear un flow. Por cada trigger dice qué acciones sirven de verdad (`status: ok` o `partial` si el dato puede faltar), sus condiciones y sus placeholders válidos. Una acción incompatible ahora se rechaza al crear con un mensaje claro, en vez de guardarse y no ejecutarse nunca. Además el trigger `order_card_shortcut` (botón en la tarjeta de venta) ya se puede usar desde el MCP.
|
package/dist/index.js
CHANGED
|
@@ -5,15 +5,15 @@ import { z } from "zod";
|
|
|
5
5
|
import { MergeOnClient } from "./client.js";
|
|
6
6
|
import { registerAllTools } from "./tools/index.js";
|
|
7
7
|
const client = new MergeOnClient();
|
|
8
|
-
const MERGEON_INSTRUCTIONS = `Eres el consultor de implementación de MergeOn Seller para este usuario. Tu trabajo NO es solo listar datos ni volcar resultados: es entender el negocio y ayudar a IMPLEMENTAR sobre la plataforma.
|
|
9
|
-
|
|
10
|
-
Postura por defecto (aplícala en TODA interacción sobre MergeOn):
|
|
11
|
-
- No te limites a listar/leer y devolver un volcado. Cuando el usuario describe una necesidad ("quiero responder pautas", "que confirme ventas", "seguir leads fríos", "capturar de un reel"), haz 1–3 preguntas concretas para llenar los huecos y luego CREA la solución con las tools (flows_create, agent_prompts_update, nurturing_flow_create, forms_create, templates_create, etc.).
|
|
12
|
-
- Sé proactivo: propón qué automatizar y cómo, no esperes a que el usuario sepa el nombre exacto de la feature. Traduce lo que pide a triggers, conditions y actions concretas.
|
|
13
|
-
- Antes de crear algo con datos del negocio (mensajes, precios, envíos, tono), confirma los detalles mínimos que faltan en UNA pregunta agrupada, no en diez separadas.
|
|
14
|
-
- Después de crear/modificar algo, di en una frase qué quedó activo y ofrece el siguiente paso lógico (verificar, encadenar otro flow, activar el agente).
|
|
15
|
-
- Solo listar sin más cuando el usuario pide explícitamente ver/consultar datos ("muéstrame las ventas de hoy", "lista mis flows").
|
|
16
|
-
|
|
8
|
+
const MERGEON_INSTRUCTIONS = `Eres el consultor de implementación de MergeOn Seller para este usuario. Tu trabajo NO es solo listar datos ni volcar resultados: es entender el negocio y ayudar a IMPLEMENTAR sobre la plataforma.
|
|
9
|
+
|
|
10
|
+
Postura por defecto (aplícala en TODA interacción sobre MergeOn):
|
|
11
|
+
- No te limites a listar/leer y devolver un volcado. Cuando el usuario describe una necesidad ("quiero responder pautas", "que confirme ventas", "seguir leads fríos", "capturar de un reel"), haz 1–3 preguntas concretas para llenar los huecos y luego CREA la solución con las tools (flows_create, agent_prompts_update, nurturing_flow_create, forms_create, templates_create, etc.).
|
|
12
|
+
- Sé proactivo: propón qué automatizar y cómo, no esperes a que el usuario sepa el nombre exacto de la feature. Traduce lo que pide a triggers, conditions y actions concretas.
|
|
13
|
+
- Antes de crear algo con datos del negocio (mensajes, precios, envíos, tono), confirma los detalles mínimos que faltan en UNA pregunta agrupada, no en diez separadas.
|
|
14
|
+
- Después de crear/modificar algo, di en una frase qué quedó activo y ofrece el siguiente paso lógico (verificar, encadenar otro flow, activar el agente).
|
|
15
|
+
- Solo listar sin más cuando el usuario pide explícitamente ver/consultar datos ("muéstrame las ventas de hoy", "lista mis flows").
|
|
16
|
+
|
|
17
17
|
Conocimiento experto: las skills instaladas en el CLAUDE.md del usuario (prompt-creation, flows-creation, nurturing-creation, forms-creation, templates-creation, webhooks-usage, social-tracking, sales-analysis, meta-events-debug, reviews-usage) contienen la guía detallada de cada dominio. Si el usuario aún no las tiene, puede instalarlas todas con \`npx mergeon-mcp skills add all\`.`;
|
|
18
18
|
const server = new McpServer({
|
|
19
19
|
name: "mergeon",
|
package/dist/tools/flows.js
CHANGED
|
@@ -58,8 +58,9 @@ export function registerFlowsTools(server, client) {
|
|
|
58
58
|
Valid trigger_type values: ${TRIGGER_LIST}.
|
|
59
59
|
|
|
60
60
|
Conditions are trigger-specific:
|
|
61
|
-
- default_message: { equal_text?: string|string[], similar_text?: string, button_payload?: string|string[], length_lt?: number, length_gt?: number, length_eq?: number }
|
|
61
|
+
- default_message: { equal_text?: string|string[], similar_text?: string, button_payload?: string|string[], follows_me?: boolean, length_lt?: number, length_gt?: number, length_eq?: number }
|
|
62
62
|
button_payload matches the id of the quick-reply button the customer TAPPED (sent by a previous send_buttons action). It never matches text typed by hand.
|
|
63
|
+
follows_me (Instagram only) requires the person to follow (true) or not follow (false) the business account. Meta only allows reading this for someone who ALREADY messaged the business, so it does not work on ig_comment — the path is comment -> private reply -> they answer -> now it can be checked. ANDed with the other conditions; if it cannot be determined the flow does not run.
|
|
63
64
|
- story_reply: { equal_text?: string|string[], similar_text?: string, length_lt?: number, length_gt?: number, length_eq?: number }
|
|
64
65
|
- ig_comment: { media_ids?: string[] // restringe el flow a uno o varios reels/posts (IDs numericos de Meta). Vacio = aplica a cualquier media.
|
|
65
66
|
media_product_type?: 'ALL'|'REELS'|'FEED'|'STORY' // filtra por tipo (default ALL)
|
|
@@ -192,7 +193,15 @@ const STATIC_CATALOG = {
|
|
|
192
193
|
{
|
|
193
194
|
name: "default_message",
|
|
194
195
|
description: "Cualquier mensaje entrante. Matching por texto y/o longitud.",
|
|
195
|
-
conditions: [
|
|
196
|
+
conditions: [
|
|
197
|
+
"equal_text (string|string[])",
|
|
198
|
+
"similar_text (string)",
|
|
199
|
+
"button_payload (string|string[]) — id de la respuesta rápida que TOCÓ el cliente",
|
|
200
|
+
"follows_me (boolean) — solo Instagram; exige que la persona siga (true) o no siga (false) la cuenta",
|
|
201
|
+
"length_lt (number)",
|
|
202
|
+
"length_gt (number)",
|
|
203
|
+
"length_eq (number)",
|
|
204
|
+
],
|
|
196
205
|
},
|
|
197
206
|
{
|
|
198
207
|
name: "first_message",
|
package/dist/tools/flows.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../src/tools/flows.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,SAAS,IAAI,CAAC,IAAS;IACrB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACvF,CAAC;AAED,yEAAyE;AACzE,sEAAsE;AACtE,yEAAyE;AACzE,yEAAyE;AAEzE,MAAM,aAAa,GAAG;IACpB,iBAAiB,EAAM,2EAA2E;IAClG,eAAe,EAAQ,8BAA8B;IACrD,aAAa,EAAU,kCAAkC;IACzD,oBAAoB,EAAG,wDAAwD;IAC/E,MAAM,EAAiB,2DAA2D;IAClF,qBAAqB,EAAE,0DAA0D;IACjF,qBAAqB,EAAE,6EAA6E;IACpG,YAAY,EAAW,0BAA0B;IACjD,aAAa,EAAU,wCAAwC;IAC/D,eAAe,EAAQ,0CAA0C;IACjE,gBAAgB,EAAO,kDAAkD;IACzE,eAAe,EAAQ,wEAAwE;IAC/F,iBAAiB,EAAM,+EAA+E;IACtG,qBAAqB,EAAE,0EAA0E;CACzF,CAAC;AAEX,MAAM,YAAY,GAAG;IACnB,cAAc,EAAU,sEAAsE;IAC9F,cAAc,EAAU,wFAAwF;IAChH,YAAY,EAAY,oEAAoE;IAC5F,aAAa,EAAW,2CAA2C;IACnE,eAAe,EAAS,0DAA0D;IAClF,iBAAiB,EAAO,gEAAgE;IACxF,iBAAiB,EAAO,uEAAuE;IAC/F,WAAW,EAA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,CAAC,IAAI,CAAC;YAC1F,UAAU,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC;SACzC;QACD;YACE,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,oQAAoQ;YACjR,UAAU,EAAE,CAAC,sFAAsF,CAAC;SACrG;QACD;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,wPAAwP;YACrQ,UAAU,EAAE;gBACV,sFAAsF;gBACtF,iEAAiE;gBACjE,8BAA8B;gBAC9B,uBAAuB;gBACvB,4CAA4C;aAC7C;SACF;QACD;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,6JAA6J;YAC1K,UAAU,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,kDAAkD,CAAC;SAC/F;QACD;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,6EAA6E;YAC1F,UAAU,EAAE,CAAC,8BAA8B,EAAE,yBAAyB,EAAE,2BAA2B,CAAC;SACrG;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,mFAAmF;YAChG,UAAU,EAAE,CAAC,kEAAkE,EAAE,kDAAkD,CAAC;SACrI;QACD;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,kUAAkU;YAC/U,UAAU,EAAE,CAAC,2DAA2D,EAAE,yCAAyC,CAAC;SACrH;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,wLAAwL;YACrM,UAAU,EAAE,CAAC,+DAA+D,EAAE,iBAAiB,CAAC;SACjG;KACF;IACD,YAAY,EAAE,eAAe;IAC7B,cAAc,EAAE,cAAc;IAC9B,YAAY,EAAE,qBAAqB;CACxC,CAAC"}
|
package/dist/tools/forms.js
CHANGED
|
@@ -38,21 +38,21 @@ export function registerFormsTools(server, client) {
|
|
|
38
38
|
// ──────────────────────────────────────────────────────────────────
|
|
39
39
|
server.tool("forms_list", "Lists all forms for this ecommerce. Each form includes aggregated metrics (total_submissions, total_codes, last_submission_at). Use this before creating a tracking code or before designing a similar form.", {}, async () => text(await client.get("/forms/")));
|
|
40
40
|
server.tool("forms_get", "Returns one form with full form_schema and metrics by id.", { form_id: z.number().int() }, async ({ form_id }) => text(await client.get(`/forms/${form_id}`)));
|
|
41
|
-
server.tool("forms_create", `Creates a new form template. The form is rendered at mergeon.dev/form/{tracking_code} once you create at least one tracking code (see forms_tracking_codes_create).
|
|
42
|
-
|
|
43
|
-
Field types (FieldType): ${FIELD_TYPES.join(", ")}.
|
|
44
|
-
- 'phone' supports default_country (e.g. '+57') and country_options.
|
|
45
|
-
- 'select' / 'multi_select' require an options[] of {value,label}.
|
|
46
|
-
- show_if: { field, equals } shows the field only when another field equals a value (e.g. show "crm_name" only when "uses_crm" equals "yes").
|
|
47
|
-
|
|
48
|
-
destination_mode:
|
|
49
|
-
- 'mergeon_hosted' (default): renders at mergeon.dev/form/{code} using the schema.
|
|
50
|
-
- 'external_redirect': /r/{code} 302s to external_url with UTMs appended. No schema rendering. external_url is required.
|
|
51
|
-
|
|
52
|
-
after_submit:
|
|
53
|
-
- { type:'message', success_message:'...' } → muestra el mensaje y se queda en la página.
|
|
54
|
-
- { type:'redirect_url', value:'https://calendly...', open_in_new_tab:true } → redirige tras guardar.
|
|
55
|
-
|
|
41
|
+
server.tool("forms_create", `Creates a new form template. The form is rendered at mergeon.dev/form/{tracking_code} once you create at least one tracking code (see forms_tracking_codes_create).
|
|
42
|
+
|
|
43
|
+
Field types (FieldType): ${FIELD_TYPES.join(", ")}.
|
|
44
|
+
- 'phone' supports default_country (e.g. '+57') and country_options.
|
|
45
|
+
- 'select' / 'multi_select' require an options[] of {value,label}.
|
|
46
|
+
- show_if: { field, equals } shows the field only when another field equals a value (e.g. show "crm_name" only when "uses_crm" equals "yes").
|
|
47
|
+
|
|
48
|
+
destination_mode:
|
|
49
|
+
- 'mergeon_hosted' (default): renders at mergeon.dev/form/{code} using the schema.
|
|
50
|
+
- 'external_redirect': /r/{code} 302s to external_url with UTMs appended. No schema rendering. external_url is required.
|
|
51
|
+
|
|
52
|
+
after_submit:
|
|
53
|
+
- { type:'message', success_message:'...' } → muestra el mensaje y se queda en la página.
|
|
54
|
+
- { type:'redirect_url', value:'https://calendly...', open_in_new_tab:true } → redirige tras guardar.
|
|
55
|
+
|
|
56
56
|
webhook_url (optional): se firma con HMAC-SHA256 en X-Webhook-Signature usando SECRET_KEY del backend; el body lleva el submission completo.`, {
|
|
57
57
|
name: z.string().describe("Internal name shown in the app."),
|
|
58
58
|
title: z.string().optional().describe("Public-facing title rendered on the page."),
|
|
@@ -93,10 +93,10 @@ webhook_url (optional): se firma con HMAC-SHA256 en X-Webhook-Signature usando S
|
|
|
93
93
|
const qs = form_id !== undefined ? `?form_id=${form_id}` : "";
|
|
94
94
|
return text(await client.get(`/forms/tracking-codes/${qs}`));
|
|
95
95
|
});
|
|
96
|
-
server.tool("forms_tracking_codes_create", `Creates a tracking code (URL slug) for a form. One form → many tracking codes. Each code typically corresponds to a video/reel/channel so attribution is separate.
|
|
97
|
-
|
|
98
|
-
If 'code' is omitted, an 8-char random slug is generated. If a provided code clashes, the backend auto-falls-back to random.
|
|
99
|
-
|
|
96
|
+
server.tool("forms_tracking_codes_create", `Creates a tracking code (URL slug) for a form. One form → many tracking codes. Each code typically corresponds to a video/reel/channel so attribution is separate.
|
|
97
|
+
|
|
98
|
+
If 'code' is omitted, an 8-char random slug is generated. If a provided code clashes, the backend auto-falls-back to random.
|
|
99
|
+
|
|
100
100
|
Bind to a video by setting tracked_media_id (use tracked_media_list to find it). The UTMs are bake-in: they get attached to the submission and to /r/{code} redirects.`, {
|
|
101
101
|
form_id: z.number().int(),
|
|
102
102
|
code: z.string().optional().describe("Readable slug like 'oferta-enero' OR omit for autogenerated."),
|
package/dist/tools/nurturing.js
CHANGED
|
@@ -66,13 +66,13 @@ export function registerNurturingTools(server, client) {
|
|
|
66
66
|
}));
|
|
67
67
|
// ───── CRUD ─────
|
|
68
68
|
server.tool("nurturing_flows_list", "List all nurturing/hydration flows for this ecommerce. Each flow shows lead_stage, hours_trigger, action and activation guardrails.", {}, async () => text(await client.get("/hydration/")));
|
|
69
|
-
server.tool("nurturing_flow_create", `Create a nurturing flow. Required: name, lead_stage (the CRM status to watch), hours_trigger (hours since last_message), action.
|
|
70
|
-
|
|
71
|
-
action MUST be one of:
|
|
72
|
-
- {"send_message": "texto"} — only when hours_trigger < 24 (WhatsApp 24h window)
|
|
73
|
-
- {"send_template": "template_name"} — preferred for >= 24h (HSM)
|
|
74
|
-
- {"run_agent": {"channel":"whatsapp","extra_context":"..."}} — hand off to the AI agent
|
|
75
|
-
|
|
69
|
+
server.tool("nurturing_flow_create", `Create a nurturing flow. Required: name, lead_stage (the CRM status to watch), hours_trigger (hours since last_message), action.
|
|
70
|
+
|
|
71
|
+
action MUST be one of:
|
|
72
|
+
- {"send_message": "texto"} — only when hours_trigger < 24 (WhatsApp 24h window)
|
|
73
|
+
- {"send_template": "template_name"} — preferred for >= 24h (HSM)
|
|
74
|
+
- {"run_agent": {"channel":"whatsapp","extra_context":"..."}} — hand off to the AI agent
|
|
75
|
+
|
|
76
76
|
Use max_activations + max_activations_window_days to avoid spamming the same lead.`, {
|
|
77
77
|
name: z.string().describe("Friendly name for the flow."),
|
|
78
78
|
lead_stage: z.string().describe("CRM status the flow watches (cold, warm, hot, sold, custom...)."),
|
package/dist/tools/webhooks.js
CHANGED
|
@@ -53,8 +53,8 @@ export function registerWebhooksTools(server, client) {
|
|
|
53
53
|
// ───── CRUD ─────
|
|
54
54
|
server.tool("webhooks_list", "List all webhook endpoints configured for this ecommerce. Returns id, name, event_type, flow_id (if linked), is_active, api_key_preview (last 4 chars only — full key is shown only on create/rotate).", {}, async () => text(await client.get("/webhooks/")));
|
|
55
55
|
server.tool("webhooks_get", "Get full configuration of a single webhook endpoint by id (does NOT return the api_key — use rotate to get a fresh one).", { webhook_id: z.number().int().describe("Webhook endpoint id.") }, async ({ webhook_id }) => text(await client.get(`/webhooks/${webhook_id}`)));
|
|
56
|
-
server.tool("webhooks_create", `Create a new webhook endpoint. Returns the FULL api_key (mk_wh_...) — it's only shown once, save it to the external system that will call this webhook.
|
|
57
|
-
|
|
56
|
+
server.tool("webhooks_create", `Create a new webhook endpoint. Returns the FULL api_key (mk_wh_...) — it's only shown once, save it to the external system that will call this webhook.
|
|
57
|
+
|
|
58
58
|
event_type must be one of: ${EVENT_TYPES.join(", ")}. Use webhooks_get_catalog for the available_fields per event.`, {
|
|
59
59
|
name: z.string().describe("Friendly name (e.g. 'Form contacto desde landing')."),
|
|
60
60
|
event_type: z.enum(EVENT_TYPES).describe("Event type — see webhooks_get_catalog for behavior + fields."),
|
package/package.json
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
3
|
-
import { join, resolve } from 'path';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
import { dirname } from 'path';
|
|
6
|
-
|
|
7
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
|
|
9
|
-
const AVAILABLE_SKILLS = {
|
|
10
|
-
'prompt-creation': {
|
|
11
|
-
file: join(__dirname, '..', 'skills', 'prompt-creation.md'),
|
|
12
|
-
description: 'Experto en crear prompts de agentes de ventas para WhatsApp e Instagram',
|
|
13
|
-
},
|
|
14
|
-
'flows-creation': {
|
|
15
|
-
file: join(__dirname, '..', 'skills', 'flows-creation.md'),
|
|
16
|
-
description: 'Experto en diseñar flows de automatización (post-venta, pautas, notificaciones, chatbots)',
|
|
17
|
-
},
|
|
18
|
-
'nurturing-creation': {
|
|
19
|
-
file: join(__dirname, '..', 'skills', 'nurturing-creation.md'),
|
|
20
|
-
description: 'Experto en hidratación de leads (secuencias multi-touch por stage del CRM)',
|
|
21
|
-
},
|
|
22
|
-
'templates-creation': {
|
|
23
|
-
file: join(__dirname, '..', 'skills', 'templates-creation.md'),
|
|
24
|
-
description: 'Experto en plantillas WhatsApp (HSM) avanzadas con headers media y botones',
|
|
25
|
-
},
|
|
26
|
-
'forms-creation': {
|
|
27
|
-
file: join(__dirname, '..', 'skills', 'forms-creation.md'),
|
|
28
|
-
description: 'Experto en forms dinámicos (mergeon.dev/form/{code}), tracking codes y atribución a video',
|
|
29
|
-
},
|
|
30
|
-
'social-tracking': {
|
|
31
|
-
file: join(__dirname, '..', 'skills', 'social-tracking.md'),
|
|
32
|
-
description: 'Experto en tracking de reels/posts de Instagram: funnel por video y flows ig_comment segmentados',
|
|
33
|
-
},
|
|
34
|
-
'webhooks-usage': {
|
|
35
|
-
file: join(__dirname, '..', 'skills', 'webhooks-usage.md'),
|
|
36
|
-
description: 'Experto en webhooks entrantes: integrar forms, pasarelas y CRMs externos',
|
|
37
|
-
},
|
|
38
|
-
'sales-analysis': {
|
|
39
|
-
file: join(__dirname, '..', 'skills', 'sales-analysis.md'),
|
|
40
|
-
description: 'Analista de ventas: revenue, comparativas, top productos, atribución a pauta',
|
|
41
|
-
},
|
|
42
|
-
'meta-events-debug': {
|
|
43
|
-
file: join(__dirname, '..', 'skills', 'meta-events-debug.md'),
|
|
44
|
-
description: 'Auditoría end-to-end de eventos a Meta CAPI y backfill de pendientes',
|
|
45
|
-
},
|
|
46
|
-
'reviews-usage': {
|
|
47
|
-
file: join(__dirname, '..', 'skills', 'reviews-usage.md'),
|
|
48
|
-
description: 'Subir reseñas/testimonios reales con foto vía media_upload + reviews_create',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const args = process.argv.slice(2);
|
|
53
|
-
const command = args[0];
|
|
54
|
-
const skillName = args[1];
|
|
55
|
-
|
|
56
|
-
function getClaudeMdPath() {
|
|
57
|
-
return resolve(process.cwd(), 'CLAUDE.md');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function ensureClaudeMd(path) {
|
|
61
|
-
if (!existsSync(path)) {
|
|
62
|
-
writeFileSync(path, '# CLAUDE.md\n\n', 'utf8');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function skillAlreadyInstalled(content, marker) {
|
|
67
|
-
return content.includes(marker);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Instala un skill en CLAUDE.md. Devuelve 'installed' | 'already' | 'unknown'.
|
|
71
|
-
function installSkill(name, claudeMdPath) {
|
|
72
|
-
const skill = AVAILABLE_SKILLS[name];
|
|
73
|
-
if (!skill) return 'unknown';
|
|
74
|
-
|
|
75
|
-
const marker = `<!-- mergeon-skill:${name} -->`;
|
|
76
|
-
const current = readFileSync(claudeMdPath, 'utf8');
|
|
77
|
-
|
|
78
|
-
if (skillAlreadyInstalled(current, marker)) return 'already';
|
|
79
|
-
|
|
80
|
-
const skillContent = readFileSync(skill.file, 'utf8');
|
|
81
|
-
const toAppend = `\n\n${marker}\n${skillContent}\n${marker}:end\n`;
|
|
82
|
-
writeFileSync(claudeMdPath, current + toAppend, 'utf8');
|
|
83
|
-
return 'installed';
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (command === 'add') {
|
|
87
|
-
const claudeMdPath = getClaudeMdPath();
|
|
88
|
-
ensureClaudeMd(claudeMdPath);
|
|
89
|
-
|
|
90
|
-
// `add all` → instala todos los skills disponibles de una vez.
|
|
91
|
-
if (skillName === 'all' || skillName === '*') {
|
|
92
|
-
let installed = 0;
|
|
93
|
-
let already = 0;
|
|
94
|
-
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
95
|
-
const result = installSkill(name, claudeMdPath);
|
|
96
|
-
if (result === 'installed') {
|
|
97
|
-
installed++;
|
|
98
|
-
console.log(`✅ ${name} — ${info.description}`);
|
|
99
|
-
} else if (result === 'already') {
|
|
100
|
-
already++;
|
|
101
|
-
console.log(`↷ ${name} (ya estaba instalado)`);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
console.log(`\n${installed} skill(s) instalado(s), ${already} ya presente(s). Total: ${Object.keys(AVAILABLE_SKILLS).length}.`);
|
|
105
|
-
process.exit(0);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (!skillName || !AVAILABLE_SKILLS[skillName]) {
|
|
109
|
-
console.error(`❌ Skill desconocido: "${skillName}"`);
|
|
110
|
-
console.log('\nSkills disponibles:');
|
|
111
|
-
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
112
|
-
console.log(` ${name} — ${info.description}`);
|
|
113
|
-
});
|
|
114
|
-
console.log('\nInstalar todos: npx mergeon-mcp skills add all');
|
|
115
|
-
process.exit(1);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const result = installSkill(skillName, claudeMdPath);
|
|
119
|
-
if (result === 'already') {
|
|
120
|
-
console.log(`✅ El skill "${skillName}" ya está instalado en CLAUDE.md`);
|
|
121
|
-
process.exit(0);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
console.log(`✅ Skill "${skillName}" instalado en CLAUDE.md`);
|
|
125
|
-
console.log(` ${AVAILABLE_SKILLS[skillName].description}`);
|
|
126
|
-
|
|
127
|
-
} else if (command === 'list') {
|
|
128
|
-
console.log('\nSkills disponibles de mergeon-mcp:\n');
|
|
129
|
-
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
130
|
-
console.log(` 📦 ${name}`);
|
|
131
|
-
console.log(` ${info.description}\n`);
|
|
132
|
-
});
|
|
133
|
-
console.log('Instalar uno: npx mergeon-mcp skills add <nombre-del-skill>');
|
|
134
|
-
console.log('Instalar todos: npx mergeon-mcp skills add all\n');
|
|
135
|
-
|
|
136
|
-
} else {
|
|
137
|
-
console.log(`
|
|
138
|
-
mergeon-mcp skills
|
|
139
|
-
|
|
140
|
-
Comandos:
|
|
141
|
-
add <skill> Instala un skill en tu CLAUDE.md
|
|
142
|
-
add all Instala TODOS los skills disponibles de una vez
|
|
143
|
-
list Lista todos los skills disponibles
|
|
144
|
-
|
|
145
|
-
Ejemplo:
|
|
146
|
-
npx mergeon-mcp skills add prompt-creation
|
|
147
|
-
npx mergeon-mcp skills add all
|
|
148
|
-
`);
|
|
149
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
3
|
+
import { join, resolve } from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname } from 'path';
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
9
|
+
const AVAILABLE_SKILLS = {
|
|
10
|
+
'prompt-creation': {
|
|
11
|
+
file: join(__dirname, '..', 'skills', 'prompt-creation.md'),
|
|
12
|
+
description: 'Experto en crear prompts de agentes de ventas para WhatsApp e Instagram',
|
|
13
|
+
},
|
|
14
|
+
'flows-creation': {
|
|
15
|
+
file: join(__dirname, '..', 'skills', 'flows-creation.md'),
|
|
16
|
+
description: 'Experto en diseñar flows de automatización (post-venta, pautas, notificaciones, chatbots)',
|
|
17
|
+
},
|
|
18
|
+
'nurturing-creation': {
|
|
19
|
+
file: join(__dirname, '..', 'skills', 'nurturing-creation.md'),
|
|
20
|
+
description: 'Experto en hidratación de leads (secuencias multi-touch por stage del CRM)',
|
|
21
|
+
},
|
|
22
|
+
'templates-creation': {
|
|
23
|
+
file: join(__dirname, '..', 'skills', 'templates-creation.md'),
|
|
24
|
+
description: 'Experto en plantillas WhatsApp (HSM) avanzadas con headers media y botones',
|
|
25
|
+
},
|
|
26
|
+
'forms-creation': {
|
|
27
|
+
file: join(__dirname, '..', 'skills', 'forms-creation.md'),
|
|
28
|
+
description: 'Experto en forms dinámicos (mergeon.dev/form/{code}), tracking codes y atribución a video',
|
|
29
|
+
},
|
|
30
|
+
'social-tracking': {
|
|
31
|
+
file: join(__dirname, '..', 'skills', 'social-tracking.md'),
|
|
32
|
+
description: 'Experto en tracking de reels/posts de Instagram: funnel por video y flows ig_comment segmentados',
|
|
33
|
+
},
|
|
34
|
+
'webhooks-usage': {
|
|
35
|
+
file: join(__dirname, '..', 'skills', 'webhooks-usage.md'),
|
|
36
|
+
description: 'Experto en webhooks entrantes: integrar forms, pasarelas y CRMs externos',
|
|
37
|
+
},
|
|
38
|
+
'sales-analysis': {
|
|
39
|
+
file: join(__dirname, '..', 'skills', 'sales-analysis.md'),
|
|
40
|
+
description: 'Analista de ventas: revenue, comparativas, top productos, atribución a pauta',
|
|
41
|
+
},
|
|
42
|
+
'meta-events-debug': {
|
|
43
|
+
file: join(__dirname, '..', 'skills', 'meta-events-debug.md'),
|
|
44
|
+
description: 'Auditoría end-to-end de eventos a Meta CAPI y backfill de pendientes',
|
|
45
|
+
},
|
|
46
|
+
'reviews-usage': {
|
|
47
|
+
file: join(__dirname, '..', 'skills', 'reviews-usage.md'),
|
|
48
|
+
description: 'Subir reseñas/testimonios reales con foto vía media_upload + reviews_create',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const args = process.argv.slice(2);
|
|
53
|
+
const command = args[0];
|
|
54
|
+
const skillName = args[1];
|
|
55
|
+
|
|
56
|
+
function getClaudeMdPath() {
|
|
57
|
+
return resolve(process.cwd(), 'CLAUDE.md');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function ensureClaudeMd(path) {
|
|
61
|
+
if (!existsSync(path)) {
|
|
62
|
+
writeFileSync(path, '# CLAUDE.md\n\n', 'utf8');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function skillAlreadyInstalled(content, marker) {
|
|
67
|
+
return content.includes(marker);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Instala un skill en CLAUDE.md. Devuelve 'installed' | 'already' | 'unknown'.
|
|
71
|
+
function installSkill(name, claudeMdPath) {
|
|
72
|
+
const skill = AVAILABLE_SKILLS[name];
|
|
73
|
+
if (!skill) return 'unknown';
|
|
74
|
+
|
|
75
|
+
const marker = `<!-- mergeon-skill:${name} -->`;
|
|
76
|
+
const current = readFileSync(claudeMdPath, 'utf8');
|
|
77
|
+
|
|
78
|
+
if (skillAlreadyInstalled(current, marker)) return 'already';
|
|
79
|
+
|
|
80
|
+
const skillContent = readFileSync(skill.file, 'utf8');
|
|
81
|
+
const toAppend = `\n\n${marker}\n${skillContent}\n${marker}:end\n`;
|
|
82
|
+
writeFileSync(claudeMdPath, current + toAppend, 'utf8');
|
|
83
|
+
return 'installed';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (command === 'add') {
|
|
87
|
+
const claudeMdPath = getClaudeMdPath();
|
|
88
|
+
ensureClaudeMd(claudeMdPath);
|
|
89
|
+
|
|
90
|
+
// `add all` → instala todos los skills disponibles de una vez.
|
|
91
|
+
if (skillName === 'all' || skillName === '*') {
|
|
92
|
+
let installed = 0;
|
|
93
|
+
let already = 0;
|
|
94
|
+
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
95
|
+
const result = installSkill(name, claudeMdPath);
|
|
96
|
+
if (result === 'installed') {
|
|
97
|
+
installed++;
|
|
98
|
+
console.log(`✅ ${name} — ${info.description}`);
|
|
99
|
+
} else if (result === 'already') {
|
|
100
|
+
already++;
|
|
101
|
+
console.log(`↷ ${name} (ya estaba instalado)`);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
console.log(`\n${installed} skill(s) instalado(s), ${already} ya presente(s). Total: ${Object.keys(AVAILABLE_SKILLS).length}.`);
|
|
105
|
+
process.exit(0);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!skillName || !AVAILABLE_SKILLS[skillName]) {
|
|
109
|
+
console.error(`❌ Skill desconocido: "${skillName}"`);
|
|
110
|
+
console.log('\nSkills disponibles:');
|
|
111
|
+
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
112
|
+
console.log(` ${name} — ${info.description}`);
|
|
113
|
+
});
|
|
114
|
+
console.log('\nInstalar todos: npx mergeon-mcp skills add all');
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const result = installSkill(skillName, claudeMdPath);
|
|
119
|
+
if (result === 'already') {
|
|
120
|
+
console.log(`✅ El skill "${skillName}" ya está instalado en CLAUDE.md`);
|
|
121
|
+
process.exit(0);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
console.log(`✅ Skill "${skillName}" instalado en CLAUDE.md`);
|
|
125
|
+
console.log(` ${AVAILABLE_SKILLS[skillName].description}`);
|
|
126
|
+
|
|
127
|
+
} else if (command === 'list') {
|
|
128
|
+
console.log('\nSkills disponibles de mergeon-mcp:\n');
|
|
129
|
+
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
130
|
+
console.log(` 📦 ${name}`);
|
|
131
|
+
console.log(` ${info.description}\n`);
|
|
132
|
+
});
|
|
133
|
+
console.log('Instalar uno: npx mergeon-mcp skills add <nombre-del-skill>');
|
|
134
|
+
console.log('Instalar todos: npx mergeon-mcp skills add all\n');
|
|
135
|
+
|
|
136
|
+
} else {
|
|
137
|
+
console.log(`
|
|
138
|
+
mergeon-mcp skills
|
|
139
|
+
|
|
140
|
+
Comandos:
|
|
141
|
+
add <skill> Instala un skill en tu CLAUDE.md
|
|
142
|
+
add all Instala TODOS los skills disponibles de una vez
|
|
143
|
+
list Lista todos los skills disponibles
|
|
144
|
+
|
|
145
|
+
Ejemplo:
|
|
146
|
+
npx mergeon-mcp skills add prompt-creation
|
|
147
|
+
npx mergeon-mcp skills add all
|
|
148
|
+
`);
|
|
149
|
+
}
|
package/skills/flows-creation.md
CHANGED
|
@@ -99,6 +99,13 @@ Las condiciones son opcionales. Si no hay condiciones, el flow se activa para TO
|
|
|
99
99
|
|
|
100
100
|
{ "button_payload": ["quiero_comprar", "ver_precios"] }
|
|
101
101
|
// Cualquiera de esos botones
|
|
102
|
+
|
|
103
|
+
{ "follows_me": true }
|
|
104
|
+
// Solo si la persona SIGUE la cuenta de Instagram. `false` para el caso contrario.
|
|
105
|
+
// ⚠️ Solo Instagram, y solo acá: Meta únicamente deja consultarlo de alguien que YA
|
|
106
|
+
// escribió al negocio, así que NO funciona en el trigger ig_comment.
|
|
107
|
+
// Se combina en AND con las demás condiciones. Si no se puede averiguar (no ha
|
|
108
|
+
// escrito, bloqueó la cuenta, o es WhatsApp) la condición NO se cumple.
|
|
102
109
|
```
|
|
103
110
|
|
|
104
111
|
### Para `sold` (post-venta):
|
|
@@ -990,6 +997,28 @@ Si la URL no es permanente, pedirle que la suba a su CDN, Google Drive (con link
|
|
|
990
997
|
|
|
991
998
|
## Combinaciones poderosas
|
|
992
999
|
|
|
1000
|
+
**Comentario → DM → pedir seguimiento → entregar (convierte comentaristas en seguidores):**
|
|
1001
|
+
|
|
1002
|
+
Instagram NO tiene webhook de "empezó a seguirme" — el disparador que usan otras
|
|
1003
|
+
herramientas es una beta privada de Meta, no la API pública. Lo que sí se puede es
|
|
1004
|
+
exigir el seguimiento para entregar algo, que comercialmente rinde más porque gana
|
|
1005
|
+
seguidores en vez de solo saludar a los que ya lo son.
|
|
1006
|
+
|
|
1007
|
+
```
|
|
1008
|
+
ig_comment (media_ids: ["<id del reel>"])
|
|
1009
|
+
→ respond_comment "Te escribí al DM"
|
|
1010
|
+
→ send_message "¿Te paso el enlace?" ← la respuesta da el consentimiento
|
|
1011
|
+
|
|
1012
|
+
default_message (similar_text: "si, dale, quiero" + follows_me: true)
|
|
1013
|
+
→ send_message "Listo, acá lo tienes: <link>"
|
|
1014
|
+
|
|
1015
|
+
default_message (similar_text: "si, dale, quiero" + follows_me: false)
|
|
1016
|
+
→ send_message "Sígueme y te lo mando 👇"
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
Son dos flows con el mismo texto y `follows_me` invertido. El orden importa poco:
|
|
1020
|
+
las condiciones van en AND y solo uno matchea.
|
|
1021
|
+
|
|
993
1022
|
**Pauta → Info automática → Agente cierra venta:**
|
|
994
1023
|
```
|
|
995
1024
|
default_message (equal_text: "texto pauta")
|