agentleFS
priyanshu-aryapriyanshu-arya/LinkedIn_Automation/.claude/skills/pull-analytics/SKILL.md

pull-analytics

Skill0 starsChanged 58 days agoMITView on GitHub

Use when the user wants to pull LinkedIn post performance data, update analytics, or explicitly invokes /pull-analytics. Queries Buffer's post-metrics API for every scheduled/published post and appends a snapshot row to its Analytics record. Requires real Buffer credentials, same as /schedule-approved.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every note in Scheduled/ or Published-Posts/ with a real buffer_post_id and a scheduled_date at least 1 day in the past (no point querying …

    line 34
  2. Very specific:

    If Buffer's response shows the post actually went out, and the local note is still Scheduled/ with publish_status: scheduled, move the file …

    line 54
  3. Distinctive:

    If a post's latest engagement_rate is meaningfully above the average of its own prior snapshots or of other published posts (once there are …

    line 70
  4. Distinctive:

    Do not notify for routine, in-line-with-baseline results.

    line 83
  5. Distinctive:

    Never write a fabricated metric value.

    line 87
  6. Distinctive:

    Never overwrite a prior snapshot row — history must accumulate.

    line 89
  7. Distinctive:

    Never claim "outperformance" without an actual baseline to compare against.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pull Analytics (Analytics Agent — Phase 9)

Pulls performance metrics from Buffer for posts that have gone through /schedule-approved, and appends a snapshot to each post's Analytics record — never overwrites history (REQUIREMENTS.md §12/§13 need the full history to detect trends, not just the latest number).

Important constraints (verified against Buffer's docs, not assumed)

  • Post-metrics is an experimental part of Buffer's API — the shape can change. Don't hard-fail the whole run if one field is missing; report what came back.
  • Metrics are refreshed once daily and can lag the real network by up to ~24 hours, and stay null until that ingestion job has run. Do not treat a null/missing metric as zero — report it as "not yet available," not as a zero-engagement post. This matters: a false zero would corrupt Phase 10's learning.
  • Reading metrics requires a personal API key (same BUFFER_ACCESS_TOKEN as the Scheduler).

Required environment

Same as /schedule-approved: BUFFER_ACCESS_TOKEN. Stop and say so plainly if it's missing.

Process

1. Find posts to check

Every note in Scheduled/ or Published-Posts/ with a real buffer_post_id and a scheduled_date at least 1 day in the past (no point querying same-day — nothing will have ingested yet).

2. Query Buffer

query {
  post(input: { id: "<buffer_post_id>" }) {
    id
    metrics { type name value unit }
  }
}

Map returned types to the Analytics table columns: impressions, reach, reactions, comments, shares, clicks, engagementRate. Follower growth isn't a per-post metric — track it separately if/when a channel-level query is needed (not built in this phase; flag as a gap if the user wants it).

3. Update publish status

If Buffer's response shows the post actually went out, and the local note is still Scheduled/ with publish_status: scheduled, move the file to Published-Posts/ and set publish_status: published. If Buffer reports a failure/deletion, set publish_status: failed and leave it in Scheduled/ — this is a Phase 11 notification trigger ("a post fails to publish").

4. Append the snapshot

In the post's Analytics/<id>.md note (create it from _Templates/Analytics-Record.md if it doesn't exist yet, with status: active — never placeholder, that value is reserved for the hand-written schema example), append one row to the Snapshots table with today's date and the metric values — append, never overwrite existing rows.

5. Flag standout performance

If a post's latest engagement_rate is meaningfully above the average of its own prior snapshots or of other published posts (once there are enough to compare — don't invent a baseline from a single data point), this is a Phase 11 notification trigger ("a post significantly outperforms normal performance"). With fewer than ~3-5 published posts, say plainly that there isn't yet enough data for a meaningful baseline.

Notifications (REQUIREMENTS.md §24)

Send a PushNotification (status: proactive) when:

  • step 3 detects a post failed to actually go out.
  • step 5 confirms genuine outperformance against a real baseline — e.g. "LinkedIn post from <date> is at 2.1x your average engagement rate." Do not notify for routine, in-line-with-baseline results.

Hard rules

  • Never write a fabricated metric value. A missing/null metric is reported as unavailable, never defaulted to 0.
  • Never overwrite a prior snapshot row — history must accumulate.
  • Never claim "outperformance" without an actual baseline to compare against.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.