Agent: read this first
You're working in the Weekly management dashboard workspace at trydock.ai/<org>/weekly-management-dashboard.
## Your role
Pulls HubSpot pipeline + closed won every Monday at 7 AM, reads weekly_metrics.json, drafts executive commentary, appends a row to Weekly metrics and a section to Weekly commentary. Never modifies past rows or sections.
## Cadence, when to update Dock
- After EVERY tool call that changes state (row create / update, doc append), append an entry to the **Status** surface.
- After every milestone, update the canonical doc surface for that work.
- When you start a session, READ the last 5 Status entries first to know what happened since you last worked.
## User-loop protocol
- End EVERY reply to the user with: "Check Dock for the latest at trydock.ai/<org>/weekly-management-dashboard."
- If you make a decision the user might want to override (priority, scope cut, tone change), append to **Status** AND mention it in your reply: "Decided X. If you'd rather Y, edit [surface] and I'll re-plan."
- If you're blocked, post to Status with prefix `BLOCKED:` and ask one specific question.
## Don't touch
- Canonical phase / column / surface titles.
- Anything in a section titled "Locked" or "Decisions sealed."
- The agentPrompt itself (this section).
## First tool calls
1. `list_surfaces(workspace_slug="weekly-management-dashboard")`
2. `get_doc(workspace_slug="weekly-management-dashboard", surface_slug="status")`
3. `list_rows(workspace_slug="weekly-management-dashboard", surface_slug="weekly-metrics")`
---
# Weekly management dashboard
A Monday-morning snapshot of pipeline, revenue, cash, and headcount, with a 2-3 paragraph executive commentary. Open in Dock and you get four surfaces seeded:
- **Weekly metrics** (table) one row per week: Week, Pipeline, New Deals, Closed Won, Revenue MTD, Cash, Headcount, Notes. Rolling week-over-week view.
- **Setup guide** (doc) how the agent connects to HubSpot + the Python script + Sunday-night reminder pattern for weekly_metrics.json.
- **Weekly commentary** (doc) running narrative log. One section per week, newest at bottom. Useful for copying into board updates or investor emails.
- **Status** (doc) the agent's working session log. End of every run: 1 paragraph of what happened, what's pending.
## Bring your own agent
Connect one agent to this workspace (Claude in Cursor, Claude Code, Codex, any MCP client). The agent reads HubSpot every Monday morning, no manual trigger needed once the weekly cron is wired.
## The user-loop protocol
Your agent proposes; you decide.
- Sunday night: you update weekly_metrics.json with this week's revenue, cash, headcount, notes. Set a calendar reminder so this is reliably done.
- Monday 7 AM: agent fetches HubSpot pipeline (all open deals), new deals (createdate >= week start), closed won (dealstage = closedwon, closedate >= week start), reads weekly_metrics.json, computes the metrics block, asks Claude for commentary, appends a row to Weekly metrics + a section to Weekly commentary.
- Agent NEVER edits past Weekly metrics rows or past Weekly commentary sections. Those are history.
- dashboard_state.json prevents double-posting if the worker retries within the same week.
- End of every working session, agent writes 1 paragraph to **Status**: what was pulled, what was posted, anything that looked off.
## First run
1. Confirm CRM source with the operator: HubSpot, Salesforce, or Pipedrive. Get the access token.
2. Confirm financial metrics to track: revenue MTD, cash balance, burn rate, headcount, customer count, NPS, anything else.
3. Open Setup guide and follow the install steps. Configure .env. Seed weekly_metrics.json with this week's numbers.
4. Run generate_dashboard.py once manually. Watch Weekly metrics + Weekly commentary + Status for the first entries.
## Status
### [00:00 UTC] seeded by Dock
Workspace created from the weekly management dashboard template. Agent: read the Setup guide, then confirm CRM source + metrics list with the operator before the first run.
Next: confirm CRM source + metrics with operator.
Outcome
A Monday-morning dashboard workspace where pipeline and revenue come from HubSpot automatically, cash and headcount come from a small JSON file you update Sunday night, and Claude writes the commentary fresh every week.
Estimated time: 45 min setup, ongoing ~5 min/Sun to update weekly_metrics.json
Difficulty: beginner
For: PE-backed leadership teams (CEO, CFO, COO) running Monday standups against a fixed set of weekly KPIs.
What you'll need
Pre-register or install before you start.
- Dock (Free plan covers this template; Pro $19/mo unlocks more workspaces.) — The workspace itself, the rolling Weekly metrics table, the Weekly commentary doc surface.
- Anthropic API (Pay per token, ~$0.01 per weekly commentary on Sonnet.) — Claude writes the 2-3 paragraph executive commentary every Monday from the metrics block.
- HubSpot CRM (Free private app token; CRM seats per your existing HubSpot plan.) — Source for pipeline value, new deals this week, closed won this week. Salesforce and Pipedrive work as alternatives, see Setup guide.
- CueAPI (optional) (Free tier covers weekly cadence.) — Cloud-scheduled Monday 7 AM run so the dashboard keeps posting when your laptop is closed.
The template · 5 steps
Step 1: Pick the CRM source + confirm metrics
Estimated time: 10 min
The script ships with HubSpot wiring out of the box. Salesforce and Pipedrive are supported via small swaps in get_pipeline_metrics(). Beyond CRM, the operator decides which financial and operational metrics live in weekly_metrics.json: revenue MTD, cash balance, burn rate, headcount, customer count, NPS, support tickets, anything they track weekly.
Tasks
- HubSpot: open Settings, Integrations, Private Apps. Create an app with crm.objects.deals.read. Copy the token.
- Salesforce: get an OAuth access token. The Setup guide notes the SOQL swap in get_pipeline_metrics().
- Pipedrive: get an API key. The Setup guide notes the GET /api/v1/deals swap.
- Decide which metrics belong in weekly_metrics.json. Common: revenue_mtd, cash_balance, headcount, customer_count, notes. Add or remove fields based on what the operator actually tracks.
[!CAUTION] Gotchas
- HubSpot pipeline of 0 usually means deal.amount is blank or deal stages don't match closedwon/closedlost. Check Settings, CRM, Deal Stages and adjust the filter values.
- If closedate filter returns nothing, check property type via GET /crm/v3/properties/deals/closedate. If fieldType is date not datetime, switch the filter to week_start.strftime('%Y-%m-%d').
Step 2: Wire .env + the Python script
Estimated time: 15 min
One script: generate_dashboard.py runs every Monday at 7 AM. Reads HubSpot, reads weekly_metrics.json, asks Claude, writes two Dock surfaces. dashboard_state.json prevents double-posts on worker retries.
Tasks
- Open Setup guide (doc) and copy generate_dashboard.py into a local folder
- Run pip install anthropic requests python-dotenv
- Create .env with HUBSPOT_ACCESS_TOKEN, DOCK_API_KEY, DOCK_WORKSPACE_SLUG, ANTHROPIC_API_KEY, COMPANY_NAME, CURRENCY_SYMBOL=$, METRICS_FILE=./weekly_metrics.json, CLAUDE_MODEL=claude-sonnet-4-6
- Create weekly_metrics.json with this week's numbers: revenue_mtd, cash_balance, headcount, customer_count, notes (free text)
- Run python generate_dashboard.py once manually. Confirm a row appears in Weekly metrics + a section appears in Weekly commentary.
[!CAUTION] Gotchas
- dashboard_state.json blocks a second run in the same ISO week. Delete it to force a re-run during testing.
- If weekly_metrics.json is missing, the script logs a warning and posts with only HubSpot metrics. The Notes column will be blank.
Agent prompt for this step
Run a first dashboard generation. Check dashboard_state.json: if it shows the current ISO week, skip with a Status note. Otherwise compute this Monday's week_start in UTC + epoch ms. Fetch HubSpot open pipeline, new deals this week, closed won this week. Read weekly_metrics.json. Generate 2-3 paragraph Claude commentary. Append one row to Weekly metrics and one section to Weekly commentary. Update dashboard_state.json. Post a Status entry summarizing the pull + the post.
Step 3: Set up the Sunday-night metrics reminder
Estimated time: 5 min
The single failure mode of this template is forgetting to update weekly_metrics.json on Sunday night. Add a recurring calendar reminder. Two minutes of typing on Sunday means Monday's dashboard has revenue, cash, and headcount instead of just CRM data.
Tasks
- Calendar reminder Sunday 9 PM: 'Update weekly_metrics.json'
- The reminder body: open the file, swap in this week's revenue, cash, headcount, customer count, and any notes about wins or things to flag for Monday standup
- Notes is free text and feeds directly into Claude's commentary. Mentioning 'Closed Acme deal' or 'starting engineering hire' shapes the headline paragraph.
[!CAUTION] Gotchas
- Forgetting Sunday night means Monday's dashboard runs with last week's numbers (or no manual metrics at all). Operator-side process, not script-side.
Step 4: Schedule the Monday 7 AM run
Estimated time: 10 min
One cron task: generate weekly on Monday at 7 AM. The script is idempotent via dashboard_state.json. Schedule before the Monday leadership standup (or whatever fits your team's rhythm).
Tasks
- Option A, cron: crontab -e, add
0 7 * * 1 cd /path && source .env && python3 generate_dashboard.py >> dashboard.log 2>&1 - Option B, CueAPI: pip install cueapi cueapi-worker, then cueapi create --schedule '0 7 * * 1' --name 'Management Dashboard'. Start the worker with --handler ./generate_dashboard.py.
- Confirm next Monday: Status has a fresh session entry, Weekly metrics has a new row, Weekly commentary has a new section.
[!CAUTION] Gotchas
- Cron requires the machine awake at 7 AM Monday. Closed laptop = no dashboard. Switch to CueAPI for cloud-scheduled runs.
- dashboard_state.json is the only thing standing between a worker retry and two duplicate rows. Keep it.
Step 5: Use the dashboard in Monday standups
Estimated time: 5 min/week ongoing
The whole point is walking into Monday standup with the snapshot already written. Pull up Weekly metrics for the rolling week-over-week view. Read Weekly commentary out loud to open the meeting. Copy the commentary section into the board update or investor email.
Tasks
- Open Weekly metrics (table) at the start of standup. Walk the row top to bottom: pipeline, new deals, closed won, revenue, cash, headcount.
- Open Weekly commentary (doc), scroll to the latest section, read the 2-3 paragraphs out loud.
- If the commentary surfaces something to act on (deal at risk, cash burn higher than expected), assign an owner before moving on.
- Copy the commentary section into the investor update or board email if relevant. The voice is already there.
[!CAUTION] Gotchas
- The commentary is a draft. Edit it before sharing externally. Claude is good at flagging risks; humans are better at picking which risks to surface to a board.
Hand the template to your agent
Paste the prompt below into your agent's permanent system prompt so the agent reads, writes, and maintains this workspace as you work through the steps.
You are the agent running on the "Weekly management dashboard" template workspace, connected via MCP at your-org/weekly-management-dashboard.
Your job: every Monday at 7 AM, pull HubSpot pipeline and closed-won metrics, read weekly_metrics.json, draft executive commentary, post one row to Weekly metrics and one section to Weekly commentary. Never edit past rows or sections.
User-loop protocol:
- You propose. The operator decides. Never edit past Weekly metrics rows or past Weekly commentary sections.
- Monday 7 AM (or "run dashboard"): check dashboard_state.json. If last_run_week matches the current ISO week, skip with a Status note. Otherwise: compute week_start = the Monday of this week (UTC), week_start_ms = epoch ms.
- Fetch HubSpot deals: (1) open pipeline (dealstage NOT IN closedwon, closedlost), sum amount; (2) new deals (createdate GTE week_start_ms), count; (3) closed won (dealstage EQ closedwon, closedate GTE week_start_ms), sum amount + collect deal names.
- Read METRICS_FILE (default ./weekly_metrics.json) for revenue_mtd, cash_balance, headcount, customer_count, notes. Missing keys are fine.
- Ask Claude for 2-3 paragraph commentary on the metrics block: headline, pipeline/revenue health, one forward-looking observation. No hype.
- Append a Weekly metrics row (Week, Pipeline, New Deals, Closed Won, Revenue MTD, Cash, Headcount, Notes). Append a Weekly commentary doc section. Update dashboard_state.json.
- End of every working session, write 1 paragraph to Status: what was pulled, what was posted, anything that looked off.
Don't touch:
- Past Weekly metrics rows (those are history).
- Past Weekly commentary sections (those are the rolling narrative log).
- weekly_metrics.json (the operator owns this file).
First MCP tool calls:
1. list_surfaces(workspace_slug="weekly-management-dashboard")
2. list_rows(workspace_slug="weekly-management-dashboard", surface_slug="weekly-metrics")
3. get_doc(workspace_slug="weekly-management-dashboard", surface_slug="status")
FAQ
What if I don't use HubSpot?
Setup guide includes the SOQL swap for Salesforce (Opportunities with StageName != Closed Lost for pipeline, StageName = Closed Won + CloseDate >= this_week for closed won) and the GET /api/v1/deals swap for Pipedrive (status=open for pipeline, status=won&start_date=YYYY-MM-DD for closed won). Set the relevant env vars and adjust get_pipeline_metrics() accordingly.
Why a JSON file instead of a Dock table for manual metrics?
weekly_metrics.json is the smallest possible input surface. Sunday night, you open one file, change a few numbers, save. Doing the same thing through a Dock table means switching context to the browser, finding the right cell, etc. The dashboard surface is the output; the JSON file is the input. Keep them separate.
Can the agent update weekly_metrics.json on my behalf?
No. The agent reads weekly_metrics.json but never writes it. Cash balance and headcount are facts the operator owns. Letting the agent populate them creates an attribution problem when the Monday number looks wrong. Set the Sunday reminder instead.
What if Monday morning's commentary surfaces something I don't want shared?
Edit the section. Weekly commentary is a doc surface; you can rewrite or delete sections directly. The agent doesn't re-generate past sections, so your edits stick. For weeks where you want a totally different tone (board update vs. team standup), edit the prompt in generate_commentary() once.
Does this work alongside an existing BI tool?
Yes. The Monday dashboard is a snapshot, not a replacement for Looker, Metabase, or Snowflake. Pipeline and revenue numbers should match your BI tool. If they don't, the most common reason is the HubSpot deal stage filter (closedwon spelling, custom stages); check Settings, CRM, Deal Stages.