Employee Care
What It Does
Reads the Feishu employee roster (birthday + hire date), checks daily whether any employee has a birthday or work anniversary; for each match, writes a personalized blessing (acrostic poem / heartfelt short phrase) incorporating their department/role, pairs it with a celebratory main image, creates a Feishu interactive card, first sends it to the operator for preview and confirmation, then sends it directly to the employee via the operator's own account. Supports scheduled daily runs and parallel processing of multiple employees. Built-in production-grade safeguards: idempotent deduplication (no repeated notifications), inactive employee filtering, dual celebration card merging for same-day birthday + anniversary, consolidated roster card for multiple celebrants (see at a glance who's celebrating today), run receipts (who was sent to / failed / skipped), and optionally asks during installation whether to notify the direct manager in advance.
The roster file is actively searched by the skill across the user's Feishu assets during first run, with links provided for user confirmation, eliminating the need for manual token entry. The main image is generated using Doubao/Ark (default: a simple theme of "a group of 3D little people celebrating"). If no API key is available or image generation fails, it gracefully degrades to a text-only card.
Flow
Step 0 · Initial Configuration (Proactively Ask During Setup)
During the first run, ask three questions upfront before proceeding—don't try to sneak by with default values:
- Data Source: Do you have an existing roster file? Yes → Path A; No or want to use Feishu HR active employee data → Path B (CoreHR direct connection).
- Leader Notification: Would you like to privately notify the employee's direct manager one day before their birthday/anniversary, so the manager can also send a blessing? (Optional advance days, default 1 day; enable or disable) – See
references/leader-notify.md. - Scheduling: Would you like it to run automatically every day? Default 10:30 Asia/Shanghai, user-selectable time.
Record these three choices as the configuration for the daily loop.
Step 1 · Locate and Read the Roster
Follow references/data-sources.md, choose one of two data sources:
- Path A · Roster File (default):
lark-cli drive +searchto search the user's Feishu assets, read headers and verify key fields (required:Name+ at least one date columnBirthday/Hire Date; optional:Department,Role,open_id,Status), present the link + field verification results to the user for confirmation; if the user says "none are correct" or candidates lack key fields, ask them to provide one. Read by type (bitable usinglark-base, sheet usinglark-sheets). - Path B · CoreHR Direct Connection: If no roster file exists or the user wants to use Feishu HR active employee data directly,
python3 scripts/extract_corehr.py(wrapspeople-cli's CoreHRemployees/search, tested to retrieve name/birthday/hire date/open_id/department/status). Requirescorehr:employee:read+corehr:person.date_of_birth:readpermissions.
Prioritize asking the user: "Do you have an existing roster file?" If yes, go with A; if no or explicitly wanting HR data, go with B. Both paths normalize into the same people list and write a temporary JSON:
[{"name":"Zhang San","open_id":"ou_xxx","department":"R&D Platform","role":"Backend Engineer","birthday":"1994-08-25","hire_date":"2021-08-25","status":"hired"}]
The open_id can be empty during the preview phase (Path A can use lark-contact to look up by name + department to fill in; Path B comes with open_id). It must be filled in before sending to the employee.
Step 2 · Detect Today's Matches (Including Inactive Filtering, Dual Celebration Merging)
python3 scripts/match_today.py --roster <tmp.json> --tz Asia/Shanghai
Returns celebrations (one per person, kind being birthday/anniversary/both), inactive (separated/resigned, filtered out and not sent), skipped (no usable dates). The script handles: leap year Feb-29→Feb-28, hire date not counting as anniversary on the same day, unknown birth year age=null, same-day birthday+anniversary merged as both (sends one dual celebration card, not two), filters by status column for separated/resigned (long-term leave is not automatically filtered, but status is displayed for manual review). If celebrations is empty, no one is celebrating today—quietly finish.
Step 3 · Idempotent Deduplication
python3 scripts/match_today.py ... | python3 scripts/run_state.py filter --date <today> --source <roster identifier>
Filters out people already successfully sent to today (prevents duplicate triggers from scheduled runs / manual+automatic sends). Continue with the returned todo list.
Step 4 · Write Personalized Blessings
Follow references/blessing.md, generate for each person in the todo list individually (default: acrostic poem; or short heartfelt phrases), incorporating department/role imagery. For both dual celebrations, write one paragraph that touches on both birthday and anniversary. Avoid repetitive phrasing when multiple people are involved. Be sincere and restrained—no slogans, no emoji overload—provide the final text directly.
Step 5 · Generate Main Image + Build Card + Preview & Send + Record
The card architecture is fixed in scripts/build_card.py—use it every time. The resulting Card 2.0 JSON is designed following lark-im P0–P7 "good-looking standards," polished, consistent, and renderable—no hand-written JSON. The --kind option supports birthday/anniversary/both (dual celebration card). The main image defaults to "a group of 3D little people celebrating" (user can customize), generated via Ark; pass the img_key to the script if available; if no key/failure, omit, and the script automatically degrades to a text-only card. Details (image prompt, gift CTA, sending) in references/card.md.
python3 scripts/build_card.py --kind birthday --name "Zhang San" --department "R&D Platform" --role "Backend Engineer" \
--date-label "August 25" --wish $'Zhang lights up on his birthday,\nSan's years of work weave deep.' \
[--img-key img_v3_xxx] [--gift-url https://... --gift-text Claim Birthday Gift]
Send the card using the user's own account (default identity – Doubao Enterprise/Feishu automatically associates the current user's tenant for CLI proxied sending; do not hardcode a bot or fixed open_id). Send using lark-cli im +messages-send. Write the card to a file, then pass with --content "$(cat file)" (--content does not support @file; do not use echo as a proxy—it will corrupt the JSON). First, send to the operator for preview:
python3 scripts/build_card.py --kind birthday --name "Zhang San" ... > /tmp/card.json
lark-cli im +messages-send --user-id <self ou_...> --msg-type interactive --content "$(cat /tmp/card.json)" --dry-run # Validate first
lark-cli im +messages-send --user-id <self ou_...> --msg-type interactive --content "$(cat /tmp/card.json)"
After the user confirms, send to each employee's open_id individually. Record each send immediately, whether successful or failed:
python3 scripts/run_state.py mark --date <today> --source <roster identifier> --open-id <ou_...> --status sent --name "Zhang San"
Multiple people on the same day: In addition to each person's individual personalized card, generate a consolidated roster card using --roundup (shows everyone celebrating today at a glance, tagged by birthday/anniversary/dual), sent by default to the operator for an overview preview. With the user's consent, it can also be sent to a team group for public celebration.
python3 scripts/match_today.py --roster <tmp.json> | python3 scripts/build_card.py --roundup --date-label "August 25" > /tmp/roundup.json
After the batch run, produce a run receipt with run_state.py report --date <today> --source <...> (who was sent to / who failed / why), and report it to the operator along with inactive and skipped status lists. See references/card.md for details.
Step 6 · Notify Direct Manager in Advance (Based on Step 0 Choice)
If the user opted in during Step 0, follow references/leader-notify.md: N days in advance (default 1 day), identify the direct manager of the employee who will be celebrating a birthday/anniversary, and privately remind them to send a blessing. If scope is missing / manager cannot be found, skip and honestly report it—does not affect the blessing card for the employee. If Step 0 was not asked or the user chose not to enable it, do not notify.
Step 7 · Scheduled Run (Optional)
If the user wants "run automatically every day," follow references/scheduling.md to call the host's automation tool, create a daily recurring task (default 10:30 Asia/Shanghai, user-selectable), and read it back for confirmation; if the host cannot invoke reasoning, honestly inform the user that manual triggering is required.
Hard Rules
- Preview before sending: By default, all blessing cards are first sent to the operator. Send to the employee only after the user explicitly confirms.
- Do not spam: Use
run_state.py filterto deduplicate before sending—no employee receives a second card on the same day. Immediatelymarkeach send. - Do not send to separated employees: Filter by
statusfor separated/resigned; listinactiveand those withoutopen_idexplicitly in the preview and receipt for manual review. - One card per person, personalized individually: Do not reuse the same text for different employees. Merge same-day birthday + anniversary into one dual celebration card.
- Privacy and tenant isolation: Read only the minimum necessary fields. Do not persist sensitive employee information on disk (the ledger only stores open_id + status, which can be discarded). Before sending cards, ensure the
lark-cliprofile points to the correct tenant, strictly isolating company and personal Feishu. - No fabrication: If date/open_id cannot be read, report it honestly—do not fabricate. If no image generation key or generation fails, fall back to a text-only card—do not fabricate an
img_key. Gift claim links are provided by the user; if not provided, do not add one—do not fabricate a URL. - Know your limits: For large-scale, fully unattended scenarios with over 500 employees, recommend using Feishu's multi-dimensional tables' "scheduled batch fetch records" automation instead, and inform the user honestly.
- Portable (open-source requirement): Designed for all Doubao Enterprise users and any agent (Codex/Claude Code/Cursor, etc.). Do not hardcode any local specifics—no hardcoded open_id / app_id / profile name / bot identity / pre-authorized scopes. Identity uses the environment default (the user's own account). File paths, tenants, and roster sources are discovered at runtime or confirmed by the user. If a scope is missing, follow CLI prompts to guide authorization—do not assume it is already authorized.
Resources
scripts/match_today.py— Detects today's matches: one per person,bothdual celebration merging, inactive filtering, leap year and tenure calculation.scripts/extract_corehr.py— Connects to CoreHR viapeople-clito extract active employees and normalize them (Path B data source).scripts/build_card.py— Fixed polished card builder: produces Card 2.0 JSON meeting P0–P7 standards, supports birthday/anniversary/dual celebration color schemes, department/role data, main image, gift button, batch output, and consolidated roster card (--roundup).scripts/run_state.py— Idempotent deduplication ledger + run reporting (filter/mark/report).references/data-sources.md— Roster key field schema, searching Feishu assets for location, field verification and confirmation, reading and normalization.references/blessing.md— Writing requirements and examples for acrostic poems / short phrases.references/card.md— Description of the fixed card architecture,build_card.pyusage, image prompts, gift CTA, sending.references/leader-notify.md— (Optional) Notify direct manager in advance.references/scheduling.md— Enabling scheduled daily runs and recurring task templates.