Skill: cinience/aliyun-airec-manage (version 1.0.0)

--- name: aliyun-airec-manage description: Use when managing Alibaba Cloud AIRec (Airec) via OpenAPI/SDK, including the user needs recommendation-engine resource operations in Alibaba Cloud, including list/create/update flows, status inspection, and troubleshooting AIRec configuration or runtime issues. version: 1.0.0 --- Category: service # AIRec Use Alibaba Cloud OpenAPI (RPC) with official SDKs or OpenAPI Explorer to manage resources for AIRec. ## Workflow 1) Confirm region, resource identifiers, and desired action. 2) Discover API list and required parameters (see references). 3) Call API with SDK or OpenAPI Explorer. 4) Verify results with describe/list APIs. ## AccessKey priority (must follow) 1) Environment variables: `ALICLOUD_ACCESS_KEY_ID` / `ALICLOUD_ACCESS_KEY_SECRET` / `ALICLOUD_REGION_ID` Region policy: `ALICLOUD_REGION_ID` is an optional default. If unset, decide the most reasonable region for the task; if unclear, ask the user. 2) Shared config file: `~/.alibabacloud/credentials` ## API discovery - Product code: `Airec` - Default API version: `2020-11-26` - Use OpenAPI metadata endpoints to list APIs and get schemas (see references). ## High-frequency operation patterns 1) Inventory/list: prefer `List*` / `Describe*` APIs to get current resources. 2) Change/configure: prefer `Create*` / `Update*` / `Modify*` / `Set*` APIs for mutations. 3) Status/troubleshoot: prefer `Get*` / `Query*` / `Describe*Status` APIs for diagnosis. ## Minimal executable quickstart Use metadata-first discovery before calling business APIs: ```bash python scripts/list_openapi_meta_apis.py ``` Optional overrides: ```bash python scripts/list_openapi_meta_apis.py --product-code <ProductCode> --version <Version> ``` The script writes API inventory artifacts under the skill output directory. ## Output policy If you need to save responses or generated artifacts, write them under: `output/aliyun-airec-manage/` ## Validation ```bash mkdir -p output/aliyun-airec-manage for f in skills/ai/recommendation/aliyun-airec-manage/scripts/*.py; do python3 -m py_compile "$f" done echo "py_compile_ok" > output/aliyun-airec-manage/validate.txt ``` Pass criteria: command exits 0 and `output/aliyun-airec-manage/validate.txt` is generated. ## Output And Evidence - Save artifacts, command outputs, and API response summaries under `output/aliyun-airec-manage/`. - Include key parameters (region/resource id/time range) in evidence files for reproducibility. ## Prerequisites - Configure least-privilege Alibaba Cloud credentials before execution. - Prefer environment variables: `ALICLOUD_ACCESS_KEY_ID`, `ALICLOUD_ACCESS_KEY_SECRET`, optional `ALICLOUD_REGION_ID`. - If region is unclear, ask the user before running mutating operations. ## References - Sources: `references/sources.md`

path: agents/openai.yaml
content: interface:
  display_name: "Alibaba Cloud AI Recommend AIRec"
  short_description: "AIRec recommendation configuration workflows"
  default_prompt: "Use $alicloud-ai-recommend-airec to complete this ai/recommendation task on Alibaba Cloud."


path: references/sources.md
content: # Sources

- OpenAPI product page: `https://api.aliyun.com/product/Airec`
- API list (metadata): `https://api.aliyun.com/meta/v1/products/Airec/versions/2020-11-26/api-docs.json`
- API definition (single API): `https://api.aliyun.com/meta/v1/products/Airec/versions/2020-11-26/apis/{ApiName}/api.json`


path: scripts/list_openapi_meta_apis.py
content: #!/usr/bin/env python3
"""Fetch OpenAPI metadata API list for one product/version and save to output/.

Env:
- OPENAPI_META_TIMEOUT (seconds, default: 20)
"""

from __future__ import annotations

import argparse
import json
import os
import pathlib
import urllib.request

DEFAULT_PRODUCT_CODE = "Airec"
DEFAULT_VERSION = "2020-11-26"
OUTPUT_DIR = pathlib.Path("output/aliyun-airec-manage")


def fetch_json(url: str, timeout: int) -> dict:
    req = urllib.request.Request(url, headers={"User-Agent": "codex-skill"})
    with urllib.request.urlopen(req, timeout=timeout) as resp:
        return json.loads(resp.read().decode("utf-8"))


def main() -> None:
    parser = argparse.ArgumentParser()
    parser.add_argument("--product-code", default=DEFAULT_PRODUCT_CODE)
    parser.add_argument("--version", default=DEFAULT_VERSION)
    parser.add_argument("--output-dir", default=str(OUTPUT_DIR))
    args = parser.parse_args()

    timeout = int(os.getenv("OPENAPI_META_TIMEOUT", "20"))
    output_dir = pathlib.Path(args.output_dir)
    output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)

    raw_apis = payload.get("apis", {})
    if isinstance(raw_apis, dict):
        api_names = sorted(raw_apis.keys())
    elif isinstance(raw_apis, list):
        names = []
        for item in raw_apis:
            if isinstance(item, dict):
                name = item.get("name") or item.get("apiName")
                if name:
                    names.append(name)
            elif isinstance(item, str):
                names.append(item)
        api_names = sorted(set(names))
    else:
        api_names = []

    json_file = output_dir / f"{args.product_code}_{args.version}_api_docs.json"
    md_file = output_dir / f"{args.product_code}_{args.version}_api_list.md"

    json_file.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8")
    md_lines = [
        f"# {args.product_code} {args.version} API List",
        "",
        f"- Source: {url}",
        f"- API count: {len(api_names)}",
        "",
    ]
    md_lines.extend([f"- `{name}`" for name in api_names])
    md_file.write_text("\n".join(md_lines) + "\n", encoding="utf-8")

    print(f"Saved: {json_file}")
    print(f"Saved: {md_file}")


if __name__ == "__main__":
    main()


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)