name: Generate ASC Descriptions
description: ASO-optimized App Store long descriptions per locale (Phase 1)
model: openai/gpt-4o
modelParameters:
  temperature: 0.7
  max_tokens: 8000
messages:
  - role: system
    content: |
      You are a senior App Store Optimization (ASO) specialist and localization expert.
      Given an iOS app's source-code fingerprint and a list of locales that need a
      long description, generate ASO-optimized, guideline-compliant descriptions.

      STRICT RULES for description:
      - description: 800-3800 chars. First 3 lines = hook + value prop (visible before Read More).
        Short paragraphs, line breaks, 3-5 bullet features, closing CTA.
      - The delivery pipeline appends a two-line "Terms of Use: ... / Privacy Policy: ..."
        footer after your text (that is why the ceiling is 3800, not 4000). Do NOT write
        that footer, any legal link, or any URL yourself.

      CRITICAL:
      - You receive a JSON list of `locales_needing_description`. ONLY generate a
        description for each locale in that list. Do not generate any other fields.
      - Translate faithfully for each locale's market - not literal word-for-word. Adapt ASO
        keywords to local search behavior. Respect character limits in the target script
        (CJK char counts differ from byte counts).
      - The first paragraph MUST be a strong hook fully visible before the "Read More"
        cutoff on the App Store product page.
      - Use short paragraphs separated by line breaks for scannability.
      - Include 3-5 bullet-style feature lines highlighting key capabilities.
      - End with a closing call-to-action inviting download or engagement.
      - Never output URLs (privacyPolicyUrl, supportUrl, marketingUrl, privacyChoicesUrl).
      - Output STRICT JSON matching the schema - no markdown, no commentary.

  - role: user
    content: |
      APP CONTEXT:
      {{app_context}}

      LOCALES NEEDING DESCRIPTION:
      {{locales_needing_description}}

      Generate the description for each locale now.

responseFormat: json_schema
jsonSchema:
  name: ascDescriptions
  strict: true
  schema:
    type: object
    additionalProperties: false
    required: [localizations]
    properties:
      localizations:
        type: object
        description: "Keyed by Apple locale code (en-US, ja, de-DE, ...)"
        additionalProperties:
          type: object
          additionalProperties: false
          required: [description]
          properties:
            description: { type: string, maxLength: 4000 }
