/aaif-events:aaif-sync-badgesfrom AAIF Community Events Toolkit
Syncs AAIF chapter organizer badges (SVG + PNG) into each chapter's Drive folder, generating missing badges and optionally regenerating all after a design change.
Ships in AAIF Community Events Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Paths in this skill are relative to this skill directory. Resolve <skill-root>
from the loaded SKILL.md; it is a placeholder, not an environment variable.
Tooling rule —
gws+ Python only. Every read, edit, and write of a Drive file goes through thegwsCLI, driven from Python. Prefer native Google formats: editapplication/vnd.google-apps.*files with the Docs/Sheets/ Slides API. Drop to byte-level OOXML surgery on the.docx/.pptx/.xlsxzip parts (embedded fonts and untouched parts survive) only when the file genuinely is a stored Office file. Never use LibreOffice /soffice— not to edit, not to convert, and not to render a "just checking it locally" preview: it substitutes local system fonts for the brand fonts and drops OOXML it doesn't understand, so its output and its renders both misrepresent the real file. Same forunoconvand any desktop office suite. To see a file, render it through the API instead — a slide viaaaif_events.slides_export.render_slide_png, a doc viagws drive files copyto a Google Doc →gws drive files exportto PDF → trash the copy. Never round-trip a native Doc through.docx— it strips native features like Tabs.
Keeps every chapter's own Badges/ Drive subfolder (created directly inside
the chapter's folder under the Chapters Drive folder, id
1IQ1K7aVOKUUkxAcfLuNjdETEnmavvtjx — same one aaif-create-chapter clones from
— alongside its existing Icons/, Event Templates (…)/, etc.) in sync. Each
chapter's Badges/ folder holds two badge styles, 6 files total:
organizer_badge_<slug>_colour.svg \
organizer_badge_<slug>_white.svg | style 1 — scripts/make_badges.py
organizer_badge_<slug>_colour_1000.png | (self-contained, hand-tuned palette)
organizer_badge_<slug>_white_1000.png /
organizer_badge_<slug>_agent.svg \ style 2 — scripts/make_agent_badge.py
organizer_badge_<slug>_agent_1000.png / (real AAIF design-system tokens
+ the chapter's own agent mascot)
<slug> is make_badges.slugify(city name) — e.g. "Mexico City" → mexico_city,
"Delhi NCR" → delhi_ncr.
make_badges.py — a ring-and-arc badge in its own hand-picked orange/ink/
lilac palette and a system font stack (Liberation Sans, DejaVu Sans), rendered
to PNG via cairosvg. Self-contained (no lib import), per this repo's usual
skill-script convention. This was the original design and is deliberately kept
as-is — it does not pull from the AAIF design system.make_agent_badge.py — draws from the real design system instead: Instrument
Sans embedded exactly as report_style.font_css() does for every HTML report,
ink/paper/hairline tokens, and the chapter's own agent mascot
(agent_art.chapter_scene() / agent_art.agent() — the same deterministic
per-chapter colour already used for that chapter's Icons/ folder and decks, so
the badge and the chapter's other AAIF-generated art always agree). Rendered via
headless Chrome — DESIGN.md's one allowed SVG→PNG renderer — not cairosvg.
This intentionally takes the lib/aaif_events coupling AGENTS.md otherwise asks
skill scripts to avoid, for the same reason restyle_design_system.py does: the
whole point of this variant is to be provably on-system.Prereqs: the gws CLI installed and authenticated (aaif-check-setup
confirms it); cairosvg importable for style 1
(python3 -m pip install cairosvg); a Chrome/Chromium install for style 2. Both
are imported lazily (only when actually rendering a PNG), so a plan-only run
needs neither Drive write access nor either renderer, and a chapter only missing
one style's files never invokes the other style's renderer.
scripts/sync_badges.py)# Plan (default) — nothing is created/uploaded, just reported:
python3 <skill-root>/scripts/sync_badges.py
# Apply — create missing chapter subfolders and upload missing files:
python3 <skill-root>/scripts/sync_badges.py --write
# Regenerate every file (after a design change) and overwrite what's already there:
python3 <skill-root>/scripts/sync_badges.py --write --regenerate
# One chapter only (Drive chapter-folder name, case-insensitive substring):
python3 <skill-root>/scripts/sync_badges.py --chapter "Mexico City" --write
aaif-create-chapter
shows up here on the next run with no code change. TemplateCity (the
clone source, not a real chapter) is excluded.Badges/ subfolder or file already present is
left alone unless --regenerate is passed — badges are never deleted, and a
file that already exists is updated in place (same Drive file id), never
duplicated.Badges used to live in one shared parent folder (<parent>/<slug>/…) instead
of inside each chapter. scripts/migrate_legacy_badges.py moves files out of
that old layout into the per-chapter Badges/ folder this skill now targets —
a Drive reparent (addParents/removeParents), not a re-upload, so file
ids and revision history survive. Plan-only by default:
# Plan — nothing is moved:
python3 <skill-root>/scripts/migrate_legacy_badges.py
# Apply the moves:
python3 <skill-root>/scripts/migrate_legacy_badges.py --write
# Also trash (Drive trash, recoverable) a legacy folder left empty by the move:
python3 <skill-root>/scripts/migrate_legacy_badges.py --write --trash-empty
--trash-empty is resilient per folder: one folder's trash failing (e.g. a
Drive permissions mismatch on that specific folder — differing ownership or
sharing from its siblings) is reported and skipped, never lets an exception
stop the rest from being cleaned up. A folder that can't be trashed this way
is harmless either way — it's already empty, and every file it held has
already been safely moved — and can be deleted by hand in Drive by an owner,
or re-run later if permissions change. If many folders in a row fail with the
same error, the script stops instead of continuing to fail identically
through every remaining folder — that pattern means something systemic (a
stale gws credential, a broken API call), not a per-folder quirk, and is
worth fixing before re-running rather than working around.
A file already present at the destination (by name) is left alone and
reported, never overwritten by the migration — run sync_badges.py --regenerate afterward if the content should also be refreshed. A legacy
folder matching no canonical chapter (a renamed/retired chapter, or a stray
item) is reported and never touched.
Plan, approve, write, verify. Nothing is created without --write.
bash python3 <skill-root>/scripts/sync_badges.py
Read every + create folder / upload / overwrite line before writing.--write.image/svg+xml and image/png
inside the chapter's own Badges/ subfolder.bash python3 <skill-root>/scripts/test_sync_badges.py python3 <skill-root>/scripts/test_make_badges.py python3 <skill-root>/scripts/test_make_agent_badge.py python3 <skill-root>/scripts/test_migrate_legacy_badges.py tempfile.mkdtemp() directory that is
deleted at the end of the run — nothing lands in the repo working tree, so
there's no .gitignore entry to add.make_badges.py or make_agent_badge.py) directly, then run --write --regenerate to push the new design to every chapter.scripts/make_agent_badge.py (opens in a new tab)scripts/make_badges.py (opens in a new tab)scripts/migrate_legacy_badges.py (opens in a new tab)scripts/sync_badges.py (opens in a new tab)scripts/test_make_agent_badge.py (opens in a new tab)scripts/test_make_badges.py (opens in a new tab)scripts/test_migrate_legacy_badges.py (opens in a new tab)scripts/test_sync_badges.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aaif/community-events --plugin aaif-events24 skills in this plugin
/aaif-announcement-postWrite the LinkedIn launch/announcement post for an AAIF event when RSVPs open. Use when asked to draft the announcement, launch post, or "RSVPs are open" post for an AAIF event./aaif-attendee-reminderWrite the pre-event reminder to people who RSVP'd to an AAIF event (sent ~1 week out and the morning of). Use when asked to draft the attendee reminder / "see you tomorrow" note for an AAIF event./aaif-audit-slackAudit the community Slack workspace and report it as one HTML page — whether every chapter has its public and organizer channels and the right people in them, which subject-matter rooms have gone quiet or overlap, and what the headline member count is actually made of. Use when asked about Slack coverage for chapters, whether organizers are in their channels, who is in an -organizers channel, workspace health, channel clutter, inactive channels or accounts, or the newcomer experience./aaif-backupTake a versioned local backup of critical AAIF ops data — the Community Intake Ops sheet by default, or any Drive file / local file you name. Snapshots are immutable and timestamped so you keep a full history. Use when asked to back up / snapshot the intake data (or another file) before a risky edit./aaif-carousel-copyWrite copy for a 6-slide LinkedIn carousel announcing an AAIF event. Use when asked to draft carousel slides/copy for an AAIF event (built from the LinkedIn Carousel template)./aaif-check-setupCheck that this computer is ready to run the AAIF toolkit — Python, the full plugin install, the gws Google Workspace tool and its Google sign-in, edit access to the Community Intake sheet, the Slack token, the Luma key, and Chrome for PDF reports — and explain in plain language how to fix anything missing. Read-only. Use when asked to check my setup, test whether the toolkit works, after installing it on a new computer, or when another AAIF skill fails because a tool, sign-in, token or key is missing.Other plugins' skills for the same job