$npx -y skills add PHY041/claude-agent-skills --skill engagement-trackerTrack engagement metrics on all posted content (Reddit comments, Twitter replies, original posts). Runs 24h after posting to measure performance. Produces weekly analysis with actionable insights. Triggers on "check engagement", "track metrics", "how did my posts do", "engagement
| 1 | # Engagement Tracker Skill |
| 2 | |
| 3 | Closed-loop analytics for all social media activity. Scrapes engagement metrics 24h after posting, stores structured data, and produces weekly insights. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## Core Principle |
| 8 | |
| 9 | **You can't optimize what you don't measure.** Every post gets tracked. Every week gets analyzed. Decisions come from data, not vibes. |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | ## Configuration |
| 14 | |
| 15 | Set your Twitter handle: |
| 16 | ```bash |
| 17 | export TWITTER_HANDLE="yourhandle" |
| 18 | ``` |
| 19 | |
| 20 | Point to your Twikit directory: |
| 21 | ```bash |
| 22 | export TWIKIT_DIR="~/crawlee-social-scraper" # wherever you have twikit + cookies |
| 23 | ``` |
| 24 | |
| 25 | --- |
| 26 | |
| 27 | ## Daily Engagement Check (runs at 07:00 your TZ) |
| 28 | |
| 29 | ### Step 1: Find Yesterday's Posts |
| 30 | |
| 31 | Read `memory/YYYY-MM-DD.md` for yesterday's date. Extract all posted URLs from the log tables. |
| 32 | |
| 33 | **Reddit comment URLs** look like: |
| 34 | ``` |
| 35 | https://www.reddit.com/r/{subreddit}/comments/{post_id}/comment/{comment_id}/ |
| 36 | ``` |
| 37 | |
| 38 | **Twitter reply URLs** look like: |
| 39 | ``` |
| 40 | https://x.com/{username}/status/{tweet_id} |
| 41 | ``` |
| 42 | |
| 43 | ### Step 2: Scrape Reddit Comment Metrics |
| 44 | |
| 45 | For each Reddit comment URL, fetch engagement data via AppleScript Chrome: |
| 46 | |
| 47 | ```bash |
| 48 | osascript -l JavaScript -e ' |
| 49 | var chrome = Application("Google Chrome"); |
| 50 | var tab = chrome.windows[0].activeTab; |
| 51 | tab.execute({javascript: "(" + function() { |
| 52 | var commentId = "COMMENT_ID"; |
| 53 | fetch("/api/info.json?id=t1_" + commentId, {credentials: "include"}) |
| 54 | .then(r => r.json()) |
| 55 | .then(d => { |
| 56 | var c = d.data.children[0].data; |
| 57 | document.title = "METRICS:" + JSON.stringify({ |
| 58 | id: c.name, |
| 59 | score: c.score, |
| 60 | ups: c.ups, |
| 61 | num_replies: c.num_comments || 0, |
| 62 | permalink: c.permalink, |
| 63 | subreddit: c.subreddit, |
| 64 | body: c.body.substring(0, 100) |
| 65 | }); |
| 66 | }); |
| 67 | } + ")();"}); |
| 68 | ' |
| 69 | sleep 2 |
| 70 | osascript -e 'tell application "Google Chrome" to return title of active tab of first window' |
| 71 | ``` |
| 72 | |
| 73 | **Multi-profile Chrome fallback:** Use System Events + Console pattern (see `reddit-cultivate` skill). |
| 74 | |
| 75 | **Rate limiting:** Wait 2+ seconds between each comment check. |
| 76 | |
| 77 | ### Step 3: Scrape Twitter Reply Metrics |
| 78 | |
| 79 | ```bash |
| 80 | cd $TWIKIT_DIR |
| 81 | source venv/bin/activate |
| 82 | python3 -c " |
| 83 | import asyncio, json |
| 84 | from twikit import Client |
| 85 | |
| 86 | async def check(): |
| 87 | client = Client('en-US') |
| 88 | client.load_cookies('twitter_cookies.json') |
| 89 | user = await client.get_user_by_screen_name('$TWITTER_HANDLE') |
| 90 | tweets = await client.get_user_tweets(user.id, tweet_type='Replies', count=20) |
| 91 | results = [] |
| 92 | for t in tweets: |
| 93 | results.append({ |
| 94 | 'id': t.id, |
| 95 | 'text': t.text[:100], |
| 96 | 'created_at': str(t.created_at), |
| 97 | 'likes': t.favorite_count, |
| 98 | 'retweets': t.retweet_count, |
| 99 | 'replies': t.reply_count, |
| 100 | 'views': t.view_count, |
| 101 | 'in_reply_to': t.in_reply_to_tweet_id, |
| 102 | 'url': f'https://x.com/$TWITTER_HANDLE/status/{t.id}' |
| 103 | }) |
| 104 | print(json.dumps(results, indent=2)) |
| 105 | |
| 106 | asyncio.run(check()) |
| 107 | " |
| 108 | ``` |
| 109 | |
| 110 | ### Step 4: Store Metrics |
| 111 | |
| 112 | Append to `memory/analytics/engagement-log.json`: |
| 113 | |
| 114 | ```json |
| 115 | { |
| 116 | "entries": [ |
| 117 | { |
| 118 | "id": "reddit-2026-01-01-001", |
| 119 | "date": "2026-01-01", |
| 120 | "platform": "reddit", |
| 121 | "type": "comment", |
| 122 | "subreddit": "SideProject", |
| 123 | "post_title": "Post title here", |
| 124 | "url": "https://www.reddit.com/r/SideProject/comments/abc/comment/xyz/", |
| 125 | "checked_at": "2026-01-02T07:00:00+08:00", |
| 126 | "hours_since_post": 22, |
| 127 | "metrics": { |
| 128 | "upvotes": 12, |
| 129 | "replies": 3 |
| 130 | } |
| 131 | } |
| 132 | ] |
| 133 | } |
| 134 | ``` |
| 135 | |
| 136 | ### Step 5: Daily Summary |
| 137 | |
| 138 | Report only if there's notable engagement: |
| 139 | |
| 140 | ``` |
| 141 | Engagement Check (24h metrics) |
| 142 | |
| 143 | Reddit (3 comments yesterday): |
| 144 | r/ClaudeAI "your post topic" — 12 upvotes, 3 replies |
| 145 | r/SideProject "your post topic" — 8 upvotes, 1 reply |
| 146 | |
| 147 | Twitter (2 replies yesterday): |
| 148 | @somebody — 5 likes, 1500 views |
| 149 | @someone — 2 likes, 800 views |
| 150 | |
| 151 | Top performer: Reddit r/ClaudeAI comment (12 upvotes) |
| 152 | Needs attention: 3 replies on ClaudeAI comment — consider responding! |
| 153 | ``` |
| 154 | |
| 155 | **If no notable engagement (all zeros):** Reply `HEARTBEAT_OK`, no notification. |
| 156 | |
| 157 | **If replies detected:** Flag them for response (author re |