CommunityImagegithub.com

hmos-appgallery-poster

Generates AppGallery promotional images, store screenshots, and detail page graphics for HarmonyOS apps.

What is hmos-appgallery-poster?

This skill automates the creation of promotional image sets for publishing HarmonyOS apps on the Huawei AppGallery (AppGallery Connect). It reads the project source code to extract app metadata, branding colors, and feature highlights, then plans a set of marketing images (typically 5 portrait phone images, 2-3 landscape tablet images, and 2 16:9 PC images). The core workflow includes: (1) fetching the latest AppGallery image specifications via web search, (2) taking real device/emulator screenshots using hdc, (3) generating multi-style AI backgrounds via free services like Pollinations.ai (with human-like iterative seed refinement), and (4) compositing the final images using Python/Pillow (merging screenshots into phone mockups with branded text overlays). It rigorously avoids prohibited content (iOS references, false features, political elements) and outputs all assets to a `promotion/` directory. The skill also supports optional refinement via Canva connector if configured. It is designed for developers using HarmonyOS CLI tools (devecocli, hdc) and requires Python with Pillow.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Huangzihengcmd/hmos-appgallery-poster/tree/HEAD

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

HarmonyOS AppGallery Promotional Image Generator

Generates a complete set of promotional images (app detail page carousel screenshots / hero images) ready for upload to AppGallery Connect for the current HarmonyOS project.

General Principles

  1. Do not draw background illustrations with code. Think like a human designer: write prompts → use free image generation models → review images → retry with different seeds or modified prompts if unsatisfied (see Step 3). Code is only used for compositing (collage, rounded corners, text layout, scaling export).
  2. Always verify specifications online first. The baseline specs embedded in this file may be outdated; perform Step 1 before starting.
  3. Default output is a "standard promotional image set": 5 portrait phone images (up to 8) + 2-3 landscape tablet images + 2 16:9 PC images. Follow user instructions if otherwise specified.
  4. Write all output to <project root>/promotion/; do not pollute the project source code directory.
  5. Place temporary files (downloaded assets, generated images) within the project directory, not in the system's Temp directory.

Workflow

Step 0: Analyze the App

Read the following files to extract information (do not ask the user; read the code yourself):

  • AppScope/app.json5: bundleName, icon, label
  • entry/src/main/module.json5: abilities, permissions, device types (tablet/pc support)
  • AppScope/resources/base/element/string.json and resources/zh/: app name
  • entry/src/main/resources/base/profile/main_pages.json + pages under pages/: feature list
  • resources under resources/base/media/: determine brand primary color (e.g., by visually inspecting the icon)

Generate promotion/plan.md containing: app name, one-sentence positioning, 3-5 core selling points (one per promotional image), target audience, brand primary color (hex), and style selection.

Step 1: Verify Specifications Online (Mandatory)

Use websearch / webfetch to check the latest requirements. Example search queries:

  • AppGallery promotional image size specifications app info
  • Huawei AppGallery app introduction image screenshot requirements
  • developer.huawei.com theme design guidelines specifications (HarmonyOS design guidelines)
  • AppGallery Connect image specifications release

Rely on official Huawei documentation (developer.huawei.com / AppGallery Connect Help Center). If official pages are JS-rendered and unreadable, cross-verify with secondary authoritative sources using the above keywords.

Baseline Specifications (Verified Nov 2026, but still requires online re-verification):

AssetSize/Aspect RatioFormat & Limits
Phone promotional images (portrait)1080×1920 / 1080×2340 / 1080×2400 (9:16 ~ 9:19.5)JPG/PNG, ≤2MB each, 3-8 images
Tablet promotional images (landscape)2560×1440 (16:9) or 3:2Same as above
PC promotional images1920×1080 (16:9)Same as above
App Store icon216×216 (AGC backend) / 512×512PNG, rounded corners handled by backend
HarmonyOS desktop icon foreground/background1024×1024PNG, transparent, no built-in rounded corners/margins/shadows

Review Red Lines: Images must not contain iOS / iPhone / Apple Store / competitor app store logos or device appearances; no false claims inconsistent with actual features; no national flags or politically sensitive elements; no personal information exposed in screenshots.

Record the verification results in promotion/plan.md.

Step 2: Emulator Screenshots (Product Introduction Image Assets)

  1. devecocli devices – check devices; if none, launch an emulator.
  2. If the project is not built: devecocli build; then devecocli run --skip-build to install and launch.
  3. Take screenshots page by page (default: use hdc screenshot; do not use verify_ui – UI verification tool only used when explicitly requested by the user):
hdc shell "snapshot_display -f /data/local/tmp/shot_1.jpeg"
hdc file recv /data/local/tmp/shot_1.jpeg .\promotion\shots\shot_1.jpeg
  1. Plan screenshots according to selling points: at least one screenshot per core feature page; navigate to the corresponding page before taking the next screenshot.
  2. If a screenshot is not 1080 pixels wide, record its actual resolution in plan.md, and scale proportionally during compositing.

Step 3: AI Image Generation – Mimic Human Painting (Multi-Style Backgrounds)

Method A (Default, Free, No API Key Required): Pollinations Direct

URL format (prompt must be URL-encoded and in English):

https://image.pollinations.ai/prompt/{encoded_prompt}?width=1024&height=2048&seed={n}

Actual testing notes (Nov 2026):

  • Do not include nologo=true; this parameter has become paid (returns 402 Payment Required). Also do not include model=flux; use the default model.
  • The free tier has rate limiting; the first request often returns 503 (Retry after 10s). Wait 12 seconds and retry; up to 5 retries usually succeed.
$prompt = [uri]::EscapeDataString("soft gradient fluid abstract background, deep blue and cyan, smooth flowing shapes, no text, no watermark")
foreach ($i in 1..5) {
  Start-Sleep -Seconds 12
  try {
    Invoke-WebRequest -Uri "https://image.pollinations.ai/prompt/$prompt`?width=1024&height=2048&seed=42" -OutFile .\promotion\bg\style1_s42.png -TimeoutSec 120
    break
  } catch { }
}

Human-like iteration: generate 2-3 seeds per style, review each image (judge quality visually), and modify the prompt or change the seed if unsatisfied. Do not generate dozens at once.

Method B (Fallback; used when user requests "operate the webpage like a human"): Browser Automation

If deveco.json is configured with a browser MCP (e.g., @playwright/mcp), open a free image generation site (pollinations.ai, etc.), simulate human input: type prompt → wait for image → download to promotion/bg/. If no such MCP is configured, simply use Method A.

Method C (Preferred over A if available): Pre-configured Image Generation MCP/Connector (e.g., Canva connector's built-in AI image generator).

Style Library (select 3-5 styles in plan.md according to app type; each style corresponds to 1-2 promotional images):

StyleSuitable ForPrompt Keywords
Gradient FluidTools/Technology/AIsoft gradient fluid abstract, smooth flowing shapes
Minimalist GeometricProductivity/Businessminimalist flat design, geometric shapes, clean, pastel
3D Cartoon RenderKids/Education/Casualcute 3d cartoon render, soft lighting, playful
Natural Landscape PhotographyLifestyle/Health/Travelnatural landscape photography, golden hour, bokeh
Guochao IllustrationContent/Culturechinese traditional illustration, modern guochao style
Dark NeonGames/E-sportsdark neon glow, cyberpunk, dramatic lighting
Soft Diffuse LightSocial/Emotionalsoft diffuse light, dreamy pastel, warm

Prompt Inviolable Rule: Must include no text, no watermark – text in the images will be handled by compositing in Step 4; AI-generated text is always garbled. Color scheme should revolve around the brand primary color.

Step 4: Composite Product Introduction Images (HarmonyOS Phone Outline + Copywriting)

Use Python + Pillow to compose (if not installed, pip install pillow). Structure for each portrait image:

┌─────────────────┐  1080×2400
│  App Name (Title) │  ← Title area: app name + one-sentence selling point, brand primary/white text
│  One-sentence  │
│     USP        │
│ ╭─────────────╮ │
│ │ HarmonyOS  │ │  ← Phone body: brand primary gradient rounded rectangle (r≈140px),
│ │  Phone      │ │     highlight stroke, embedded Step 2 screenshot (also rounded clipped)
│ │ ┌─────────┐ │ │
│ │ │ Screenshot│ │ │
│ │ └─────────┘ │ │
│ ╰─────────────╯ │
│  icon + App Name │  ← Bottom brand area
└─────────────────┘

Minimum viable skeleton (modify parameters as needed; do not copy rigidly):

from PIL import Image, ImageDraw, ImageFilter, ImageFont

W, H = 1080, 2400
bg = Image.open("bg/style1_s42.png").convert("RGB")
bg = bg.resize((W, H))  # fill background; crop first if necessary to maintain aspect ratio

img = bg.copy()
draw = ImageDraw.Draw(img)

# HarmonyOS phone frame
frame_w, frame_h = 760, 1560
fx, fy = (W - frame_w) // 2, 560
body = Image.new("RGB", (frame_w, frame_h), (20, 20, 25))
mask = Image.new("L", (frame_w, frame_h), 0)
ImageDraw.Draw(mask).rounded_rectangle([0, 0, frame_w, frame_h], radius=110, fill=255)
img.paste(body, (fx, fy), mask)

shot = Image.open("shots/shot_1.jpeg").convert("RGB")
shot = shot.resize((frame_w - 24, int((frame_w - 24) * shot.height / shot.width)))
if shot.height > frame_h - 24:
    shot = shot.crop((0, 0, shot.width, frame_h - 24))
smask = Image.new("L", shot.size, 0)
ImageDraw.Draw(smask).rounded_rectangle([0, 0, shot.width, shot.height], radius=98, fill=255)
img.paste(shot, (fx + 12, fy + 12), smask)
draw.rounded_rectangle([fx, fy, fx + frame_w, fy + frame_h], radius=110, outline=(255, 255, 255), width=4)

# Text (Chinese font: Windows use msyh.ttc; HarmonyOS Sans preferred if installed)
font_big = ImageFont.truetype("C:/Windows/Fonts/msyh.ttc", 88)
font_sub = ImageFont.truetype("C:/Windows/Fonts/msyh.ttc", 46)
draw.text((W // 2, 300), "App Name", font=font_big, fill=(255, 255, 255), anchor="mm")
draw.text((W // 2, 410), "One-sentence USP", font=font_sub, fill=(230, 230, 230), anchor="mm")

img.save("final/phone/poster_1.png", optimize=True)

Requirements:

  • For tablet/PC versions: use landscape layout – screenshot on left or right, text area opposite side; resolution as verified in Step 1.
  • After export, check each image: single file ≤2MB (if exceeded, convert to JPG quality=88 or downsample); text must not obscure main content; rounded corners should be natural.
  • Copywriting should be distilled from selling points in plan.md, using short phrases (≤12 characters per line). No false feature descriptions.

Step 5: Optional Enhancement – Web Design Tools (Canva Connector, etc.)

Canva provides a wealth of built-in graphical assets: ready-to-use templates (app promotion / phone poster categories), shapes, illustration stickers, icons, and typography. An AI using the Canva connector can directly apply these built-in graphics for polishing, without drawing from scratch.

  1. Check the project's deveco.json / global configuration for mcp sections containing design connectors like canva, Figma, MasterGo, Pixso.
  2. If Canva is available: Search for built-in templates (keywords: "app promotion" / phone poster) → replace Step 3 AI backgrounds and Step 2 screenshots into template placeholders → fine-tune layout and copywriting using built-in graphics → export to promotion/final/. This leverages Canva's ready-made design assets, making it fast and professional.
  3. If not available: Skip this step. The main workflow (free image generation + compositing) is sufficient. Notify the user that configuring a Canva connector would provide template polishing capabilities.

Purpose: This step is an optional polish enhancement. The primary promotional image output always comes from Step 3 (free Pollinations generation) + Step 4 (code compositing). Canva is only used when the connector exists and the user desires more refined, template-based layout.

Step 6: Self-Check & Delivery

For each image in promotion/final/, verify:

  • Resolution matches the specifications verified in Step 1 (size, aspect ratio)
  • Format is JPG/PNG, single file ≤2MB
  • Phone images: 3-8 images, each corresponding to one selling point
  • No iOS/Apple/competitor logos, no watermarks, no garbled text
  • Chinese copywriting has no typos and is consistent with the app's actual features

Directory structure:

promotion/
  plan.md          # Selling points, spec verification records, style selection
  shots/           # Emulator original screenshots
  bg/              # AI-generated backgrounds (multiple styles, multiple seeds)
  final/phone/     # Phone final images
  final/tablet/    # Tablet final images (if applicable)
  final/pc/        # PC final images (if applicable)
  manifest.md      # Delivery checklist: file names, sizes, file sizes, corresponding selling points

Report to the user upon delivery: path to final images, size and corresponding selling point for each image, and where to upload them in AppGallery Connect (App Info → Introduction Image / Promotional Image).

Related Skills