{
 "schema": "aiblocks-page/1",
 "id": "how-messages-reach-your-agent-implementation-planner",
 "type": "skill",
 "name": "Slack agent message router builder",
 "summary": "Plan how Slack messages reach the right AI agent, with scope checks, user permissions, bot-loop blocking and logged refusals. Draft code only.",
 "headline": "Slack agent message router builder",
 "subhead": "Give it your Slack channel map, who may use which agent, your agent list and a few sample messages. It plans how each message is checked, matched to one agent and queued as a job. You get the routing steps, the refusal paths, the job fields and a test list. Nothing is run.",
 "job": {
  "id": "build-software",
  "name": "Build and ship software"
 },
 "level": "intermediate",
 "thinking": "medium",
 "tested": true,
 "updated": "2026-11-03",
 "first_published": "2026-10-25",
 "inputs": [
  {
   "type": "question",
   "required": true,
   "label": "Question",
   "what": "the problem, decision or piece of work you want help with, and what a good outcome looks like"
  },
  {
   "type": "codebase",
   "required": false,
   "label": "Codebase",
   "what": "a project's code, in a folder or repo the AI can open"
  },
  {
   "type": "code_change",
   "required": false,
   "label": "Code change",
   "what": "a change to the code, with what it fixes and how it was checked"
  }
 ],
 "outputs": [
  {
   "type": "plan",
   "required": true,
   "label": "Plan",
   "what": "a dated plan: what to do, in what order, with a decision rule for each step"
  },
  {
   "type": "code_change",
   "required": false,
   "label": "Code change",
   "what": "a change to the code, with what it fixes and how it was checked"
  }
 ],
 "you_give": [
  "Your channel list, with the client each channel belongs to",
  "Who may use which agent, as a short table of users or roles",
  "Your agent list, with a name, what each does and trigger words",
  "Three to five real message examples from Slack, with names removed",
  "Your project folder, or its package file and main folders (optional)"
 ],
 "you_get": [
  "The routing steps in order, with what each check does and what happens when it fails",
  "A refusal path for each failure, with what the user sees and what is logged",
  "The fields every queued job must carry",
  "A plan for the agent-matching step, with its keyword fallback",
  "A failure checklist and made-up test cases"
 ],
 "use_when": [
  "You have several AI agents in one Slack workspace and need each message to reach the right one.",
  "Your agents work for more than one client and a message must never touch the wrong client's data.",
  "Your bot has answered its own messages, or answered the same message twice.",
  "You want a refusal path written down before a user asks an agent for something they should not get."
 ],
 "skip_when": [
  "You have never built a Slack bot. Start with the Slack bot build brief writer, then come back.",
  "You have one agent and one channel. A router adds checks you won't use. A plain command handler is enough.",
  "You need the job queue itself, with retries and crash recovery. Use the Recoverable agent job queue builder.",
  "You want the agents to run all day on a server. Use the TypeScript agent worker builder, then the Render worker deployment planner."
 ],
 "output_sample": {
  "input": [
   "Your channel list, with the client each channel belongs to",
   "Who may use which agent",
   "Your agent list, with trigger words",
   "A few real message examples, with names removed"
  ],
  "prerequisites": [
   "A Slack app and a test channel",
   "A queue for jobs, such as Redis, if you plan to build it"
  ],
  "output": [
   {
    "name": "Routing steps",
    "contains": "Each check in order, what passes it and what happens when a message fails it."
   },
   {
    "name": "Denial paths",
    "contains": "What the user sees and what is logged for each refusal, such as no access."
   },
   {
    "name": "Job fields",
    "contains": "The details every queued job must hold, such as client, agent and a stable ID."
   },
   {
    "name": "Matching plan",
    "contains": "How a message is matched to one agent, and what happens when it is unclear."
   },
   {
    "name": "Failure checklist",
    "contains": "Problems such as bot loops and repeat events, each with how the plan prevents it."
   },
   {
    "name": "Test cases",
    "contains": "Made-up messages to try, such as a bot message or a user with no access."
   }
  ]
 },
 "output_shape": "BASIS\n<what was supplied, what is missing, nothing was run>\n\nROUTING STEPS\n<#> | <check> | <passes when> | <on failure>\n\nDENIAL PATHS\n<case> | <what the user sees> | <what is logged>\n\nJOB FIELDS\n<field> | <what it holds> | <why it is needed>\n\nMATCHING PLAN\n<AI step: allowed answers and fallback> | <keyword triggers per agent> | <what happens when unsure>\n\nFAILURE CHECKLIST\n<failure> | <how it is prevented>\n\nTEST CASES\n<name> | <made-up message and setup> | <expected result>\n\nNEXT STEP\n<the smallest useful step>",
 "how_to_use": [
  "Open Claude, ChatGPT or Gemini and paste the skill. Use Claude Code or Codex if you want it to read your project.",
  "Paste your channel list, your permission table and your agent list. Never paste a Slack token.",
  "Add three to five message examples. Include one from a bot and one that fits no agent.",
  "Read the ROUTING STEPS first. Check that the order matches how you want messages checked.",
  "Read the DENIAL PATHS. Make sure each message to the user is one you would be happy to show.",
  "Run the test cases in a test channel before any real client channel."
 ],
 "checks": [],
 "next": [
  {
   "name": "Logging and alerts code writer",
   "url": "https://useaiblocks.com/skills/logging-and-alerts-setter",
   "why": "Build it"
  }
 ],
 "source": null,
 "credits": [],
 "files": [
  "references/method-notes.md",
  "references/minimal-router-scaffold.ts",
  "references/visual-reference-notes.md"
 ],
 "links": {
  "page": "https://useaiblocks.com/skills/how-messages-reach-your-agent-implementation-planner",
  "markdown": "https://useaiblocks.com/skills/how-messages-reach-your-agent-implementation-planner.md",
  "json": "https://useaiblocks.com/skills/how-messages-reach-your-agent-implementation-planner.json",
  "instructions": "https://useaiblocks.com/skills/how-messages-reach-your-agent-implementation-planner/SKILL.md",
  "download": "https://useaiblocks.com/skills/how-messages-reach-your-agent-implementation-planner.zip",
  "api_item": "https://useaiblocks.com/api/v1/items/how-messages-reach-your-agent-implementation-planner",
  "api_document": "https://useaiblocks.com/api/v1/documents/skill/how-messages-reach-your-agent-implementation-planner",
  "mcp": "https://useaiblocks.com/mcp"
 }
}
