{"id":42349,"plugin_id":"plugin_asdk_app_6a3317442fc8819193f6cb06ef619a67","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-10-24T13:04:29.380Z","digest":"4ad30c9d8bbf9c6a9f2d12918e084da5e6f4bf7aedb3fce88dcdc306cc24d8aa","against":null,"payload":{"description":"Wire or repair the automation around a Ninjo agent, which is where most agents fall short. Use when the operator wants the agent to stop after a purchase or booking, to follow up leads that went quiet, to get notified when someone converts, to push a lead into a CRM or webhook, or asks \"cómo hago que deje de escribirle a los que ya compraron\", \"quiero que haga seguimiento a los 2 días\", \"avisame por WhatsApp cuando alguien agende\", \"la propiedad se setea pero no pasa nada\". Also the mandatory activation kit for a newly created agent.","included_files":[],"name":"wire-automation","skill_md_contents":"---\nname: wire-automation\ndescription: Wire or repair the automation around a Ninjo agent, which is where most agents fall short. Use when the operator wants the agent to stop after a purchase or booking, to follow up leads that went quiet, to get notified when someone converts, to push a lead into a CRM or webhook, or asks \"cómo hago que deje de escribirle a los que ya compraron\", \"quiero que haga seguimiento a los 2 días\", \"avisame por WhatsApp cuando alguien agende\", \"la propiedad se setea pero no pasa nada\". Also the mandatory activation kit for a newly created agent.\n---\n\n# Wire the automation around an agent\n\nThe prompt controls only what the agent **says**. Stopping after a conversion, following up a\nstalled lead, alerting the operator, updating a CRM: all of that is a **custom property** that\nan evaluator fills from the transcript, consumed by a **contact limit**, a **workflow** or a\n**notification**. A property does nothing until something consumes it. Reply in the\noperator's language.\n\n## 0. Read the wiring before touching it\n\n- `diagnose_agent` (mode `quick`) lists what exists and what is missing, with the fix tool\n  for each finding. Run it first and again at the end.\n- `list_custom_properties`, `list_contact_limits`, `list_workflows`,\n  `list_custom_notifications`, `list_property_actions` show the current state. Read them\n  before writing; several writes are **replace, not merge**, and a partial update can null the\n  conditions and leave a rule firing on everyone or on no one.\n- Docs: `get_playbook_doc` on `knowledge/custom-properties`, `knowledge/workflows`,\n  `knowledge/follow-up-architecture`, `knowledge/property-actions`.\n\n## 1. New agent: the activation kit in one call\n\n`scaffold_agent_activation(agent_id, ...)` creates the terminal conversion property, the\ncontact limit gated on it, the follow-up for non-converters and the operator notification.\nIt is idempotent. The one thing it cannot guess is the client's conversion fact (booked a\ncall, paid, left a phone number): ask, then pass it explicitly. Loop: `diagnose_agent`,\nscaffold, `diagnose_agent` again until `complete: true`.\n\n## 2. The rules every property must satisfy\n\n- **Boolean or number, never string**, for anything that gates automation. Text values\n  compare unreliably in conditions.\n- **`check_until_match` true with the terminal value** on any property that gates a shutdown,\n  a follow-up lock or a conversion notification. Otherwise an early `false` freezes forever\n  and the later signal never flips it. `upsert_custom_property` defaults a boolean to gated;\n  pass `checkUntilMatch: false` explicitly only for a descriptive boolean, on every write.\n- **Never ask a property for a fact the platform already stores** (booking link sent, call\n  booked through an integration, phone number). Use the native field.\n- A terminal conversion such as \"call booked\" should come from the booking integration, not\n  from the transcript, whenever the integration is connected.\n- Read the `warning` field in the `upsert_custom_property` response. It says when the tool\n  healed an ungated boolean or when the property still cannot drive automation as written.\n\n## 3. Contact limits: the stop switch\n\n- `upsert_contact_limit` gated on the terminal property. When it fires it sets the agent\n  inactive **for that contact, permanently**; nothing brings it back. Correct after a purchase\n  or booking, wrong after \"not right now\".\n- \"The agent never stops messaging converted leads\" is usually a frozen property (rule above)\n  or a limit gated on a string. Compare the property's values against the transcripts.\n\n## 4. Follow-ups: workflows of type FOLLOW_UP\n\n- `upsert_workflow` with the stage delay and the property conditions that select the lead.\n  Gate on data: a lead who booked or bought must be excluded by the terminal property.\n- **Meta's 24h window.** On Instagram and Messenger a follow-up can only go out inside 24h\n  of the lead's last message; a lead who only commented cannot be followed up at all. On\n  WhatsApp, past 24h only an approved template can reach them (`send_whatsapp_template`).\n- Multi-stage sequences: each stage needs its own \"already sent\" guard or the second stage\n  fires as soon as the first one has. `templates/follow-up-sequence` is the copy-paste\n  skeleton; `knowledge/follow-up-architecture` is the doctrine.\n- `get_workflow_activity` shows whether a workflow evaluated, sent, or failed and why.\n\n## 5. Notifications and side effects\n\n- `upsert_custom_notification` gated on the conversion property, to a destination from\n  `list_notification_destinations` (`upsert_notification_destination` to add one). A\n  notification on a property that nothing fills never arrives.\n- A `CUSTOM_NOTIFICATION` only evaluates conversations with an inbound in the last 24h, so it\n  cannot re-contact a lead days later. Multi-day re-contact on WhatsApp is a template batch.\n- `upsert_property_action` fires a webhook or CRM field update when a property reaches a\n  value. For CRM field updates the value source is `trigger_value` or `static`.\n\n## 6. Verify, then say what will happen\n\nAfter writing, read every row back and state the chain in plain words: \"cuando el evaluador\nmarque `call_booked = true`, el límite de contacto apaga al agente para ese lead y te llega la\nnotificación a Telegram\". If a link in that chain is missing, the operator will find out from\na lead who got messaged after paying; find it now with `diagnose_agent`.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}