SuperAPI AI Directory

activity-push

General & other

View repository

Updated 10-16 08:46

About this skill

Activity Push Skill

Used to filter activity-type articles from WeChat Official Account article sources, extract structured activity information, and push it to an internal group via a WeCom group bot Webhook.

This skill is suitable for the following tasks:

  • "Pull WeChat Official Account articles from the last 24 hours based on feeds.md and filter for activities"
  • "Extract activity articles into structured JSON"
  • "Organize activity information into content suitable for group sending"
  • "Push to a WeCom internal group via webhook"

Why this skill

Referring to Claude's skill best practices, this skill splits the work into two layers:

  • SKILL.md Responsible for trigger conditions, judgment criteria, steps, quality requirements, and exception handling
  • All actual scraping and pushing actions use bash + curl + jq execution
  • "Whether this is an activity" is semantically judged by the model after reading the article, without keyword script filtering
  • Internal group push uses a webhook bot, simple and direct
  • Complex details sink down to scripts and reference documents
  • Address coordinate completion uses the Amap geocoding CLI

The benefits of doing this are:

  • Avoid hardcoding "activity judgment" into fragile keyword rules
  • Keep execution actions auditable, with all requests traceable back to bash and curl
  • Stable output paths and file formats
  • Distinguish between "Markdown for review" and "plain text for API sending", avoiding message body format incompatibility
  • In the future, users only need to provide feeds.md、.env and the execution directory to reuse the entire pipeline

Compatibility

Depends on these commands by default:

  • bash
  • curl
  • jq
  • date
  • awk
  • sed

If jqis missing, you should first clearly tell the user that the current environment does not satisfy the skill dependencies, and do not fall back to Python.

Use for complex push logic:

Optional tools:

For complex API documentation, see:

Usage rules:

  • SKILL.md Provide the main process first
  • Only when debugging webhook push issues, read references/wecom-group-types-guide.md

Required Inputs

Before execution, confirm that the following inputs exist:

  • Execution directory EXEC_DIR, uses the current working directory by default
  • ~/.aj-skills/.env
  • feeds.md

~/.aj-skills/.env It is recommended to include these variables:

MP_API_HOST=...
MP_API_KEY=...
AMAP_WEB_SERVICE_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WE_COM_WEBHOOK_KEYS=2449ebfdd2b2a1f20d88f797e3627d8fc6

Among them:

  • MP_API_HOST: Required
  • MP_API_KEY: Optional; provide only when the feed interface requires authentication
  • AMAP_WEB_SERVICE_KEY: Optional; provide when activity addresses need to be completed into coordinates
  • WE_COM_WEBHOOK_KEYS: Optional; provide when webhook push needs to be executed. Supports multiple groups, separated by commas

feeds.md Conventions:

  • One WeChat Official Account per line
  • The first column is the WeChat Official Account MP_ID
  • The remaining content is treated as the WeChat Official Account name
  • Blank lines and # comment lines are ignored
  • If MP_ID accidentally has an English comma at the end, the script will automatically clean it up
  • If the same MP_ID appears repeatedly, the script only processes the first occurrence

Example:

gh_1234567890 科技早知道
gh_abcdef123456 AI 产品观察

Default Workflow

Execute in the following order, do not skip steps:

1. Pre-check the environment

EXEC_DIR="${EXEC_DIR:-$PWD}"
ENV_FILE="${HOME}/.aj-skills/.env"
FEEDS_FILE="${EXEC_DIR}/feeds.md"
TODAY="$(date +%Y%m%d)"
OUT_DIR="${EXEC_DIR}/activity-push/${TODAY}"

test -f "${ENV_FILE}" || { echo "缺少 ${ENV_FILE}"; exit 1; }
test -f "${FEEDS_FILE}" || { echo "缺少 ${FEEDS_FILE}"; exit 1; }
command -v curl >/dev/null || { echo "缺少 curl"; exit 1; }
command -v jq >/dev/null || { echo "缺少 jq"; exit 1; }

set -a
source "${ENV_FILE}"
set +a

test -n "${MP_API_HOST}" || { echo "缺少 MP_API_HOST"; exit 1; }

mkdir -p "${OUT_DIR}"

Check items:

  • ~/.aj-skills/.env Whether it exists
  • MP_API_HOST Whether it exists
  • MP_API_KEY Whether it exists depends on whether the feed interface requires authentication
  • WE_COM_WEBHOOK_KEYS Only check when step 6 push needs to be executed
  • feeds.md Whether it exists and contains at least one official account

Note:

  • Do not reveal the full key in the reply
  • Only show a masked version of the secret or the number of target groups

2. Fetch the feed and generate raw.json

FETCH_ARGS=(
  --feeds-file "${FEEDS_FILE}"
  --output-file "${OUT_DIR}/raw.json"
  --api-host "${MP_API_HOST}"
  --hours 24
)

if [ -n "${MP_API_KEY:-}" ]; then
  FETCH_ARGS+=(--api-key "${MP_API_KEY}")
fi

bash /Users/yujian/Code/py/aj-skills/skills/activity-push/scripts/fetch_recent_feeds.sh "${FETCH_ARGS[@]}"

Instructions:

  • Always use fetch_recent_feeds.sh, do not temporarily hand-write while read fetch loops in the session
  • This script uses a separate file descriptor to read feeds.md, preventing commands in the loop body from accidentally affecting subsequent feed reads, solving the "only the first feed is fetched" problem
  • CUTOFF_EPOCH is calculated internally by the script, no need to maintain it repeatedly in the outer layer

Default output directory:

  • {EXEC_DIR}/activity-push/{yyyyMMdd}/raw.json
  • {EXEC_DIR}/activity-push/{yyyyMMdd}/activity.json
  • {EXEC_DIR}/activity-push/{yyyyMMdd}/activity-structured.json
  • {EXEC_DIR}/activity-push/{yyyyMMdd}/activity-structured-geo.json
  • {EXEC_DIR}/activity-push/{yyyyMMdd}/activity-summary.png
  • {EXEC_DIR}/activity-push/{yyyyMMdd}/activity-structured.md
  • {EXEC_DIR}/activity-push/{yyyyMMdd}/activity-push.txt

Note:

  • Do not use jq fromdateiso8601 to parse times with timezone offsets anymore; it is not reliable for formats like +08:00 .
  • The currently recommended approach is to let jq only handle extracting articles, then use bash's date to parse the time.
  • If a feed's updated still cannot be parsed by date , keep the fetched results and clearly state in the reply that the feed's time format is incompatible with the current bash filtering logic.
  • If there are no articles, also generate raw.json, and the content must be []。
  • If the public feed does not require authentication, execution should be allowed to continue without MP_API_KEY being set.
  • If the API returns 401 / 403, then clearly prompt the user to provide MP_API_KEY。

3. Let the model determine which articles are truly events, and generate activity.json

Do not do keyword filtering here. You should directly read the article content in raw.json and judge semantically.

The criteria for determining an "event" are:

  • The article's main purpose is to invite users to participate in a specific arrangement during a certain time period, rather than simply conveying information
  • The text contains an explicit or implicit participation action, such as registration, reservation, attendance, online joining, submitting an application, or joining an agenda
  • The article revolves around a specific event and usually corresponds to several of the following: time, location, participation method, number of people, agenda, target audience, or organizer
  • The event theme must be clear, so users can clearly know what theme and content the event revolves around
  • Even if the word "event" is not written, as long as it is essentially organizing a participatory time-based occurrence, it still counts as an event

Content that should not be judged as an "event":

  • Event recaps, post-event summaries, on-site reviews
  • Industry news, opinion commentary, funding news, product announcements
  • Recruitment, admissions, long-term course sales pages, unless they clearly correspond to a specific session or time period
  • Pure material downloads, white paper releases, feature launch notices
  • Event notices with vague themes, empty content, and no visible core topic or actual arrangement
  • Job fairs, recruitment presentations, position matching fairs, talent recruitment fairs
  • Prize-based calls for submissions, essay solicitations, work solicitations, selection solicitations, lottery solicitations, and other lead-generation activities

Handle edge cases as follows:

  • "Call for submissions / recruitment / training camp / roadshow / Demo Day / Webinar / closed-door meeting": if users need to participate within a certain time window, it usually counts as an event
  • "Long-term community recruitment / year-round registration": if there is no clear session or time boundary, it usually does not count as an event
  • "Live broadcast preview": if there is a specific broadcast time and entry point, it counts as an event
  • But if the event theme itself is unclear, or it is essentially a recruitment / prize-based call for submissions, then even if a time window exists, do not count it as an event

Generate activity.json when:

  • The file content must be a JSON array composed of a subset of raw.json JSON array composed of subsets
  • Keep the original article objects; do not structure them first
  • Keep only the articles you are confident belong to events
  • When there are no events, write []

activity.json It is recommended to keep this form:

[
  {
    "mpId": "gh_xxx",
    "mpName": "某公众号",
    "sourceTitle": "活动原文标题",
    "sourceUrl": "https://example.com/post/1",
    "sourceUpdated": "2026-03-11T10:00:00+08:00",
    "summary": "原文摘要",
    "content": "原文正文或正文摘要"
  }
]

If raw.json the original article objects have more fields:

  • You may keep them as they are
  • But do not in activity.json invent new structured fields
  • activity.json 's role is only "the set of original texts judged to be events"

During review, prioritize ensuring these fields:

{
  "activityName": "活动名称",
  "activityType": "活动类型",
  "activityAddress": "活动地址",
  "activityStartTime": "活动开始时间",
  "activityEndTime": "活动结束时间",
  "activityLimitNum": "活动限制人数",
  "activityDescription": "活动说明",
  "activityImages": ["活动图片1", "活动图片2"]
}

4. Extract structured event information and generate activity-structured.json

This step is still completed by the model after reading activity.json , do not infer with keyword scripts.

Requirements:

  • Extract the event name, type, address, start time, end time, attendee limit, description, and image according to the article semantics
  • When a field is missing, use an empty string "", and when the image is missing, use an empty array []
  • If the same event appears repeatedly in multiple articles, deduplicate by "the same event entity", rather than only checking whether the titles are exactly the same
  • When deduplicating, judge comprehensively by event name, time, location, organizer, and agenda content
  • If the event theme is unclear, or it belongs to clearly excluded categories such as job fairs / prize-based calls for submissions, do not include it in activity-structured.json
  • Each event must receive an internal value score and be sorted by the scoring result
  • activity-structured.json Must output events from high to low value, with the highest-value event first
  • The output must be a JSON array

To ensure a QR code can definitely be generated in the summary image, each event must retain these source fields:

  • sourceUrl
  • sourceTitle
  • sourceMpId
  • sourceMpName

activity-structured.json Must stay as close as possible to the following structure:

[
  {
    "activityName": "活动名称",
    "activityType": "活动类型",
    "activityAddress": "活动地址",
    "activityStartTime": "2026-03-12 14:00",
    "activityEndTime": "2026-03-12 17:00",
    "activityLimitNum": "50",
    "activityDescription": "活动说明",
    "activityImages": [
      "https://example.com/image-1.jpg"
    ],
    "sourceUrl": "https://example.com/post/1",
    "sourceTitle": "活动原文标题",
    "sourceMpId": "gh_xxx",
    "sourceMpName": "某公众号"
  }
]

Field constraints:

  • activityName: Must be an event name users can directly recognize; do not write only "registration notice"
  • activityType: For example, lecture, sharing session, workshop, training camp, roadshow, live broadcast, closed-door meeting
  • activityAddress: For offline events, write the detailed location; for online events, write "online" or the specific participation method
  • activityStartTime / activityEndTime: Try to standardize as YYYY-MM-DD HH:mm
  • activityLimitNum: Keep only digits; write an empty string when unknown
  • activityDescription: 1 to 3 sentences; do not copy the entire original text
  • activityImages: Must be an array
  • sourceUrl: Must retain the original link so the summary image can render the QR code directly into the image; when missing, silently omitting the QR code is not allowed

When scoring event value, prioritize considering:

  • Whether it has direct value to target users and whether it is worth acting on immediately
  • Whether the organizer, guests, and partners are reliable, and whether the resources are scarce
  • Whether the time, location, registration method, threshold, and deadline are clear
  • Whether the event is concretely actionable, rather than vague promotion
  • Whether there is a clear quota, registration window, or timeliness

The scoring fields are only for internal sorting; do not write them by default into the final user-facing activity-structured.json, Markdown, image, or push text.

Sorting rules:

  • First sort by internal score in descending order
  • If the scores are the same, prioritize activities with a closer start time and more complete information
  • If they are still the same, prioritize activities with a more reliable organizer and clearer participation requirements

When writing to disk, prioritize ensuring valid JSON. It is recommended to write using the following method:

printf '%s\n' "${STRUCTURED_JSON}" | jq '.' > "${OUT_DIR}/activity-structured.json"

4.5 Use Amap geocoding to fill in coordinates and static map URLs, and generate activity-structured-geo.json

If an activity has activityAddress, continue filling in coordinates.

Execution entry point:

python3 /Users/yujian/Code/py/aj-skills/skills/activity-push/scripts/amap_geocode_wgs84.py \
  --input "${OUT_DIR}/activity-structured.json" \
  --output "${OUT_DIR}/activity-structured-geo.json" \
  --amap-key "${AMAP_WEB_SERVICE_KEY}"

Local fixture verification is available:

python3 /Users/yujian/Code/py/aj-skills/skills/activity-push/scripts/amap_geocode_wgs84.py \
  --input "${OUT_DIR}/activity-structured.json" \
  --output "${OUT_DIR}/activity-structured-geo.json" \
  --fixture-file /Users/yujian/Code/py/aj-skills/skills/activity-push/tests/fixtures/amap-geocode/responses.json

Completion rules:

  • If activityAddress is empty, set the coordinate fields and static map URL to empty,activityGeoStatus / activityStaticMapStatus set to skipped
  • If the address is too vague and does not resolve to a precise mappable location, skip geocoding directly,activityGeoStatus / activityStaticMapStatus set to skipped_vague
  • If Amap does not match the address, set the coordinate fields and static map URL to empty,activityGeoStatus / activityStaticMapStatus set to not_found
  • If the address is matched, keep the coordinates returned by Amap as GCJ-02, and additionally provide WGS84
  • If provided AMAP_WEB_SERVICE_KEY, also assemble an Amap static map URL without a marker for direct reference in the final Markdown

The "vague addresses" here include but are not limited to:

  • Only non-offline locations such as "online", "Tencent Meeting", or "livestream room"
  • Only descriptions that do not give a physical location, such as "notified after registration", "notified separately", or "see poster for details"
  • Only large-area locations such as a district, nearby, or surrounding area, with no specific street number, building, or clear POI

It is recommended to append these fields:

  • activityLongitudeGCJ02
  • activityLatitudeGCJ02
  • activityLongitudeWGS84
  • activityLatitudeWGS84
  • activityGeoProvider
  • activityGeoStatus
  • activityStaticMapUrl
  • activityStaticMapStatus

Coordinate system description:

  • Amap geocoding results are treated as Amap coordinates
  • According to the Amap coordinate system description, the returned location is treated as GCJ-02 here
  • If the user needs WGS84, it is provided by a local conversion formula
  • For more detailed instructions, see amap-geocode-wgs84.md

5. Use Python CLI + PIL based on activity-structured-geo.json to render the summary image

Before pushing, first render the structured activity information as an image for manual review, archiving, or subsequent integration into an image message pipeline.

Execution entry point:

python3 /Users/yujian/Code/py/aj-skills/skills/activity-push/scripts/render_activity_image.py \
  --input "${OUT_DIR}/activity-structured-geo.json" \
  --output "${OUT_DIR}/activity-summary.png" \
  --title "活动情报速递" \
  --subtitle "$(date +%F)"

Requirements:

  • Input should preferably use activity-structured-geo.json
  • Output is fixed as a single PNG
  • Only data fields that actually exist are rendered in the image; missing fields are omitted directly, and placeholder words such as "not specified" or "to be added" should not be written
  • Only show the map preview when the activity has valid latitude and longitude; when there is no latitude or longitude, do not render a map placeholder block
  • If present activityStaticMapUrl and there are valid latitude and longitude, the static map can be pasted into the image; do not additionally overlay markers, crosshairs, or highlight points on the map image
  • As long as activity cards are rendered in the image, an original link QR code must be generated inside each activity card; the QR code cannot be omitted as an optional item
  • If an activity lacks sourceUrl, it should be treated as incomplete data and an error should be raised directly, rather than continuing to produce an activity image without a QR code
  • Do not use a red emphasis bar in the QR code area, and do not write ineffective explanations such as "link converted to QR code"
  • When there are no activities, an empty result image should still be generated for archiving

Recommended output:

  • {EXEC_DIR}/{yyyyMMdd}/activity-summary.png

5.5 Generate Markdown for review and plain text for API push

Prefer using activity-structured-geo.json as input; if coordinate completion has not been performed, fall back to activity-structured.json。

Save the structured result as:

  • {EXEC_DIR}/{yyyyMMdd}/activity-structured.md
  • {EXEC_DIR}/{yyyyMMdd}/activity-push.txt

activity-structured.md Requirements:

  • The title should be concise and suitable for group messages
  • Each activity should have its own section
  • The activity order must match activity-structured.json and should be displayed from highest to lowest value
  • Prioritize displaying: activity name, time, location, number of people, activity description
  • Omit missing fields directly; do not output "to be supplemented" or "not specified"
  • If activityStaticMapUrlexists, directly display the static map image or image link
  • Do not display latitude and longitude fields in the final Markdown
  • If the content is too long, first split it into multiple second-level heading sections in the file for easier manual review
  • When there are no activities, explicitly write "No new activity articles found in the last 24 hours"

activity-structured.md It is recommended to use this template:

# 活动情报速递(YYYY-MM-DD)

> 最近 24 小时筛选出的活动信息如下。

## 1. 活动名称
- 类型:活动类型
- 时间:2026-03-12 14:00 - 2026-03-12 17:00
- 地点:活动地址
- 地图:![活动地点静态图](https://restapi.amap.com/v3/staticmap?location=121.436525,31.194729&zoom=15&size=750*300&scale=2&key=YOUR_AMAP_WEB_SERVICE_KEY)
- 人数:50
- 说明:活动说明
- 来源:某公众号 / https://example.com/post/1

## 2. 活动名称
- 类型:活动类型
- 地点:线上
- 说明:活动说明
- 来源:某公众号 / https://example.com/post/2

When there are no activities, write it in the fixed form:

# 活动情报速递(YYYY-MM-DD)

最近 24 小时未发现新的活动文章。

It is recommended to save to disk in the following way:

cat > "${OUT_DIR}/activity-structured.md" <<'EOF'
${ACTIVITY_STRUCTURED_MARKDOWN}
EOF

activity-push.txt is the text content used for webhook push. Requirements:

  • Plain text, do not use Markdown syntax
  • Compress the length appropriately to avoid members being unwilling to send it because it is too long
  • The activity order must match activity-structured.json and should be arranged from highest to lowest value
  • On the first screen, prioritize giving the 1 to 3 activities most worth pushing
  • Omit missing fields directly; do not output "to be supplemented" or "not specified"
  • It is recommended to keep each activity to 2 to 5 lines
  • When there are no activities, do not generate this file or leave the content empty, and do not push a message to the group

Recommended template:

活动情报速递(YYYY-MM-DD)

1. 活动名称
类型:活动类型
时间:2026-03-12 14:00 - 2026-03-12 17:00
地点:活动地址
说明:活动说明
链接:https://example.com/post/1

2. 活动名称
类型:活动类型
地点:线上
说明:活动说明
链接:https://example.com/post/2

It is recommended to save to disk in the following way:

cat > "${OUT_DIR}/activity-push.txt" <<'EOF'
${ACTIVITY_PUSH_TEXT}
EOF

6. Use Webhook to push to the internal group

This step is optional and is used to push activity information to the WeCom internal group.

Features:

  • ✅ No access_token required, only webhook key
  • ✅ Instant sending, no member confirmation required
  • ❌ Only internal groups are supported; external groups are not supported

Add a group bot:

  1. WeCom client → enter the internal group → group settings
  2. Group bot → add bot
  3. Copy the key part from the Webhook address:xxxxxx

Environment variable configuration(~/.aj-skills/.env):

# 单群
WE_COM_WEBHOOK_KEYS=2449ebfdd2b2a1f20d88f797e3627d8fc6
# 多群(逗号分隔)
WE_COM_WEBHOOK_KEYS=key1,key2,key3

Push command:

# 检查是否有活动(activity.json 不为空数组)
ACTIVITY_COUNT=$(jq 'length' "${OUT_DIR}/activity.json")

if [ "$ACTIVITY_COUNT" -eq 0 ]; then
  echo "No activities found, skipping push"
elif [ -n "${WE_COM_WEBHOOK_KEYS:-}" ]; then
  # 读取消息内容并转义为 JSON 字符串
  MESSAGE=$(cat "${OUT_DIR}/activity-push.txt" | jq -Rs '.')

  # 遍历所有 key 进行推送(兼容 bash/zsh)
  echo "$WE_COM_WEBHOOK_KEYS" | tr ',' '\n' | while IFS= read -r key; do
    key=$(echo "$key" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')  # 去除空格
    [ -z "$key" ] && continue
    echo "Pushing to webhook: ${key:0:8}..."
    curl -s "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=$key" \
      -H 'Content-Type: application/json' \
      -d "{\"msgtype\":\"text\",\"text\":{\"content\":$MESSAGE}}" | jq .
  done
else
  echo "skip push: WE_COM_WEBHOOK_KEYS not configured"
fi

Limitations:

6.1 Push images

Webhook also supports pushing images, butyou need to upload the image first to obtain the media_id。

Upload an image to obtain the media_id:

# 上传图片(key 是机器人的 webhook key)
curl -F "key=YOUR_KEY" \
     -F "media=@activity-summary.png" \
     "https://qyapi.weixin.qq.com/cgi-bin/webhook/upload_media?type=image" | jq -r '.media_id'

Push an image message:

# 使用获取到的 media_id 推送图片
curl -s "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "msgtype": "image",
    "image": {
      "media_id": "MEDIA_ID_FROM_UPLOAD"
    }
  }' | jq .

Push text and images at the same time:

# 先推送文字
MESSAGE=$(cat "${OUT_DIR}/activity-push.txt" | jq -Rs '.')
curl -s "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY" \
  -H 'Content-Type: application/json' \
  -d "{\"msgtype\":\"text\",\"text\":{\"content\":$MESSAGE}}"

# 再推送图片
MEDIA_ID=$(curl -s -F "key=YOUR_KEY" -F "media=@${OUT_DIR}/activity-summary.png" \
  "https://qyapi.weixin.qq.com/cgi-bin/webhook/upload_media?type=image" | jq -r '.media_id')

curl -s "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY" \
  -H 'Content-Type: application/json' \
  -d "{\"msgtype\":\"image\",\"image\":{\"media_id\":\"$MEDIA_ID\"}}" | jq .

Note:

  • Image size cannot exceed 2MB
  • media_id is valid for 3 days
  • Supported formats: png, jpg, jpeg, gif, bmp, webp

Output Rules

  • raw.json must be a JSON array composed of articles from the last 24 hours
  • activity.json must be a JSON array composed of activity candidate articles
  • activity-structured.json must be an array of deduplicated activity objects
  • activity-structured.json must be sorted in descending order by the internal scoring result
  • activity-structured-geo.json must, when an address is available, complete GCJ-02, WGS84 and the static map URL as much as possible
  • activity-summary.png must be rendered and generated by activity-structured-geo.json ; empty results must also be produced
  • activity-summary.png When there is an activity, every activity card must include a QR code
  • activity-structured.md Must be used for manual review, defaults to Chinese
  • activity-structured.md Do not display coordinate fields, prioritize displaying a static map
  • activity-push.txt Must be used for text content pushed via webhook

If there is no activity:

  • Still generate all target files
  • activity.json and activity-structured.json is an empty array []
  • activity-structured-geo.json should also be an empty array []
  • activity-summary.png Should still generate an empty result image
  • activity-structured.md State "No new activity articles found in the last 24 hours"
  • activity-push.txt If it is an empty file or not generated, do not push the "no activity" message to the group

Semantic Judgment Rules

When determining "whether it is an activity," always use the following approach rather than looking up words:

  1. First look at the core intent of the article If the article's center is organizing a participation behavior, it is more likely an activity; if the center is merely expressing an opinion, conveying news, or making a summary, it is not an activity.

  2. Then look at whether there is a "participation loop" Activities usually form a loop: who can participate, when to participate, where to participate, how to participate, and what happens after participating. Even if some of these fields are missing, as long as the loop is broadly established, it can be judged an activity.

  3. Then look at temporality and eventness An activity is a specific event, usually with sessions, a time window, or a clear schedule. Introduction pages that persist long-term and have no clear sessions should usually not be regarded as activities.

  4. Finally look at whether the article asks readers to take action If readers are asked to register, make an appointment, join a group, attend in person, watch a livestream, submit materials, or participate in an agenda, this usually indicates it is an activity.

WeCom Push Rules

  • Use a group bot webhook to push to the internal group
  • Use plain text for the message body, do not send Markdown as-is
  • Support pushing to multiple groups simultaneously (multiple keys separated by commas)
  • Only when WE_COM_WEBHOOK_KEYS configuration exists, execute step 6

Quality Checklist

  • Environment precheck completed
  • Scraping completed using bash + curl + jq Complete the fetch
  • Filtered articles from the last 24 hours by updated Filter articles from the last 24 hours
  • Produced raw.json
  • The model has semantically judged activity candidates and produced activity.json
  • Extracted structured fields and deduplicated
  • Produced activity-structured.json
  • Completed activity value scoring and sorted from high to low
  • If an address exists, produced activity-structured-geo.json
  • Produced activity-summary.png
  • Confirmed that all activity cards have QR codes
  • Produced for review activity-structured.md
  • Produced for push activity-push.txt
  • If the push configuration is complete, push has been completed via webhook
  • Clearly provide all output file paths in the reply
  • If in the development or debugging stage, at least one CLI dry-run or local test has been run

Failure Handling

If an error occurs, handle it in the following order:

  1. First identify whether it is missing input, network failure, field incompatibility, or webhook call failure
  2. Continue executing steps that can continue; do not abort the entire process because a single official account fails
  3. Keep a summary of the failure reason in the terminal output
  4. If the feed JSON structure is incompatible, first save the original result, then explain what field assumptions were used
  5. If the webhook returns an error, check whether the key is valid and whether the group still exists
  6. If the WeCom push configuration is missing, skip step 6 directly; do not mark the entire skill as failed

Optimization Notes

Compared with your original draft, the following optimizations were made here:

  • No longer leave "whether it is an event" to keyword rules; instead, let the model make a semantic judgment
  • The entire workflow returns to bash + curl + jq, which is closer to the execution method you requested
  • feeds.md Supports blank lines and comments
  • Event deduplication is changed to event entity judgment, rather than hard string matching
  • The push pipeline uses a webhook bot, which is simple and direct
  • Review content and sent content are separated, reducing the risk of incompatibility with the API message body format
  • Event addresses support completion of Amap coordinates, WGS84 coordinates, and static map URLs, making them convenient for Markdown display or use by downstream systems
  • A PIL summary image is added before pushing, making it convenient for quick manual review and also providing a stable artifact for the subsequent image message pipeline
  • All steps are written to disk, making secondary inspection and reruns convenient

Test Prompts

You can use these prompts to test whether the skill is triggered correctly:

  1. "Based on feeds.md in the current directory, extract events from WeChat official account articles from the last 24 hours and push them to the WeCom group via webhook."
  2. "Read ~/.aj-skills/.env and feeds.md, output raw.json, activity.json, activity-structured.json, activity-structured-geo.json, activity-summary.png, activity-structured.md, activity-push.txt, and then push via webhook."
  3. "Help me build an event push pipeline: fetch articles from WeChat official account feeds, filter events, perform structured extraction, complete Amap address coordinates and convert them to WGS84, generate a static map URL along the way, then use PIL to render an event summary image, generate review Markdown and group-send text, and push it to the WeCom group via webhook."