Skip to content

LeoYeAI/agent-master-skills / skills/amemo-skill/modules/amemo-send-code

amemo-send-code

Verified

当用户输入 11 位手机号时调用,向该手机号发送短信验证码,完成后等待用户回复验证码进入登录流程。

FileKindSize
SKILL.mdskill md2.3 KB
---
name: amemo-send-code
description: 当用户输入 11 位手机号时调用,向该手机号发送短信验证码,完成后等待用户回复验证码进入登录流程。
---

# amemo-send-code — 发送验证码

---

## 接口信息

| 属性 | 值 |
|:-----|:---|
| **路由** | `POST https://skill.amemo.cn/send-code` |
| **Bean** | `LoginBean`(自动获取客户端 IP) |
| **Content-Type** | `application/json` |

---

## 请求参数

> ⚠️ 服务端要求所有字段必须存在,`code` 可选但字段必须存在(传 `null`)。

| 参数 | 类型 | 必填 | 说明 |
|:-----|:----:|:----:|:-----|
| `phone` | str | ✅ | 手机号 |
| `code` | str | — | 验证码(发送时传 `null`) |

---

## 请求示例

```bash
curl -X POST https://skill.amemo.cn/send-code \
  -H "Content-Type: application/json" \
  -d '{"phone": "13800138000", "code": null}'
```

---

## 响应示例

```json
{
  "code": 200,
  "desc": "success",
  "data": "验证码已发送"
}
```

---

## 注意事项

> 📱 **无需认证**:此接口无需 userToken,可直接调用
>
> ⚠️ **字段要求**:`code` 字段必须传 `null`
>
> 🔄 **后续步骤**:调用后提示用户查看手机验证码,再调用 `amemo-login` 完成登录

---

## 执行流程(由主模块调度)

当主模块检测到用户输入手机号时,自动调用本模块。

### 输入提取规则

| 规则 | 说明 |
|:-----|:-----|
| **正则** | `1[3-9]\d{9}` |
| **自动过滤** | 空格、横线、+86 前缀 |

**用户输入示例:**

| 用户输入 | 提取结果 |
|:---------|:---------|
| `"13800138000"` | `13800138000` |
| `"我的手机号是 138-0013-8000"` | `13800138000` |
| `"+86 138 0013 8000"` | `13800138000` |

---

### 执行步骤

```
1. 使用正则 1[3-9]\d{9} 从用户消息中提取手机号
    ↓
2. 过滤空格、横线、+86 前缀,保留纯数字手机号
    ↓
3. 调用 POST /send-code 发送验证码
    ↓
4. 向用户返回验证码发送提示
```

---

## 回复模板

### 发送成功后

```
📱 已向 138****8000 发送验证码,请查收短信。

请输入 4-6 位验证码:
```

### 发送失败后

```
❌ 验证码发送失败,请稍后重试。
```

---

## 错误处理

### 手机号格式错误

```
❌ 手机号格式不正确,请发送正确的 11 位手机号。
示例:13800138000
```
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall