一键导入
analytics-collector
Collect X and LinkedIn post metrics for the Genfeed content loop and emit normalized Metric JSON for feedback scoring.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Collect X and LinkedIn post metrics for the Genfeed content loop and emit normalized Metric JSON for feedback scoring.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create paid ad copy for Meta, Google, LinkedIn, TikTok, and X using direct-response frameworks, platform limits, variants, and test plans. Triggers on ad headlines, ad creative, paid social ads, Google ads, and ad variants.
Analyze paid media performance, diagnose issues, and provide optimization recommendations across all major ad platforms. Triggers on "analyze ad performance", "ad metrics", "why is my ROAS low", "ad optimization", "campaign performance", "creative fatigue", "ad budget allocation".
Create SEO-optimized blog posts in multiple formats with heading hierarchy, meta descriptions, and internal link strategy. Triggers on "write a blog post", "create a blog article", "draft a blog", "write an article", "blog about".
Create brand foundations: name, positioning, voice, and strategic identity. Triggers on brand naming, positioning, voice, identity, differentiation, and day-one brand strategy.
Validate channel focus against the One Channel Rule before adding more platforms or tactics. Triggers on channel sprawl, platform focus, right-channel questions, and expansion readiness.
Analyze GTM competitors, market positioning, feature gaps, pricing, win/loss patterns, and differentiation opportunities. Triggers on competitive intelligence, market analysis, competitor pricing, feature benchmarking, and positioning gaps.
| name | analytics-collector |
| description | Collect X and LinkedIn post metrics for the Genfeed content loop and emit normalized Metric JSON for feedback scoring. |
| license | MIT |
| metadata | {"author":"genfeedai","version":"1.0.0"} |
You measure what happened after publishing. Given the ids of posts that went out, you pull their engagement from X and LinkedIn and normalize each to one Metric. You are the analytic in trend -> remix -> produce -> post -> analytic -> repeat.
This is where the loop closes. The orchestrator pipes each Metric you emit into gf record-metric <id>; the connector recomputes that item's feedbackScore; and gf feedback <term> turns those scores into a multiplier that lifts previously-successful themes to the top of the next trend scan. You produce the raw measurement that makes the factory learn.
Pure worker: reads one token from the environment, persists nothing, writes no manifest itself.
bun run scripts/collect.ts --platform x --ids 1799111,1799222
bun run scripts/collect.ts --platform linkedin --ids "urn:li:share:6844785523593134080"
A ContentItem (or an array of {platform, postId}) on stdin is an alternative to --ids — every derivative with a postId is collected:
bun run ../genfeed-connector/gf.ts get <id> \
| bun run scripts/collect.ts --platform x
Requires Bun 1.1+. Zero dependencies — only Node built-ins and global fetch.
GET https://api.x.com/2/tweets?ids=...&tweet.fields=public_metrics,organic_metrics,non_public_metrics.public_metrics works with an app-only or user token; organic_metrics / non_public_metrics (impressions, link clicks) need a user-context token for the author. If the richer fields are denied, it automatically retries with public_metrics alone.impressions <- impression_count, likes <- like_count, comments <- reply_count, shares <- retweet_count + quote_count, clicks <- url_link_clicks.GET https://api.linkedin.com/rest/socialActions/<urn> with LinkedIn-Version + X-Restli-Protocol-Version: 2.0.0.likes <- likesSummary.totalLikes, comments <- commentsSummary.aggregatedTotalComments.Per-id failures warn to stderr and are skipped; the run returns whatever it could collect.
{
"count": 1,
"metrics": [
{
"platform": "x",
"postId": "1799111",
"impressions": 10400,
"likes": 612,
"comments": 41,
"shares": 88,
"clicks": 230,
"capturedAt": "2026-06-08T12:00:00.000Z"
}
]
}
Each metric matches the Metric shape in genfeed-connector/lib/schema.ts.
export X_BEARER_TOKEN="$(bun run ../genfeed-connector/gf.ts token x)"
# 1. measure
bun run scripts/collect.ts --platform x --ids "$POST_ID" > metrics.json
# 2. record each metric — this recomputes feedbackScore on the item
jq -c '.metrics[]' metrics.json | while read -r m; do
bun run ../genfeed-connector/gf.ts record-metric "$ITEM_ID" <<<"$m"
done
# 3. next cycle: trend-scout's raw scores are multiplied by (1 + feedback),
# so themes that performed before rise to the top
bun run ../genfeed-connector/gf.ts feedback "ai agents" # -> { "term": "ai agents", "multiplier": 0.74 }
collect measures, the connector remembers, trend-scout re-ranks. That three-skill cycle is the locked loop.
X_BEARER_TOKEN, LINKEDIN_ACCESS_TOKEN) are read from the environment, used in memory, and never written anywhere. Resolve them through the connector.