{"skill":{"slug":"infoxmed-qr-generator","displayName":"Infoxmed Qr Generator","summary":"Use when the user asks to generate infoxmed VIP membership activation QR codes, batch QR codes, or mentions infoxmed membership cards. Triggers on keywords l...","description":"---\nname: infoxmed-qr-generator\ndescription: Use when the user asks to generate infoxmed VIP membership activation QR codes, batch QR codes, or mentions infoxmed membership cards. Triggers on keywords like infoxmed, VIP QR, membership activation QR, member card QR code generation.\n---\n\n# Infoxmed VIP Membership QR Code Generator\n\n## Overview\n\nExtracts parameters from natural language input and calls the infoxmed batch QR code generation API, then saves the returned zip file locally.\n\n## When to Use\n\n- User asks to generate infoxmed VIP/membership activation QR codes\n- User mentions keywords: infoxmed, VIP二维码, 会员激活二维码, 会员卡二维码\n\n## Parameter Extraction Rules\n\nFrom user input, extract and map these fields:\n\n| User Input Field | API Parameter | Extraction Rule |\n|---|---|---|\n| 医院名称 / 机构 | `agent` | Format: `{商务渠道人}-{医院名称}`, e.g. `商务二部 蔡宏-宜兴市人民医院` |\n| 时限 / 卡类型 | `cardName` | Extract core card name from input. Map: 月卡/季卡/半年卡/年卡/周卡. Strip \"会员\"/\"会员卡\" suffix, keep only `X卡` |\n| 可扫码数量 / 次数 / 张数 | `times` | Extract number. If not specified and vipCarType=2, default `9999` |\n| 绑定商务渠道人 / 商务 | (part of `agent`) | Combined into agent field as prefix before `-` |\n| 扫码类型 | `vipCarType` | `2` if times > 1 or user specifies multi-use; `1` if one-time QR code. Default: infer from times |\n\n**Fixed parameters:**\n- `password`: Read from environment variable `INFOXMED_VIP_PASSWORD`. If not set, **stop and tell the user** to configure it (see Setup section below).\n- `count`: `1`\n\n## Password Check (MUST Run Before Every API Call)\n\nFirst detect the platform, then check the environment variable using the platform-appropriate command:\n\n**macOS / Linux:**\n```bash\necho $INFOXMED_VIP_PASSWORD\n```\n\n**Windows (PowerShell):**\n```powershell\necho $env:INFOXMED_VIP_PASSWORD\n```\n\n**If the variable is set (non-empty):** proceed with the API call.\n\n**If the variable is empty or not set:** DO NOT call the API. Instead, run the following interactive setup flow:\n\n1. Ask the user: \"检测到 INFOXMED_VIP_PASSWORD 未配置，请提供你的接口密码，我来帮你自动配置。\"\n2. After the user provides the password, detect platform and shell, then persist the variable:\n\n### macOS / Linux\n\n```bash\n# Detect shell profile\nif [ -n \"$ZSH_VERSION\" ] || [[ \"$SHELL\" == */zsh ]]; then\n  PROFILE=\"$HOME/.zshrc\"\nelif [ -n \"$BASH_VERSION\" ] || [[ \"$SHELL\" == */bash ]]; then\n  PROFILE=\"$HOME/.bashrc\"\nelif [[ \"$SHELL\" == */fish ]]; then\n  PROFILE=\"$HOME/.config/fish/config.fish\"\nelse\n  PROFILE=\"$HOME/.profile\"\nfi\n\n# Write to profile (fish uses different syntax)\nif [[ \"$SHELL\" == */fish ]]; then\n  echo 'set -gx INFOXMED_VIP_PASSWORD \"USER_PROVIDED_PASSWORD\"' >> \"$PROFILE\"\nelse\n  echo '' >> \"$PROFILE\"\n  echo '# Infoxmed VIP QR API password' >> \"$PROFILE\"\n  echo 'export INFOXMED_VIP_PASSWORD=\"USER_PROVIDED_PASSWORD\"' >> \"$PROFILE\"\nfi\n\n# Set for current session\nexport INFOXMED_VIP_PASSWORD=\"USER_PROVIDED_PASSWORD\"\n```\n\n### Windows (PowerShell)\n\n```powershell\n# Set permanently for current user (persists across reboots)\n[System.Environment]::SetEnvironmentVariable(\"INFOXMED_VIP_PASSWORD\", \"USER_PROVIDED_PASSWORD\", \"User\")\n\n# Set for current session\n$env:INFOXMED_VIP_PASSWORD = \"USER_PROVIDED_PASSWORD\"\n```\n\n3. Confirm to the user: \"已配置完成并在当前会话生效，后续无需再次配置。\"\n4. Then continue with the original QR code generation request.\n\n## cardName Mapping Examples\n\n| User says | cardName value |\n|---|---|\n| 半年会员卡 / 半年卡 / 半年 | 半年卡 |\n| 月卡 / 月会员卡 / 一个月 | 月卡 |\n| 季卡 / 季度卡 / 三个月 | 季卡 |\n| 年卡 / 年会员卡 / 一年 | 年卡 |\n| 周卡 / 周会员卡 / 一周 | 周卡 |\n\n## vipCarType Logic\n\n```\nif times == 1 or user explicitly says \"一次性\":\n    vipCarType = 1, times = 1\nelse:\n    vipCarType = 2, times = user_specified or 9999\n```\n\n## Execution Steps\n\n1. **Extract parameters** from user's natural language input using rules above\n2. **Confirm parameters** - show extracted parameters to user before calling API\n3. **Call API** — use platform-appropriate command:\n\n**macOS / Linux:**\n```bash\ncurl -s -o /tmp/vip_qr_{timestamp}.zip \\\n  \"https://api.infox-med.com/system/batchGenerateVipQr?password=${INFOXMED_VIP_PASSWORD}&agent={url_encoded_agent}&count=1&cardName={url_encoded_cardName}&vipCarType={vipCarType}&times={times}\" \\\n  -H \"Origin: https://admin.infox-med.com\" \\\n  -H \"Referer: https://admin.infox-med.com/\"\n```\n\n**Windows (PowerShell):**\n```powershell\nInvoke-WebRequest -Uri \"https://api.infox-med.com/system/batchGenerateVipQr?password=$env:INFOXMED_VIP_PASSWORD&agent={url_encoded_agent}&count=1&cardName={url_encoded_cardName}&vipCarType={vipCarType}&times={times}\" `\n  -Headers @{ \"Origin\" = \"https://admin.infox-med.com\"; \"Referer\" = \"https://admin.infox-med.com/\" } `\n  -OutFile \"$env:TEMP\\vip_qr_{timestamp}.zip\"\n```\n\n4. **Verify** the downloaded file is a valid zip\n5. **Report** file path to user\n\n## Missing Parameter Handling\n\nIf any required info is missing, ask the user. Required fields:\n- 医院名称 (for agent)\n- 商务渠道人 (for agent)\n- 卡类型/时限 (for cardName)\n- 可扫码数量 (for times, defaults to 9999 if truly unspecified for multi-use)\n\n## Example\n\n**User input:**\n> 请生成二维码\n> 医院名称：宜兴市人民医院\n> 时限：半年会员卡\n> 可扫码数量：1000次\n> 绑定商务渠道人：商务二部 蔡宏\n\n**Extracted parameters:**\n- `agent` = `商务二部 蔡宏-宜兴市人民医院`\n- `count` = `1`\n- `cardName` = `半年卡`\n- `vipCarType` = `2` (because times=1000 > 1)\n- `times` = `1000`\n- `password` = `${INFOXMED_VIP_PASSWORD}`\n\n**API call:**\n```\nGET https://api.infox-med.com/system/batchGenerateVipQr?password=${INFOXMED_VIP_PASSWORD}&agent=商务二部%20蔡宏-宜兴市人民医院&count=1&cardName=半年卡&vipCarType=2&times=1000\n```\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":221,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1773132370857,"updatedAt":1779078649800},"latestVersion":{"version":"1.0.0","createdAt":1773132370857,"changelog":"infoxmed-qr-generator v1.0.0\n\n- Initial release of Infoxmed VIP Membership QR Code Generator.\n- Extracts parameters from natural language requests to generate VIP/member activation QR codes for Infoxmed.\n- Checks for required INFOXMED_VIP_PASSWORD environment variable before API calls; guides the user through setup if missing.\n- Supports both macOS/Linux and Windows environments for password setup and QR code generation.\n- Provides clear missing-parameter prompts and confirms all extracted info with the user before execution.\n- Downloads resulting QR codes as a zip file and reports the path to the user.","license":"MIT-0"},"metadata":null,"owner":{"handle":"yaochao","userId":"s1785d5b88ps0v1q3c6192xc9183kq6d","displayName":"yaochao","image":"https://avatars.githubusercontent.com/u/4301793?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779963453752}}