Skip to content
Back to skills

Cocometer

ASecurity

Pre-flight token and cost estimation for a planned action. Analyzes the current plan or a described action and estimates token consumption, Snowflake credit usage, and whether it exceeds configured thresholds.

  • 724 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 5, 2026
ai-agentsgosqldocumentation

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add Snowflake-Labs/cocoplus --skill cocometer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cocometer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cocometer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snowflake-labs-cocometer-d325d229/badge)](https://www.skillsdirectory.com/skills/snowflake-labs-cocometer-d325d229)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "meter-estimate"
description: "Pre-flight token and cost estimation for a planned action. Analyzes the current plan or a described action and estimates token consumption, Snowflake credit usage, and whether it exceeds configured thresholds."
version: "1.0.3"
author: "CocoPlus"
tags:
  - cocoplus
  - cocometer
---

Your objective is to estimate token and cost impact before executing an action.

Before proceeding, verify that `.cocoplus/` exists.
If not: output "CocoPlus not initialized in this directory. Run `$pod init` to begin." Then stop.

If no argument provided: read `.cocoplus/flow.json` to estimate the full pipeline.
If argument provided (e.g., `$meter estimate "run 3-stage pipeline"`): estimate the described action.

## Estimation Approach

For pipeline estimation:
- Count stages in flow.json
- For each stage, estimate based on persona and typical workload:
  - data-engineer: ~8,000 tokens/stage (SQL-heavy)
  - analytics-engineer: ~6,000 tokens/stage (semantic modeling)
  - data-scientist: ~12,000 tokens/stage (notebook + analysis)
  - data-analyst: ~4,000 tokens/stage (queries + reporting)
  - bi-analyst: ~3,000 tokens/stage (visualization spec)
  - data-product-manager: ~2,000 tokens/stage (documentation)
  - data-steward: ~3,000 tokens/stage (governance)
  - chief-data-officer: ~2,000 tokens/stage (review)

## Apply Accuracy Learning Calibration

Read `.cocoplus/meter/adjustment-factor.json` if it exists:
```json
{ "factor": N, "sample_size": N, "computed_at": "..." }
```

If the file exists and `sample_size` >= 2:
- `calibrated_total = raw_total × factor`
- Calibration label: `(baseline: [raw_total], calibration factor: [factor]x from [sample_size] prior sessions)`
Else:
- `calibrated_total = raw_total`
- No calibration label

Write estimate to `.cocoplus/meter/preflight-log.jsonl`:
```json
{ "session_id": "[current-session-id]", "estimated_tokens": [calibrated_total], "estimated_credits": [estimated_credits], "timestamp": "[ISO 8601]" }
```

Output:

```
# Pre-flight Estimate

Action: [described action or "Full pipeline execution"]

## Token Estimate
Per stage breakdown:
[stage name] ([persona]): ~[estimate] tokens
...
Baseline estimate: ~[raw_total] tokens
[If calibrated:] Calibrated estimate: ~[calibrated_total] tokens [calibration label]
[If not calibrated:] Total estimate: ~[raw_total] tokens (conservative — no calibration data yet)

## Snowflake Credit Estimate
Estimated SQL calls: ~[N]
Estimated credits: ~[N × 0.00001] credits

## Budget Check
Configured threshold: [from cost-tracker.monitor.json]
Estimate vs threshold: [WITHIN / EXCEEDS by N%]

Note: These are estimates. Actual usage depends on response length, query complexity, and data volume.
Run `$meter accuracy` to view calibration history.
```

## Anti-Rationalization

| Shortcut / Temptation | Why It Fails |
|-----------------------|--------------|
| Use a single flat estimate without per-stage breakdown | Different personas have very different token footprints; a flat estimate hides cost concentration in expensive stages |
| Skip the budget threshold check | The entire value of pre-flight estimation is knowing whether to proceed — skipping the check defeats the purpose |

## Exit Criteria

- [ ] Per-stage token breakdown is shown with persona label for each stage
- [ ] Total token estimate is shown
- [ ] Configured budget threshold is compared against the estimate with WITHIN or EXCEEDS result

Files in this skill

  • archetype-classifier.skill.md1.5 KB
  • chargeback-refresh.skill.md1.5 KB
  • cost-center-resolver.skill.md1.5 KB
  • invoice-generator.skill.md1.5 KB
  • meter-accuracy.skill.md2.3 KB
  • meter-benchmark.skill.md1.3 KB
  • meter-chargeback.skill.md3.2 KB
  • meter-compare.skill.md4.1 KB
  • meter-estimate.skill.md3.4 KB
  • meter-history.skill.md1.9 KB
  • meter-invoice.skill.md1.5 KB
  • meter-off.skill.md2.3 KB
  • meter-on.skill.md2.3 KB
  • meter-reconcile.skill.md4.1 KB
  • meter-refresh.skill.md1.5 KB
  • meter-report.skill.md3.5 KB
  • meter-status.skill.md1.5 KB
  • meter-sync.skill.md2 KB
  • meter-verify.skill.md1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…