FrancyJGLisboa/agent-skills-platform / references/examples/weekly-crm-report
weekly-crm-report
UnverifiedCleans a weekly CRM export and produces a regional sales summary. Activates when the user asks to clean a CRM export, deduplicate sales rows, calculate regional totals, or generate a weekly sales report from a CSV.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 1.7 KB |
| SKILL.md | skill md | 2.4 KB |
| VERIFICATION.md | markdown | 845 B |
| contracts/data_contract_crm_export/.contract_id | other | 10 B |
| contracts/data_contract_crm_export/code/contract_health.py | script | 386 B |
| discovery.json | config | 2.2 KB |
| evals/golden/case-1/expected.json | config | 126 B |
| evals/golden/case-1/input.csv | other | 62 B |
| evals/golden/case-2/expected.json | config | 129 B |
| evals/golden/case-2/input.csv | other | 46 B |
| evals/golden/case-3/expected.json | config | 106 B |
| evals/golden/case-3/input.csv | other | 39 B |
| evals/weekly-crm-report.eval.md | markdown | 1.8 KB |
| scripts/dependency_health.py | script | 3.9 KB |
| scripts/evolve.pyexecutable | script | 10.2 KB |
| scripts/review_staleness.py | script | 6.2 KB |
| scripts/run_evals.pyexecutable | script | 49.4 KB |
| scripts/run_pipeline.pyexecutable | script | 2.3 KB |
| scripts/schema_drift.py | script | 7.3 KB |
| scripts/skill_document.py | script | 9.8 KB |
| scripts/staleness_check.py | script | 7.5 KB |
| scripts/success_ledger.py | script | 16.5 KB |
scripts/run_pipeline.py
View on GitHub#!/usr/bin/env python3
"""Deterministic entry-point for the weekly-crm-report skill.
Reads a CRM-export CSV, drops exact-duplicate rows, totals `amount` per `region`,
and writes a JSON summary. Stdlib-only — runs with no third-party dependencies, so
the eval rollout works out of the box.
python3 scripts/run_pipeline.py --input export.csv --output summary.json
"""
from __future__ import annotations
import argparse
import csv
import json
import sys
from pathlib import Path
def summarize(rows: list[dict]) -> dict:
"""Dedup identical rows, total `amount` per `region`, return the summary dict."""
seen: set[tuple] = set()
deduped: list[dict] = []
for row in rows:
key = tuple(sorted(row.items()))
if key not in seen:
seen.add(key)
deduped.append(row)
regions: dict[str, float] = {}
for row in deduped:
region = (row.get("region") or "").strip()
if not region:
continue
try:
amount = float(row.get("amount", "") or 0)
except ValueError:
amount = 0.0
regions[region] = round(regions.get(region, 0.0) + amount, 2)
return {
"rows_in": len(rows),
"rows_after_dedup": len(deduped),
"regions": regions,
"grand_total": round(sum(regions.values()), 2),
}
def run_pipeline(input_path: Path, output_path: Path) -> Path:
"""Read the CSV, build the summary, write JSON. Return the output path."""
with input_path.open(newline="", encoding="utf-8") as fh:
rows = list(csv.DictReader(fh))
output_path.write_text(json.dumps(summarize(rows), indent=2), encoding="utf-8")
return output_path
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description="Summarize a weekly CRM export.")
parser.add_argument("--input", required=True, help="CRM export CSV.")
parser.add_argument("--output", required=True, help="Where to write summary JSON.")
args = parser.parse_args(argv)
try:
run_pipeline(Path(args.input), Path(args.output))
except (OSError, ValueError) as exc:
print(json.dumps({"error": str(exc), "error_type": "runtime"}), file=sys.stderr)
return 1
return 0
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |