Guardian verify setup

From vargasjr-dev/mycadet-temp · View interactive version

Guardian verify setup is an AI agent skill from the GitHub repository vargasjr-dev/mycadet-temp. Set up channel verification for phone, Telegram, Slack, Discord, or email channels via outbound verification flow

How to use this skill

Skill file

You are helping your user set up channel verification for a messaging channel (phone, Telegram, Slack, Discord, or email). This links their identity for verified message delivery on the chosen channel. Use the assistant channel-verification-sessions CLI for all verification operations.

When to Use

Load this skill when:

Do not load this skill for:

Prerequisites

Step 1: Confirm Channel

Ask the user which channel they want to verify:

Skip the prompt and proceed directly with the named channel when:

⚠️ CRITICAL — point of action: Do not re-prompt for channel when it is already determined. Re-prompting after a parent skill has just configured a channel makes the user feel like the assistant forgot the previous five minutes of setup.

Step 2: Collect Destination

Based on the chosen channel, ask for the required destination:

1. Auto-lookup (preferred): Ask the user for their Slack display name or @handle, then look up their member ID using the Slack API.

Set USER_QUERY to whatever the user gave you (display name, @handle, or full name — the search matches against all of them). For example, if the user says "find me, I'm @alice", set USER_QUERY="alice". If they say "Alice Example", set USER_QUERY="Alice Example". Do not leave USER_QUERY as a literal <...> placeholder string.

```bash

USER_QUERY="alice" # ← replace with the actual value the user provided

USER_QUERY="${USER_QUERY#@}" # strip leading @ — Slack .name fields have no @ prefix

# Search for matching users (paginate through all workspace members).

# The request door sends the bot token from inside the assistant; never

# reveal it into a variable or a curl line, where it would land in the

# transcript and the tool log. The door exits non-zero when the bot is

# not configured, when the call is refused, and when Slack answers with

# ok:false, so one branch covers every failure.

CURSOR=""

MATCHES="[]"

while true; do

RESPONSE=$(assistant channels request slack "/users.list?limit=200${CURSOR:+&cursor=$CURSOR}") || {

echo "ERROR: the Slack lookup failed; fall back to manual entry"

exit 1

}

PAGE_MATCHES=$(echo "$RESPONSE" | jq --arg q "$USER_QUERY" '[.members[] | select(.deleted == false) | select(.profile.display_name == $q or .name == $q or .profile.display_name_normalized == $q or .real_name == $q) | {id: .id, name: .name, display_name: .profile.display_name, real_name: .real_name}]')

MATCHES=$(echo "$MATCHES $PAGE_MATCHES" | jq -s 'add')

CURSOR=$(echo "$RESPONSE" | jq -r '.response_metadata.next_cursor // empty')

[ -z "$CURSOR" ] && break

done

echo "$MATCHES" | jq '.[]'

```

⚠️ CRITICAL — point of action: Substitute USER_QUERY with the actual user-provided value before running the bash block. A literal USER_QUERY="<query>" or USER_QUERY="<name>" matches nothing and burns a users.list cycle.

Result handling:

2. Fallback to manual entry if any of the following occur:

For manual entry: ask for their Slack user ID. Explain that this is their Slack member ID (e.g. U01ABCDEF), not their display name or email. They can find it in their Slack profile under "More" > "Copy member ID".

The bot will send a verification code via Slack DM once the member ID is resolved.

The bot DMs the code to that user. Discord only permits that DM when the bot and the user share a server, so complete the invite step of discord-app-setup first, and note that a user who has turned off direct messages from server members cannot receive it.

Step 3: Start Outbound Verification

Execute the outbound start request:

assistant channel-verification-sessions create --channel <channel> --destination "<destination>" --json

Replace <channel> with phone, telegram, slack, discord, or email, and <destination> with the phone number, Telegram destination, Slack user ID, Discord user ID, or email address.

On success (`success: true`)

Report the exact next action based on the channel:

After reporting the bootstrap URL for Telegram handle flows, wait for the user to confirm they clicked the link. Then check verification status (Step 6) to see if the bootstrap completed and a code was sent.

On error (`success: false`)

Handle each error code:

| Error code | Action |

| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| missing_destination | Ask the user to provide their phone number, Telegram destination, Slack user ID, or Discord user ID. |

| invalid_destination | Tell the user the format is invalid. For phone: suggest E.164 format (+15551234567). For Telegram: explain that group chat IDs (negative numbers) are not supported. For Slack: explain that the value must be a Slack member ID (e.g. U01ABCDEF). For Discord: explain that the value must be a numeric user snowflake, not a username. For email: suggest a valid email address. |

| already_bound | Tell the user a verified identity is already bound for this channel, and ask whether they want to verify that same identity again or replace it. Same identity, or a new phone number: re-run create with --rebind. A different identity on any other channel: revoke the current one first (Step 7), confirm bound: false, then run create again without --rebind. |

| rate_limited | Tell the user they have sent too many verification attempts to this destination. Ask them to wait and try again later. |

| unsupported_channel | Tell the user the channel is not supported. Valid channels are phone, telegram, slack, discord, and email. |

| no_bot_username | Telegram bot is not configured. Load and run the telegram-setup skill first. |

Step 4: Handle Resend

If the user says they did not receive the code or asks to resend:

assistant channel-verification-sessions resend --channel <channel> --json

On success, report the next action based on the channel:

Resend errors

Handle each error code from the resend endpoint:

| Error code | Action |

| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| rate_limited | Tell the user to wait before trying again (the cooldown is 15 seconds between resends). |

| max_sends_exceeded | Tell the user they have reached the maximum number of resends for this session (5 sends per session). Suggest canceling the current session (Step 5) and starting a new verification from Step 3. |

| no_destination | This should not normally occur during resend. Tell the user to cancel (Step 5) and restart verification from scratch at Step 3. |

| pending_bootstrap | Remind the user to click the Telegram deep-link first before a code can be sent. |

| no_active_session | No session is active. Start a new one from Step 3. |

Step 5: Handle Cancel

If the user wants to cancel the verification:

assistant channel-verification-sessions cancel --channel <channel> --json

Confirm cancellation to the user. On no_active_session, tell them there is nothing to cancel.

Auto-Check Polling

After delivering the code (in Step 3 or Step 4), do NOT wait for the user to report back. Poll for completion so they get confirmation without having to ask "did it work?"

Applies to phone, Slack, Discord, and email. Never Telegram -- Telegram confirms through its own bot-driven flow, so polling it reports nothing useful.

Each channel differs only in timing and in the sentence you send on success:

| Channel | Poll every | Give up after | Success message |

| ------- | ---------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------- |

| phone | 15s | 2 minutes (~8 polls) | "Voice verification complete! Your phone number is now verified." |

| slack | 15s | 2 minutes (~8 polls) | "Slack verification complete! Your Slack account is now verified. The DM channel has been captured for future message delivery." |

| discord | 15s | 2 minutes (~8 polls) | "Discord verification complete! Your Discord account is now verified." |

| email | 20s | 3 minutes (~9 polls) | "Email verification complete! Your email address is now verified." |

Email is slower than chat, which is why it waits longer before giving up.

Polling procedure:

  1. Wait one interval after delivering the code, to give the user time to receive it and reply.
  2. Check the binding status. Each bash invocation starts fresh, so set CHANNEL in the same block as the command:
CHANNEL=""  # ← MUST set to one of: phone, slack, discord, email
if [ -z "$CHANNEL" ]; then echo "ERROR: CHANNEL not set"; exit 1; fi
assistant channel-verification-sessions status --channel "$CHANNEL" --json
  1. If the response shows bound: true (subject to the rebind guard below): immediately send that channel's success message in the current chat and stop polling.
  2. If not yet bound: wait one more interval and poll again.
  3. Stop at the channel's timeout.
  4. On timeout, proactively tell the user: "I've been checking for a couple of minutes but verification hasn't completed yet. The code may have expired or wasn't entered. Would you like me to resend a new code (Step 4) or start a new session (Step 3)?"

A timeout is also how a silent delivery failure surfaces. Code delivery is fire-and-forget, so a Discord user with DMs closed, or a Slack DM that could not be opened, produces a clean create response and then no arrival. Offer resend rather than asserting the code was received.

Rebind guard:

This applies only when the session was created with --rebind: the identity already linked on the channel verifying again, or a new phone number replacing the linked one. The existing link reports bound: true the whole time, so bound: true alone would report success before the user has entered the new code. For a rebind session:

Important polling rules:

Step 6: Check Verification Status

After the user reports entering the code, verify the binding was created. Set CHANNEL to the channel currently being verified before running:

CHANNEL=""  # ← MUST set to one of: phone, telegram, slack, discord, email
if [ -z "$CHANNEL" ]; then echo "ERROR: CHANNEL not set"; exit 1; fi
assistant channel-verification-sessions status --channel "$CHANNEL" --json

⚠️ CRITICAL — point of action: CHANNEL must be set to the channel currently being verified (phone, telegram, slack, discord, or email) before running. The empty-string guard ensures a missed substitution fails safely rather than operating on the wrong channel.

If the response shows the channel is bound, confirm success: "Verification complete! Your [channel] identity is now verified."

If not yet bound, offer to resend (Step 4) or generate a new session (Step 3).

Step 7: Revoke Verification

If the user wants to remove themselves (or the current verified identity) from a channel, use the revoke endpoint. Set CHANNEL to the channel to unbind from before running:

CHANNEL=""  # ← MUST set to one of: phone, telegram, slack, discord, email
if [ -z "$CHANNEL" ]; then echo "ERROR: CHANNEL not set"; exit 1; fi
assistant channel-verification-sessions revoke --channel "$CHANNEL" --json

⚠️ CRITICAL — point of action: CHANNEL must be set to the channel to unbind (phone, telegram, slack, discord, or email) before running. The empty-string guard ensures a missed substitution fails safely rather than accidentally revoking the wrong channel.

On success (`success: true`)

The response includes bound: false after the operation completes. Check the previous binding state to tailor the message:

Important Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.