AGENT SKILL

building-messages

Use when changing, previewing, or debugging the WhatsApp message text itself — daily report or monthly-target layout, brand lines, signature fallback, balance-block states, or why a sent message looks wrong.

License 许可
MIT
最近更新
2026-08-11
Stars
★ 0
Forks
0

01 前言 Front Matter

name
building-messages
license
MIT
sources
[ "anthropics/skills", "mattpocock/skills" ]
version
1.0.0
description
Use when changing, previewing, or debugging the WhatsApp message text itself — daily report or monthly-target layout, brand lines, signature fallback, balance-block states, or why a sent message looks wrong.

03 SKILL.md 正文

Building WhatsApp Messages

The two builders (templates.py)

  • build_whatsapp_message(...) — the daily report: header (agency), report date, account, brandwise invoiced, brandwise balance, target-speed line, signature.
  • build_monthly_target_message(...) — the start-of-month target announcement.

Both take brand_strings (list of {label, actual, balance, target} items), market_names (brand code → full display name), and user_profile. Brand display names come from market_names, never from the raw code.

Signature fallback

_build_signature(profile) renders "Regards," + bold name + designation + bold agency when the profile has any of those fields; with no profile fields it returns config.MESSAGE_FOOTER. Never hardcode a signature block — that is the exact bug this fallback was introduced to prevent (MESSAGE_FOOTER is the config-driven default).

The three balance-block states

  1. target_completed=True → "✅ All brand targets fully completed!" + congratulations line.
  2. No balance lines (every brand at/over target) → same completed line, no DRR line.
  3. Otherwise → the balance lines + "👉 Target Speed: Order an average of X Cases daily…" (DRR from required_drr).

Greeting decoration happens at send time

The dispatchers prepend the greeting (☀️ Good Morning / 📊 Good Afternoon / 🌙 Good Evening by local hour) to each queue message in dispatcher.py and dispatcher_web.py — not in templates.py. Consequence: the GUI preview dialog shows the message exactly as templates.py rendered it, without the greeting. Keep the two dispatchers' greeting logic in sync.

Verifying

  • GUI: Run tab → Load File → the preview dialog renders the exact message for each queued account before dispatch.
  • Tests: tests/test_templates.py covers layout and the signature fallback. Extend it when touching templates.py.

Common mistakes

  • Editing the message body inside a dispatcher instead of templates.py — it would diverge between the two backends.
  • Hardcoding the signature instead of falling back to MESSAGE_FOOTER.
  • Judging the sent message from the preview alone and missing the greeting prefix the dispatcher adds.

04 同仓库更多 Skills

BangerSoul
BangerSoul/whatsapp-mtd-sales-automation

vercel-react-view-transitions

Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.

★ 0
BangerSoul
BangerSoul/whatsapp-mtd-sales-automation

vercel-react-native-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

★ 0
BangerSoul
BangerSoul/whatsapp-mtd-sales-automation

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

★ 0
BangerSoul
BangerSoul/whatsapp-mtd-sales-automation

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

★ 0
BangerSoul
BangerSoul/whatsapp-mtd-sales-automation

supabase-postgres-best-practices

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

★ 0
BangerSoul
BangerSoul/whatsapp-mtd-sales-automation

skill-installer

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

★ 0