Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

huawei-cloud-voucher-send

БесплатноЗапускает вложенные скриптыНе проверен

1. Issue (发放) new Huawei Cloud BSS (费用中心) vouchers / coupons to sub-customers / partners through KooCLI (hcloud BSS CreatePartnerCoupons — mutating POST…

wlc-devот wlc-dev396 установок в других каталогах

Об этом скилле

Huawei Cloud BSS Voucher Send (发放代金券给子客户/合作伙伴)

Overview

Issue new Huawei Cloud BSS vouchers / coupons to one or more sub-customer / partner accounts through the KooCLI issue-coupon operation (CreatePartnerCoupons, hcloud service BSS) on the official issue-coupon API, POST /v2/promotions/benefits/partner-coupons, verified in the huaweicloudsdkbss v2 client _create_partner_coupons_http_info metadata). When hcloud is not installed the skill falls back to the official huaweicloudsdkbss v2 SDK (BssClient.create_partner_coupons).

Architecture:

agent → python3 scripts/send_voucher.py --quota-id <q> --customer-id <c> --face-value <v> --confirm
      → hcloud BSS CreatePartnerCoupons --cli-region=<region> ... (mutating POST)
      → Huawei Cloud BSS OpenAPI (global endpoint) → coupon_infos / error_details
      → idempotency ledger (per customer) + human summary / --json

(hcloud binary missing) → fallback: huaweicloudsdkbss v2 BssClient.create_partner_coupons

Key properties:

  • Write by design, safe by default — issuing a coupon moves money / benefit to the target account and is normally irreversible. A live send requires the explicit --confirm flag; without it the run stops and prints a warning. --dry-run previews the exact request (including the ledger skips) without issuing anything.
  • Issuance source & the coupon code — a new coupon has no 券码 before it is issued: the BSS issue API selects the coupon source by coupon quota (quota_id, an 额度ID obtained from ListQuotaCoupons), and returns the generated coupon_id / 券码 for each target. coupon_code is therefore a response-only field; this skill correctly parameterises the request with quota_id + face_value instead of a pre-existing code. (The Spec placeholder operation SendSubCustomerCoupons does not exist in the official API and is accepted only as a naming alias of CreatePartnerCoupons.)
  • Batch — many sub-customers are issued in a single API call; the response reports per-customer successes (coupon_infos) and per-customer failures (error_details).
  • Idempotent / no double-issue — a per-customer natural key (quota + customer
    • face value + expiry + memo + limits) is stored in a local ledger. On retry, customers already issued inside the idempotency window are skipped, so re-running a partially failed batch only retries the failures.
  • CLI first, SDK fallback — KooCLI is the primary path; when the KooCLI binary is absent the script falls back to huaweicloudsdkbss v2. BSS is a global service, so the SDK path uses GlobalCredentials + with_endpoints (https://bss.myhuaweicloud.com). Credentials are resolved by config.py (hcloud profile for the CLI path; standard environment variables for the SDK path) — never handled by the skill.
  • Offline-testable — validation, batch construction, idempotency, error grading, SDK fallback and all output modes are covered by unit tests that mock the hcloud subprocess.

Out of scope: coupon queries (use the read-only sibling skill), coupon reclaim / return / freeze / cancel, and the account-to-account transfer semantic (a different BSS operation).

Prerequisites

  1. KooCLI (hcloud) installed — see references/cli-installation-guide.md. Alternative: pip install huaweicloudsdkcore huaweicloudsdkbss to enable the SDK fallback path.
  2. Credential profile — configure credentials out-of-band (hcloud configure in your terminal, or the standard credential environment variables). Never paste AK/SK into chat; config.py reads the hcloud profile / environment and never echoes or stores secrets.
  3. IAM write permission — the issue-coupon action (least-privilege policy in references/iam-policies.md). The calling identity must be a distributor / partner of the target sub-customers.
  4. A coupon quota (quota_id) — the source of the coupon to issue; query it with hcloud BSS ListQuotaCoupons --cli-region=cn-north-1.
  5. Python 3.8+ (standard library only for the command path — argparse / json / subprocess / decimal).
  6. Outbound HTTPS access to bss.myhuaweicloud.com.
  7. Region — BSS is a global service; use cn-north-1 (the default here).

Workflow

  1. Confirm the danger — issuing vouchers is a money-moving, irreversible change. Obtain explicit user confirmation (the caller sets --confirm); the skill refuses to send without it.
  2. Resolve the source quota — query the coupon quota (hcloud BSS ListQuotaCoupons --cli-region=cn-north-1) to get the quota_id to issue from.
  3. Prepare the batch — one or more target sub-customer account IDs (--customer-id, --customer-ids, or --customers-file) and the coupon --face-value (+ optional validity window / limits / memo).
  4. Preview — run with --dry-run to inspect the exact re
Полный SKILL.md на ClawHub

Установить huawei-cloud-voucher-send в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл huawei-cloud-voucher-send?

1. Issue (发放) new Huawei Cloud BSS (费用中心) vouchers / coupons to sub-customers / partners through KooCLI (hcloud BSS CreatePartnerCoupons — mutating POST /v2/promotions/benefits/partner-coupons), with an automatic fallback to the official huaweicloudsdkbss v2 SDK when hcloud is not installed. 2. Zero-config operation: the invocation path is chosen automatically (CLI first, SDK fallback); credentials are loaded only from the hcloud profile or the standard Huawei Cloud environment variables. 3. Batch-aware: one call issues coupons to many sub-customer accounts (repeatable --customer-id / comma --customer-ids / --customers-file). 4. Idempotent: a per-customer natural key is remembered in a local ledger, so retrying a partially failed batch never double-issues an already-issued customer; --force overrides, --no-idempotency disables. 5. Safe by default for a money-moving, irreversible operation: a live send requires the explicit --confirm flag; --dry-run previews the exact request without issuing anything. 6. Graded errors: ConfigError (missing/invalid parameters or credentials) / AuthError (401/403 / insufficient IAM permission) / ApiError (unexpected API or network failure), each with an actionable hint. 7. Offline unit tests (mocked hcloud subprocess) cover validation, batch construction, idempotency, error grading, SDK fallback and all CLI modes. 8. Triggers include: "发放代金券", "给子客户发券", "发放优惠券给子客户", "合作伙伴发券", "send voucher", "issue coupon", "create partner coupons", "华为云代金券发放", "BSS coupon issue". 9. Write-intent guard: only the issue-coupon operation ever executes; reclaim / transfer / freeze / individually-issued-coupon mutation operations are rejected — this skill issues new coupons only.

Как установить скилл huawei-cloud-voucher-send?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл huawei-cloud-voucher-send запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить huawei-cloud-voucher-send с