Skip to content

Commit 62f4e6b

Browse files
committed
feat: add cross-harness data layer dashboard
1 parent 5d8bc82 commit 62f4e6b

21 files changed

Lines changed: 1658 additions & 2 deletions

.agent/AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ Daily driver, highest-leverage first:
5555
in one shot (stage + graduate + render). For rules you already know.
5656
- `show.py` — one-screen dashboard of brain state: episodes, candidates,
5757
lessons, failing skills, activity graph.
58+
- `data_layer_export.py` — local cross-harness activity/data-layer export:
59+
agent events, cron timelines, tokens/cost estimates, categories,
60+
harness mix, `dashboard.html`, and `daily-report.md`.
5861
- `list_candidates.py` / `graduate.py` / `reject.py` / `reopen.py` — review
5962
protocol for patterns the dream cycle has staged.
6063
- `memory_reflect.py <skill> <action> <outcome>` — log a significant event.

.agent/skills/_index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ Pre-deployment verification against a structured checklist.
2626
Triggers: "deploy", "ship", "release", "go live"
2727
Constraints: all tests passing, no unresolved TODOs in diff,
2828
requires human approval for production.
29+
30+
## data-layer
31+
Cross-harness activity monitoring and dashboard exports.
32+
Triggers: "data layer", "dashboard", "agent analytics", "resource usage",
33+
"cron monitoring", "daily report", "tokens"
34+
Constraints: local-only by default; no screenshot delivery without explicit user
35+
approval; do not commit private `.agent/data-layer/` exports.

.agent/skills/_manifest.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
{"name":"git-proxy","version":"2026-01-01","triggers":["commit","push","branch","merge","rebase","pull request","PR"],"tools":["bash"],"preconditions":[".git exists"],"constraints":["never force push to main","never force push to protected branches","run tests before push"],"category":"operations"}
44
{"name":"debug-investigator","version":"2026-01-01","triggers":["debug","why is this failing","investigate","stack trace","bug"],"tools":["bash","memory_reflect"],"preconditions":[],"constraints":["reproduce before fixing","fix root cause, not symptoms"],"category":"engineering"}
55
{"name":"deploy-checklist","version":"2026-01-01","triggers":["deploy","ship","release","go live"],"tools":["bash"],"preconditions":[],"constraints":["all tests passing","no unresolved TODOs in diff","requires human approval for production"],"category":"operations"}
6+
{"name":"data-layer","version":"2026-04-25","triggers":["data layer","dashboard","agent analytics","resource usage","cron monitoring","daily report","tokens"],"tools":["bash","git"],"preconditions":[".agent exists"],"constraints":["local-only by default","no screenshot delivery without explicit user approval","do not commit private .agent/data-layer exports"],"category":"operations"}

.agent/skills/data-layer/SKILL.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
name: data-layer
3+
version: 2026-04-25
4+
triggers: ["data layer", "dashboard", "agent analytics", "resource usage", "cron monitoring", "daily report", "tokens"]
5+
tools: [bash, git]
6+
preconditions: [".agent exists"]
7+
constraints: ["local-only by default", "do not send screenshots without explicit user approval", "do not commit private .agent/data-layer exports"]
8+
---
9+
10+
# Data Layer - cross-harness monitoring for the portable brain
11+
12+
Use this skill when the user wants to measure agent activity across Claude Code,
13+
Hermes, OpenClaw, Codex, Cursor, OpenCode, Windsurf, Pi, Antigravity, or any
14+
custom loop using `.agent/`.
15+
16+
The goal is local business intelligence for the whole agent suite:
17+
18+
- what harnesses are active
19+
- how many agent events are happening
20+
- when cron/scheduled agents fire
21+
- which crons started/finished and how long they ran
22+
- how many agents are active
23+
- tokens and estimated cost by hour/day/week/month
24+
- resource usage by user-defined category
25+
- workflow success/error rates
26+
- KPI summary rows for cron cadence, run volume, reliability, active agents,
27+
workflow breadth, token usage, and estimated cost
28+
- screenshot-ready daily resource reports
29+
30+
## Hard Rules
31+
32+
- Stay local-first. Do not add telemetry or remote sync.
33+
- Do not store raw prompts, raw code, client names, emails, phone numbers, or
34+
unredacted business records in shared examples.
35+
- Do not commit `.agent/data-layer/` exports unless the user explicitly reviewed
36+
and sanitized them.
37+
- Do not send dashboard screenshots to email, Slack, webhooks, or any other
38+
channel unless the user explicitly approves the destination.
39+
40+
## Inputs
41+
42+
Default inputs:
43+
44+
```text
45+
.agent/memory/episodic/AGENT_LEARNINGS.jsonl
46+
.agent/data-layer/harness-events.jsonl optional
47+
.agent/data-layer/cron-runs.jsonl optional
48+
.agent/data-layer/category-rules.json optional
49+
```
50+
51+
`AGENT_LEARNINGS.jsonl` is the shared activity log. Optional files let users add
52+
events from harnesses that do not automatically write rich events yet.
53+
54+
## Export
55+
56+
Run:
57+
58+
```bash
59+
python3 .agent/tools/data_layer_export.py --window 30d --bucket day
60+
```
61+
62+
Use `--bucket hour`, `--bucket day`, `--bucket week`, or `--bucket month` for
63+
different chart grains.
64+
65+
Outputs go to:
66+
67+
```text
68+
.agent/data-layer/exports/<YYYY-MM-DD>/
69+
```
70+
71+
Key outputs:
72+
73+
- `agent-events.jsonl/csv`
74+
- `cron-runs.jsonl/csv`
75+
- `cron-timeline.json/csv`
76+
- `activity-series.json/csv`
77+
- `category-summary.json/csv`
78+
- `harness-summary.json/csv`
79+
- `workflow-summary.json/csv`
80+
- `kpi-summary.json/csv`
81+
- `dashboard-summary.json`
82+
- `dashboard-report.json`
83+
- `dashboard.html`
84+
- `daily-report.md`
85+
86+
## Categories
87+
88+
Users can define any categories they want in
89+
`.agent/data-layer/category-rules.json`, for example:
90+
91+
```json
92+
{
93+
"default_category": "uncategorized",
94+
"rules": [
95+
{"category": "coding", "skills": ["debug-investigator", "git-proxy"]},
96+
{"category": "admin", "run_types": ["cron"]},
97+
{"category": "financial", "workflows": ["invoice_collection"]},
98+
{"category": "personal", "workflows": ["calendar_coordination"]},
99+
{"category": "work", "phases": ["plan", "review", "qa", "ship"]}
100+
]
101+
}
102+
```
103+
104+
## Daily Screenshot Report
105+
106+
For daily resource management:
107+
108+
1. Run the exporter from a user-approved cron or scheduled agent.
109+
2. Open `dashboard.html`.
110+
3. Capture the Resource Overview, Activity, Tokens, Cron Runs, Task Categories,
111+
Harness Mix, Workflow Outcomes, Cron Gantt, and Cron Timeline sections.
112+
4. Send the screenshot only through an explicitly approved channel.
113+
114+
The exporter creates `daily-report.md` as the text summary. It does not send
115+
anything by itself.
116+
117+
## Self-rewrite hook
118+
119+
If exports are confusing twice in a row, improve category rules, schema names,
120+
or dashboard labels before adding heavier dashboard dependencies.

0 commit comments

Comments
 (0)