AgentSkillsCN

Generate Daily Exec Report

生成每日执行报告

SKILL.md

generate-daily-exec-report

Purpose

Generates the Executive Daily Report - a comprehensive daily briefing that synthesizes:

  • Raw conversations from ChatGPT, Claude, Gemini, Cursor
  • Extracted memories (CMA output)
  • Business insights (PAR output)
  • SEO recommendations (SEOS output)
  • Operational telemetry

What It Does

  1. Reads exported conversations for the date (/cosmocrat/inbox/conversations/{date}.json)
  2. Queries ClickHouse for memories, insights, and telemetry
  3. Loads prior day's report for delta computation
  4. Calls OpenAI (gpt-4o) with structured prompts
  5. Writes JSON + Markdown reports to /cosmocrat/reports/{date}/
  6. Indexes to ClickHouse (artifacts_daily, orion_daily_analyses)
  7. Posts summary to Slack #orion-ops

Memory Contract

Reads

  • conversation_message (ops lane) - Source conversations
  • daily_event (ops lane) - Operational events for context
  • episodic_memory (ops lane) - Short-term agent memories

Writes

  • artifact_daily (ops lane) - Report artifact with input/output
  • daily_analysis (ops lane) - Structured analysis (decisions, actions, themes)

Provenance

All writes include:

  • run_id - Execution ID
  • trace_id - Langfuse trace ID
  • source_ref - Date identifier (e.g., "daily_report_2025-12-21")
  • actor - "generate_daily_exec_report"

Schedule

Cron: 5 2 * * * (02:05 PT daily)
Triggered after: conversation-exporter (23:50 PT)

Implementation

Script: app/services/mcp/jobs/daily/executive_daily_report_runner.py
Indexer: app/services/mcp/jobs/memory/index_exec_report.py

Outputs

JSON Schema

json
{
  "date": "YYYY-MM-DD",
  "decisions": [{"id": "d1", "title": "...", "status": "..."}],
  "actions_due": [{"id": "a1", "title": "...", "owner": "...", "status": "..."}],
  "themes": [{"name": "...", "stability_score": 0-100}],
  "deltas": {
    "new": ["..."],
    "closed": ["..."],
    "updated": ["..."]
  },
  "deltaComputed": true
}

Markdown Format

markdown
**Executive Daily Report — {DATE}**

## Recommendations
...

## Decisions
...

## Actions Due
...

## Themes
...

Dependencies

  • OpenAI API (gpt-4o)
  • ClickHouse (messages_v2, events_daily)
  • Slack hooks (orion-ops channel)
  • Langfuse (tracing)

Observability

  • Langfuse trace: executive-daily-report-{date}
  • ClickHouse events: events_daily (agent_id: executive-daily-report)
  • Metrics: duration_ms, token_count, decisions_count, actions_count, themes_count

Error Handling

  • Missing input file → Warning, skip gracefully
  • ClickHouse unavailable → Fail fast, alert
  • OpenAI timeout → Retry with exponential backoff (3 attempts)
  • Slack post failure → Log warning, continue (non-critical)