Announcement Banner logo

Announcement Banner

Community
rshankras
announcement-banner

Generates an in-app announcement banner system with remote configuration, scheduling, deep link actions, and dismiss tracking. Use when user wants in-app banners, promotional notices, maintenance alerts, or contextual announcements.

Overview

Publisherrshankras
Repositoryclaude-code-apple-skills
Skill nameannouncement-banner
Stars
744
Forks
70
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by rshankras on GitHub. Read the source before you install it.

Installation

Install the Announcement Banner AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills.git /tmp/claude-code-apple-skills
mkdir -p .claude/skills
cp -r /tmp/claude-code-apple-skills/skills/generators/announcement-banner .claude/skills/announcement-banner
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Announcement Banner in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Announcement Banner on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Announcement Banner is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Announcement Banner Generator

Generate a configurable in-app announcement/banner system that displays contextual messages (maintenance alerts, new feature highlights, promotions) from remote config or local definitions. Supports dismissal, deep link actions, and scheduling.

When This Skill Activates

Use this skill when the user:

  • Asks to "add announcement banner" or "in-app banner"
  • Wants "app announcement" or "notification banner"
  • Mentions "promotional banner" or "promo banner"
  • Asks about "maintenance notice" or "maintenance alert"
  • Wants "in-app messaging" or "contextual banners"
  • Asks to "show announcements" or "display alerts to users"
  • Mentions "feature highlight banner" or "what's new banner"

Pre-Generation Checks

1. Project Context Detection

  • Check Swift version (requires Swift 5.9+)
  • Check deployment target (iOS 16+ / macOS 13+)
  • Check for @Observable support (iOS 17+ / macOS 14+)
  • Identify source file locations

2. Conflict Detection

Search for existing banner/toast code:

Glob: **/*Banner*.swift, **/*Announcement*.swift, **/*Toast*.swift, **/*InAppMessage*.swift
Grep: "AnnouncementBanner" or "InAppBanner" or "ToastView" or "BannerView"

If third-party library found (Firebase In-App Messaging, Braze, Intercom):

  • Ask if user wants to replace or keep it
  • If keeping, don't generate — advise on integration patterns instead

3. Deep Linking Detection

Check for existing deep linking setup:

Grep: "deepLink" or "DeepLink" or "universalLink" or "openURL" or "onOpenURL"

If deep linking exists, integrate with it. If not, generate standalone action handling.

Configuration Questions

Ask user via AskUserQuestion:

  1. Banner position?

    • Top (slides in from top) — recommended for alerts
    • Bottom (slides in from bottom)
    • Floating (centered overlay with dimmed background)
  2. Content source?

    • Local only (hardcoded announcements in code)
    • Remote JSON (fetch from server endpoint)
    • Both (remote with local fallbacks) — recommended
  3. Action type?

    • Deep link (navigate to in-app screen)
    • URL (open in Safari/SFSafariViewController)
    • Dismiss only (informational, no action button)
    • All of the above — recommended
  4. Include scheduling (start/end dates)?

    • Yes (time-limited announcements with date ranges) — recommended
    • No (always-active until dismissed)

Generation Process

Step 1: Read Templates

Read templates.md for production Swift code.

Step 2: Create Core Files

Generate these files:

  1. Announcement.swift — Model with style, action, priority, scheduling
  2. AnnouncementManager.swift — @Observable manager: loads, filters, tracks dismissals
  3. AnnouncementProvider.swift — Protocol + local/remote implementations with caching

Step 3: Create UI Files

  1. AnnouncementBannerView.swift — SwiftUI banner with style-aware colors and animations
  2. AnnouncementBannerModifier.swift — ViewModifier for overlay placement and action routing

Step 4: Create Optional Files

Based on configuration:

  • AnnouncementScheduler.swift — If scheduling selected (date range filtering, timezone handling)

Step 5: Determine File Location

Check project structure:

  • If Sources/ exists -> Sources/AnnouncementBanner/
  • If App/ exists -> App/AnnouncementBanner/
  • Otherwise -> AnnouncementBanner/

Output Format

After generation, provide:

Files Created

AnnouncementBanner/
├── Announcement.swift              # Model with style, action, priority
├── AnnouncementManager.swift       # Observable manager with dismiss tracking
├── AnnouncementProvider.swift      # Protocol + local/remote providers
├── AnnouncementBannerView.swift    # SwiftUI banner view
├── AnnouncementBannerModifier.swift# ViewModifier for overlay + actions
└── AnnouncementScheduler.swift     # Date range filtering (optional)

Integration Steps

Add banner overlay to root view:

swift
// In your root ContentView or NavigationStack
ContentView()
    .announcementBanner()

With custom position:

swift
ContentView()
    .announcementBanner(position: .bottom)

With deep link action handler:

swift
ContentView()
    .announcementBanner { action in
        switch action {
        case .deepLink(let destination):
            router.navigate(to: destination)
        case .url(let url):
            openURL(url)
        case .dismiss:
            break
        }
    }

Define local announcements:

swift
let provider = LocalAnnouncementProvider(announcements: [
    Announcement(
        id: "maintenance-2024",
        title: "Scheduled Maintenance",
        message: "We'll be performing maintenance on Saturday 9-11 AM EST.",
        style: .warning,
        action: .dismiss,
        priority: 10,
        startDate: maintenanceStart,
        endDate: maintenanceEnd
    ),
    Announcement(
        id: "new-feature-photos",
        title: "New: Photo Library",
        message: "Check out our new photo library with AI-powered search!",
        style: .promotion,
        action: .deepLink("app://features/photos"),
        priority: 5,
        isDismissible: true
    )
])

Fetch from remote config:

swift
let provider = RemoteAnnouncementProvider(
    url: URL(string: "https://api.example.com/announcements")!,
    cacheDuration: 3600  // 1 hour
)

Testing

swift
@Test
func dismissedAnnouncementsAreHidden() async throws {
    let manager = AnnouncementManager(
        provider: MockAnnouncementProvider(announcements: [testAnnouncement]),
        dismissalStore: InMemoryDismissalStore()
    )

    await manager.loadAnnouncements()
    #expect(manager.activeAnnouncement != nil)

    manager.dismiss(testAnnouncement)
    #expect(manager.activeAnnouncement == nil)
}

@Test
func highestPriorityAnnouncementShownFirst() async throws {
    let lowPriority = Announcement(id: "low", title: "Low", message: "...", style: .info, priority: 1)
    let highPriority = Announcement(id: "high", title: "High", message: "...", style: .warning, priority: 10)
    let manager = AnnouncementManager(
        provider: MockAnnouncementProvider(announcements: [lowPriority, highPriority])
    )

    await manager.loadAnnouncements()
    #expect(manager.activeAnnouncement?.id == "high")
}

@Test
func expiredAnnouncementsAreFiltered() async throws {
    let expired = Announcement(
        id: "expired",
        title: "Old",
        message: "...",
        style: .info,
        endDate: Date.distantPast
    )
    let manager = AnnouncementManager(
        provider: MockAnnouncementProvider(announcements: [expired])
    )

    await manager.loadAnnouncements()
    #expect(manager.activeAnnouncement == nil)
}

Common Patterns

Show Maintenance Banner

swift
Announcement(
    id: "maintenance-\(date)",
    title: "Scheduled Maintenance",
    message: "Service will be unavailable Saturday 2-4 AM EST.",
    style: .warning,
    action: .url(URL(string: "https://status.example.com")!),
    priority: 100,  // High priority overrides other banners
    startDate: Calendar.current.date(byAdding: .day, value: -1, to: maintenanceDate)!,
    endDate: maintenanceEndDate,
    isDismissible: false  // Can't dismiss maintenance warnings
)

Promote New Feature

swift
Announcement(
    id: "feature-v2.5-darkmode",
    title: "Dark Mode is Here!",
    message: "Try our new dark mode in Settings.",
    style: .promotion,
    action: .deepLink("app://settings/appearance"),
    priority: 5,
    isDismissible: true
)

Time-Limited Promotion

swift
Announcement(
    id: "promo-summer-2024",
    title: "Summer Sale - 40% Off!",
    message: "Upgrade to Pro at our lowest price ever.",
    style: .promotion,
    action: .deepLink("app://subscription/upgrade"),
    priority: 8,
    startDate: promoStart,
    endDate: promoEnd,
    isDismissible: true,
    targetAudience: .freeUsers
)

Gotchas

  1. Banner stacking — Never show multiple banners simultaneously. Use priority to determine which single banner to display. Queue others and show the next one after dismissal.
  2. Don't cover critical UI — Ensure the banner doesn't overlap navigation bars, tab bars, or interactive elements. Use safe area insets.
  3. Respect user dismissal — Persist dismissed announcement IDs so they don't reappear after app relaunch. Use UserDefaults or a lightweight store.
  4. Remote config caching — Cache fetched announcements to avoid network requests on every app launch. Honor cache duration but allow force-refresh.
  5. Date/timezone handling — Always use UTC for start/end dates in remote config. Convert to local timezone only for display purposes.
  6. Accessibility — Announce banner appearance with AccessibilityNotification.Announcement. Ensure dismiss button has proper label.
  7. Animation interruption — If a user navigates away mid-animation, ensure the banner state resets properly. Use .task tied to view lifecycle.

References

  • templates.md — All production Swift templates
  • Related: generators/deep-linking — Deep link routing integration
  • Related: generators/whats-new — What's new screen for feature highlights

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Announcement Banner AI skill do?

Generates an in-app announcement banner system with remote configuration, scheduling, deep link actions, and dismiss tracking. Use when user wants in-app banners, promotional notices, maintenance alerts, or contextual announcements.

Why use Announcement Banner on TypingMind?

Because you install it once and use it with any model. Announcement Banner is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Announcement Banner in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/rshankras/claude-code-apple-skills/tree/main/skills/generators/announcement-banner. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Announcement Banner?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Announcement Banner?

As many as you like. As long as a model supports skills, you can use Announcement Banner with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Announcement Banner AI skill free?

Yes. It is published on GitHub by rshankras under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇