---
name: ad_compliance_rules.aiconfig
description: 广告合规规则配置 - 定义 Facebook、Google、TikTok、Unity Ads 的试玩广告技术合规要求
triggers: 合规,compliance,审核,review,平台规则,platform rules,广告政策,ad policy,facebook规则,google规则
---

# ad_compliance_rules.aiconfig

广告合规规则配置。定义各广告平台（Facebook、Google、TikTok、Unity Ads）的试玩广告技术合规要求，作为构建和审核的检查清单。

### 通用规则

| 规则 | 要求 | 说明 |
|------|------|------|
| 文件大小 | ≤ 5MB | 所有平台的硬性限制 |
| 外部请求 | 禁止 | 不允许 fetch/XHR/动态加载 |
| 自动播放音频 | 禁止 | 必须用户交互后才能播放 |
| CTA 按钮 | 必须有 | 必须包含明确的下载/安装按钮 |
| Viewport | 固定 | `width=device-width, initial-scale=1, user-scalable=no` |

### 平台特定规则

| 平台 | 格式 | 特殊要求 |
|------|------|---------|
| Facebook | HTML 或 ZIP | 不使用 MRAID |
| Google | HTML 或 ZIP | 必须使用 `ExitApi` |
| TikTok | ZIP | 必须集成 TikTok SDK |
| Unity Ads | 单 HTML | 必须使用 MRAID |

## Recipe

- **配置方式**：固定（fixed）
- **核心参数**：
  - `rules.universal`: 所有平台共用的合规规则
  - `rules.facebook`: Facebook Playable Ads 特定规则
  - `rules.google`: Google Interactive Ads 特定规则
  - `rules.tiktok`: TikTok Playable Ads 特定规则
  - `rules.unity`: Unity Ads Playable 特定规则
- **使用场景**：
  - 构建前：检查项目设置是否符合目标平台要求
  - 构建后：验证产物是否满足合规清单
  - 审核时：Reviewer Agent 按此清单逐项检查

**配置步骤：**
1. 读取项目的 `game/config.json`
2. 写入 `compliance` 配置块，包含通用规则和各平台特定规则
3. 此配置为固定值，通常不需要用户修改

## Result

- **产物**：修改 `game/config.json` 的合规规则配置块
- **格式**：JSON patch
- **目标键**：`compliance`
- **包含子键**：`rules.universal`, `rules.facebook`, `rules.google`, `rules.tiktok`, `rules.unity`

## Binding

- **Binding Role**：`gameConfig`
- **挂载目标**：`game/config.json`
- **引用类型**：`config-key-value`
- **与其他 Skill 的关系**：
  - 与 `cta_platform_config.aiconfig` 联动：CTA 实现必须符合对应平台的合规要求
  - 与 `playtest_report.aivalidator` 联动：试玩报告中包含合规检查项

## Skill Definition

tools:
  - read
  - write
prompt_extension: |
  You are configuring ad compliance rules for a playable ad (试玩广告).
  These rules define the technical requirements that each ad platform enforces.
  CRITICAL rules that MUST be followed for ALL platforms:
  - File size ≤ 5MB (compressed)
  - No external HTTP requests (no fetch, XHR, dynamic script loading)
  - No auto-play audio (audio only after user interaction)
  - Must include a CTA (Call-to-Action) button
  - Viewport meta tag must be set correctly
  Platform-specific requirements:
  - Facebook: No MRAID. Use FbPlayableAd SDK.
  - Google: Must use ExitApi for CTA. No MRAID.
  - TikTok: Must include TikTok Playable SDK. ZIP format required.
  - Unity Ads: Must use MRAID. Single HTML file format.
  Read game/config.json and write the compliance rules config block.
  This config is used by the Reviewer agent to validate builds.
