# Get a weekly metrics report written by an agent from Stripe, analytics and a sheet

> Build a scheduled job that pulls revenue, traffic and your own sheet numbers, computes week over week changes in code and has an agent write a short report.

- URL: https://paperchasewebb.ai/bots/marketplace/items/weekly-metrics-report-agent/
- Type: Agent use case pack
- Category: Solo business
- By: PaperChaseWebb
- Works with: Plain .md
- Price: $39 USD
- Difficulty: Advanced
- Setup time: 1 hr 30 min
- Time to result: First report the same day you finish setup
- Format: Markdown (.md) file, weekly-metrics-report-agent.md
- Version: 1.0, updated 2026-10-15
- License: Personal and commercial use inside your own business. Do not resell the pack itself.

## What you end up with

Every Monday morning a one-page report is waiting: what moved, by how much, and the two things worth looking at, with every number traceable to its source.

## What you get

- Architecture diagram and the data contract between steps
- Collector code for Stripe (restricted key), an analytics adapter and a published sheet
- A deltas module that computes every change in code before the model sees it
- Report prompt that may only cite numbers it was given, with a self-check step
- Delivery options: email draft to yourself, a Slack message or a Markdown file
- Setup guide for read-only keys and secrets

## Who it is for

Solo founders and small teams who check five dashboards every Monday and still cannot say in one sentence how last week went.

## Tools needed

- Stripe restricted API key: read-only access to charges, subscriptions and refunds
- PostHog or Plausible: traffic and conversion numbers
- Google Sheets published CSV: anything you track by hand
- GitHub Actions schedule or Cloudflare Workers cron: runs the job weekly
- Any model API: writes the prose, never the math
- You need: A Stripe account
- You need: An analytics tool with an API
- You need: Comfort with environment variables and a scheduled job

Cost to run: Free tier scheduling on GitHub Actions or Cloudflare Workers. One model call per week on your own key.

## How it works

1. **Create read-only keys.** Make a Stripe restricted key with read access only, and an analytics key with the narrowest scope offered. Expected: Keys that cannot change anything, stored as secrets.
2. **Collect.** Run each collector once by hand and check its JSON against the dashboard. Expected: Numbers match what you see in Stripe and analytics.
3. **Compute in code.** Run the deltas module to produce this week, last week, change and four-week average for each metric. Expected: A table of numbers you could report without any AI.
4. **Write the report.** Send only the computed table to the model with the report prompt. Expected: A one-page report where every number appears in the input table.
5. **Schedule it.** Add the weekly schedule and pick a delivery option. Expected: A report arrives at the same time every week.

## Sample prompt: Report writer (Any model API)

```
You write a weekly metrics report for [business name]. Input is a JSON table of metrics with this_week, last_week, change_pct and avg_4w for each.
Rules: use only numbers that appear in the input. Do not calculate new numbers. If a metric is missing or null, say so plainly.
Format: a one-sentence headline, then up to five bullets on the biggest moves, then two things worth looking at this week with the reason for each.
Finish with a self-check: list every number you used and the input field it came from.
```

The self-check list makes it obvious if the model ever reached for a number that is not in the data.

## Free preview of weekly-metrics-report-agent.md

````markdown
# Get a weekly metrics report written by an agent from Stripe, analytics and a sheet

PaperChase agent use case pack (playbook), version 1.0. Node.js 20, no dependencies. Runs on a GitHub Actions schedule (or a Cloudflare Workers cron with small changes). Setup: 60 to 90 minutes.

## The design in one line

Code collects and computes every number. The model only writes sentences about numbers it was handed, then lists where each one came from.

```
collect (Stripe, analytics, sheet)  ->  metrics.json (raw)
compute (code: this week, last week, change, 4-week average)  ->  table.json
write (model: headline, biggest moves, two things to look at, self-check)  ->  report.md
deliver (email draft to you, Slack webhook or a file)
```

## Why the math stays in code

Language models are unreliable at arithmetic and will produce a confident percentage that is slightly wrong. A report you cannot trust is worse than no report. Every change and average is computed in `compute.mjs`, and the prompt forbids new calculations.

## What you will build

```
metrics-report/
  collect.mjs        # Stripe, analytics and sheet collectors
  compute.mjs        # weekly windows and deltas
  write.mjs          # model call with the report prompt
  run.mjs            # runs all three, saves report.md
  .github/workflows/weekly-report.yml
```

## Contents

1. Keys and secrets (read-only)
2. Collectors
3. Compute
4. Report prompt and writer
5. Schedule and delivery
6. Checking it is right
7. Instructions for your AI coding agent
````

## Worth knowing

- Never give the job a full-access Stripe key. A restricted read-only key limits the damage if a secret leaks.
- Models are bad at arithmetic. The pack computes every change in code for this reason; do not skip that step.
- A report reflects the data sources. If your analytics undercounts because of blockers, the report will too.

## Questions

**Can it post to Slack?** Yes, through an incoming webhook you create. The default delivery is an email draft or a Markdown file, so nothing goes to a team channel until you choose that.

**Does it work without Stripe?** Yes. Each collector is optional. Use the sheet collector for revenue from any other processor.

## How to buy

$39 one time at https://paperchasewebb.ai/bots/marketplace/items/weekly-metrics-report-agent/. Stripe checkout, then an instant download page; the download link is also in your emailed receipt.

Seller: PaperChaseWebb Inc., mgmt@paperchasewebb.com
