{"owner":"go-pay","repo":"gopay","hasSkills":true,"totalSkillsCount":4,"totalTokensCount":4155,"categories":["claude-rule","anthropic-skill"],"hasMcp":false,"mcpConfig":null,"found":[".claude/skills/install.sh","CLAUDE.md",".claude/skills/README.md",".claude/skills/add-payment-interface/SKILL.md"],"skills":{".claude/skills/install.sh":"#!/bin/bash\n\n# GoPay Skills 安装脚本\n# 将项目中的 skills 安装到全局 ~/.claude/skills/ 目录\n\nset -e\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nGLOBAL_SKILLS_DIR=\"$HOME/.claude/skills\"\n\necho \"🚀 开始安装 GoPay Skills...\"\n\n# 创建全局 skills 目录（如果不存在）\nif [ ! -d \"$GLOBAL_SKILLS_DIR\" ]; then\n    echo \"📁 创建全局 skills 目录: $GLOBAL_SKILLS_DIR\"\n    mkdir -p \"$GLOBAL_SKILLS_DIR\"\nfi\n\n# 安装每个 skill\nfor skill_dir in \"$SCRIPT_DIR\"/*/; do\n    if [ -d \"$skill_dir\" ]; then\n        skill_name=$(basename \"$skill_dir\")\n\n        # 跳过非 skill 目录\n        if [ ! -f \"$skill_dir/SKILL.md\" ]; then\n            continue\n        fi\n\n        echo \"📦 安装 skill: $skill_name\"\n\n        # 复制到全局目录\n        cp -r \"$skill_dir\" \"$GLOBAL_SKILLS_DIR/\"\n\n        echo \"   ✅ $skill_name 安装完成\"\n    fi\ndone\n\necho \"\"\necho \"✨ 所有 skills 安装完成！\"\necho \"\"\necho \"📝 下一步：\"\necho \"   1. 在 Claude Code 中执行: /skills reload\"\necho \"   2. 执行 /skills 查看已安装的 skills\"\necho \"\"\n","CLAUDE.md":"# GoPay 项目说明\n\n## 代码探索约定\n\n探索/索引本项目代码时，**默认优先使用 `codebase-memory` MCP**，未安装则降级到默认工具：\n\n1. **首选**：`mcp__codebase-memory-mcp__*` 工具（若可用）\n   - `search_graph` — 按名称/标签/限定名查找函数、类型、路由\n   - `trace_path` — 调用链、数据流、跨服务追踪\n   - `get_code_snippet` — 按限定名获取精确源码片段\n   - `query_graph` — 复杂 Cypher 查询\n   - `get_architecture` — 项目结构总览\n   - `search_code` — 图增强的文本搜索\n   - 项目未索引时，先运行 `index_repository` 建立索引\n2. **降级（MCP 未安装/不可用时）**：使用默认工具 `Grep` / `Glob` / `Read` / `Bash`（find、grep）进行文本与文件检索\n3. 不管哪种方式，**编辑前必须先 `Read` 目标文件**\n\n## 项目概述\n\nGoPay 是一个 Go 语言的支付 SDK 项目，提供微信、支付宝、QQ、通联支付、拉卡拉、PayPal、扫呗、Apple 支付的统一接口。\n\n- **仓库**: https://github.com/go-pay/gopay\n- **Go 版本**: 1.24.0\n- **许可证**: Apache 2.0\n\n## 项目结构\n\n```\ngopay/\n├── alipay/          # 支付宝支付 SDK\n├── wechat/          # 微信支付 SDK\n├── apple/           # Apple 支付校验\n├── paypal/          # PayPal 支付 SDK\n├── qq/              # QQ 支付 SDK\n├── allinpay/        # 通联支付 SDK\n├── lakala/          # 拉卡拉支付 SDK\n├── saobei/          # 扫呗支付 SDK\n├── pkg/             # 公共包\n├── doc/             # 各支付方式文档\n└── examples/        # 示例代码\n```\n\n## 开发约定\n\n### 代码风格\n\n1. **遵循 Go 标准规范**\n   - 使用 `gofmt` 格式化代码\n   - 遵循 Go 命名约定（驼峰命名）\n   - 导出的函数、类型、常量首字母大写\n\n2. **测试文件**\n   - 每个模块都有对应的 `*_test.go` 文件\n   - 测试文件包含实际使用示例\n   - 建议使用正式环境 1 分钱测试法\n\n3. **日志处理**\n   - 使用项目依赖的 `github.com/go-pay/xlog` 包\n   - 支持自定义 Logger（实现 `xlog.XLogger` interface）\n\n### 支付平台版本\n\n- **支付宝**: 优先使用 V3 版本\n- **微信**: 优先使用 V3 版本（V2 版本不推荐）\n- 其他平台参考 `doc/` 目录下的文档\n\n### 重要注意事项\n\n1. **安全性优先**\n   - 处理支付相关代码时特别注意安全性\n   - 不要在代码中硬编码敏感信息（密钥、证书等）\n   - 注意参数验证和签名校验\n\n2. **向后兼容**\n   - 这是一个公开的 SDK，修改时注意 API 兼容性\n   - 重大变更需要在 `release_note.md` 中记录\n\n3. **文档同步**\n   - 新增功能需要更新对应的 `doc/*.md` 文档\n   - 保持代码示例和文档的一致性\n\n## 依赖管理\n\n项目使用 Go Modules，主要依赖：\n- `github.com/go-pay/crypto` - 加密工具\n- `github.com/go-pay/xlog` - 日志工具\n- `github.com/go-pay/util` - 通用工具\n- `golang.org/x/crypto` - Go 官方加密库\n\n## 参考资源\n\n- 各支付方式文档: `doc/` 目录\n- 测试用例: 各模块的 `*_test.go` 文件\n- 示例项目: https://github.com/go-pay/gopay-platform\n",".claude/skills/README.md":"# GoPay 项目 Skills\n\n本目录包含 GoPay 项目专用的 Claude Code skills。\n\n## 可用 Skills\n\n### add-payment-interface\n\n为 GoPay 项目添加新支付接口的标准化工作流程。\n\n**功能：**\n- 分析官方接口文档\n- 实现接口代码（常量、模型、方法）\n- 更新项目文档\n- 更新版本记录\n- 准备 git 提交\n\n**适用场景：**\n- 添加微信支付新接口\n- 添加支付宝新接口\n- 添加其他支付平台接口\n\n## 安装 Skills\n\nSkills 需要安装到全局 `~/.claude/skills/` 目录才能被 Claude Code 识别。\n\n### 方法一：使用脚本安装（推荐）\n\n```bash\n# 在项目根目录执行\n.claude/skills/install.sh\n```\n\n### 方法二：手动安装\n\n```bash\n# 复制 skill 到全局目录\ncp -r .claude/skills/add-payment-interface ~/.claude/skills/\n\n# 重新加载 skills\n# 在 Claude Code 中执行: /skills reload\n```\n\n## 使用 Skills\n\n安装完成后，在 Claude Code 中：\n\n1. 查看所有可用 skills：\n   ```\n   /skills\n   ```\n\n2. 使用 skill：\n   - 直接告诉 Claude：\"使用 add-payment-interface skill 添加 xxx 接口\"\n   - 或者提供接口文档链接，Claude 会自动识别并使用相应的 skill\n\n## 维护说明\n\n### 更新 Skill\n\n如果需要修改 skill：\n\n1. 编辑项目中的 skill 文件：`.claude/skills/add-payment-interface/SKILL.md`\n2. 重新安装到全局目录：\n   ```bash\n   cp -r .claude/skills/add-payment-interface ~/.claude/skills/\n   ```\n3. 在 Claude Code 中重新加载：`/skills reload`\n\n### 换电脑后的设置\n\n1. Clone 项目仓库\n2. 运行安装脚本：\n   ```bash\n   .claude/skills/install.sh\n   ```\n3. 在 Claude Code 中验证：`/skills`\n\n## 目录结构\n\n```\n.claude/\n└── skills/\n    ├── README.md                          # 本文件\n    ├── install.sh                         # 安装脚本\n    └── add-payment-interface/\n        └── SKILL.md                       # Skill 定义文件\n```\n\n## 注意事项\n\n- Skills 必须安装到全局目录 `~/.claude/skills/` 才能生效\n- 项目中的 `.claude/skills/` 目录仅用于版本控制和分发\n- 修改 skill 后需要重新安装并重新加载\n- 建议将 `.claude/skills/` 目录提交到 git，方便团队协作\n",".claude/skills/add-payment-interface/SKILL.md":"---\nname: add-payment-interface\ndescription: Add new payment interfaces to GoPay project following standard workflow - analyze docs, implement code, update documentation and version records. Use when adding WeChat Pay, Alipay or other payment platform APIs.\n---\n\n# Add Payment Interface\n\nStandardized workflow for adding new payment platform interfaces to the GoPay project.\n\n## When to Activate\n\n- Adding new WeChat Pay v3 interfaces\n- Adding new Alipay v3 interfaces\n- Adding interfaces for other payment platforms\n- Updating existing payment interfaces with new capabilities\n\n## Standard Workflow\n\n### Step 1: Analyze Interface Documentation\n\n**Objective:** Extract complete interface specifications from official documentation.\n\n**Actions:**\n1. Use `WebFetch` to retrieve official documentation\n2. Use browser automation (`mcp__browser-automation__*`) if interactive navigation needed\n3. Extract:\n   - HTTP method (GET/POST/PUT/DELETE/PATCH)\n   - URL path (e.g., `/v3/med-ins/orders`)\n   - Request parameters (name, type, required, description)\n   - Response parameters (name, type, description)\n\n**Example Output:**\n```\nInterface: 医保自费混合收款下单\nMethod: POST\nPath: /v3/med-ins/orders\nRequest: mix_pay_type, order_type, appid, openid, ...\nResponse: mix_trade_no, mix_pay_status, ...\n```\n\n### Step 2: Implement Interface Code\n\n**Objective:** Implement interface following project conventions.\n\n#### 2.1 Add API Path Constants\n\n**File:** `wechat/v3/constant.go` or `alipay/v3/constant.go`\n\n**Naming:** `v3` + ModuleName + ActionName\n\n**Example:**\n```go\n// 医保支付\nv3MedInsOrder             = \"/v3/med-ins/orders\"                 // 医保自费混合收款下单 POST\nv3MedInsOrderQueryByMixNo = \"/v3/med-ins/orders/mix-trade-no/%s\" // mix_trade_no 查询 GET\nv3MedInsOrderQueryByOutNo = \"/v3/med-ins/orders/out-trade-no/%s\" // out_trade_no 查询 GET\n```\n\n#### 2.2 Define Data Models\n\n**File:** Create or update `model_*.go` (e.g., `model_medins.go`)\n\n**Required structures:**\n```go\n// Response wrapper\ntype XxxRsp struct {\n    Code        int         `json:\"-\"`\n    SignInfo    *SignInfo   `json:\"-\"`\n    Response    *Xxx        `json:\"response,omitempty\"`\n    ErrResponse ErrResponse `json:\"err_response,omitempty\"`\n    Error       string      `json:\"-\"`\n}\n\n// Response data\ntype Xxx struct {\n    Field1 string `json:\"field1\"` // 字段说明\n    Field2 int    `json:\"field2\"` // 字段说明\n    // ... more fields\n}\n```\n\n#### 2.3 Implement Interface Methods\n\n**File:** Create or update module file (e.g., `medins.go`)\n\n**Method naming:** `V3` + ModuleName + ActionName\n\n**Implementation pattern:**\n```go\nfunc (c *ClientV3) V3XxxMethod(ctx context.Context, bm gopay.BodyMap) (wxRsp *XxxRsp, err error) {\n    // 1. Generate authorization\n    authorization, err := c.authorization(MethodPost, v3ApiPath, bm)\n    if err != nil {\n        return nil, err\n    }\n    \n    // 2. Send request (use doProdPost for POST, doProdGet for GET)\n    res, si, bs, err := c.doProdPost(ctx, bm, v3ApiPath, authorization)\n    if err != nil {\n        return nil, err\n    }\n    \n    // 3. Initialize response\n    wxRsp = &XxxRsp{Code: Success, SignInfo: si, Response: new(Xxx)}\n    if res.StatusCode != http.StatusOK {\n        wxRsp.Code = res.StatusCode\n        wxRsp.Error = string(bs)\n        _ = js.UnmarshalBytes(bs, &wxRsp.ErrResponse)\n        return wxRsp, nil\n    }\n    \n    // 4. Parse response\n    if err = json.Unmarshal(bs, wxRsp.Response); err != nil {\n        return nil, fmt.Errorf(\"[%w]: %v, bytes: %s\", gopay.UnmarshalErr, err, string(bs))\n    }\n    \n    // 5. Verify signature\n    return wxRsp, c.verifySyncSign(si)\n}\n```\n\n**Key points:**\n- POST requests: use `doProdPost`\n- GET requests: use `doProdGet`\n- Path parameters: use `fmt.Sprintf` to format URL\n- Always verify signature with `verifySyncSign`\n\n### Step 3: Update Documentation\n\n**Objective:** Document new interfaces in project docs.\n\n#### 3.1 Update API Documentation\n\n**File:** `doc/wechat_v3.md` or `doc/alipay_v3.md`\n\n**Location:** Appendix section, grouped by functionality\n\n**Format:**\n```markdown\n* <font color='#07C160' size='4'>Module Name</font>\n    * Interface description: `client.V3MethodName()`\n    * Interface description: `client.V3MethodName2()`\n```\n\n**Example:**\n```markdown\n* <font color='#07C160' size='4'>医保支付</font>\n    * 医保自费混合收款下单：`client.V3MedInsOrder()`\n    * 使用医保自费混合订单号查看下单结果：`client.V3MedInsOrderQueryByMixNo()`\n    * 使用商户订单号查看下单结果：`client.V3MedInsOrderQueryByOutNo()`\n```\n\n### Step 4: Update Version Records\n\n**Objective:** Record changes in version history.\n\n#### 4.1 Update Version Number\n\n**File:** `constant.go` (root directory)\n\n**Action:** Increment patch version (e.g., `v1.5.116` → `v1.5.117`)\n\n#### 4.2 Update Release Notes\n\n**File:** `release_note.md`\n\n**Action:** Add new version section at the top\n\n**Format:**\n```markdown\n## 版本号：v1.5.xxx\n\n* 修改记录：\n  * 平台名：新增 功能模块 相关接口。\n    * client.MethodName()，接口说明。\n    * client.MethodName2()，接口说明。\n```\n\n### Step 5: Commit Changes\n\n**Objective:** Stage all modified files for commit.\n\n**Actions:**\n```bash\n# Add all related files\ngit add constant.go\ngit add release_note.md\ngit add doc/wechat_v3.md  # or corresponding platform doc\ngit add wechat/v3/constant.go  # or corresponding platform\ngit add wechat/v3/new_file.go\ngit add wechat/v3/model_new_file.go\n\n# Check status\ngit status\n\n# Add any linter-formatted files\ngit add <formatted_files>\n```\n\n## Implementation Example\n\n**Case:** WeChat Pay v3 Medical Insurance Payment\n\n**Documentation:** `https://pay.weixin.qq.com/doc/v3/merchant/4016781466`\n\n**Interfaces identified:**\n1. Create medical insurance order - POST `/v3/med-ins/orders`\n2. Query by mix trade no - GET `/v3/med-ins/orders/mix-trade-no/{mix_trade_no}`\n3. Query by merchant order no - GET `/v3/med-ins/orders/out-trade-no/{out_trade_no}`\n\n**Files modified:**\n- `constant.go` - version bump to v1.5.117\n- `release_note.md` - added v1.5.117 changelog\n- `doc/wechat_v3.md` - added medical insurance section\n- `wechat/v3/constant.go` - added 3 API path constants\n- `wechat/v3/medins.go` - new file with 3 methods\n- `wechat/v3/model_medins.go` - new file with data structures\n\n## Quality Checklist\n\nBefore completing:\n- [ ] Code compiles without errors (`go build ./wechat/v3/...`)\n- [ ] All API paths added to constants\n- [ ] Data models include all documented fields\n- [ ] Methods follow existing implementation patterns\n- [ ] Error handling is complete\n- [ ] Signature verification is included\n- [ ] API documentation is updated\n- [ ] Version number is incremented\n- [ ] Release notes are updated\n- [ ] All files are staged for commit\n\n## Reference Files\n\n- **Constants:** `wechat/v3/constant.go`, `alipay/v3/constant.go`\n- **Models:** `wechat/v3/model_*.go`, `alipay/v3/model_*.go`\n- **Implementations:** `wechat/v3/*.go`, `alipay/v3/*.go`\n- **Documentation:** `doc/wechat_v3.md`, `doc/alipay_v3.md`\n- **Version:** `constant.go`, `release_note.md`\n\n## Tools Used\n\n- **WebFetch** - Retrieve documentation content\n- **Browser automation** - Navigate interactive documentation\n- **Read** - Reference existing implementations\n- **Write/Edit** - Create or modify code files\n- **Bash** - Execute git commands and build verification\n"},"files":{".claude/skills/install.sh":"#!/bin/bash\n\n# GoPay Skills 安装脚本\n# 将项目中的 skills 安装到全局 ~/.claude/skills/ 目录\n\nset -e\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nGLOBAL_SKILLS_DIR=\"$HOME/.claude/skills\"\n\necho \"🚀 开始安装 GoPay Skills...\"\n\n# 创建全局 skills 目录（如果不存在）\nif [ ! -d \"$GLOBAL_SKILLS_DIR\" ]; then\n    echo \"📁 创建全局 skills 目录: $GLOBAL_SKILLS_DIR\"\n    mkdir -p \"$GLOBAL_SKILLS_DIR\"\nfi\n\n# 安装每个 skill\nfor skill_dir in \"$SCRIPT_DIR\"/*/; do\n    if [ -d \"$skill_dir\" ]; then\n        skill_name=$(basename \"$skill_dir\")\n\n        # 跳过非 skill 目录\n        if [ ! -f \"$skill_dir/SKILL.md\" ]; then\n            continue\n        fi\n\n        echo \"📦 安装 skill: $skill_name\"\n\n        # 复制到全局目录\n        cp -r \"$skill_dir\" \"$GLOBAL_SKILLS_DIR/\"\n\n        echo \"   ✅ $skill_name 安装完成\"\n    fi\ndone\n\necho \"\"\necho \"✨ 所有 skills 安装完成！\"\necho \"\"\necho \"📝 下一步：\"\necho \"   1. 在 Claude Code 中执行: /skills reload\"\necho \"   2. 执行 /skills 查看已安装的 skills\"\necho \"\"\n","CLAUDE.md":"# GoPay 项目说明\n\n## 代码探索约定\n\n探索/索引本项目代码时，**默认优先使用 `codebase-memory` MCP**，未安装则降级到默认工具：\n\n1. **首选**：`mcp__codebase-memory-mcp__*` 工具（若可用）\n   - `search_graph` — 按名称/标签/限定名查找函数、类型、路由\n   - `trace_path` — 调用链、数据流、跨服务追踪\n   - `get_code_snippet` — 按限定名获取精确源码片段\n   - `query_graph` — 复杂 Cypher 查询\n   - `get_architecture` — 项目结构总览\n   - `search_code` — 图增强的文本搜索\n   - 项目未索引时，先运行 `index_repository` 建立索引\n2. **降级（MCP 未安装/不可用时）**：使用默认工具 `Grep` / `Glob` / `Read` / `Bash`（find、grep）进行文本与文件检索\n3. 不管哪种方式，**编辑前必须先 `Read` 目标文件**\n\n## 项目概述\n\nGoPay 是一个 Go 语言的支付 SDK 项目，提供微信、支付宝、QQ、通联支付、拉卡拉、PayPal、扫呗、Apple 支付的统一接口。\n\n- **仓库**: https://github.com/go-pay/gopay\n- **Go 版本**: 1.24.0\n- **许可证**: Apache 2.0\n\n## 项目结构\n\n```\ngopay/\n├── alipay/          # 支付宝支付 SDK\n├── wechat/          # 微信支付 SDK\n├── apple/           # Apple 支付校验\n├── paypal/          # PayPal 支付 SDK\n├── qq/              # QQ 支付 SDK\n├── allinpay/        # 通联支付 SDK\n├── lakala/          # 拉卡拉支付 SDK\n├── saobei/          # 扫呗支付 SDK\n├── pkg/             # 公共包\n├── doc/             # 各支付方式文档\n└── examples/        # 示例代码\n```\n\n## 开发约定\n\n### 代码风格\n\n1. **遵循 Go 标准规范**\n   - 使用 `gofmt` 格式化代码\n   - 遵循 Go 命名约定（驼峰命名）\n   - 导出的函数、类型、常量首字母大写\n\n2. **测试文件**\n   - 每个模块都有对应的 `*_test.go` 文件\n   - 测试文件包含实际使用示例\n   - 建议使用正式环境 1 分钱测试法\n\n3. **日志处理**\n   - 使用项目依赖的 `github.com/go-pay/xlog` 包\n   - 支持自定义 Logger（实现 `xlog.XLogger` interface）\n\n### 支付平台版本\n\n- **支付宝**: 优先使用 V3 版本\n- **微信**: 优先使用 V3 版本（V2 版本不推荐）\n- 其他平台参考 `doc/` 目录下的文档\n\n### 重要注意事项\n\n1. **安全性优先**\n   - 处理支付相关代码时特别注意安全性\n   - 不要在代码中硬编码敏感信息（密钥、证书等）\n   - 注意参数验证和签名校验\n\n2. **向后兼容**\n   - 这是一个公开的 SDK，修改时注意 API 兼容性\n   - 重大变更需要在 `release_note.md` 中记录\n\n3. **文档同步**\n   - 新增功能需要更新对应的 `doc/*.md` 文档\n   - 保持代码示例和文档的一致性\n\n## 依赖管理\n\n项目使用 Go Modules，主要依赖：\n- `github.com/go-pay/crypto` - 加密工具\n- `github.com/go-pay/xlog` - 日志工具\n- `github.com/go-pay/util` - 通用工具\n- `golang.org/x/crypto` - Go 官方加密库\n\n## 参考资源\n\n- 各支付方式文档: `doc/` 目录\n- 测试用例: 各模块的 `*_test.go` 文件\n- 示例项目: https://github.com/go-pay/gopay-platform\n",".claude/skills/README.md":"# GoPay 项目 Skills\n\n本目录包含 GoPay 项目专用的 Claude Code skills。\n\n## 可用 Skills\n\n### add-payment-interface\n\n为 GoPay 项目添加新支付接口的标准化工作流程。\n\n**功能：**\n- 分析官方接口文档\n- 实现接口代码（常量、模型、方法）\n- 更新项目文档\n- 更新版本记录\n- 准备 git 提交\n\n**适用场景：**\n- 添加微信支付新接口\n- 添加支付宝新接口\n- 添加其他支付平台接口\n\n## 安装 Skills\n\nSkills 需要安装到全局 `~/.claude/skills/` 目录才能被 Claude Code 识别。\n\n### 方法一：使用脚本安装（推荐）\n\n```bash\n# 在项目根目录执行\n.claude/skills/install.sh\n```\n\n### 方法二：手动安装\n\n```bash\n# 复制 skill 到全局目录\ncp -r .claude/skills/add-payment-interface ~/.claude/skills/\n\n# 重新加载 skills\n# 在 Claude Code 中执行: /skills reload\n```\n\n## 使用 Skills\n\n安装完成后，在 Claude Code 中：\n\n1. 查看所有可用 skills：\n   ```\n   /skills\n   ```\n\n2. 使用 skill：\n   - 直接告诉 Claude：\"使用 add-payment-interface skill 添加 xxx 接口\"\n   - 或者提供接口文档链接，Claude 会自动识别并使用相应的 skill\n\n## 维护说明\n\n### 更新 Skill\n\n如果需要修改 skill：\n\n1. 编辑项目中的 skill 文件：`.claude/skills/add-payment-interface/SKILL.md`\n2. 重新安装到全局目录：\n   ```bash\n   cp -r .claude/skills/add-payment-interface ~/.claude/skills/\n   ```\n3. 在 Claude Code 中重新加载：`/skills reload`\n\n### 换电脑后的设置\n\n1. Clone 项目仓库\n2. 运行安装脚本：\n   ```bash\n   .claude/skills/install.sh\n   ```\n3. 在 Claude Code 中验证：`/skills`\n\n## 目录结构\n\n```\n.claude/\n└── skills/\n    ├── README.md                          # 本文件\n    ├── install.sh                         # 安装脚本\n    └── add-payment-interface/\n        └── SKILL.md                       # Skill 定义文件\n```\n\n## 注意事项\n\n- Skills 必须安装到全局目录 `~/.claude/skills/` 才能生效\n- 项目中的 `.claude/skills/` 目录仅用于版本控制和分发\n- 修改 skill 后需要重新安装并重新加载\n- 建议将 `.claude/skills/` 目录提交到 git，方便团队协作\n",".claude/skills/add-payment-interface/SKILL.md":"---\nname: add-payment-interface\ndescription: Add new payment interfaces to GoPay project following standard workflow - analyze docs, implement code, update documentation and version records. Use when adding WeChat Pay, Alipay or other payment platform APIs.\n---\n\n# Add Payment Interface\n\nStandardized workflow for adding new payment platform interfaces to the GoPay project.\n\n## When to Activate\n\n- Adding new WeChat Pay v3 interfaces\n- Adding new Alipay v3 interfaces\n- Adding interfaces for other payment platforms\n- Updating existing payment interfaces with new capabilities\n\n## Standard Workflow\n\n### Step 1: Analyze Interface Documentation\n\n**Objective:** Extract complete interface specifications from official documentation.\n\n**Actions:**\n1. Use `WebFetch` to retrieve official documentation\n2. Use browser automation (`mcp__browser-automation__*`) if interactive navigation needed\n3. Extract:\n   - HTTP method (GET/POST/PUT/DELETE/PATCH)\n   - URL path (e.g., `/v3/med-ins/orders`)\n   - Request parameters (name, type, required, description)\n   - Response parameters (name, type, description)\n\n**Example Output:**\n```\nInterface: 医保自费混合收款下单\nMethod: POST\nPath: /v3/med-ins/orders\nRequest: mix_pay_type, order_type, appid, openid, ...\nResponse: mix_trade_no, mix_pay_status, ...\n```\n\n### Step 2: Implement Interface Code\n\n**Objective:** Implement interface following project conventions.\n\n#### 2.1 Add API Path Constants\n\n**File:** `wechat/v3/constant.go` or `alipay/v3/constant.go`\n\n**Naming:** `v3` + ModuleName + ActionName\n\n**Example:**\n```go\n// 医保支付\nv3MedInsOrder             = \"/v3/med-ins/orders\"                 // 医保自费混合收款下单 POST\nv3MedInsOrderQueryByMixNo = \"/v3/med-ins/orders/mix-trade-no/%s\" // mix_trade_no 查询 GET\nv3MedInsOrderQueryByOutNo = \"/v3/med-ins/orders/out-trade-no/%s\" // out_trade_no 查询 GET\n```\n\n#### 2.2 Define Data Models\n\n**File:** Create or update `model_*.go` (e.g., `model_medins.go`)\n\n**Required structures:**\n```go\n// Response wrapper\ntype XxxRsp struct {\n    Code        int         `json:\"-\"`\n    SignInfo    *SignInfo   `json:\"-\"`\n    Response    *Xxx        `json:\"response,omitempty\"`\n    ErrResponse ErrResponse `json:\"err_response,omitempty\"`\n    Error       string      `json:\"-\"`\n}\n\n// Response data\ntype Xxx struct {\n    Field1 string `json:\"field1\"` // 字段说明\n    Field2 int    `json:\"field2\"` // 字段说明\n    // ... more fields\n}\n```\n\n#### 2.3 Implement Interface Methods\n\n**File:** Create or update module file (e.g., `medins.go`)\n\n**Method naming:** `V3` + ModuleName + ActionName\n\n**Implementation pattern:**\n```go\nfunc (c *ClientV3) V3XxxMethod(ctx context.Context, bm gopay.BodyMap) (wxRsp *XxxRsp, err error) {\n    // 1. Generate authorization\n    authorization, err := c.authorization(MethodPost, v3ApiPath, bm)\n    if err != nil {\n        return nil, err\n    }\n    \n    // 2. Send request (use doProdPost for POST, doProdGet for GET)\n    res, si, bs, err := c.doProdPost(ctx, bm, v3ApiPath, authorization)\n    if err != nil {\n        return nil, err\n    }\n    \n    // 3. Initialize response\n    wxRsp = &XxxRsp{Code: Success, SignInfo: si, Response: new(Xxx)}\n    if res.StatusCode != http.StatusOK {\n        wxRsp.Code = res.StatusCode\n        wxRsp.Error = string(bs)\n        _ = js.UnmarshalBytes(bs, &wxRsp.ErrResponse)\n        return wxRsp, nil\n    }\n    \n    // 4. Parse response\n    if err = json.Unmarshal(bs, wxRsp.Response); err != nil {\n        return nil, fmt.Errorf(\"[%w]: %v, bytes: %s\", gopay.UnmarshalErr, err, string(bs))\n    }\n    \n    // 5. Verify signature\n    return wxRsp, c.verifySyncSign(si)\n}\n```\n\n**Key points:**\n- POST requests: use `doProdPost`\n- GET requests: use `doProdGet`\n- Path parameters: use `fmt.Sprintf` to format URL\n- Always verify signature with `verifySyncSign`\n\n### Step 3: Update Documentation\n\n**Objective:** Document new interfaces in project docs.\n\n#### 3.1 Update API Documentation\n\n**File:** `doc/wechat_v3.md` or `doc/alipay_v3.md`\n\n**Location:** Appendix section, grouped by functionality\n\n**Format:**\n```markdown\n* <font color='#07C160' size='4'>Module Name</font>\n    * Interface description: `client.V3MethodName()`\n    * Interface description: `client.V3MethodName2()`\n```\n\n**Example:**\n```markdown\n* <font color='#07C160' size='4'>医保支付</font>\n    * 医保自费混合收款下单：`client.V3MedInsOrder()`\n    * 使用医保自费混合订单号查看下单结果：`client.V3MedInsOrderQueryByMixNo()`\n    * 使用商户订单号查看下单结果：`client.V3MedInsOrderQueryByOutNo()`\n```\n\n### Step 4: Update Version Records\n\n**Objective:** Record changes in version history.\n\n#### 4.1 Update Version Number\n\n**File:** `constant.go` (root directory)\n\n**Action:** Increment patch version (e.g., `v1.5.116` → `v1.5.117`)\n\n#### 4.2 Update Release Notes\n\n**File:** `release_note.md`\n\n**Action:** Add new version section at the top\n\n**Format:**\n```markdown\n## 版本号：v1.5.xxx\n\n* 修改记录：\n  * 平台名：新增 功能模块 相关接口。\n    * client.MethodName()，接口说明。\n    * client.MethodName2()，接口说明。\n```\n\n### Step 5: Commit Changes\n\n**Objective:** Stage all modified files for commit.\n\n**Actions:**\n```bash\n# Add all related files\ngit add constant.go\ngit add release_note.md\ngit add doc/wechat_v3.md  # or corresponding platform doc\ngit add wechat/v3/constant.go  # or corresponding platform\ngit add wechat/v3/new_file.go\ngit add wechat/v3/model_new_file.go\n\n# Check status\ngit status\n\n# Add any linter-formatted files\ngit add <formatted_files>\n```\n\n## Implementation Example\n\n**Case:** WeChat Pay v3 Medical Insurance Payment\n\n**Documentation:** `https://pay.weixin.qq.com/doc/v3/merchant/4016781466`\n\n**Interfaces identified:**\n1. Create medical insurance order - POST `/v3/med-ins/orders`\n2. Query by mix trade no - GET `/v3/med-ins/orders/mix-trade-no/{mix_trade_no}`\n3. Query by merchant order no - GET `/v3/med-ins/orders/out-trade-no/{out_trade_no}`\n\n**Files modified:**\n- `constant.go` - version bump to v1.5.117\n- `release_note.md` - added v1.5.117 changelog\n- `doc/wechat_v3.md` - added medical insurance section\n- `wechat/v3/constant.go` - added 3 API path constants\n- `wechat/v3/medins.go` - new file with 3 methods\n- `wechat/v3/model_medins.go` - new file with data structures\n\n## Quality Checklist\n\nBefore completing:\n- [ ] Code compiles without errors (`go build ./wechat/v3/...`)\n- [ ] All API paths added to constants\n- [ ] Data models include all documented fields\n- [ ] Methods follow existing implementation patterns\n- [ ] Error handling is complete\n- [ ] Signature verification is included\n- [ ] API documentation is updated\n- [ ] Version number is incremented\n- [ ] Release notes are updated\n- [ ] All files are staged for commit\n\n## Reference Files\n\n- **Constants:** `wechat/v3/constant.go`, `alipay/v3/constant.go`\n- **Models:** `wechat/v3/model_*.go`, `alipay/v3/model_*.go`\n- **Implementations:** `wechat/v3/*.go`, `alipay/v3/*.go`\n- **Documentation:** `doc/wechat_v3.md`, `doc/alipay_v3.md`\n- **Version:** `constant.go`, `release_note.md`\n\n## Tools Used\n\n- **WebFetch** - Retrieve documentation content\n- **Browser automation** - Navigate interactive documentation\n- **Read** - Reference existing implementations\n- **Write/Edit** - Create or modify code files\n- **Bash** - Execute git commands and build verification\n"},"items":[{"name":"SKILL.md","path":".claude/skills/add-payment-interface/SKILL.md","rawUrl":"https://raw.githubusercontent.com/go-pay/gopay/HEAD/.claude/skills/add-payment-interface/SKILL.md","title":"add-payment-interface","category":"anthropic-skill","format":"markdown","content":"---\nname: add-payment-interface\ndescription: Add new payment interfaces to GoPay project following standard workflow - analyze docs, implement code, update documentation and version records. Use when adding WeChat Pay, Alipay or other payment platform APIs.\n---\n\n# Add Payment Interface\n\nStandardized workflow for adding new payment platform interfaces to the GoPay project.\n\n## When to Activate\n\n- Adding new WeChat Pay v3 interfaces\n- Adding new Alipay v3 interfaces\n- Adding interfaces for other payment platforms\n- Updating existing payment interfaces with new capabilities\n\n## Standard Workflow\n\n### Step 1: Analyze Interface Documentation\n\n**Objective:** Extract complete interface specifications from official documentation.\n\n**Actions:**\n1. Use `WebFetch` to retrieve official documentation\n2. Use browser automation (`mcp__browser-automation__*`) if interactive navigation needed\n3. Extract:\n   - HTTP method (GET/POST/PUT/DELETE/PATCH)\n   - URL path (e.g., `/v3/med-ins/orders`)\n   - Request parameters (name, type, required, description)\n   - Response parameters (name, type, description)\n\n**Example Output:**\n```\nInterface: 医保自费混合收款下单\nMethod: POST\nPath: /v3/med-ins/orders\nRequest: mix_pay_type, order_type, appid, openid, ...\nResponse: mix_trade_no, mix_pay_status, ...\n```\n\n### Step 2: Implement Interface Code\n\n**Objective:** Implement interface following project conventions.\n\n#### 2.1 Add API Path Constants\n\n**File:** `wechat/v3/constant.go` or `alipay/v3/constant.go`\n\n**Naming:** `v3` + ModuleName + ActionName\n\n**Example:**\n```go\n// 医保支付\nv3MedInsOrder             = \"/v3/med-ins/orders\"                 // 医保自费混合收款下单 POST\nv3MedInsOrderQueryByMixNo = \"/v3/med-ins/orders/mix-trade-no/%s\" // mix_trade_no 查询 GET\nv3MedInsOrderQueryByOutNo = \"/v3/med-ins/orders/out-trade-no/%s\" // out_trade_no 查询 GET\n```\n\n#### 2.2 Define Data Models\n\n**File:** Create or update `model_*.go` (e.g., `model_medins.go`)\n\n**Required structures:**\n```go\n// Response wrapper\ntype XxxRsp struct {\n    Code        int         `json:\"-\"`\n    SignInfo    *SignInfo   `json:\"-\"`\n    Response    *Xxx        `json:\"response,omitempty\"`\n    ErrResponse ErrResponse `json:\"err_response,omitempty\"`\n    Error       string      `json:\"-\"`\n}\n\n// Response data\ntype Xxx struct {\n    Field1 string `json:\"field1\"` // 字段说明\n    Field2 int    `json:\"field2\"` // 字段说明\n    // ... more fields\n}\n```\n\n#### 2.3 Implement Interface Methods\n\n**File:** Create or update module file (e.g., `medins.go`)\n\n**Method naming:** `V3` + ModuleName + ActionName\n\n**Implementation pattern:**\n```go\nfunc (c *ClientV3) V3XxxMethod(ctx context.Context, bm gopay.BodyMap) (wxRsp *XxxRsp, err error) {\n    // 1. Generate authorization\n    authorization, err := c.authorization(MethodPost, v3ApiPath, bm)\n    if err != nil {\n        return nil, err\n    }\n    \n    // 2. Send request (use doProdPost for POST, doProdGet for GET)\n    res, si, bs, err := c.doProdPost(ctx, bm, v3ApiPath, authorization)\n    if err != nil {\n        return nil, err\n    }\n    \n    // 3. Initialize response\n    wxRsp = &XxxRsp{Code: Success, SignInfo: si, Response: new(Xxx)}\n    if res.StatusCode != http.StatusOK {\n        wxRsp.Code = res.StatusCode\n        wxRsp.Error = string(bs)\n        _ = js.UnmarshalBytes(bs, &wxRsp.ErrResponse)\n        return wxRsp, nil\n    }\n    \n    // 4. Parse response\n    if err = json.Unmarshal(bs, wxRsp.Response); err != nil {\n        return nil, fmt.Errorf(\"[%w]: %v, bytes: %s\", gopay.UnmarshalErr, err, string(bs))\n    }\n    \n    // 5. Verify signature\n    return wxRsp, c.verifySyncSign(si)\n}\n```\n\n**Key points:**\n- POST requests: use `doProdPost`\n- GET requests: use `doProdGet`\n- Path parameters: use `fmt.Sprintf` to format URL\n- Always verify signature with `verifySyncSign`\n\n### Step 3: Update Documentation\n\n**Objective:** Document new interfaces in project docs.\n\n#### 3.1 Update API Documentation\n\n**File:** `doc/wechat_v3.md` or `doc/alipay_v3.md`\n\n**Location:** Appendix section, grouped by functionality\n\n**Format:**\n```markdown\n* <font color='#07C160' size='4'>Module Name</font>\n    * Interface description: `client.V3MethodName()`\n    * Interface description: `client.V3MethodName2()`\n```\n\n**Example:**\n```markdown\n* <font color='#07C160' size='4'>医保支付</font>\n    * 医保自费混合收款下单：`client.V3MedInsOrder()`\n    * 使用医保自费混合订单号查看下单结果：`client.V3MedInsOrderQueryByMixNo()`\n    * 使用商户订单号查看下单结果：`client.V3MedInsOrderQueryByOutNo()`\n```\n\n### Step 4: Update Version Records\n\n**Objective:** Record changes in version history.\n\n#### 4.1 Update Version Number\n\n**File:** `constant.go` (root directory)\n\n**Action:** Increment patch version (e.g., `v1.5.116` → `v1.5.117`)\n\n#### 4.2 Update Release Notes\n\n**File:** `release_note.md`\n\n**Action:** Add new version section at the top\n\n**Format:**\n```markdown\n## 版本号：v1.5.xxx\n\n* 修改记录：\n  * 平台名：新增 功能模块 相关接口。\n    * client.MethodName()，接口说明。\n    * client.MethodName2()，接口说明。\n```\n\n### Step 5: Commit Changes\n\n**Objective:** Stage all modified files for commit.\n\n**Actions:**\n```bash\n# Add all related files\ngit add constant.go\ngit add release_note.md\ngit add doc/wechat_v3.md  # or corresponding platform doc\ngit add wechat/v3/constant.go  # or corresponding platform\ngit add wechat/v3/new_file.go\ngit add wechat/v3/model_new_file.go\n\n# Check status\ngit status\n\n# Add any linter-formatted files\ngit add <formatted_files>\n```\n\n## Implementation Example\n\n**Case:** WeChat Pay v3 Medical Insurance Payment\n\n**Documentation:** `https://pay.weixin.qq.com/doc/v3/merchant/4016781466`\n\n**Interfaces identified:**\n1. Create medical insurance order - POST `/v3/med-ins/orders`\n2. Query by mix trade no - GET `/v3/med-ins/orders/mix-trade-no/{mix_trade_no}`\n3. Query by merchant order no - GET `/v3/med-ins/orders/out-trade-no/{out_trade_no}`\n\n**Files modified:**\n- `constant.go` - version bump to v1.5.117\n- `release_note.md` - added v1.5.117 changelog\n- `doc/wechat_v3.md` - added medical insurance section\n- `wechat/v3/constant.go` - added 3 API path constants\n- `wechat/v3/medins.go` - new file with 3 methods\n- `wechat/v3/model_medins.go` - new file with data structures\n\n## Quality Checklist\n\nBefore completing:\n- [ ] Code compiles without errors (`go build ./wechat/v3/...`)\n- [ ] All API paths added to constants\n- [ ] Data models include all documented fields\n- [ ] Methods follow existing implementation patterns\n- [ ] Error handling is complete\n- [ ] Signature verification is included\n- [ ] API documentation is updated\n- [ ] Version number is incremented\n- [ ] Release notes are updated\n- [ ] All files are staged for commit\n\n## Reference Files\n\n- **Constants:** `wechat/v3/constant.go`, `alipay/v3/constant.go`\n- **Models:** `wechat/v3/model_*.go`, `alipay/v3/model_*.go`\n- **Implementations:** `wechat/v3/*.go`, `alipay/v3/*.go`\n- **Documentation:** `doc/wechat_v3.md`, `doc/alipay_v3.md`\n- **Version:** `constant.go`, `release_note.md`\n\n## Tools Used\n\n- **WebFetch** - Retrieve documentation content\n- **Browser automation** - Navigate interactive documentation\n- **Read** - Reference existing implementations\n- **Write/Edit** - Create or modify code files\n- **Bash** - Execute git commands and build verification\n","frontmatter":{"name":"add-payment-interface","description":"Add new payment interfaces to GoPay project following standard workflow - analyze docs, implement code, update documentation and version records. Use when adding WeChat Pay, Alipay or other payment platform APIs."},"isInternal":false,"tokens":1990,"sizeBytes":7372},{"name":"README.md","path":".claude/skills/README.md","rawUrl":"https://raw.githubusercontent.com/go-pay/gopay/HEAD/.claude/skills/README.md","title":"Skills Skill","category":"anthropic-skill","format":"markdown","content":"# GoPay 项目 Skills\n\n本目录包含 GoPay 项目专用的 Claude Code skills。\n\n## 可用 Skills\n\n### add-payment-interface\n\n为 GoPay 项目添加新支付接口的标准化工作流程。\n\n**功能：**\n- 分析官方接口文档\n- 实现接口代码（常量、模型、方法）\n- 更新项目文档\n- 更新版本记录\n- 准备 git 提交\n\n**适用场景：**\n- 添加微信支付新接口\n- 添加支付宝新接口\n- 添加其他支付平台接口\n\n## 安装 Skills\n\nSkills 需要安装到全局 `~/.claude/skills/` 目录才能被 Claude Code 识别。\n\n### 方法一：使用脚本安装（推荐）\n\n```bash\n# 在项目根目录执行\n.claude/skills/install.sh\n```\n\n### 方法二：手动安装\n\n```bash\n# 复制 skill 到全局目录\ncp -r .claude/skills/add-payment-interface ~/.claude/skills/\n\n# 重新加载 skills\n# 在 Claude Code 中执行: /skills reload\n```\n\n## 使用 Skills\n\n安装完成后，在 Claude Code 中：\n\n1. 查看所有可用 skills：\n   ```\n   /skills\n   ```\n\n2. 使用 skill：\n   - 直接告诉 Claude：\"使用 add-payment-interface skill 添加 xxx 接口\"\n   - 或者提供接口文档链接，Claude 会自动识别并使用相应的 skill\n\n## 维护说明\n\n### 更新 Skill\n\n如果需要修改 skill：\n\n1. 编辑项目中的 skill 文件：`.claude/skills/add-payment-interface/SKILL.md`\n2. 重新安装到全局目录：\n   ```bash\n   cp -r .claude/skills/add-payment-interface ~/.claude/skills/\n   ```\n3. 在 Claude Code 中重新加载：`/skills reload`\n\n### 换电脑后的设置\n\n1. Clone 项目仓库\n2. 运行安装脚本：\n   ```bash\n   .claude/skills/install.sh\n   ```\n3. 在 Claude Code 中验证：`/skills`\n\n## 目录结构\n\n```\n.claude/\n└── skills/\n    ├── README.md                          # 本文件\n    ├── install.sh                         # 安装脚本\n    └── add-payment-interface/\n        └── SKILL.md                       # Skill 定义文件\n```\n\n## 注意事项\n\n- Skills 必须安装到全局目录 `~/.claude/skills/` 才能生效\n- 项目中的 `.claude/skills/` 目录仅用于版本控制和分发\n- 修改 skill 后需要重新安装并重新加载\n- 建议将 `.claude/skills/` 目录提交到 git，方便团队协作\n","isInternal":false,"tokens":684,"sizeBytes":2236},{"name":"install.sh","path":".claude/skills/install.sh","rawUrl":"https://raw.githubusercontent.com/go-pay/gopay/HEAD/.claude/skills/install.sh","title":"Claude Directive: install.sh","category":"claude-rule","format":"markdown","content":"#!/bin/bash\n\n# GoPay Skills 安装脚本\n# 将项目中的 skills 安装到全局 ~/.claude/skills/ 目录\n\nset -e\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nGLOBAL_SKILLS_DIR=\"$HOME/.claude/skills\"\n\necho \"🚀 开始安装 GoPay Skills...\"\n\n# 创建全局 skills 目录（如果不存在）\nif [ ! -d \"$GLOBAL_SKILLS_DIR\" ]; then\n    echo \"📁 创建全局 skills 目录: $GLOBAL_SKILLS_DIR\"\n    mkdir -p \"$GLOBAL_SKILLS_DIR\"\nfi\n\n# 安装每个 skill\nfor skill_dir in \"$SCRIPT_DIR\"/*/; do\n    if [ -d \"$skill_dir\" ]; then\n        skill_name=$(basename \"$skill_dir\")\n\n        # 跳过非 skill 目录\n        if [ ! -f \"$skill_dir/SKILL.md\" ]; then\n            continue\n        fi\n\n        echo \"📦 安装 skill: $skill_name\"\n\n        # 复制到全局目录\n        cp -r \"$skill_dir\" \"$GLOBAL_SKILLS_DIR/\"\n\n        echo \"   ✅ $skill_name 安装完成\"\n    fi\ndone\n\necho \"\"\necho \"✨ 所有 skills 安装完成！\"\necho \"\"\necho \"📝 下一步：\"\necho \"   1. 在 Claude Code 中执行: /skills reload\"\necho \"   2. 执行 /skills 查看已安装的 skills\"\necho \"\"\n","isInternal":false,"tokens":342,"sizeBytes":1088},{"name":"CLAUDE.md","path":"CLAUDE.md","rawUrl":"https://raw.githubusercontent.com/go-pay/gopay/HEAD/CLAUDE.md","title":"Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"# GoPay 项目说明\n\n## 代码探索约定\n\n探索/索引本项目代码时，**默认优先使用 `codebase-memory` MCP**，未安装则降级到默认工具：\n\n1. **首选**：`mcp__codebase-memory-mcp__*` 工具（若可用）\n   - `search_graph` — 按名称/标签/限定名查找函数、类型、路由\n   - `trace_path` — 调用链、数据流、跨服务追踪\n   - `get_code_snippet` — 按限定名获取精确源码片段\n   - `query_graph` — 复杂 Cypher 查询\n   - `get_architecture` — 项目结构总览\n   - `search_code` — 图增强的文本搜索\n   - 项目未索引时，先运行 `index_repository` 建立索引\n2. **降级（MCP 未安装/不可用时）**：使用默认工具 `Grep` / `Glob` / `Read` / `Bash`（find、grep）进行文本与文件检索\n3. 不管哪种方式，**编辑前必须先 `Read` 目标文件**\n\n## 项目概述\n\nGoPay 是一个 Go 语言的支付 SDK 项目，提供微信、支付宝、QQ、通联支付、拉卡拉、PayPal、扫呗、Apple 支付的统一接口。\n\n- **仓库**: https://github.com/go-pay/gopay\n- **Go 版本**: 1.24.0\n- **许可证**: Apache 2.0\n\n## 项目结构\n\n```\ngopay/\n├── alipay/          # 支付宝支付 SDK\n├── wechat/          # 微信支付 SDK\n├── apple/           # Apple 支付校验\n├── paypal/          # PayPal 支付 SDK\n├── qq/              # QQ 支付 SDK\n├── allinpay/        # 通联支付 SDK\n├── lakala/          # 拉卡拉支付 SDK\n├── saobei/          # 扫呗支付 SDK\n├── pkg/             # 公共包\n├── doc/             # 各支付方式文档\n└── examples/        # 示例代码\n```\n\n## 开发约定\n\n### 代码风格\n\n1. **遵循 Go 标准规范**\n   - 使用 `gofmt` 格式化代码\n   - 遵循 Go 命名约定（驼峰命名）\n   - 导出的函数、类型、常量首字母大写\n\n2. **测试文件**\n   - 每个模块都有对应的 `*_test.go` 文件\n   - 测试文件包含实际使用示例\n   - 建议使用正式环境 1 分钱测试法\n\n3. **日志处理**\n   - 使用项目依赖的 `github.com/go-pay/xlog` 包\n   - 支持自定义 Logger（实现 `xlog.XLogger` interface）\n\n### 支付平台版本\n\n- **支付宝**: 优先使用 V3 版本\n- **微信**: 优先使用 V3 版本（V2 版本不推荐）\n- 其他平台参考 `doc/` 目录下的文档\n\n### 重要注意事项\n\n1. **安全性优先**\n   - 处理支付相关代码时特别注意安全性\n   - 不要在代码中硬编码敏感信息（密钥、证书等）\n   - 注意参数验证和签名校验\n\n2. **向后兼容**\n   - 这是一个公开的 SDK，修改时注意 API 兼容性\n   - 重大变更需要在 `release_note.md` 中记录\n\n3. **文档同步**\n   - 新增功能需要更新对应的 `doc/*.md` 文档\n   - 保持代码示例和文档的一致性\n\n## 依赖管理\n\n项目使用 Go Modules，主要依赖：\n- `github.com/go-pay/crypto` - 加密工具\n- `github.com/go-pay/xlog` - 日志工具\n- `github.com/go-pay/util` - 通用工具\n- `golang.org/x/crypto` - Go 官方加密库\n\n## 参考资源\n\n- 各支付方式文档: `doc/` 目录\n- 测试用例: 各模块的 `*_test.go` 文件\n- 示例项目: https://github.com/go-pay/gopay-platform\n","isInternal":false,"tokens":1139,"sizeBytes":3218}],"systemPromptSnippet":"<yakaai_skills repo=\"go-pay/gopay\">\n<!-- File: .claude/skills/add-payment-interface/SKILL.md (Tokens: ~1990 | Category: anthropic-skill) -->\n---\nname: add-payment-interface\ndescription: Add new payment interfaces to GoPay project following standard workflow - analyze docs, implement code, update documentation and version records. Use when adding WeChat Pay, Alipay or other payment platform APIs.\n---\n\n# Add Payment Interface\n\nStandardized workflow for adding new payment platform interfaces to the GoPay project.\n\n## When to Activate\n\n- Adding new WeChat Pay v3 interfaces\n- Adding new Alipay v3 interfaces\n- Adding interfaces for other payment platforms\n- Updating existing payment interfaces with new capabilities\n\n## Standard Workflow\n\n### Step 1: Analyze Interface Documentation\n\n**Objective:** Extract complete interface specifications from official documentation.\n\n**Actions:**\n1. Use `WebFetch` to retrieve official documentation\n2. Use browser automation (`mcp__browser-automation__*`) if interactive navigation needed\n3. Extract:\n   - HTTP method (GET/POST/PUT/DELETE/PATCH)\n   - URL path (e.g., `/v3/med-ins/orders`)\n   - Request parameters (name, type, required, description)\n   - Response parameters (name, type, description)\n\n**Example Output:**\n```\nInterface: 医保自费混合收款下单\nMethod: POST\nPath: /v3/med-ins/orders\nRequest: mix_pay_type, order_type, appid, openid, ...\nResponse: mix_trade_no, mix_pay_status, ...\n```\n\n### Step 2: Implement Interface Code\n\n**Objective:** Implement interface following project conventions.\n\n#### 2.1 Add API Path Constants\n\n**File:** `wechat/v3/constant.go` or `alipay/v3/constant.go`\n\n**Naming:** `v3` + ModuleName + ActionName\n\n**Example:**\n```go\n// 医保支付\nv3MedInsOrder             = \"/v3/med-ins/orders\"                 // 医保自费混合收款下单 POST\nv3MedInsOrderQueryByMixNo = \"/v3/med-ins/orders/mix-trade-no/%s\" // mix_trade_no 查询 GET\nv3MedInsOrderQueryByOutNo = \"/v3/med-ins/orders/out-trade-no/%s\" // out_trade_no 查询 GET\n```\n\n#### 2.2 Define Data Models\n\n**File:** Create or update `model_*.go` (e.g., `model_medins.go`)\n\n**Required structures:**\n```go\n// Response wrapper\ntype XxxRsp struct {\n    Code        int         `json:\"-\"`\n    SignInfo    *SignInfo   `json:\"-\"`\n    Response    *Xxx        `json:\"response,omitempty\"`\n    ErrResponse ErrResponse `json:\"err_response,omitempty\"`\n    Error       string      `json:\"-\"`\n}\n\n// Response data\ntype Xxx struct {\n    Field1 string `json:\"field1\"` // 字段说明\n    Field2 int    `json:\"field2\"` // 字段说明\n    // ... more fields\n}\n```\n\n#### 2.3 Implement Interface Methods\n\n**File:** Create or update module file (e.g., `medins.go`)\n\n**Method naming:** `V3` + ModuleName + ActionName\n\n**Implementation pattern:**\n```go\nfunc (c *ClientV3) V3XxxMethod(ctx context.Context, bm gopay.BodyMap) (wxRsp *XxxRsp, err error) {\n    // 1. Generate authorization\n    authorization, err := c.authorization(MethodPost, v3ApiPath, bm)\n    if err != nil {\n        return nil, err\n    }\n    \n    // 2. Send request (use doProdPost for POST, doProdGet for GET)\n    res, si, bs, err := c.doProdPost(ctx, bm, v3ApiPath, authorization)\n    if err != nil {\n        return nil, err\n    }\n    \n    // 3. Initialize response\n    wxRsp = &XxxRsp{Code: Success, SignInfo: si, Response: new(Xxx)}\n    if res.StatusCode != http.StatusOK {\n        wxRsp.Code = res.StatusCode\n        wxRsp.Error = string(bs)\n        _ = js.UnmarshalBytes(bs, &wxRsp.ErrResponse)\n        return wxRsp, nil\n    }\n    \n    // 4. Parse response\n    if err = json.Unmarshal(bs, wxRsp.Response); err != nil {\n        return nil, fmt.Errorf(\"[%w]: %v, bytes: %s\", gopay.UnmarshalErr, err, string(bs))\n    }\n    \n    // 5. Verify signature\n    return wxRsp, c.verifySyncSign(si)\n}\n```\n\n**Key points:**\n- POST requests: use `doProdPost`\n- GET requests: use `doProdGet`\n- Path parameters: use `fmt.Sprintf` to format URL\n- Always verify signature with `verifySyncSign`\n\n### Step 3: Update Documentation\n\n**Objective:** Document new interfaces in project docs.\n\n#### 3.1 Update API Documentation\n\n**File:** `doc/wechat_v3.md` or `doc/alipay_v3.md`\n\n**Location:** Appendix section, grouped by functionality\n\n**Format:**\n```markdown\n* <font color='#07C160' size='4'>Module Name</font>\n    * Interface description: `client.V3MethodName()`\n    * Interface description: `client.V3MethodName2()`\n```\n\n**Example:**\n```markdown\n* <font color='#07C160' size='4'>医保支付</font>\n    * 医保自费混合收款下单：`client.V3MedInsOrder()`\n    * 使用医保自费混合订单号查看下单结果：`client.V3MedInsOrderQueryByMixNo()`\n    * 使用商户订单号查看下单结果：`client.V3MedInsOrderQueryByOutNo()`\n```\n\n### Step 4: Update Version Records\n\n**Objective:** Record changes in version history.\n\n#### 4.1 Update Version Number\n\n**File:** `constant.go` (root directory)\n\n**Action:** Increment patch version (e.g., `v1.5.116` → `v1.5.117`)\n\n#### 4.2 Update Release Notes\n\n**File:** `release_note.md`\n\n**Action:** Add new version section at the top\n\n**Format:**\n```markdown\n## 版本号：v1.5.xxx\n\n* 修改记录：\n  * 平台名：新增 功能模块 相关接口。\n    * client.MethodName()，接口说明。\n    * client.MethodName2()，接口说明。\n```\n\n### Step 5: Commit Changes\n\n**Objective:** Stage all modified files for commit.\n\n**Actions:**\n```bash\n# Add all related files\ngit add constant.go\ngit add release_note.md\ngit add doc/wechat_v3.md  # or corresponding platform doc\ngit add wechat/v3/constant.go  # or corresponding platform\ngit add wechat/v3/new_file.go\ngit add wechat/v3/model_new_file.go\n\n# Check status\ngit status\n\n# Add any linter-formatted files\ngit add <formatted_files>\n```\n\n## Implementation Example\n\n**Case:** WeChat Pay v3 Medical Insurance Payment\n\n**Documentation:** `https://pay.weixin.qq.com/doc/v3/merchant/4016781466`\n\n**Interfaces identified:**\n1. Create medical insurance order - POST `/v3/med-ins/orders`\n2. Query by mix trade no - GET `/v3/med-ins/orders/mix-trade-no/{mix_trade_no}`\n3. Query by merchant order no - GET `/v3/med-ins/orders/out-trade-no/{out_trade_no}`\n\n**Files modified:**\n- `constant.go` - version bump to v1.5.117\n- `release_note.md` - added v1.5.117 changelog\n- `doc/wechat_v3.md` - added medical insurance section\n- `wechat/v3/constant.go` - added 3 API path constants\n- `wechat/v3/medins.go` - new file with 3 methods\n- `wechat/v3/model_medins.go` - new file with data structures\n\n## Quality Checklist\n\nBefore completing:\n- [ ] Code compiles without errors (`go build ./wechat/v3/...`)\n- [ ] All API paths added to constants\n- [ ] Data models include all documented fields\n- [ ] Methods follow existing implementation patterns\n- [ ] Error handling is complete\n- [ ] Signature verification is included\n- [ ] API documentation is updated\n- [ ] Version number is incremented\n- [ ] Release notes are updated\n- [ ] All files are staged for commit\n\n## Reference Files\n\n- **Constants:** `wechat/v3/constant.go`, `alipay/v3/constant.go`\n- **Models:** `wechat/v3/model_*.go`, `alipay/v3/model_*.go`\n- **Implementations:** `wechat/v3/*.go`, `alipay/v3/*.go`\n- **Documentation:** `doc/wechat_v3.md`, `doc/alipay_v3.md`\n- **Version:** `constant.go`, `release_note.md`\n\n## Tools Used\n\n- **WebFetch** - Retrieve documentation content\n- **Browser automation** - Navigate interactive documentation\n- **Read** - Reference existing implementations\n- **Write/Edit** - Create or modify code files\n- **Bash** - Execute git commands and build verification\n\n<!-- File: .claude/skills/README.md (Tokens: ~684 | Category: anthropic-skill) -->\n# GoPay 项目 Skills\n\n本目录包含 GoPay 项目专用的 Claude Code skills。\n\n## 可用 Skills\n\n### add-payment-interface\n\n为 GoPay 项目添加新支付接口的标准化工作流程。\n\n**功能：**\n- 分析官方接口文档\n- 实现接口代码（常量、模型、方法）\n- 更新项目文档\n- 更新版本记录\n- 准备 git 提交\n\n**适用场景：**\n- 添加微信支付新接口\n- 添加支付宝新接口\n- 添加其他支付平台接口\n\n## 安装 Skills\n\nSkills 需要安装到全局 `~/.claude/skills/` 目录才能被 Claude Code 识别。\n\n### 方法一：使用脚本安装（推荐）\n\n```bash\n# 在项目根目录执行\n.claude/skills/install.sh\n```\n\n### 方法二：手动安装\n\n```bash\n# 复制 skill 到全局目录\ncp -r .claude/skills/add-payment-interface ~/.claude/skills/\n\n# 重新加载 skills\n# 在 Claude Code 中执行: /skills reload\n```\n\n## 使用 Skills\n\n安装完成后，在 Claude Code 中：\n\n1. 查看所有可用 skills：\n   ```\n   /skills\n   ```\n\n2. 使用 skill：\n   - 直接告诉 Claude：\"使用 add-payment-interface skill 添加 xxx 接口\"\n   - 或者提供接口文档链接，Claude 会自动识别并使用相应的 skill\n\n## 维护说明\n\n### 更新 Skill\n\n如果需要修改 skill：\n\n1. 编辑项目中的 skill 文件：`.claude/skills/add-payment-interface/SKILL.md`\n2. 重新安装到全局目录：\n   ```bash\n   cp -r .claude/skills/add-payment-interface ~/.claude/skills/\n   ```\n3. 在 Claude Code 中重新加载：`/skills reload`\n\n### 换电脑后的设置\n\n1. Clone 项目仓库\n2. 运行安装脚本：\n   ```bash\n   .claude/skills/install.sh\n   ```\n3. 在 Claude Code 中验证：`/skills`\n\n## 目录结构\n\n```\n.claude/\n└── skills/\n    ├── README.md                          # 本文件\n    ├── install.sh                         # 安装脚本\n    └── add-payment-interface/\n        └── SKILL.md                       # Skill 定义文件\n```\n\n## 注意事项\n\n- Skills 必须安装到全局目录 `~/.claude/skills/` 才能生效\n- 项目中的 `.claude/skills/` 目录仅用于版本控制和分发\n- 修改 skill 后需要重新安装并重新加载\n- 建议将 `.claude/skills/` 目录提交到 git，方便团队协作\n\n<!-- File: .claude/skills/install.sh (Tokens: ~342 | Category: claude-rule) -->\n#!/bin/bash\n\n# GoPay Skills 安装脚本\n# 将项目中的 skills 安装到全局 ~/.claude/skills/ 目录\n\nset -e\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nGLOBAL_SKILLS_DIR=\"$HOME/.claude/skills\"\n\necho \"🚀 开始安装 GoPay Skills...\"\n\n# 创建全局 skills 目录（如果不存在）\nif [ ! -d \"$GLOBAL_SKILLS_DIR\" ]; then\n    echo \"📁 创建全局 skills 目录: $GLOBAL_SKILLS_DIR\"\n    mkdir -p \"$GLOBAL_SKILLS_DIR\"\nfi\n\n# 安装每个 skill\nfor skill_dir in \"$SCRIPT_DIR\"/*/; do\n    if [ -d \"$skill_dir\" ]; then\n        skill_name=$(basename \"$skill_dir\")\n\n        # 跳过非 skill 目录\n        if [ ! -f \"$skill_dir/SKILL.md\" ]; then\n            continue\n        fi\n\n        echo \"📦 安装 skill: $skill_name\"\n\n        # 复制到全局目录\n        cp -r \"$skill_dir\" \"$GLOBAL_SKILLS_DIR/\"\n\n        echo \"   ✅ $skill_name 安装完成\"\n    fi\ndone\n\necho \"\"\necho \"✨ 所有 skills 安装完成！\"\necho \"\"\necho \"📝 下一步：\"\necho \"   1. 在 Claude Code 中执行: /skills reload\"\necho \"   2. 执行 /skills 查看已安装的 skills\"\necho \"\"\n\n<!-- File: CLAUDE.md (Tokens: ~1139 | Category: claude-rule) -->\n# GoPay 项目说明\n\n## 代码探索约定\n\n探索/索引本项目代码时，**默认优先使用 `codebase-memory` MCP**，未安装则降级到默认工具：\n\n1. **首选**：`mcp__codebase-memory-mcp__*` 工具（若可用）\n   - `search_graph` — 按名称/标签/限定名查找函数、类型、路由\n   - `trace_path` — 调用链、数据流、跨服务追踪\n   - `get_code_snippet` — 按限定名获取精确源码片段\n   - `query_graph` — 复杂 Cypher 查询\n   - `get_architecture` — 项目结构总览\n   - `search_code` — 图增强的文本搜索\n   - 项目未索引时，先运行 `index_repository` 建立索引\n2. **降级（MCP 未安装/不可用时）**：使用默认工具 `Grep` / `Glob` / `Read` / `Bash`（find、grep）进行文本与文件检索\n3. 不管哪种方式，**编辑前必须先 `Read` 目标文件**\n\n## 项目概述\n\nGoPay 是一个 Go 语言的支付 SDK 项目，提供微信、支付宝、QQ、通联支付、拉卡拉、PayPal、扫呗、Apple 支付的统一接口。\n\n- **仓库**: https://github.com/go-pay/gopay\n- **Go 版本**: 1.24.0\n- **许可证**: Apache 2.0\n\n## 项目结构\n\n```\ngopay/\n├── alipay/          # 支付宝支付 SDK\n├── wechat/          # 微信支付 SDK\n├── apple/           # Apple 支付校验\n├── paypal/          # PayPal 支付 SDK\n├── qq/              # QQ 支付 SDK\n├── allinpay/        # 通联支付 SDK\n├── lakala/          # 拉卡拉支付 SDK\n├── saobei/          # 扫呗支付 SDK\n├── pkg/             # 公共包\n├── doc/             # 各支付方式文档\n└── examples/        # 示例代码\n```\n\n## 开发约定\n\n### 代码风格\n\n1. **遵循 Go 标准规范**\n   - 使用 `gofmt` 格式化代码\n   - 遵循 Go 命名约定（驼峰命名）\n   - 导出的函数、类型、常量首字母大写\n\n2. **测试文件**\n   - 每个模块都有对应的 `*_test.go` 文件\n   - 测试文件包含实际使用示例\n   - 建议使用正式环境 1 分钱测试法\n\n3. **日志处理**\n   - 使用项目依赖的 `github.com/go-pay/xlog` 包\n   - 支持自定义 Logger（实现 `xlog.XLogger` interface）\n\n### 支付平台版本\n\n- **支付宝**: 优先使用 V3 版本\n- **微信**: 优先使用 V3 版本（V2 版本不推荐）\n- 其他平台参考 `doc/` 目录下的文档\n\n### 重要注意事项\n\n1. **安全性优先**\n   - 处理支付相关代码时特别注意安全性\n   - 不要在代码中硬编码敏感信息（密钥、证书等）\n   - 注意参数验证和签名校验\n\n2. **向后兼容**\n   - 这是一个公开的 SDK，修改时注意 API 兼容性\n   - 重大变更需要在 `release_note.md` 中记录\n\n3. **文档同步**\n   - 新增功能需要更新对应的 `doc/*.md` 文档\n   - 保持代码示例和文档的一致性\n\n## 依赖管理\n\n项目使用 Go Modules，主要依赖：\n- `github.com/go-pay/crypto` - 加密工具\n- `github.com/go-pay/xlog` - 日志工具\n- `github.com/go-pay/util` - 通用工具\n- `golang.org/x/crypto` - Go 官方加密库\n\n## 参考资源\n\n- 各支付方式文档: `doc/` 目录\n- 测试用例: 各模块的 `*_test.go` 文件\n- 示例项目: https://github.com/go-pay/gopay-platform\n</yakaai_skills>"}