Skills

Meter Sync

Refresh the CocoMeter Enhanced dashboard by re-querying Snowflake with current...

Install

npx skills add Snowflake-Labs/cocoplus --skill meter-sync -g -a claude-code -y
Category
Engineering
Updated
1mo ago
License
MIT
Context cost
Lightabout 428 tokens
Runs scripts
No, instructions only

What it does

Refresh the CocoMeter Enhanced dashboard by re-querying Snowflake with current request-map.jsonl data. Regenerates .cocoplus/meter-view.html without opening the browser. Use after the 90-minute Snowflake usage history latency window.

Your objective is to refresh the CocoMeter dashboard with updated Snowflake data.

Pre-flight Check

Check that .cocoplus/meter-view.html exists. If not: Output: "No meter dashboard found. Run $meter view first." Then stop.

Check that .cocoplus/meter/request-map.jsonl exists. If not: Output: "No attribution data found. Run $meter on and execute some pipeline stages first." Then stop.

Re-execute Dashboard Generation

Execute steps 2, 11 of $meter view exactly:

  1. Read and partition request-map.jsonl (Direct IDs vs Anchor IDs)
  2. Execute Pass 1 and Pass 2 Snowflake queries
  3. Join Snowflake rows with attribution data
  4. Compute aggregations
  5. Serialise merged dataset as JSON
  6. Read meter-view.html.template
  7. Inject data between /* __METER_INJECTION_START__ */ and /* __METER_INJECTION_END__ */
  8. Write to .cocoplus/meter-view.html atomically
  9. Update .cocoplus/meter/last-sync.json

Do NOT open the browser. Only refresh the file.

Output

✓ CocoMeter dashboard refreshed.
  Snowflake rows added: <N>  |  Total requests tracked: <N>
  File updated: .cocoplus/meter-view.html
  (Reload the tab in your browser to see the latest data.)

Anti-Rationalization

Shortcut / TemptationWhy It Fails
Open the browser after sync$meter sync is a background refresh, the developer has the tab open already
Skip if Snowflake returns same row countRow count may be the same but token values may have updated

Exit Criteria

  • .cocoplus/meter-view.html regenerated with latest data
  • .cocoplus/meter/last-sync.json updated
  • Output confirms row count and file path
  • Browser NOT opened

More in Engineering