@hungvv/super-ads-skills 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -13
- package/dist/cli.js +8 -2
- package/package.json +1 -1
- package/skills/README.md +4 -0
- package/skills/adspro-to-superads/SKILL.md +157 -732
- package/skills/adspro-to-superads/references/global-invariant-check.md +49 -0
- package/skills/adspro-to-superads/references/migration-contract.md +57 -0
- package/skills/adspro-to-superads/references/phase-0-inventory.md +39 -0
- package/skills/adspro-to-superads/references/phase-1-2-gradle-manifest.md +85 -0
- package/skills/adspro-to-superads/references/phase-3-config-migration.md +159 -0
- package/skills/adspro-to-superads/references/phase-4-wrapper-observability.md +70 -0
- package/skills/adspro-to-superads/references/phase-5-7-callsites-layout-cleanup.md +73 -0
- package/skills/adspro-to-superads/references/principles-and-authority.md +73 -0
- package/skills/adspro-to-superads/references/user-questions.md +53 -0
- package/skills/adspro-to-superads/snippets/ads-api-quick.md +20 -0
- package/skills/adspro-to-superads/templates/migration-inventory.md +42 -0
- package/skills/super-ads-ab-test/SKILL.md +91 -23
- package/skills/super-ads-adb-test/SKILL.md +85 -36
- package/skills/super-ads-adb-test/{references → examples}/scenarios-sample.md +5 -5
- package/skills/super-ads-add-placement/SKILL.md +145 -50
- package/skills/super-ads-add-placement/references/call-site-api.md +33 -0
- package/skills/super-ads-add-placement/snippets/app-open.md +25 -0
- package/skills/super-ads-add-placement/snippets/fullscreen-nav.md +14 -0
- package/skills/super-ads-add-placement/snippets/inline-banner-native.md +19 -0
- package/skills/super-ads-add-placement/snippets/preload-event.md +13 -0
- package/skills/super-ads-add-placement/snippets/reward.md +17 -0
- package/skills/super-ads-config/SKILL.md +94 -36
- package/skills/super-ads-debug/SKILL.md +87 -37
- package/skills/super-ads-debug/references/logging-setup.md +2 -0
- package/skills/super-ads-debug/scripts/filter-logads.sh +21 -0
- package/skills/super-ads-debug-override/SKILL.md +154 -81
- package/skills/super-ads-debug-override/snippets/arm-override.md +9 -0
- package/skills/super-ads-debug-override/snippets/check-module.md +8 -0
- package/skills/super-ads-debug-override/snippets/clear-override.md +9 -0
- package/skills/super-ads-debug-override/snippets/confirm-active.md +16 -0
- package/skills/super-ads-guide/SKILL.md +129 -0
- package/skills/super-ads-guide/references/compatibility.md +26 -0
- package/skills/super-ads-guide/references/sdk-version-check.md +50 -0
- package/skills/super-ads-integrate/SKILL.md +145 -47
- package/skills/super-ads-integrate/references/application-setup.md +2 -21
- package/skills/super-ads-integrate/references/gradle-setup.md +1 -13
- package/skills/super-ads-integrate/snippets/consent-request.md +12 -0
- package/skills/super-ads-integrate/templates/application-oncreate.md +17 -0
- package/skills/super-ads-integrate/templates/gradle-dependencies.md +17 -0
- package/skills/super-ads-release-check/SKILL.md +85 -32
- package/skills/super-ads-show-rate/SKILL.md +87 -36
- package/skills/super-ads-show-rate/references/collect-snippet.md +2 -36
- package/skills/super-ads-show-rate/scripts/show-rate.sh +25 -0
- package/skills/super-ads-show-rate/snippets/show-events-logger.md +26 -0
- package/skills/super-ads-upgrade/SKILL.md +137 -0
- package/skills/super-ads-upgrade/references/upgrade-hops.md +26 -0
- package/skills/super-ads-upgrade/templates/changelog-template.md +39 -0
- package/skills/super-ads-add-placement/references/call-site-snippets.md +0 -90
- /package/skills/super-ads-ab-test/{references → templates}/firebase-handoff-template.md +0 -0
- /package/skills/super-ads-config/{references → examples}/patch-examples.md +0 -0
|
@@ -1,43 +1,95 @@
|
|
|
1
1
|
---
|
|
2
2
|
schema: 1
|
|
3
3
|
name: super-ads-release-check
|
|
4
|
-
description: Use when an app using SuperAds is about to ship a release build
|
|
5
|
-
version: 1.
|
|
4
|
+
description: Use when an app using SuperAds is about to ship a release build, to get an evidence-based report-only checklist
|
|
5
|
+
version: 1.3.0
|
|
6
6
|
group: Ads
|
|
7
|
+
superAds: ">=4.0.0 <5.0.0"
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Rà SuperAds trước khi phát hành
|
|
10
11
|
|
|
11
12
|
Checklist **chỉ báo cáo**. Mỗi mục có lệnh kiểm, tiêu chí đạt và nguồn. Skill không sửa file nào; mọi sửa đổi chờ user duyệt.
|
|
12
13
|
|
|
13
|
-
Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `DBG/` = `super-ads-debug/src/main/java/com/android/fullhd/super_ads/debug/`. `<app>` là module app, `<config>` là file config sẽ phát hành (asset và/hoặc bản remote).
|
|
14
|
-
|
|
15
14
|
## When to use
|
|
16
15
|
- Trước khi build release, tạo bản phát hành, hoặc trước khi đẩy config remote mới lên production.
|
|
17
16
|
|
|
18
|
-
## When NOT to use
|
|
17
|
+
## 🚫 When NOT to use
|
|
19
18
|
- Đang tìm lỗi một ad cụ thể → `super-ads-debug`.
|
|
20
19
|
- Gắn SDK lần đầu → `super-ads-integrate` (chạy skill này ở cuối).
|
|
21
20
|
|
|
22
|
-
##
|
|
21
|
+
## 📋 Prerequisites
|
|
22
|
+
- Định tuyến skill và kiểm version SDK: xem [super-ads-guide](../super-ads-guide/SKILL.md).
|
|
23
|
+
- Skill này nhắm SuperAds `>=4.0.0 <5.0.0`. App dùng SuperAds thấp hơn ⇒ **dừng** và khuyến nghị (không ép) nâng cấp qua [super-ads-upgrade](../super-ads-upgrade/SKILL.md) trước khi tiếp tục.
|
|
24
|
+
- Biết module app, build type release, file config sẽ phát hành (asset và/hoặc remote), danh sách network (thu ở Phase 1).
|
|
25
|
+
- Build được release (keystore, artifact có sẵn); MCP `super-ads` cho `validate_config` (mục 11).
|
|
26
|
+
|
|
27
|
+
## ⚡ Quick Reference
|
|
28
|
+
|
|
29
|
+
| Cần | Tài liệu |
|
|
30
|
+
|---|---|
|
|
31
|
+
| Bảng 22 mục kiểm | phần `## Checklist` bên dưới |
|
|
32
|
+
| Checklist Firebase A/B (mục 22) | [references/firebase-ab-checklist.md](references/firebase-ab-checklist.md) |
|
|
33
|
+
| Custom dimension/metric GA4 (mục 20) | [references/ga4-custom-definitions.md](references/ga4-custom-definitions.md) |
|
|
34
|
+
|
|
35
|
+
Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `DBG/` = `super-ads-debug/src/main/java/com/android/fullhd/super_ads/debug/`. `<app>` là module app, `<config>` là file config sẽ phát hành (asset và/hoặc bản remote).
|
|
36
|
+
|
|
37
|
+
Kết quả mỗi mục: `PASS` / `FAIL` / `CẦN QUYẾT ĐỊNH` / `SKIP`.
|
|
38
|
+
|
|
39
|
+
## 🏗️ Recommended Architecture
|
|
40
|
+
Thứ tự thẩm quyền khi các nguồn mâu thuẫn:
|
|
23
41
|
1. Code SDK và Gradle thật của app (output `dependencies`, không phải đọc tay).
|
|
24
42
|
2. `MIGRATION.md`.
|
|
25
43
|
3. Quy ước phát hành của nhóm do user cung cấp. Mục nào là **quyết định sản phẩm** thì báo "cần quyết định", không báo "lỗi".
|
|
26
44
|
|
|
27
|
-
##
|
|
28
|
-
|
|
45
|
+
## Workflow
|
|
46
|
+
|
|
47
|
+
### Stop conditions
|
|
48
|
+
- Không build được release (thiếu keystore, thiếu artifact): báo nguyên văn lỗi, không tự sửa.
|
|
49
|
+
- Không lấy được config remote đang dùng: hỏi user nguồn config.
|
|
50
|
+
|
|
51
|
+
### Phase 1: Thu thông tin
|
|
52
|
+
Module app, build type release, file config (asset và remote), danh sách network.
|
|
53
|
+
|
|
54
|
+
**Verify:** biết `<app>`, `<config>`, nguồn config remote (hoặc "không dùng").
|
|
55
|
+
|
|
56
|
+
### Phase 2: Chạy checklist
|
|
57
|
+
Chạy từng mục theo bảng ở `## Checklist`. Mục cần build release (1–3, 13, 15, 16, 18) chạy sau cùng, một lần build.
|
|
58
|
+
|
|
59
|
+
**Verify:** 22 mục đều có kết quả và bằng chứng.
|
|
60
|
+
|
|
61
|
+
### Phase 3: Báo cáo
|
|
62
|
+
Bảng `# | mục | kết quả | bằng chứng | đề xuất`. `FAIL` và `CẦN QUYẾT ĐỊNH` đưa lên đầu. Đề xuất sửa nêu file và dòng, nhưng **không** sửa.
|
|
63
|
+
|
|
64
|
+
**Verify:** không có `PASS` nào thiếu bằng chứng.
|
|
65
|
+
|
|
66
|
+
## 🔧 API Reference
|
|
67
|
+
> **Not applicable for this skill.**
|
|
68
|
+
|
|
69
|
+
## ✅ Best Practices
|
|
29
70
|
- Chạy lệnh thật và trích output cho từng mục. Không chạy được thì ghi `SKIP` kèm lý do.
|
|
30
71
|
- Kết quả mỗi mục: `PASS` / `FAIL` / `CẦN QUYẾT ĐỊNH` / `SKIP`.
|
|
31
72
|
- Kiểm cả config asset **và** config remote (nếu app dùng remote).
|
|
32
73
|
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
74
|
+
## ❌ Anti-patterns
|
|
75
|
+
- Sửa Gradle, manifest, `Application`, config.
|
|
76
|
+
- Đẩy config lên Firebase hay server.
|
|
77
|
+
- Coi build debug pass là bằng chứng cho build release.
|
|
78
|
+
- Đọc `build.gradle` bằng mắt thay cho output `dependencies` (version có thể bị BOM hoặc resolution đổi).
|
|
79
|
+
- Chỉ kiểm config asset trong khi production dùng config remote.
|
|
80
|
+
- Báo overlay debug là "lỗi" khi app cố ý giữ nó: đó là quyết định của user.
|
|
37
81
|
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
|
|
82
|
+
## ⚠️ Common Issues
|
|
83
|
+
> **Not applicable for this skill.**
|
|
84
|
+
|
|
85
|
+
## Files created
|
|
86
|
+
Skill này không tạo file nguồn.
|
|
87
|
+
|
|
88
|
+
## Files modified
|
|
89
|
+
Skill này không sửa file nguồn (Gradle, manifest, `Application`, config đều chỉ đọc). Mọi sửa đổi chờ user duyệt.
|
|
90
|
+
|
|
91
|
+
## Verification
|
|
92
|
+
Mọi mục trong bảng `## Checklist` có kết quả kèm output lệnh thật làm bằng chứng; không có `PASS` nào thiếu bằng chứng; mục không chạy được ghi `SKIP` kèm lý do.
|
|
41
93
|
|
|
42
94
|
## Checklist
|
|
43
95
|
|
|
@@ -59,7 +111,7 @@ Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `
|
|
|
59
111
|
| 14 | Plugin đủ cho config | Mỗi `network` trong `units` của config có artifact tương ứng, **và luôn có `SuperAdsInHouse`** dù config không có unit InHouse | Không thiếu plugin (thiếu ⇒ `LOAD:212`; thiếu InHouse ⇒ log `ERROR_AND_CRASH` tag `RequiredPluginCheck` lúc init; `ConfigRegistryCheck` log lúc init "KHÔNG có AdNetworkPlugin nào register" hoặc "no PROVIDER for (…)") | `SA/config/validate/ConfigRegistryCheck.kt:33-35`, `SA/config/validate/ConfigRegistryCheck.kt:88`, `super-ads/src/main/java/com/android/fullhd/super_ads/config/validate/RequiredPluginCheck.kt:27-31` |
|
|
60
112
|
| 15 | R8 / minify | Build `:<app>:assembleRelease`; chạy bản release, xem có `ClassNotFoundException` / `NoSuchMethodError` / `NoClassDefFoundError` liên quan `com.android.fullhd`. App có module phụ (`SuperAdsDebug`, `SuperAdsDebugOverride`, `super-ads-test`) mà bật `minifyEnabled` cả ở debug ⇒ chạy thêm bản debug đó: các module này là AAR riêng gọi thẳng class của core (vd `config.parse.AdsConfigParserV2`), class nào ngoài rule keep của core bị R8 đổi tên/xoá ⇒ `NoClassDefFoundError` lúc init. Phát hành core/plugin mới: `node --test test/r8-cross-module-keep.test.js` trong `tools/ai_agent_tools` phải xanh | `SA/domain/error/AdError.kt:17` |
|
|
61
113
|
| 16 | Tracking Firebase | Cùng lệnh mục 1, grep `SuperAdsTracking`; đọc `global` của `<config>`: `tracking.enable`, `tracking.revenue`, `tracking.perf`, `tracking.arbiter` | App cần doanh thu Firebase ⇒ có `SuperAdsTracking`, và `tracking.enable` / `tracking.revenue` không bị tắt ngoài ý muốn (mặc định `true` / `true`). Thiếu module ⇒ mất `ad_impression` và `ad_click`, không có lỗi. Không rõ app có cần không ⇒ `CẦN QUYẾT ĐỊNH` | `MIGRATION.md:450-452`, `SA/domain/config/model/AdsConfig.kt:81`, `SA/domain/config/model/AdsConfig.kt:85` |
|
|
62
|
-
| 17 | `global.remoteApplyTimeoutMs` | Đọc `global` của config asset (gác mọi lần đổi config: `loadFromJson`, remote, `reload`) | `0` (không giới hạn) hoặc giá trị user đã chọn. Giá trị > 0: config về sau hạn (vd Remote Config chậm) bị bỏ cả phiên, không push activation ⇒ báo `CẦN QUYẾT ĐỊNH` | `SA/domain/config/model/AdsConfig.kt:77`, `SA/config/remote/RemoteConfigLoader.kt:
|
|
114
|
+
| 17 | `global.remoteApplyTimeoutMs` | Đọc `global` của config asset (gác mọi lần đổi config: `loadFromJson`, remote, `reload`) | `0` (không giới hạn) hoặc giá trị user đã chọn. Giá trị > 0: config về sau hạn (vd Remote Config chậm) bị bỏ cả phiên, không push activation ⇒ báo `CẦN QUYẾT ĐỊNH` | `SA/domain/config/model/AdsConfig.kt:77`, `SA/config/remote/RemoteConfigLoader.kt:256-259` |
|
|
63
115
|
| 18 | Không đóng gói file tạm của MCP | `find <app>/src -path "*assets*" -name "tmp-*.json"`; liệt kê asset của APK release | Không có `tmp-*.json` do MCP `super-ads` tự sinh, không có `.super-ads-tmp/` trong asset | `tools/ai_agent_tools/README.md:62`, `tools/ai_agent_tools/README.md:66-70` |
|
|
64
116
|
| 19 | Không có module override config ở release | `./gradlew :app:dependencies --configuration releaseRuntimeClasspath` tìm `SuperAdsDebugOverride` / `super-ads-debug-override`; `unzip` dex của APK release, `grep -ac debugoverride` và `grep -ac superads_override`; grep `debugoverride` trong merged manifest release | Tất cả bằng 0 (module phải là `debugImplementation`). Áp dụng khi app khai module (`super-ads-debug-override`); không khai ⇒ `SKIP` | [hook-implementation.md](../super-ads-debug-override/references/hook-implementation.md) |
|
|
65
117
|
| 20 | Custom dimension/metric GA4 đã đăng ký cho tính năng tracking đang bật | Đọc `global` của `<config>` (`tracking.enable`, `revenue`, `perf`, `arbiter`, `spa_ad_revenue`, `item_events`, `activation_event`; asset và remote) + dependency `SuperAdsTracking` (mục 16); tra bảng trong [ga4-custom-definitions.md](references/ga4-custom-definitions.md); đối chiếu với custom definitions của property GA4 (user đọc từ GA4 Admin, hoặc GA4 MCP `ga4_metadata` nếu đã kết nối) | Mọi dimension/metric của tính năng đang bật đã đăng ký đúng **tên**, scope Event, đơn vị (`*_ms` = milliseconds, `revenue_usd` = USD). Thiếu ⇒ `FAIL` kèm danh sách param thiếu. Không xác minh được ⇒ `CẦN QUYẾT ĐỊNH`, không `PASS`. Đăng ký **không backfill**: phải làm trước khi phát hành/bật cờ; đổi cờ ⇒ chạy lại mục này | `MIGRATION.md:472-480`, `super-ads-tracking/src/main/java/com/android/fullhd/super_ads/tracking/collector/TrackingCollector.kt:58-129` |
|
|
@@ -68,25 +120,26 @@ Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `
|
|
|
68
120
|
|
|
69
121
|
Mục 8: bộ nền khai `SuperAdsDebug` bằng `implementation` nên overlay có ở release (app mẫu cũng vậy: `app/build.gradle:102`; comment giải thích nằm lệch ở `app/build.gradle:62-63`, ngay trên dòng `:super-ads-admob`). Việc cần ghi nhận là ai mở được nó: `enableDBView` và lời gọi `Ads.openDBBridge` (app mẫu có nút gọi nó: `app/src/main/java/com/android/hd/ads2026/MainActivity.kt:69`).
|
|
70
122
|
|
|
71
|
-
##
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
**Verify:** biết `<app>`, `<config>`, nguồn config remote (hoặc "không dùng").
|
|
123
|
+
## 📈 Performance Notes
|
|
124
|
+
> **Not applicable for this skill.**
|
|
75
125
|
|
|
76
|
-
##
|
|
77
|
-
|
|
126
|
+
## 🔒 Security Notes
|
|
127
|
+
> **Not applicable for this skill.**
|
|
78
128
|
|
|
79
|
-
|
|
129
|
+
## 🔄 Migration Guide
|
|
130
|
+
> **Not applicable for this skill.**
|
|
80
131
|
|
|
81
|
-
##
|
|
82
|
-
Bảng
|
|
132
|
+
## Output
|
|
133
|
+
Bảng 22 mục kèm bằng chứng, danh sách việc cần sửa (chờ duyệt), các mục `SKIP` kèm lý do.
|
|
83
134
|
|
|
84
|
-
|
|
135
|
+
## Examples
|
|
136
|
+
- [references/firebase-ab-checklist.md](references/firebase-ab-checklist.md): checklist chạy cho mục 22.
|
|
137
|
+
- [references/ga4-custom-definitions.md](references/ga4-custom-definitions.md): bảng dimension/metric cho mục 20.
|
|
85
138
|
|
|
86
|
-
##
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
139
|
+
## 📚 References
|
|
140
|
+
- [super-ads-guide](../super-ads-guide/SKILL.md), [super-ads-upgrade](../super-ads-upgrade/SKILL.md)
|
|
141
|
+
- [super-ads-integrate](../super-ads-integrate/SKILL.md), [super-ads-debug](../super-ads-debug/SKILL.md), [super-ads-debug-override](../super-ads-debug-override/SKILL.md), [super-ads-ab-test](../super-ads-ab-test/SKILL.md)
|
|
142
|
+
- `MIGRATION.md`
|
|
90
143
|
|
|
91
|
-
##
|
|
92
|
-
|
|
144
|
+
## 🏷️ Tags
|
|
145
|
+
`super-ads` `release` `checklist` `report-only` `r8` `consent` `ga4`
|
|
@@ -1,53 +1,51 @@
|
|
|
1
1
|
---
|
|
2
2
|
schema: 1
|
|
3
3
|
name: super-ads-show-rate
|
|
4
|
-
description: Use when
|
|
5
|
-
version: 1.
|
|
4
|
+
description: Use when measuring or explaining SuperAds placement show rate (shown / requested) and why shows are blocked or fail
|
|
5
|
+
version: 1.1.0
|
|
6
6
|
group: Ads
|
|
7
|
+
superAds: ">=4.0.0 <5.0.0"
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Show rate của SuperAds
|
|
10
11
|
|
|
11
12
|
Đo **show rate = số lần show có Impression / số lần gọi `Ads.show`** theo placement, tách phần bị chặn (blocked) khỏi phần lỗi (error), rồi giải thích bằng mã lỗi và tri thức key.
|
|
12
13
|
|
|
13
|
-
| Bước | Tài liệu |
|
|
14
|
-
|---|---|
|
|
15
|
-
| Định nghĩa, nguồn đo, giới hạn | [references/metrics.md](references/metrics.md) |
|
|
16
|
-
| Thu số liệu bằng Logcat | [references/collect-snippet.md](references/collect-snippet.md) |
|
|
17
|
-
| Bật log SDK | [../super-ads-debug/references/logging-setup.md](../super-ads-debug/references/logging-setup.md) |
|
|
18
|
-
| Mã lỗi | [../super-ads-debug/references/error-codes.md](../super-ads-debug/references/error-codes.md) |
|
|
19
|
-
|
|
20
|
-
Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `DBG/` = `super-ads-debug/src/main/java/com/android/fullhd/super_ads/debug/`.
|
|
21
|
-
|
|
22
14
|
## When to use
|
|
23
15
|
- "Placement X show được bao nhiêu phần trăm?", "vì sao inter ít hiện?", so sánh trước/sau khi đổi config, đánh giá A/B.
|
|
24
16
|
|
|
25
|
-
## When NOT to use
|
|
26
|
-
- Một lần show hỏng cụ thể cần tìm nguyên nhân →
|
|
17
|
+
## 🚫 When NOT to use
|
|
18
|
+
- Một lần show hỏng cụ thể cần tìm nguyên nhân → [super-ads-debug](../super-ads-debug/SKILL.md).
|
|
27
19
|
- Fill rate hoặc doanh thu theo network: show rate không đo những thứ này (xem [metrics.md](references/metrics.md) mục 1).
|
|
28
20
|
|
|
29
|
-
##
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
- `showEvents` có `seq` nhảy cóc nghĩa là mất event, số liệu chỉ là best-effort;
|
|
36
|
-
- Firebase luôn là xấp xỉ: bỏ sót blocked, và đếm dư impression sau reload ([metrics.md](references/metrics.md) mục 2).
|
|
37
|
-
- Đề xuất đổi key phải dẫn ý nghĩa từ `tools/ai_agent_tools/data/ads_key_knowledge.json`. Không có nguồn SDK thì ghi "khuyến nghị cần xác nhận".
|
|
21
|
+
## 📋 Prerequisites
|
|
22
|
+
- Routing và kiểm version SDK: [super-ads-guide](../super-ads-guide/SKILL.md).
|
|
23
|
+
- Skill này nhắm SuperAds `>=4.0.0 <5.0.0`. App dùng SuperAds thấp hơn thì **dừng** và khuyến nghị (không ép) nâng cấp bằng [super-ads-upgrade](../super-ads-upgrade/SKILL.md) trước khi tiếp tục.
|
|
24
|
+
- Một nguồn đo: app có `super-ads-debug` (overlay hoặc `Ads.debug.showEvents`), hoặc Firebase `spa_*` (module `super-ads-tracking` và config bật `global.tracking.perf` cùng `global.tracking.enable`), hoặc file `.logads`. Không có nguồn nào thì không đo được show rate theo request (xem "Dừng và hỏi user khi").
|
|
25
|
+
- Một kịch bản đo đã chốt (placement nào, số lần show, thứ tự màn hình).
|
|
26
|
+
- Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `DBG/` = `super-ads-debug/src/main/java/com/android/fullhd/super_ads/debug/`.
|
|
38
27
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
## ⚡ Quick Reference
|
|
29
|
+
| Cần | Mở |
|
|
30
|
+
|---|---|
|
|
31
|
+
| Định nghĩa, nguồn đo, giới hạn, lý do blocked/error | [references/metrics.md](references/metrics.md) |
|
|
32
|
+
| Cách thu số liệu bằng Logcat | [references/collect-snippet.md](references/collect-snippet.md) |
|
|
33
|
+
| Đoạn Kotlin in mỗi `AdShowEvent` một dòng (cần user đồng ý) | [snippets/show-events-logger.md](snippets/show-events-logger.md) |
|
|
34
|
+
| Tính show rate từ log đã thu | [scripts/show-rate.sh](scripts/show-rate.sh) |
|
|
35
|
+
| Bật log SDK | [../super-ads-debug/references/logging-setup.md](../super-ads-debug/references/logging-setup.md) |
|
|
36
|
+
| Mã lỗi | [../super-ads-debug/references/error-codes.md](../super-ads-debug/references/error-codes.md) |
|
|
44
37
|
|
|
45
|
-
##
|
|
38
|
+
## 🏗️ Recommended Architecture
|
|
39
|
+
> **Not applicable for this skill.**
|
|
40
|
+
|
|
41
|
+
## Workflow
|
|
42
|
+
|
|
43
|
+
### Dừng và hỏi user khi
|
|
46
44
|
- App không có `super-ads-debug` và user không đồng ý thêm, cũng không có Firebase `spa_*`: không đo được show rate theo request. Báo rõ và đề xuất lựa chọn.
|
|
47
45
|
- Kịch bản đo chưa được chốt (bao nhiêu lần show, thứ tự màn hình): hỏi user.
|
|
48
46
|
- Kết quả gợi ý đổi chính sách kiếm tiền (giảm cooldown, tăng `maxShow`): trình bày đánh đổi, chờ user quyết.
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
### Phase 1: Chọn nguồn đo
|
|
51
49
|
1. App có `super-ads-debug` (artifact `SuperAdsDebug` / module `:super-ads-debug`)?
|
|
52
50
|
- Có, và có máy test: đọc overlay (tab Ads Debugger), hoặc thêm đoạn thu ở [collect-snippet.md](references/collect-snippet.md) (hỏi user trước khi sửa code).
|
|
53
51
|
- Không: Firebase `spa_*` nếu đã cài module `super-ads-tracking` và config bật `global.tracking.perf` (cùng `global.tracking.enable`). Ghi là xấp xỉ.
|
|
@@ -55,38 +53,91 @@ Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `
|
|
|
55
53
|
|
|
56
54
|
**Verify:** có nguồn đo và kịch bản đã chốt.
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
### Phase 2: Thu số liệu
|
|
59
57
|
- Overlay: ghi badge `rate · shown/requested` và các lý do chặn/lỗi của từng placement. Ghi cả cảnh báo mất event nếu có.
|
|
60
|
-
- Logcat: `adb logcat -v raw -s SuperAdsShowRate:I > showrate.log` trong lúc chạy kịch bản. Muốn chạy lặp lại tự động thì dùng
|
|
58
|
+
- Logcat: `adb logcat -v raw -s SuperAdsShowRate:I > showrate.log` trong lúc chạy kịch bản. Muốn chạy lặp lại tự động thì dùng [super-ads-adb-test](../super-ads-adb-test/SKILL.md). Log SDK (lý do chặn/lỗi) nằm trong file `.logads` ([logging-setup.md](../super-ads-debug/references/logging-setup.md) mục 6); tag `SuperAdsShowRate` thì không.
|
|
61
59
|
|
|
62
60
|
**Verify:** mỗi placement trong kịch bản có `requested > 0`.
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
- Chạy
|
|
62
|
+
### Phase 3: Tính và phân loại
|
|
63
|
+
- Chạy [scripts/show-rate.sh](scripts/show-rate.sh) `showrate.log` (awk, ở [collect-snippet.md](references/collect-snippet.md) mục 3), hoặc đọc overlay.
|
|
66
64
|
- Lập bảng: `placement | requested | shown | blocked | error | pending | rate | top lý do (CATEGORY:code × số lần)`.
|
|
67
65
|
- `LOAD:204` là lỗi gộp: tách lỗi con từ `msg=` (đoạn thu ở [collect-snippet.md](references/collect-snippet.md)) hoặc log `PrioChaiLo` / `ProviderTracker` trước khi giải thích ([metrics.md](references/metrics.md) mục 3).
|
|
68
66
|
|
|
69
67
|
**Verify:** `shown + blocked + error + pending = requested` cho mỗi placement.
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
### Phase 4: Giải thích và đề xuất
|
|
72
70
|
- Tra lý do trong [metrics.md](references/metrics.md) mục 3, và trong [error-codes.md](../super-ads-debug/references/error-codes.md).
|
|
73
71
|
- Blocked đúng thiết kế (cooldown 101, premium 103, guard 108): nêu là chủ đích của config, kèm key và giá trị đang đặt (đọc config bằng MCP `read_working_config`).
|
|
74
|
-
- Error (no-fill, timeout, render): chuyển sang
|
|
72
|
+
- Error (no-fill, timeout, render): chuyển sang [super-ads-debug](../super-ads-debug/SKILL.md) để tìm nguyên nhân gốc.
|
|
75
73
|
- Mỗi đề xuất ghi rõ: key, giá trị trước/sau, hành vi dự kiến (theo tri thức key, kèm `confidence`), rủi ro, cách đo lại.
|
|
76
74
|
|
|
77
75
|
**Verify:** mỗi đề xuất có nguồn (tri thức key hoặc mã lỗi), hoặc mang nhãn "khuyến nghị cần xác nhận".
|
|
78
76
|
|
|
79
|
-
##
|
|
77
|
+
## 🔧 API Reference
|
|
78
|
+
Nguồn đo và định nghĩa: [metrics.md](references/metrics.md). Sự kiện `Ads.debug.showEvents` và đoạn thu: [collect-snippet.md](references/collect-snippet.md).
|
|
79
|
+
|
|
80
|
+
## ✅ Best Practices
|
|
81
|
+
- Dùng đúng định nghĩa của SDK: kết quả của request là event kết thúc **đầu tiên** (`DBG/model/PlacementShowStats.kt:10-29`).
|
|
82
|
+
- Báo `requested`, `shown`, `blocked`, `error`, `pending` cùng với tỷ lệ. Không báo mỗi phần trăm.
|
|
83
|
+
- Tách blocked với error theo `FailCategory.isBlocked` (`SA/api/debug/AdShowEvent.kt:97-127`). Liệt kê lý do theo `CATEGORY:code`.
|
|
84
|
+
- Ghi rõ nguồn đo và độ tin cậy:
|
|
85
|
+
- `showEvents` có `seq` nhảy cóc nghĩa là mất event, số liệu chỉ là best-effort;
|
|
86
|
+
- Firebase luôn là xấp xỉ: bỏ sót blocked, và đếm dư impression sau reload ([metrics.md](references/metrics.md) mục 2).
|
|
87
|
+
- Đề xuất đổi key phải dẫn ý nghĩa từ `tools/ai_agent_tools/data/ads_key_knowledge.json`. Không có nguồn SDK thì ghi "khuyến nghị cần xác nhận".
|
|
88
|
+
|
|
89
|
+
## ❌ Anti-patterns
|
|
90
|
+
- Tính show rate từ `Ads.debug.snapshot()`: snapshot không có số request (`SA/api/debug/AdsDebugSnapshot.kt:19-54`).
|
|
91
|
+
- Gộp show rate với fill rate.
|
|
92
|
+
- Kết luận từ dưới 3 request đã có kết quả. Overlay cũng không cảnh báo dưới ngưỡng này (`DBG/data/AdDebugModelBuilder.kt:70-71`).
|
|
93
|
+
- Tự đổi tần suất ad (`show.timeBetweenMs`, `show.maxShow`…) khi user chưa đồng ý.
|
|
80
94
|
- Lấy `showCount` trong snapshot chia cho số lần bấm nút.
|
|
81
95
|
- So show rate giữa hai lần đo có kịch bản khác nhau.
|
|
82
96
|
- Coi `LOAD:211` (maxShow) là lỗi network. Nó là giới hạn do config đặt ra.
|
|
83
97
|
- Báo cáo show rate từ Firebase mà không ghi chú phần blocked bị bỏ sót.
|
|
84
98
|
|
|
99
|
+
## ⚠️ Common Issues
|
|
100
|
+
**`seq` của `showEvents` nhảy cóc.**
|
|
101
|
+
Cause: mất event. Solution: vẫn báo số liệu nhưng ghi rõ chỉ là best-effort (script cũng in cảnh báo).
|
|
102
|
+
|
|
103
|
+
**`LOAD:204` chiếm phần lớn lỗi nhưng không rõ nguyên nhân.**
|
|
104
|
+
Cause: đây là lỗi gộp, lỗi load từng adItem bị gói vào đó. Solution: tách lỗi con từ `msg=` hoặc log `PrioChaiLo` / `ProviderTracker` ([metrics.md](references/metrics.md) mục 3).
|
|
105
|
+
|
|
106
|
+
## Files created
|
|
107
|
+
Mặc định skill này không tạo file nào trong app; nó chỉ ghi file số liệu về máy phân tích (`showrate.log`). Khi user đồng ý thêm đoạn thu (Phase 1) mới có file hoặc đoạn code mới trong app.
|
|
108
|
+
|
|
109
|
+
## Files modified
|
|
110
|
+
Mặc định skill này không sửa file nào của app. Chỉ khi user đồng ý, `Application` được thêm đoạn Kotlin trong [snippets/show-events-logger.md](snippets/show-events-logger.md) (chỉ `BuildConfig.DEBUG`); tần suất ad (`show.timeBetweenMs`, `show.maxShow`…) không bao giờ đổi khi chưa được user duyệt.
|
|
111
|
+
|
|
112
|
+
## Verification
|
|
113
|
+
Mỗi phase có dòng **Verify** riêng ở Workflow. Kết thúc: `shown + blocked + error + pending = requested` cho mỗi placement, và mỗi đề xuất có nguồn hoặc nhãn cần xác nhận.
|
|
114
|
+
|
|
85
115
|
## Checklist
|
|
86
116
|
- [ ] Nguồn đo và độ tin cậy được ghi rõ.
|
|
87
117
|
- [ ] Bảng số liệu cộng đúng `requested`.
|
|
88
118
|
- [ ] Lý do theo `CATEGORY:code`, đã tách blocked/error.
|
|
89
119
|
- [ ] Đề xuất có nguồn, hoặc mang nhãn cần xác nhận.
|
|
90
120
|
|
|
121
|
+
## 📈 Performance Notes
|
|
122
|
+
> **Not applicable for this skill.**
|
|
123
|
+
|
|
124
|
+
## 🔒 Security Notes
|
|
125
|
+
> **Not applicable for this skill.**
|
|
126
|
+
|
|
127
|
+
## 🔄 Migration Guide
|
|
128
|
+
> **Not applicable for this skill.**
|
|
129
|
+
|
|
91
130
|
## Output
|
|
92
131
|
Bảng số liệu theo placement, cảnh báo độ tin cậy (mất event / nguồn xấp xỉ), giải thích các lý do hàng đầu, đề xuất (nếu có) kèm cách đo lại.
|
|
132
|
+
|
|
133
|
+
## Examples
|
|
134
|
+
Bảng kết quả mẫu (một dòng mỗi placement, đúng định dạng của [scripts/show-rate.sh](scripts/show-rate.sh)): `inter req=3 shown=1 blocked=1 error=1 pending=0 rate=33%`. Cách thu log đầu vào: [references/collect-snippet.md](references/collect-snippet.md).
|
|
135
|
+
|
|
136
|
+
## 📚 References
|
|
137
|
+
- [super-ads-guide](../super-ads-guide/SKILL.md), [super-ads-upgrade](../super-ads-upgrade/SKILL.md)
|
|
138
|
+
- [super-ads-debug](../super-ads-debug/SKILL.md), [super-ads-adb-test](../super-ads-adb-test/SKILL.md)
|
|
139
|
+
- [Bật log SDK](../super-ads-debug/references/logging-setup.md), [Mã lỗi](../super-ads-debug/references/error-codes.md)
|
|
140
|
+
- `MIGRATION.md`, `tools/ai_agent_tools/data/ads_key_knowledge.json`
|
|
141
|
+
|
|
142
|
+
## 🏷️ Tags
|
|
143
|
+
`superads` `show-rate` `metrics` `blocked` `fill-rate` `showevents`
|
|
@@ -7,28 +7,7 @@ Chỉ thêm đoạn này khi user đã đồng ý sửa code app. Nếu app đã
|
|
|
7
7
|
|
|
8
8
|
## 1. Kotlin: in mỗi event một dòng
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
// Application.onCreate (chỉ BuildConfig.DEBUG), sau Ads.logger.init, trước/sau Ads.init đều được.
|
|
12
|
-
if (BuildConfig.DEBUG) {
|
|
13
|
-
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
|
|
14
|
-
Ads.debug.showEvents.collect { e ->
|
|
15
|
-
val (type, extra) = when (e) {
|
|
16
|
-
is AdShowEvent.Requested -> "REQ" to ""
|
|
17
|
-
is AdShowEvent.Impression -> "IMP" to ""
|
|
18
|
-
is AdShowEvent.Failed -> "FAIL" to " cat=${e.category.name} blocked=${e.category.isBlocked} code=${e.code} msg=${e.message}"
|
|
19
|
-
is AdShowEvent.Clicked -> "CLICK" to ""
|
|
20
|
-
is AdShowEvent.Dismissed -> "DISMISS" to ""
|
|
21
|
-
else -> "OTHER" to ""
|
|
22
|
-
}
|
|
23
|
-
Log.i("SuperAdsShowRate", "seq=${e.seq} req=${e.requestId} pl=${e.placementId} type=$type$extra")
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Import: `android.util.Log`, `com.android.fullhd.super_ads.api.Ads`, `com.android.fullhd.super_ads.api.debug.AdShowEvent`, `kotlinx.coroutines.CoroutineScope`, `kotlinx.coroutines.Dispatchers`, `kotlinx.coroutines.SupervisorJob`, `kotlinx.coroutines.launch`.
|
|
30
|
-
|
|
31
|
-
`msg=` luôn đứng cuối dòng: với `LOAD:204` (`AllPriorityExhausted`) nó chứa các lỗi con, vì lỗi load của từng adItem không tới app trực tiếp ([error-codes.md](../../super-ads-debug/references/error-codes.md), mục "Cách đọc").
|
|
10
|
+
Đoạn mã, danh sách import và lưu ý về `msg=` nằm ở [../snippets/show-events-logger.md](../snippets/show-events-logger.md).
|
|
32
11
|
|
|
33
12
|
## 2. Thu log
|
|
34
13
|
|
|
@@ -39,20 +18,7 @@ adb logcat -v raw -s SuperAdsShowRate:I > showrate.log
|
|
|
39
18
|
|
|
40
19
|
## 3. Tính theo placement (kết quả = event kết thúc đầu tiên của mỗi `req`)
|
|
41
20
|
|
|
42
|
-
|
|
43
|
-
awk '
|
|
44
|
-
{ delete f; for (i = 1; i <= NF; i++) { if ($i ~ /^msg=/) break; split($i, kv, "="); f[kv[1]] = kv[2] } }
|
|
45
|
-
f["type"] == "REQ" { pl[f["req"]] = f["pl"]; reqs[f["pl"]]++; if (last && f["seq"] != last + 1) gap += f["seq"] - last - 1; last = f["seq"]; next }
|
|
46
|
-
{ if (last && f["seq"] != last + 1) gap += f["seq"] - last - 1; last = f["seq"] }
|
|
47
|
-
(f["type"] == "IMP" || f["type"] == "FAIL") && !(f["req"] in done) && (f["req"] in pl) {
|
|
48
|
-
done[f["req"]] = 1; p = pl[f["req"]]
|
|
49
|
-
if (f["type"] == "IMP") shown[p]++; else { if (f["blocked"] == "true") blk[p]++; else err[p]++ }
|
|
50
|
-
}
|
|
51
|
-
END {
|
|
52
|
-
for (p in reqs) printf "%-40s req=%d shown=%d blocked=%d error=%d pending=%d rate=%.0f%%\n", p, reqs[p], shown[p], blk[p], err[p], reqs[p] - shown[p] - blk[p] - err[p], 100 * shown[p] / reqs[p]
|
|
53
|
-
if (gap) printf "CẢNH BÁO: mất %d event (seq nhảy cóc), số liệu chỉ là best-effort\n", gap
|
|
54
|
-
}' showrate.log
|
|
55
|
-
```
|
|
21
|
+
Chạy [../scripts/show-rate.sh](../scripts/show-rate.sh) `showrate.log` (awk: mỗi `req` tính theo event kết thúc đầu tiên; cảnh báo khi `seq` nhảy cóc).
|
|
56
22
|
|
|
57
23
|
Danh sách lý do theo placement: `grep "type=FAIL" showrate.log | sed -E 's/.*pl=([^ ]+) .*cat=([^ ]+) .*code=([0-9]+) msg=.*/\1 \2:\3/' | sort | uniq -c | sort -rn`.
|
|
58
24
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Tính show rate theo placement từ log `SuperAdsShowRate` (snippets/show-events-logger.md).
|
|
3
|
+
# Kết quả của mỗi `req` là event kết thúc ĐẦU TIÊN (Impression hoặc Failed).
|
|
4
|
+
#
|
|
5
|
+
# Thu log: adb logcat -c && adb logcat -v raw -s SuperAdsShowRate:I > showrate.log
|
|
6
|
+
# Cách dùng: show-rate.sh showrate.log
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
if [ "$#" -ne 1 ] || [ ! -f "$1" ]; then
|
|
10
|
+
sed -n '2,6p' "$0" | sed 's/^# \{0,1\}//' >&2
|
|
11
|
+
exit 2
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
awk '
|
|
15
|
+
{ delete f; for (i = 1; i <= NF; i++) { if ($i ~ /^msg=/) break; split($i, kv, "="); f[kv[1]] = kv[2] } }
|
|
16
|
+
f["type"] == "REQ" { pl[f["req"]] = f["pl"]; reqs[f["pl"]]++; if (last && f["seq"] != last + 1) gap += f["seq"] - last - 1; last = f["seq"]; next }
|
|
17
|
+
{ if (last && f["seq"] != last + 1) gap += f["seq"] - last - 1; last = f["seq"] }
|
|
18
|
+
(f["type"] == "IMP" || f["type"] == "FAIL") && !(f["req"] in done) && (f["req"] in pl) {
|
|
19
|
+
done[f["req"]] = 1; p = pl[f["req"]]
|
|
20
|
+
if (f["type"] == "IMP") shown[p]++; else { if (f["blocked"] == "true") blk[p]++; else err[p]++ }
|
|
21
|
+
}
|
|
22
|
+
END {
|
|
23
|
+
for (p in reqs) printf "%-40s req=%d shown=%d blocked=%d error=%d pending=%d rate=%.0f%%\n", p, reqs[p], shown[p], blk[p], err[p], reqs[p] - shown[p] - blk[p] - err[p], 100 * shown[p] / reqs[p]
|
|
24
|
+
if (gap) printf "CẢNH BÁO: mất %d event (seq nhảy cóc), số liệu chỉ là best-effort\n", gap
|
|
25
|
+
}' "$1"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Đoạn Kotlin: in mỗi `AdShowEvent` một dòng
|
|
2
|
+
|
|
3
|
+
> Chỉ dùng ở bản debug/QA, và chỉ thêm khi user đã đồng ý sửa code app. Cách dùng và cách tính: [../references/collect-snippet.md](../references/collect-snippet.md).
|
|
4
|
+
|
|
5
|
+
```kotlin
|
|
6
|
+
// Application.onCreate (chỉ BuildConfig.DEBUG), sau Ads.logger.init, trước/sau Ads.init đều được.
|
|
7
|
+
if (BuildConfig.DEBUG) {
|
|
8
|
+
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
|
|
9
|
+
Ads.debug.showEvents.collect { e ->
|
|
10
|
+
val (type, extra) = when (e) {
|
|
11
|
+
is AdShowEvent.Requested -> "REQ" to ""
|
|
12
|
+
is AdShowEvent.Impression -> "IMP" to ""
|
|
13
|
+
is AdShowEvent.Failed -> "FAIL" to " cat=${e.category.name} blocked=${e.category.isBlocked} code=${e.code} msg=${e.message}"
|
|
14
|
+
is AdShowEvent.Clicked -> "CLICK" to ""
|
|
15
|
+
is AdShowEvent.Dismissed -> "DISMISS" to ""
|
|
16
|
+
else -> "OTHER" to ""
|
|
17
|
+
}
|
|
18
|
+
Log.i("SuperAdsShowRate", "seq=${e.seq} req=${e.requestId} pl=${e.placementId} type=$type$extra")
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Import: `android.util.Log`, `com.android.fullhd.super_ads.api.Ads`, `com.android.fullhd.super_ads.api.debug.AdShowEvent`, `kotlinx.coroutines.CoroutineScope`, `kotlinx.coroutines.Dispatchers`, `kotlinx.coroutines.SupervisorJob`, `kotlinx.coroutines.launch`.
|
|
25
|
+
|
|
26
|
+
`msg=` luôn đứng cuối dòng: với `LOAD:204` (`AllPriorityExhausted`) nó chứa các lỗi con, vì lỗi load của từng adItem không tới app trực tiếp ([error-codes.md](../../super-ads-debug/references/error-codes.md), mục "Cách đọc").
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema: 1
|
|
3
|
+
name: super-ads-upgrade
|
|
4
|
+
description: Use when an app uses an older SuperAds SDK than a skill needs, or the user asks to upgrade SuperAds
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
group: Ads
|
|
7
|
+
superAds: ">=4.0.0 <5.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Nâng cấp SuperAds
|
|
11
|
+
|
|
12
|
+
Đưa app từ bản SuperAds cũ lên bản mới nhất theo từng bước nhảy trong `MIGRATION.md`: lên kế hoạch, được user duyệt, nâng core và mọi plugin cùng bản, đổi import, logic và key config, kiểm, rồi bàn giao changelog.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
- `super-ads-guide` phát hiện version SuperAds của app thấp hơn khoảng `superAds` của skill, và user đồng ý nâng.
|
|
16
|
+
- User yêu cầu nâng SuperAds (vd "nâng SuperAds lên 4.0.0", "update SDK ads").
|
|
17
|
+
- Core và plugin trong app lệch version, cần đưa về cùng một bản.
|
|
18
|
+
- Build lỗi `NoClassDefFoundError` / `NoSuchMethodError` sau khi nâng một phần.
|
|
19
|
+
|
|
20
|
+
## 🚫 When NOT to use
|
|
21
|
+
- App chưa có SDK quảng cáo: `super-ads-integrate`.
|
|
22
|
+
- App đang dùng AdsPro: `adspro-to-superads`.
|
|
23
|
+
- Chỉ đổi giá trị trong config, không đổi version SDK: `super-ads-config`.
|
|
24
|
+
- Chỉ kiểm trước khi phát hành: `super-ads-release-check`.
|
|
25
|
+
- User chưa đồng ý nâng: dừng, không tự nâng; skill chỉ **đề xuất**, không ép.
|
|
26
|
+
|
|
27
|
+
## 📋 Prerequisites
|
|
28
|
+
- Đã đọc [super-ads-guide](../super-ads-guide/SKILL.md) (định tuyến và [kiểm version](../super-ads-guide/references/sdk-version-check.md)).
|
|
29
|
+
- Có version SuperAds hiện tại của app (file, dòng) và đã hỏi user version đích.
|
|
30
|
+
- MCP `super-ads` kết nối được (`tools/ai_agent_tools/README.md`) cho phần config.
|
|
31
|
+
- Nhánh git riêng cho việc nâng, để xem `git diff` trước khi commit.
|
|
32
|
+
|
|
33
|
+
## ⚡ Quick Reference
|
|
34
|
+
|
|
35
|
+
| Cần | Ở đâu |
|
|
36
|
+
|---|---|
|
|
37
|
+
| Từng bước nhảy và chỗ trích dẫn `MIGRATION.md` | [references/upgrade-hops.md](references/upgrade-hops.md) |
|
|
38
|
+
| Mẫu changelog giao user | [templates/changelog-template.md](templates/changelog-template.md) |
|
|
39
|
+
| Cách đọc version app | [../super-ads-guide/references/sdk-version-check.md](../super-ads-guide/references/sdk-version-check.md) |
|
|
40
|
+
| Vòng sửa config có `mustAsk` | [../super-ads-config/SKILL.md](../super-ads-config/SKILL.md) |
|
|
41
|
+
|
|
42
|
+
Bản hiện tại của repo SDK là `4.0.0` (`super-ads/build.gradle:6`). Bản đích của app: hỏi user, không đoán.
|
|
43
|
+
|
|
44
|
+
## 🏗️ Recommended Architecture
|
|
45
|
+
> **Not applicable for this skill.**
|
|
46
|
+
|
|
47
|
+
## Workflow
|
|
48
|
+
1. **Đọc version hiện tại** của app (theo `super-ads-guide`, [sdk-version-check](../super-ads-guide/references/sdk-version-check.md)): core và từng plugin. Hỏi user xác nhận bản đích (bản mới nhất đã publish).
|
|
49
|
+
2. **Đọc `MIGRATION.md`** cho từng bước nhảy từ bản hiện tại tới bản đích (mục 3.x -> 4.0.0 ở đầu file, 2.x -> 3.0.0 và 1.1.x ở phía dưới). Tóm tắt thay đổi bắt buộc theo [references/upgrade-hops.md](references/upgrade-hops.md). Bước nhảy không có mục trong `MIGRATION.md`: dừng và hỏi user, không tự suy luận.
|
|
50
|
+
3. **Lập kế hoạch và xin duyệt trước khi sửa**: liệt kê file sẽ sửa, version sẽ bump, import sẽ đổi, key config sẽ đổi, hành vi đổi. Chờ user duyệt.
|
|
51
|
+
4. **Nâng**:
|
|
52
|
+
- Gradle: core và **mọi** plugin cùng một version (`MIGRATION.md:7-16`).
|
|
53
|
+
- Import và logic: theo các bảng trong `MIGRATION.md`; ví dụ `sed` trong đó chỉ là tham khảo, xem `git diff` sau khi chạy.
|
|
54
|
+
- Config JSON: chỉ qua MCP `super-ads`: `validate_config`, `diff_configs`, `explain_key`, `impact_of_patch`, `apply_patch`. Điểm dừng `mustAsk` và duyệt đúng patch theo [super-ads-config](../super-ads-config/SKILL.md), không lặp lại ở đây.
|
|
55
|
+
5. **Kiểm**: build module app, `validate_config` trên config sau khi sửa, kiểm trên thiết bị theo [super-ads-adb-test](../super-ads-adb-test/SKILL.md); trước khi phát hành theo [super-ads-release-check](../super-ads-release-check/SKILL.md).
|
|
56
|
+
6. **Báo changelog** cho user theo [templates/changelog-template.md](templates/changelog-template.md): SDK từ-lên, import đã đổi, logic đã đổi, key config thêm/xoá/đổi tên, thay đổi hành vi, việc còn lại cho user.
|
|
57
|
+
|
|
58
|
+
## 🔧 API Reference
|
|
59
|
+
|
|
60
|
+
| Tool MCP | Mục đích trong skill này |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `validate_config` | Kiểm config hợp lệ sau khi nâng |
|
|
63
|
+
| `diff_configs` | So config trước và sau |
|
|
64
|
+
| `explain_key` | Hiểu một key trước khi đổi |
|
|
65
|
+
| `impact_of_patch` | Tính tác động và `mustAsk` cho đúng patch |
|
|
66
|
+
| `apply_patch` | Áp patch đã được user duyệt |
|
|
67
|
+
|
|
68
|
+
## ✅ Best Practices
|
|
69
|
+
- Nâng từng bước nhảy một khi bản hiện tại cách xa bản đích; build sau mỗi bước.
|
|
70
|
+
- Đọc `MIGRATION.md` mục tương ứng trước, không dựa vào trí nhớ về SDK.
|
|
71
|
+
- Để compiler chỉ ra import còn sót sau khi sửa theo bảng.
|
|
72
|
+
- Ghi lại mọi thứ đã đổi để đưa vào changelog ngay lúc làm.
|
|
73
|
+
|
|
74
|
+
## ❌ Anti-patterns
|
|
75
|
+
- Nâng khi user chưa đồng ý, hoặc ép nâng khi user muốn giữ bản cũ.
|
|
76
|
+
- Nâng riêng core hay riêng một plugin: lỗi lúc chạy (`MIGRATION.md:7-16`).
|
|
77
|
+
- Chạy `sed` mù trên toàn repo rồi commit không xem `git diff`.
|
|
78
|
+
- Sửa config JSON tay thay vì MCP, hoặc áp patch khi chưa có duyệt.
|
|
79
|
+
- Tự bịa tên API, key hay version đích không có trong `MIGRATION.md`.
|
|
80
|
+
|
|
81
|
+
## ⚠️ Common Issues
|
|
82
|
+
|
|
83
|
+
| Problem | Cause | Solution |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `NoClassDefFoundError` lúc chạy | Plugin cũ link `api.plugin.*` với core 4.0.0 (`MIGRATION.md:7-16`) | Nâng mọi plugin cùng bản với core |
|
|
86
|
+
| Import không còn biên dịch | Package đổi ở 4.0.0 | Đổi theo bảng trong `MIGRATION.md`, build lại |
|
|
87
|
+
| Version đích chưa có trên repo Maven | Chưa publish | Dừng, hỏi user (xem `super-ads-integrate/SKILL.md`); không tự hạ bản |
|
|
88
|
+
| `validate_config` báo lỗi sau nâng | Key đổi giữa các bản | `explain_key`, đối chiếu `MIGRATION.md`, vá qua vòng `super-ads-config` |
|
|
89
|
+
|
|
90
|
+
## Files created
|
|
91
|
+
- Không tạo file nguồn mới cho SDK. Changelog nâng cấp (theo mẫu) có thể được lưu ở nơi user chỉ định; mặc định chỉ báo trong hội thoại.
|
|
92
|
+
|
|
93
|
+
## Files modified
|
|
94
|
+
- File Gradle của app khai `com.android.fullhd.ads:*`: bump version của core và mọi plugin.
|
|
95
|
+
- File Kotlin/Java của app có import `com.android.fullhd.super_ads` cần đổi theo `MIGRATION.md`, và logic bị ảnh hưởng.
|
|
96
|
+
- File config JSON của app (asset, working config MCP): chỉ qua `apply_patch` đã duyệt, rồi `sync_to_source` theo `AI_ADS_PLAYBOOK.md`.
|
|
97
|
+
- Manifest chỉ khi `MIGRATION.md` nói phải đổi (vd tham chiếu installer ở 3.0.0).
|
|
98
|
+
|
|
99
|
+
## Verification
|
|
100
|
+
- Build module app bằng Gradle, trích output thật. Không build được thì ghi rõ.
|
|
101
|
+
- `./gradlew :<app>:dependencies --configuration releaseRuntimeClasspath | grep "com.android.fullhd.ads:"`: mọi artifact SuperAds cùng một version.
|
|
102
|
+
- `validate_config` trên config sau nâng: không lỗi.
|
|
103
|
+
- Kiểm thiết bị qua `super-ads-adb-test` (nếu có thiết bị); nếu bỏ qua, ghi là bỏ qua.
|
|
104
|
+
- Log lúc init không có dòng `RequiredPluginCheck` (thiếu `SuperAdsInHouse`).
|
|
105
|
+
|
|
106
|
+
## Checklist
|
|
107
|
+
- [ ] Có version hiện tại và version đích do user xác nhận.
|
|
108
|
+
- [ ] Đã đọc mục `MIGRATION.md` cho từng bước nhảy.
|
|
109
|
+
- [ ] User duyệt kế hoạch trước khi sửa.
|
|
110
|
+
- [ ] Core và mọi plugin cùng một version.
|
|
111
|
+
- [ ] Import và logic đổi theo `MIGRATION.md`; `git diff` đã xem.
|
|
112
|
+
- [ ] Config đổi qua MCP, có duyệt đúng patch.
|
|
113
|
+
- [ ] Build, `validate_config` đã chạy; kiểm thiết bị đã chạy hoặc ghi rõ bỏ qua.
|
|
114
|
+
- [ ] Đã giao changelog.
|
|
115
|
+
|
|
116
|
+
## 📈 Performance Notes
|
|
117
|
+
> **Not applicable for this skill.**
|
|
118
|
+
|
|
119
|
+
## 🔒 Security Notes
|
|
120
|
+
> **Not applicable for this skill.**
|
|
121
|
+
|
|
122
|
+
## 🔄 Migration Guide
|
|
123
|
+
Nội dung từng bước nhảy nằm ở [references/upgrade-hops.md](references/upgrade-hops.md); nguồn gốc là `MIGRATION.md`.
|
|
124
|
+
|
|
125
|
+
## Output
|
|
126
|
+
Changelog theo [templates/changelog-template.md](templates/changelog-template.md), kèm: file đã tạo, file đã sửa, tóm tắt thay đổi, lỗi hoặc vấn đề gặp, việc đã chạy và việc bỏ qua.
|
|
127
|
+
|
|
128
|
+
## Examples
|
|
129
|
+
- Các bước nhảy và cách tóm tắt: [references/upgrade-hops.md](references/upgrade-hops.md).
|
|
130
|
+
- Mẫu báo cáo: [templates/changelog-template.md](templates/changelog-template.md).
|
|
131
|
+
|
|
132
|
+
## 📚 References
|
|
133
|
+
- [super-ads-guide](../super-ads-guide/SKILL.md), [super-ads-config](../super-ads-config/SKILL.md), [super-ads-adb-test](../super-ads-adb-test/SKILL.md), [super-ads-release-check](../super-ads-release-check/SKILL.md), [adspro-to-superads](../adspro-to-superads/SKILL.md).
|
|
134
|
+
- `MIGRATION.md`, `tools/ai_agent_tools/AI_ADS_PLAYBOOK.md` ở repo SDK.
|
|
135
|
+
|
|
136
|
+
## 🏷️ Tags
|
|
137
|
+
`super-ads`, `upgrade`, `migration`, `sdk-version`, `gradle`, `changelog`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Các bước nhảy nâng cấp SuperAds
|
|
2
|
+
|
|
3
|
+
Nguồn duy nhất: `MIGRATION.md` ở gốc repo SDK. File này chỉ tóm tắt; khi khác nhau, `MIGRATION.md` thắng. Chỉ có các mục dưới đây trong `MIGRATION.md`. Từ bản chưa có mục (vd 1.x tới 2.x): dừng và hỏi user.
|
|
4
|
+
|
|
5
|
+
## Hop 3.x -> 4.0.0 (đầu `MIGRATION.md`)
|
|
6
|
+
- Chỉ đổi package (vị trí class); không đổi tên class, chữ ký hàm, hành vi, JSON config, tên event, mã lỗi hay trạng thái đã lưu. App chỉ phải đổi import (`MIGRATION.md:3-5`).
|
|
7
|
+
- Bắt buộc: core và mọi plugin cùng 4.0.0; plugin 3.x không chạy với core 4.0.0 (`MIGRATION.md:7-16`).
|
|
8
|
+
- Import app hay dùng đổi theo bảng "Đổi import - class app thường dùng" (`MIGRATION.md:18`); `Ads`, `AdsFeatures`, `api.model.*` giữ nguyên.
|
|
9
|
+
- Hợp đồng plugin `api.plugin` -> `spi`: chỉ ảnh hưởng code tự viết plugin (`MIGRATION.md:39`).
|
|
10
|
+
- Class nội bộ đổi chỗ: app không nên dùng (`MIGRATION.md:57`).
|
|
11
|
+
- Ví dụ `sed` chỉ để tham khảo; xem `git diff`, build để compiler chỉ import còn sót (`MIGRATION.md:74`).
|
|
12
|
+
- Config JSON: không đổi key.
|
|
13
|
+
|
|
14
|
+
## Hop 2.x -> 3.0.0 (`MIGRATION.md`, mục "2.x -> 3.0.0")
|
|
15
|
+
- Giữ nguyên JSON config, tên event, mã lỗi, trạng thái đã lưu (`MIGRATION.md:93-94`).
|
|
16
|
+
- Core và mọi plugin cùng một version (mục "BẮT BUỘC"); version chung ghi trong mục đó là bản của thời điểm viết, bản đích lấy từ user, không lấy từ đó.
|
|
17
|
+
- Đổi import 3 class public; một hàm kiểm ad test được đổi tên (xem bảng đổi tên trong `MIGRATION.md`); consent trước ad đầu tiên qua `Ads.gdpr.requestAndShowIfRequired(...)`.
|
|
18
|
+
- Bảng thay đổi hành vi (InHouse bỏ BANNER, countdown, nút đóng, `scenarios` bị bỏ qua, mã lỗi `ClientError` gỡ, `NATIVE_FULL_DIALOG` gỡ, ...): `MIGRATION.md:133-152`. Mỗi dòng cần báo user nếu app dính.
|
|
19
|
+
- Tracking Firebase tách sang `super-ads-tracking`; thêm module và cờ `global.tracking.*` nếu app cần (`MIGRATION.md:442-452`).
|
|
20
|
+
- Plugin mạng khai dependency riêng theo từng mạng (mục "BẮT BUỘC: thêm dependency cho từng mạng").
|
|
21
|
+
|
|
22
|
+
## Hop 1.1.x -> 1.1.4 (`MIGRATION.md:224-229`)
|
|
23
|
+
- Từ 1.1.4 core không chứa mạng quảng cáo nào; AdMob và InHouse là artifact riêng, tự đăng ký qua `ContentProvider`. Cần thêm dependency plugin cho từng mạng đang dùng.
|
|
24
|
+
|
|
25
|
+
## Cách tóm tắt cho user
|
|
26
|
+
Với mỗi hop, ghi: thay đổi bắt buộc, thay đổi tuỳ chọn, thay đổi hành vi app có thể dính, key config bị ảnh hưởng. Đưa vào kế hoạch ở bước 3 của Workflow trong [../SKILL.md](../SKILL.md). Cách đọc version hiện tại: [../../super-ads-guide/references/sdk-version-check.md](../../super-ads-guide/references/sdk-version-check.md).
|