Inspiration
I help run a student entrepreneurship club. Every lecture means the same facts — date, time, room, speaker, sign-up link — have to show up in a form, an announcement email, a reminder, a follow-up, a LINE message, and an Instagram caption. When that work is rushed or automated, a wrong weekday or the wrong form link can reach dozens of members in one send. I wanted a tool that makes the safe default “prepare a draft and stop,” and that refuses to treat a brief as ready if the date and the weekday don’t even agree.
What it does
ClubGuard turns one lecture brief (預告內容.md) into sign-up and feedback form specs, announcement / reminder / follow-up emails, and LINE and Instagram copy.
Before anything is treated as ready, nycuiec check runs club rules: the calendar date must match the stated weekday, fees must use the required wording, letters must not contain member addresses or the fee/check-in lines that belong on the form, and the announcement must point at this session’s sign-up link.
generate only writes files and Gmail draft previews. It does not send mail, post to Instagram, or push to LINE. A real send needs both --confirm-send and the environment flag NYCUIEC_ALLOW_SEND=1. The config file cannot turn that flag on. Recipient lists stay outside the repo; logs and previews show counts, not member addresses. Offline testdata uses 40 fictional members and five fictional sessions on @example.com / @example.edu.tw.
The same codebase also has a PostgreSQL roster, optional official API clients (or fakes when no credentials are present), a Cloud Run service with scheduled jobs, secret storage, field encryption for personal data, a login-gated dashboard, and failure alerts. The judge-facing demo is the offline check-and-draft path above.
How we built it
Python 3.11+ package (nycuiec) with Jinja-style HTML templates, a rule checker, and a hard safety gate around send / publish / push. SQLAlchemy, Alembic, and psycopg for the database; cryptography for optional field encryption; pytest in CI. Google API clients are optional and unused in the offline demo. Deploy scripts target Cloud Run, Secret Manager, and Cloud Scheduler; they are not required to reproduce the demo.
Challenges we ran into
Keeping “draft only” as a real guarantee, not a comment: send requires a flag in the call and an environment variable, and the CLI never sets that path on generate. Checking copy across forms, three letters, LINE, and Instagram without leaking BCC addresses into the bodies. Showing a useful safety demo without exposing a live club inbox, member list, or school account.
Accomplishments that we're proud of
A working, offline path a reviewer can run in minutes: a correct synthetic brief passes, a deliberately broken brief is blocked for the wrong weekday and banned fee wording, drafts are written, and gmail send is refused. Tests cover the checker, the send gate, and the rule that testdata stays on example domains.
What we learned
The safety of a club automation tool is mostly about what it refuses to do. Catching a date/weekday mismatch before send is more valuable than adding another channel. Using synthetic data from the start made it possible to demo the system without publishing members.
What's next
- A post-send audit agent that reads what actually appeared on IG, Linktree, LINE, the form, and email, and compares it with the brief
- Phishing / lookalike-domain detection on links
- An explicit president-approval step before any send
- (Still not claimed as done.) Off-campus activity checks, comment filtering, and one-tap emergency notice
Credits, AI assistance, and pre-existing work
Solo project by Min-Yu Chen (陳敏佑). AI assistants were used to write, refactor, test, and draft documentation; I reviewed and tested the result.
This public repo is a clean snapshot of private cmy-hulala/nycuiec-club-system at commit 41184d1 (2026-11-22 22:54 Taipei time), with history reset and real sent mail / machine paths removed. The formal project was created on 2026-11-22 02:39 Taipei time, during the SafeSpace Hacks window (from 2026-10-17 12:00 Taipei time). legacy/ holds earlier one-off scripts for forms, Gmail drafts, OAuth, and Canva/IG experiments; those predate 17 October 2026 and should not be run.
A concrete safer outcome
tests/fixtures/broken/預告內容.md states that 2026-11-04 (a Wednesday) is a Monday, and describes officer fees as「另計」instead of the required wording. nycuiec check exits non-zero and prints those errors, so the brief is not treated as ready to send. The matching fictional brief in testdata/ passes and produces drafts with no member addresses.
Limitation
This is a working prototype. It does not catch every mistake, does not replace a human review, and does not guarantee safety. It does not include a post-send audit agent, phishing detection, or a president-approval workflow. Linktree is still updated by hand. Instagram copy is generated but not auto-posted. The Cloud Run deployment is login-gated and is not a public try-it-now demo; please run bash demo/safespace_demo.sh locally with synthetic data.
Built With
- gmail-api
- google-cloud-run
- google-cloud-scheduler
- google-forms-api
- google-secret-manager
- line-messaging-api
- neon
- notion-api
- postgresql
- python