debrief-cli 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
debrief/site/style.css ADDED
@@ -0,0 +1,520 @@
1
+ :root {
2
+ color-scheme: light;
3
+ --neutral-0: #ffffff;
4
+ --neutral-50: #fcfcfc;
5
+ --neutral-100: #f6f6f6;
6
+ --neutral-150: #f2f2f2;
7
+ --neutral-200: #dfdfdf;
8
+ --neutral-250: #cdcdcd;
9
+ --neutral-400: #959595;
10
+ --neutral-500: #707070;
11
+ --neutral-900: #0f0f0f;
12
+
13
+ --surface-base: var(--neutral-100);
14
+ --surface-floating: var(--neutral-0);
15
+ --surface-sunken: var(--neutral-150);
16
+ --surface-hover: #00000009;
17
+ --surface-selected: #0000000f;
18
+ --text-default: var(--neutral-900);
19
+ --text-muted: var(--neutral-500);
20
+ --text-disabled: var(--neutral-400);
21
+ --border-default: #0a0a0a1f;
22
+ --border-subtle: #0a0a0a14;
23
+ /* The card frame: a 1px hairline drawn as a shadow, never a border. */
24
+ --frame: rgb(0 0 0 / 0.06);
25
+ --frame-strong: rgb(0 0 0 / 0.12);
26
+ --shadow-card: 0 2px 4px #0000000a, 0 1px 2px -1px #0000000f;
27
+ --shadow-popover: 0 4px 12px -1px #0000000f, 0 2px 4px #0000000a;
28
+ --primary-bg: #171717;
29
+ --primary-fg: #ffffff;
30
+ --accent: #3559a6;
31
+ --focus: #3559a6;
32
+ --destructive: oklch(57.7% 0.245 27.3);
33
+ --destructive-soft: oklch(57.7% 0.245 27.3 / 0.1);
34
+ --status-merged: oklch(62.7% 0.265 303.9);
35
+
36
+ /* Agent identity: strong for marks and chip text, soft for chip fills. Pi is not in the guide: emerald. */
37
+ --ag-claude: oklch(64.6% 0.222 41.116);
38
+ --ag-claude-soft: oklch(95.4% 0.038 75.164);
39
+ --ag-codex: oklch(51.1% 0.262 276.966);
40
+ --ag-codex-soft: oklch(93% 0.034 272.788);
41
+ --ag-pi: oklch(59.6% 0.145 163.225);
42
+ --ag-pi-soft: oklch(95% 0.052 163.051);
43
+ --ag-other: var(--neutral-500);
44
+ --ag-other-soft: var(--surface-selected);
45
+
46
+ /* Friction signals: greyscale first, one non-agent hue for "overlooked". Glyph shapes tell the kinds apart. */
47
+ --sig-corrected: var(--text-default);
48
+ --sig-correction: #3d3d3d;
49
+ --sig-reversal: #707070;
50
+ --sig-defect: #a3a3a3;
51
+ --sig-could_find: #db2777;
52
+ --sig-not_filed: var(--text-muted);
53
+
54
+ --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
55
+ --mono: ui-monospace, "SF Mono", Menlo, "IBM Plex Mono", monospace;
56
+ }
57
+
58
+ @media (prefers-color-scheme: dark) {
59
+ :root:not([data-theme="light"]) {
60
+ color-scheme: dark;
61
+ --neutral-0: #070707;
62
+ --neutral-50: #111111;
63
+ --neutral-100: #161616;
64
+ --neutral-150: #1c1c1c;
65
+ --neutral-200: #222222;
66
+ --neutral-250: #292929;
67
+ --neutral-400: #4e4e4e;
68
+ --neutral-500: #707070;
69
+ --neutral-900: #f3f3f3;
70
+ --surface-base: #161616;
71
+ --surface-floating: #222222;
72
+ --surface-sunken: #111111;
73
+ --surface-hover: #ffffff09;
74
+ --surface-selected: rgb(255 255 255 / 0.08);
75
+ --text-default: #f3f3f3;
76
+ --text-muted: #b9b9b9;
77
+ --text-disabled: #707070;
78
+ --border-default: rgb(255 255 255 / 0.12);
79
+ --border-subtle: rgb(255 255 255 / 0.08);
80
+ --frame: rgb(255 255 255 / 0.14);
81
+ --frame-strong: rgb(255 255 255 / 0.24);
82
+ --primary-bg: #f5f5f5;
83
+ --primary-fg: #171717;
84
+ --accent: #8ba5df;
85
+ --focus: #8ba5df;
86
+ --destructive: oklch(70.4% 0.191 22.216);
87
+ --destructive-soft: oklch(70.4% 0.191 22.216 / 0.14);
88
+ --status-merged: oklch(71.4% 0.203 305.504);
89
+ --ag-claude: oklch(75% 0.183 55.934);
90
+ --ag-claude-soft: oklch(27.7% 0.034 38);
91
+ --ag-codex: oklch(67.3% 0.182 276.935);
92
+ --ag-codex-soft: oklch(25.7% 0.09 281.288);
93
+ --ag-pi: oklch(76.5% 0.177 163.223);
94
+ --ag-pi-soft: oklch(26.2% 0.051 172.552);
95
+ --ag-other: #959595;
96
+ --sig-correction: #e0e0e0;
97
+ --sig-reversal: #a3a3a3;
98
+ --sig-defect: #707070;
99
+ --sig-could_find: #ec4899;
100
+ }
101
+ }
102
+ :root[data-theme="dark"] {
103
+ color-scheme: dark;
104
+ --neutral-0: #070707;
105
+ --neutral-50: #111111;
106
+ --neutral-100: #161616;
107
+ --neutral-150: #1c1c1c;
108
+ --neutral-200: #222222;
109
+ --neutral-250: #292929;
110
+ --neutral-400: #4e4e4e;
111
+ --neutral-500: #707070;
112
+ --neutral-900: #f3f3f3;
113
+ --surface-base: #161616;
114
+ --surface-floating: #222222;
115
+ --surface-sunken: #111111;
116
+ --surface-hover: #ffffff09;
117
+ --surface-selected: rgb(255 255 255 / 0.08);
118
+ --text-default: #f3f3f3;
119
+ --text-muted: #b9b9b9;
120
+ --text-disabled: #707070;
121
+ --border-default: rgb(255 255 255 / 0.12);
122
+ --border-subtle: rgb(255 255 255 / 0.08);
123
+ --frame: rgb(255 255 255 / 0.14);
124
+ --frame-strong: rgb(255 255 255 / 0.24);
125
+ --primary-bg: #f5f5f5;
126
+ --primary-fg: #171717;
127
+ --accent: #8ba5df;
128
+ --focus: #8ba5df;
129
+ --destructive: oklch(70.4% 0.191 22.216);
130
+ --destructive-soft: oklch(70.4% 0.191 22.216 / 0.14);
131
+ --status-merged: oklch(71.4% 0.203 305.504);
132
+ --ag-claude: oklch(75% 0.183 55.934);
133
+ --ag-claude-soft: oklch(27.7% 0.034 38);
134
+ --ag-codex: oklch(67.3% 0.182 276.935);
135
+ --ag-codex-soft: oklch(25.7% 0.09 281.288);
136
+ --ag-pi: oklch(76.5% 0.177 163.223);
137
+ --ag-pi-soft: oklch(26.2% 0.051 172.552);
138
+ --ag-other: #959595;
139
+ --sig-correction: #e0e0e0;
140
+ --sig-reversal: #a3a3a3;
141
+ --sig-defect: #707070;
142
+ --sig-could_find: #ec4899;
143
+ }
144
+
145
+ * { box-sizing: border-box; }
146
+ html, body { height: 100%; }
147
+ body { margin: 0; background: var(--surface-base); color: var(--text-default); font: 14px/20px var(--sans); -webkit-font-smoothing: antialiased; }
148
+ a { color: var(--accent); text-decoration: none; }
149
+ a:hover { text-decoration: underline; }
150
+ :focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 4px; }
151
+ h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
152
+ h1 { font-size: 16px; line-height: 24px; }
153
+ h2 { font-size: 14px; line-height: 20px; }
154
+ h3 { font-size: 14px; }
155
+ p { margin: 0; }
156
+ code, .mono { font-family: var(--mono); font-size: 12px; }
157
+ code { background: var(--surface-sunken); padding: 1px 4px; border-radius: 4px; }
158
+ pre { font-family: var(--mono); font-size: 12px; line-height: 1.5; background: var(--surface-sunken); padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 0; white-space: pre-wrap; word-break: break-word; }
159
+ .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
160
+ .muted { color: var(--text-muted); }
161
+ .ink2 { color: var(--text-default); }
162
+ .small { font-size: 12px; line-height: 16px; }
163
+ .nowrap { white-space: nowrap; }
164
+ .loading { padding: 40px; color: var(--text-muted); }
165
+
166
+ /* ---------- app shell ---------- */
167
+ .app { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100%; }
168
+ .side { position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; align-self: start; display: flex; flex-direction: column; background: var(--surface-base); border-right: 1px solid var(--border-subtle); }
169
+ .side-top { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 12px; }
170
+ .logo { white-space: nowrap; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--text-default); }
171
+ .logo:hover { text-decoration: none; }
172
+ .logo-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--text-default); display: grid; place-items: center; color: var(--surface-floating); }
173
+ .workspace { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 8px; border-radius: 8px; background: var(--surface-floating); box-shadow: 0 0 0 1px var(--frame), var(--shadow-card); font: 12px var(--mono); color: var(--text-muted); }
174
+ .workspace.pick { padding: 0; background: none; box-shadow: none; }
175
+ .workspace.pick select { width: 100%; min-width: 0; font: 12px var(--mono); text-overflow: ellipsis; }
176
+ .group-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 6px; }
177
+ .table-wrap + .group-head { border-top: 1px solid var(--border-subtle); }
178
+ .nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 10px; }
179
+ .nav-label { padding: 12px 8px 4px; font-size: 12px; line-height: 16px; color: var(--text-muted); }
180
+ .nav a { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 8px; color: var(--text-default); font-size: 14px; }
181
+ .nav a svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--text-muted); }
182
+ .nav a:hover { background: var(--surface-hover); text-decoration: none; }
183
+ .nav a[aria-current="page"] { background: var(--surface-selected); font-weight: 600; }
184
+ .nav a[aria-current="page"] svg { color: var(--text-default); }
185
+ .nav .count { margin-left: auto; font: 12px var(--mono); font-weight: 400; color: var(--text-muted); }
186
+ .side-foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-muted); line-height: 16px; display: flex; flex-direction: column; gap: 4px; }
187
+ .side-foot .row { display: flex; justify-content: space-between; gap: 8px; }
188
+ .side-foot .row span:last-child { color: var(--text-default); font-family: var(--mono); font-variant-numeric: tabular-nums; }
189
+
190
+ .main { min-width: 0; display: flex; flex-direction: column; }
191
+ .topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; display: flex; align-items: center; gap: 12px; padding: 8px 24px; min-height: 52px; background: color-mix(in srgb, var(--surface-base) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
192
+ .crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
193
+ .crumbs a { color: var(--text-muted); }
194
+ .crumbs .sep { color: var(--text-disabled); }
195
+ .crumbs h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; line-height: 20px; font-weight: 500; }
196
+ .scope { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
197
+ .scope label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
198
+ .fresh { font: 12px var(--mono); color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; border-left: 1px solid var(--border-subtle); }
199
+ .fresh .live { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
200
+ .content { padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 16px; max-width: 1400px; width: 100%; }
201
+ .page-sub { font-size: 12px; color: var(--text-muted); margin-top: -6px; }
202
+
203
+ @media (max-width: 900px) {
204
+ .app { grid-template-columns: minmax(0, 1fr); }
205
+ .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
206
+ .side-top { padding: 10px 12px; }
207
+ .workspace, .side-foot, .nav-label, .nav .count { display: none; }
208
+ .workspace.pick { display: flex; min-width: 150px; }
209
+ .nav { flex-direction: row; padding: 6px 8px; }
210
+ .nav a { white-space: nowrap; }
211
+ .topbar { position: static; padding: 8px 16px; }
212
+ .scope { margin-left: 0; }
213
+ .content { padding: 16px 16px 40px; }
214
+ }
215
+
216
+ /* ---------- grid & cards ---------- */
217
+ .grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
218
+ .span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
219
+ .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
220
+ @media (max-width: 1100px) { .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } }
221
+ .grid > div > .card { height: 100%; }
222
+ .card { background: var(--surface-floating); border-radius: 12px; box-shadow: 0 0 0 1px var(--frame), var(--shadow-card); min-width: 0; display: flex; flex-direction: column; }
223
+ .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); min-height: 44px; flex-wrap: wrap; }
224
+ .card-head h2 { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/16px var(--mono); text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); }
225
+ .card-head .aside { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
226
+ .card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
227
+ .card-body.flush { padding: 0; }
228
+ .card-body.flush > .table-wrap { padding: 8px; }
229
+ .card-foot { padding: 10px 16px; border-top: 1px solid var(--border-subtle); font-size: 12px; }
230
+ .test-names { margin-top: 3px; font: 11px var(--mono); overflow-wrap: anywhere; }
231
+ .card-note { padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-muted); }
232
+ a.info:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
233
+ .info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border-default); color: var(--text-muted); font: 500 10px/1 var(--mono); text-transform: none; letter-spacing: 0; cursor: help; }
234
+ .empty { padding: 24px 16px; color: var(--text-muted); text-align: center; }
235
+
236
+ /* ---------- KPIs ---------- */
237
+ .kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
238
+ @media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
239
+ @media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
240
+ /* Rows with fewer tiles: equal columns, no empty cells. */
241
+ .kpis.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
242
+ .kpis.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
243
+ .kpis.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
244
+ @media (max-width: 1200px) { .kpis.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
245
+ @media (max-width: 700px) { .kpis.cols-3 { grid-template-columns: minmax(0, 1fr); } }
246
+ .kpi { padding: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--text-default); }
247
+ .kpi.link { cursor: pointer; }
248
+ .kpi.link:hover { box-shadow: 0 0 0 1px var(--frame-strong), var(--shadow-card); }
249
+ .kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 500 12px/16px var(--mono); text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); }
250
+ .kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
251
+ .kpi-value { font: 700 36px/40px var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
252
+ .kpi-value small { font-size: 16px; color: var(--text-muted); font-weight: 500; margin-left: 2px; letter-spacing: 0; }
253
+ .kpi-desc { font-size: 12px; line-height: 16px; color: var(--text-default); }
254
+ .kpi-sub { font-size: 12px; line-height: 16px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
255
+ .spark { width: 84px; height: 30px; flex: none; overflow: visible; }
256
+ .delta { font: 500 12px/18px var(--mono); padding: 0 5px; border-radius: 6px; font-variant-numeric: tabular-nums; background: var(--surface-selected); }
257
+ .delta.good { color: var(--text-default); }
258
+ .delta.bad { color: var(--destructive); background: var(--destructive-soft); }
259
+ .delta.flat { color: var(--text-muted); }
260
+
261
+ /* ---------- tables: styled as grouped lists ---------- */
262
+ .table-wrap { overflow-x: auto; }
263
+ table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
264
+ th { text-align: left; font: 500 12px/16px var(--mono); text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); padding: 10px 12px; background: var(--surface-sunken); position: sticky; top: 0; }
265
+ th:first-child { border-radius: 8px 0 0 8px; }
266
+ th:last-child { border-radius: 0 8px 8px 0; }
267
+ th.sortable { cursor: pointer; user-select: none; }
268
+ th.sortable:hover { color: var(--text-default); }
269
+ td { padding: 12px; vertical-align: middle; }
270
+ td:first-child { border-radius: 8px 0 0 8px; }
271
+ td:last-child { border-radius: 0 8px 8px 0; }
272
+ tr.click { cursor: pointer; }
273
+ tr.click:hover td { background: var(--surface-hover); }
274
+ td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
275
+ td.r { font-family: var(--mono); font-size: 12px; }
276
+ td.top { vertical-align: top; }
277
+ .cell-title { font-weight: 500; color: var(--text-default); line-height: 20px; }
278
+ /* width 0 + min-width 100%: a long prompt line fills its cell but never widens the table. */
279
+ .cell-sub { font-size: 12px; line-height: 16px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 0; min-width: 100%; }
280
+ .inline-bar { display: flex; align-items: center; gap: 8px; min-width: 90px; font: 12px var(--mono); }
281
+ .inline-bar .track { flex: 1; height: 8px; }
282
+ /* Narrow cards: less padding and shorter bars so four columns fit. */
283
+ .table-wrap.tight th, .table-wrap.tight td { padding-left: 8px; padding-right: 8px; }
284
+ .table-wrap.tight .inline-bar { min-width: 60px; gap: 6px; }
285
+
286
+ /* ---------- toolbar & controls ---------- */
287
+ .toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
288
+ .toolbar .spacer { flex: 1; }
289
+ button, select, input[type="search"], input[type="text"], input[type="password"], textarea { font: inherit; font-size: 14px; color: var(--text-default); background: var(--surface-floating); border: 0; border-radius: 8px; box-shadow: 0 0 0 1px var(--frame), var(--shadow-card); }
290
+ button { height: 32px; padding: 0 12px; cursor: pointer; font-weight: 400; }
291
+ button:hover { background: color-mix(in srgb, var(--surface-floating), var(--text-default) 4%); }
292
+ button:disabled { opacity: 0.5; cursor: default; }
293
+ button.primary { background: var(--primary-bg); color: var(--primary-fg); box-shadow: none; }
294
+ /* Segmented filters: outline buttons, the pressed one filled. */
295
+ .seg-ctl { display: inline-flex; flex-wrap: wrap; gap: 4px; }
296
+ .seg-ctl button { background: transparent; box-shadow: none; border: 1px solid var(--border-default); }
297
+ .seg-ctl button:hover { background: var(--surface-hover); }
298
+ .seg-ctl button[aria-pressed="true"] { background: var(--surface-selected); font-weight: 600; }
299
+ .seg-ctl .n { color: var(--text-muted); margin-left: 6px; font: 400 12px var(--mono); font-variant-numeric: tabular-nums; }
300
+ select, input[type="search"], input[type="text"], input[type="password"] { padding: 0 10px; height: 32px; }
301
+ input[type="search"] { width: 240px; max-width: 100%; }
302
+ textarea { width: 100%; padding: 8px 10px; resize: vertical; min-height: 64px; }
303
+ .check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-default); }
304
+ .linklike { height: auto; background: none; box-shadow: none; padding: 0; color: var(--accent); font-weight: 400; cursor: pointer; font-size: inherit; }
305
+ .linklike:hover { background: none; text-decoration: underline; }
306
+
307
+ /* ---------- settings ---------- */
308
+ .settings { max-width: 860px; }
309
+ .settings form { display: flex; flex-direction: column; gap: 12px; }
310
+ .settings td input { width: 100%; min-width: 180px; font-family: var(--mono); font-size: 12px; }
311
+ .settings .key-row { display: flex; flex-direction: row; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
312
+ .settings .key-row label { font-weight: 500; }
313
+ .settings #key { width: 260px; max-width: 100%; }
314
+ .settings .bad { color: var(--destructive); }
315
+
316
+ /* ---------- projects ---------- */
317
+ .projects { max-width: 860px; }
318
+ .projects .card-body { display: flex; flex-direction: column; gap: 12px; }
319
+ .projects .bad { color: var(--destructive); }
320
+ .projects p { margin: 0; }
321
+ .run-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
322
+ .run-row.start { justify-content: flex-start; }
323
+ .run-row progress { flex: 1; min-width: 160px; height: 8px; accent-color: var(--accent); }
324
+ .run-box { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
325
+ .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
326
+
327
+ /* ---------- chips ---------- */
328
+ .pill { display: inline-flex; align-items: center; gap: 5px; padding: 0 6px; border-radius: 6px; font: 500 12px/20px var(--sans); white-space: nowrap; background: var(--surface-selected); color: var(--text-muted); }
329
+ .pill.accent { color: var(--text-default); font-weight: 600; }
330
+ .pill.mono { font-family: var(--mono); font-weight: 400; }
331
+ .agent-chip { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 6px; font: 500 12px/20px var(--mono); white-space: nowrap; background: var(--ag-other-soft); color: var(--ag-other); }
332
+ .agent-chip.claude { background: var(--ag-claude-soft); color: var(--ag-claude); }
333
+ .agent-chip.codex { background: var(--ag-codex-soft); color: var(--ag-codex); }
334
+ .agent-chip.pi { background: var(--ag-pi-soft); color: var(--ag-pi); }
335
+ .outcome { font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
336
+ .outcome::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--text-disabled)); }
337
+ .outcome.shipped_or_pr_ready { --c: var(--status-merged); color: var(--text-default); }
338
+ .pr-state { font: 12px var(--mono); color: var(--text-muted); }
339
+
340
+ /* ---------- signals ---------- */
341
+ .sig { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-default); white-space: nowrap; }
342
+ .glyph { display: inline-block; width: 9px; height: 9px; flex: none; background: var(--c); }
343
+ .glyph.correction { --c: var(--sig-correction); border-radius: 50%; }
344
+ .glyph.reversal { --c: var(--sig-reversal); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
345
+ .glyph.could_find { --c: var(--sig-could_find); border-radius: 2px; }
346
+ .glyph.defect { --c: var(--sig-defect); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
347
+ .glyph.not_filed { --c: var(--sig-not_filed); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 70%, 70% 70%, 70% 30%, 0 30%); }
348
+ .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
349
+ .mini { display: inline-flex; gap: 8px; }
350
+
351
+ /* ---------- charts ---------- */
352
+ .bars { display: flex; flex-direction: column; gap: 4px; }
353
+ .bar-row { display: grid; grid-template-columns: minmax(90px, 180px) minmax(0, 1fr) 72px; gap: 10px; align-items: center; font-size: 14px; padding: 2px 0; }
354
+ .bar-row .lab { color: var(--text-default); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
355
+ .bar-row .val { text-align: right; font: 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--text-default); }
356
+ .bar-row.link { cursor: pointer; border-radius: 8px; }
357
+ .bar-row.link:hover .lab { text-decoration: underline; }
358
+ .track { height: 12px; display: flex; gap: 2px; align-items: stretch; }
359
+ .seg { height: 100%; background: var(--c, var(--text-muted)); min-width: 2px; }
360
+ .seg:last-child { border-radius: 0 3px 3px 0; }
361
+ .legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-default); }
362
+ .legend span { display: inline-flex; align-items: center; gap: 5px; }
363
+ .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
364
+ .chart .grid-line { stroke: var(--border-subtle); stroke-width: 1; }
365
+ .chart .axis-text { fill: var(--text-muted); font-size: 11px; font-family: var(--mono); }
366
+ .chart .cross { stroke: var(--border-default); stroke-width: 1; opacity: 0; }
367
+ .chart .hover-band:hover .cross { opacity: 1; }
368
+ .cols { display: flex; align-items: flex-end; gap: 6px; height: 150px; border-bottom: 1px solid var(--border-default); }
369
+ /* A column chart that fills its card: the bars take whatever height the card has. */
370
+ .col-chart { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 180px; }
371
+ .col-chart .cols { flex: 1; height: auto; }
372
+ .col { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; min-width: 10px; height: 100%; }
373
+ .col .seg { width: 100%; }
374
+ .col .seg:last-child { border-radius: 3px 3px 0 0; }
375
+ .col-labels { display: flex; gap: 6px; font: 11px var(--mono); color: var(--text-muted); }
376
+ .col-labels span { flex: 1; text-align: center; min-width: 10px; font-variant-numeric: tabular-nums; }
377
+ .stack-bar { display: flex; height: 10px; gap: 2px; border-radius: 3px; overflow: hidden; }
378
+ .stack-bar span { background: var(--c); }
379
+ .tip { position: fixed; z-index: 50; pointer-events: none; max-width: 300px; padding: 8px 10px; border-radius: 8px; background: var(--text-default); color: var(--surface-base); font-size: 12px; line-height: 16px; box-shadow: var(--shadow-popover); white-space: pre-line; }
380
+
381
+ /* ---------- detail layout (issue-style) ---------- */
382
+ .detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
383
+ @media (max-width: 1100px) { .detail { grid-template-columns: minmax(0, 1fr); } }
384
+ .detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
385
+ .props { position: sticky; top: 68px; }
386
+ .props dl { margin: 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 16px; font-size: 14px; }
387
+ .props dt { font: 500 12px/20px var(--mono); text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); }
388
+ .props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
389
+ .props .section { border-top: 1px solid var(--border-subtle); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
390
+ .props .section h3 { font: 500 12px/16px var(--mono); text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); }
391
+ .props select, .props input[type="text"] { width: 100%; }
392
+ .issue-title { font-size: 20px; line-height: 28px; font-weight: 600; }
393
+ .summary { padding: 10px 12px; border-radius: 8px; background: var(--surface-sunken); color: var(--text-default); font-size: 14px; }
394
+ .prose { color: var(--text-default); display: flex; flex-direction: column; gap: 8px; max-width: 80ch; }
395
+ .prose ul, .prose ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
396
+ .change-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
397
+ .change-body { padding: 12px 16px; border-radius: 8px; background: var(--surface-sunken); color: var(--text-default); display: flex; flex-direction: column; gap: 8px; }
398
+ .change-body ul, .change-body ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
399
+ .pager { display: flex; gap: 6px; margin-left: auto; }
400
+ .pager a { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border-default); border-radius: 8px; color: var(--text-default); }
401
+ .pager a:hover { background: var(--surface-hover); text-decoration: none; }
402
+ .pager a[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
403
+
404
+ /* ---------- evidence ---------- */
405
+ .evlist { display: flex; flex-direction: column; padding: 4px 8px; }
406
+ .ev { display: flex; flex-direction: column; gap: 6px; padding: 12px 8px; border-radius: 8px; color: inherit; }
407
+ a.ev:hover { background: var(--surface-hover); text-decoration: none; }
408
+ .ev-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 12px var(--mono); color: var(--text-muted); }
409
+ .ev-head .src { font-family: var(--sans); color: var(--text-default); font-weight: 500; }
410
+ .quote { border-left: 2px solid var(--border-default); padding-left: 10px; color: var(--text-default); white-space: pre-wrap; word-break: break-word; }
411
+ .quote.agent { border-left-color: var(--border-subtle); color: var(--text-muted); }
412
+ details > summary { cursor: pointer; color: var(--text-default); font-size: 12px; list-style: none; }
413
+ details > summary::-webkit-details-marker { display: none; }
414
+ details > summary::before { content: "▸"; display: inline-block; width: 13px; color: var(--text-muted); }
415
+ details[open] > summary::before { content: "▾"; }
416
+ .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
417
+ .tabs { display: flex; gap: 2px; }
418
+ .tabs button { height: 28px; background: none; box-shadow: none; padding: 0 8px; color: var(--text-muted); }
419
+ .tabs button:hover { background: var(--surface-hover); }
420
+ .tabs button[aria-pressed="true"] { background: var(--surface-selected); color: var(--text-default); font-weight: 600; }
421
+
422
+ /* ---------- transcript ---------- */
423
+ .strip { position: relative; height: 26px; border-radius: 8px; background: var(--surface-sunken); }
424
+ .strip button.mark { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 18px; height: 18px; padding: 0; box-shadow: none; background: transparent; display: grid; place-items: center; }
425
+ .strip button.mark .glyph { width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--surface-sunken); }
426
+ .strip button.mark:hover { background: transparent; }
427
+ .strip button.mark:hover .glyph { transform: scale(1.3); }
428
+ .transcript { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
429
+ .msg { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 8px; scroll-margin-top: 132px; }
430
+ .msg.human { background: var(--surface-sunken); }
431
+ .msg.agent { background: var(--surface-floating); border: 1px solid var(--border-subtle); }
432
+ .msg.injected { background: transparent; border: 1px dashed var(--border-default); color: var(--text-muted); font-size: 12px; }
433
+ .msg.focus { outline: 2px solid var(--focus); }
434
+ .msg-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 12px var(--mono); color: var(--text-muted); }
435
+ .msg-head .who { font-family: var(--sans); font-weight: 600; color: var(--text-default); }
436
+ .msg-body { white-space: pre-wrap; word-break: break-word; }
437
+ .msg-body.md { white-space: normal; display: flex; flex-direction: column; gap: 8px; }
438
+ .msg-body.md ul, .msg-body.md ol { margin: 0; padding-left: 20px; }
439
+ .clamp { max-height: 7.5em; overflow: hidden; position: relative; }
440
+ .clamp::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2.5em; background: linear-gradient(transparent, var(--surface-floating)); }
441
+ .msg.human .clamp::after { background: linear-gradient(transparent, var(--surface-sunken)); }
442
+ .agent-run { display: flex; flex-direction: column; gap: 8px; padding-left: 12px; border-left: 2px solid var(--border-subtle); }
443
+ .tools { font-size: 12px; }
444
+ .tools table { font-size: 12px; margin-top: 6px; }
445
+ .tools td { padding: 4px 8px; vertical-align: top; }
446
+ .tools td.in { font-family: var(--mono); word-break: break-all; }
447
+ .tools tr.err td { background: var(--destructive-soft); }
448
+ .errtxt { color: var(--destructive); font-weight: 500; }
449
+ .flagnote { font-size: 12px; color: var(--text-default); display: flex; gap: 6px; align-items: center; }
450
+
451
+ @media (prefers-reduced-motion: no-preference) {
452
+ .strip button.mark .glyph { transition: transform 0.12s; }
453
+ }
454
+
455
+ /* ---------- definitions ---------- */
456
+ .defs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
457
+ .toc { position: sticky; top: 68px; padding: 8px; max-height: calc(100vh - 84px); overflow-y: auto; }
458
+ .toc-group { display: flex; flex-direction: column; gap: 2px; }
459
+ .toc a { padding: 6px 8px; border-radius: 8px; color: var(--text-default); font-size: 14px; }
460
+ .toc a:hover { background: var(--surface-hover); text-decoration: none; }
461
+ .toc a[aria-current="true"] { background: var(--surface-selected); font-weight: 600; }
462
+ .defs-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
463
+ .def { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border-subtle); scroll-margin-top: 76px; max-width: 80ch; }
464
+ .def:first-child { border-top: 0; padding-top: 0; }
465
+ .def.focus { background: var(--surface-selected); margin-inline: -16px; padding-inline: 16px; border-radius: 8px; }
466
+ .def-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
467
+ .def-meta { color: var(--text-default); font-size: 14px; }
468
+ .def-meta span { display: inline-block; min-width: 124px; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); }
469
+ .def-list { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 4px 12px; margin: 2px 0; font-size: 14px; }
470
+ .def-list dt { font-weight: 500; }
471
+ .def-list dd { margin: 0; color: var(--text-default); }
472
+ @media (max-width: 900px) { .defs { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
473
+
474
+ /* ---------- overview intro ---------- */
475
+ .intro { overflow: hidden; }
476
+ .intro-head { padding: 24px 24px 20px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--border-subtle); }
477
+ .intro-head h2 { font: 400 30px/36px var(--sans); }
478
+ .intro-head p { color: var(--text-default); max-width: 90ch; }
479
+ .intro-stats { font: 12px/16px var(--mono); color: var(--text-muted) !important; font-variant-numeric: tabular-nums; }
480
+ .findings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
481
+ .finding-cell { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; border-left: 1px solid var(--border-subtle); }
482
+ .finding-cell:first-child { border-left: 0; }
483
+ .finding-big { font: 700 36px/40px var(--mono); letter-spacing: -0.02em; color: var(--text-default); }
484
+ .finding-eyebrow { font: 500 12px/16px var(--mono); letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
485
+ .finding-title { font-size: 14px; font-weight: 600; line-height: 20px; color: var(--text-default); }
486
+ .finding-detail { font-size: 14px; color: var(--text-muted); line-height: 20px; overflow-wrap: anywhere; }
487
+ .finding-go { margin-top: auto; padding-top: 4px; font-size: 14px; }
488
+ .section-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 12px 0 -4px; }
489
+ .section-title h2 { font: 500 12px/16px var(--mono); text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); }
490
+ .section-title span { font-size: 12px; color: var(--text-muted); }
491
+ @media (max-width: 1000px) { .findings { grid-template-columns: minmax(0, 1fr); } .finding-cell { border-left: 0; border-top: 1px solid var(--border-subtle); } .finding-cell:first-child { border-top: 0; } }
492
+ .method-intro { padding: 24px; display: flex; flex-direction: column; gap: 6px; }
493
+ .method-intro h2 { font: 400 30px/36px var(--sans); }
494
+ .method-intro p { color: var(--text-default); max-width: 80ch; }
495
+ .step { scroll-margin-top: 76px; }
496
+ .step.focus { outline: 2px solid var(--focus); }
497
+ .step-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
498
+ .step-head h2 { font-size: 16px; line-height: 24px; }
499
+ .step-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-selected); color: var(--text-default); font: 500 12px var(--mono); flex: none; }
500
+ .step-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; color: var(--text-default); max-width: 86ch; }
501
+ .step-body ol, .step-body ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
502
+ .step-body strong { color: var(--text-default); font-weight: 600; }
503
+ .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-muted); padding-top: 2px; }
504
+ .facts b { font: 700 14px var(--mono); color: var(--text-default); margin-right: 4px; }
505
+ .step-lede p { color: var(--text-default); font-weight: 600; font-size: 14px; }
506
+ .glance { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
507
+ .glance-step { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-left: 1px solid var(--border-subtle); color: var(--text-default); }
508
+ .glance-step:first-child { border-left: 0; }
509
+ .glance-step:hover { background: var(--surface-hover); text-decoration: none; }
510
+ .glance-name { display: flex; align-items: center; gap: 8px; font: 500 12px/16px var(--mono); text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); }
511
+ .glance-name .step-n { width: 20px; height: 20px; font-size: 11px; }
512
+ .glance-num { font: 700 24px/32px var(--mono); margin-top: 4px; }
513
+ .glance-label { font-size: 12px; color: var(--text-muted); }
514
+ @media (max-width: 1000px) { .glance { grid-template-columns: repeat(3, minmax(0, 1fr)); } .glance-step:nth-child(4) { border-left: 0; } .glance-step:nth-child(n+4) { border-top: 1px solid var(--border-subtle); } }
515
+ @media (max-width: 520px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } .glance-step:nth-child(odd) { border-left: 0; } .glance-step:nth-child(4) { border-left: 1px solid var(--border-subtle); } .glance-step:nth-child(n+3) { border-top: 1px solid var(--border-subtle); } }
516
+ /* Session page: the friction strip stays in view under the top bar, so its marks work as navigation. */
517
+ .strip-bar { position: sticky; top: 52px; z-index: 6; display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; background: var(--surface-floating); border-bottom: 1px solid var(--border-subtle); }
518
+ @media (max-width: 900px) { .strip-bar { top: 0; } .msg { scroll-margin-top: 80px; } }
519
+ .intro-repo { font: 12px/16px var(--mono); color: var(--text-muted) !important; margin-top: -2px; }
520
+ .chart .note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
debrief/skills.py ADDED
@@ -0,0 +1,107 @@
1
+ """Find skill and slash-command uses in normalized sessions.
2
+
3
+ One row per skill or slash-command use:
4
+ human: a typed "/command" (Claude Code, Codex, Pi) or a Codex "<skill>" block
5
+ injected after a "$skill" mention.
6
+ agent: a Claude Code Skill tool call, or a Codex/Pi tool call that reads a
7
+ SKILL.md file (Claude Code's own SKILL.md reads are repo work, not uses).
8
+ """
9
+
10
+ import json
11
+ import re
12
+ import sqlite3
13
+
14
+ # Built-in CLI commands that take no skill or prompt file; not counted as skill uses.
15
+ BUILTIN_COMMANDS = {
16
+ "add-dir", "agents", "bashes", "clear", "compact", "config", "context", "cost", "doctor", "exit", "export",
17
+ "help", "hooks", "ide", "login", "logout", "mcp", "memory", "model", "permissions", "plugin", "resume",
18
+ "rewind", "status", "statusline", "terminal-setup", "todos", "usage", "vim",
19
+ }
20
+ SLASH_RE = re.compile(r"/([A-Za-z][\w:.-]*)(?=\s|$)") # typed command; "/var/x" fails the lookahead
21
+ SKILL_BLOCK_RE = re.compile(r"\s*<skill>\s*<name>([^<]+)</name>") # Codex expansion of a "$skill" mention
22
+ SKILL_PATH_RE = re.compile(r"[\w.~/-]+/SKILL\.md")
23
+ NOT_A_READ_RE = re.compile(r"\b(?:ls|wc|find|stat)\s[^'\"\n;|&]*$") # listing a skill file is not using it
24
+ COLUMNS = ["session_id", "msg_idx", "skill", "invoked_by", "agent", "model", "ts"]
25
+
26
+
27
+ def skill_from_path(path: str) -> str | None:
28
+ """Name a skill from its SKILL.md path, keeping the plugin namespace.
29
+
30
+ plugins/cache/skills/entire/0.7.0/skills/review/SKILL.md -> entire:review
31
+ .codex/superpowers/skills/brainstorming/SKILL.md -> superpowers:brainstorming
32
+ .agents/skills/superpowers/brainstorming/SKILL.md -> superpowers:brainstorming
33
+ .agents/skills/pfleidi/skills/pr/SKILL.md -> pfleidi:pr
34
+ .agents/skills/test-auditor/SKILL.md -> test-auditor
35
+ """
36
+ parts = path.split("/")
37
+ if len(parts) < 2 or not re.fullmatch(r"[a-z0-9][\w.-]*", parts[-2]):
38
+ return None
39
+ name, parent = parts[-2], parts[-3] if len(parts) > 2 else ""
40
+ if parent != "skills":
41
+ grand = parts[-4] if len(parts) > 3 else ""
42
+ return f"{parent}:{name}" if grand == "skills" and not parent.startswith(".") else name
43
+ owners = [p for p in parts[:-3] if p and not re.match(r"\d", p)] # skip version dirs
44
+ owner = owners[-1] if owners else ""
45
+ nested = len(parts) > 4 and parts[-5] == "skills"
46
+ if owner == "superpowers" or nested or ("plugins" in parts and owner != "cache"):
47
+ return f"{owner}:{name}"
48
+ return name
49
+
50
+
51
+ def skills_read(tool_input) -> list[str]:
52
+ text = str(tool_input or "")
53
+ found = (
54
+ skill_from_path(m.group())
55
+ for m in SKILL_PATH_RE.finditer(text)
56
+ if not NOT_A_READ_RE.search(text[max(0, m.start() - 60) : m.start()])
57
+ )
58
+ return [s for s in dict.fromkeys(found) if s]
59
+
60
+
61
+ def slash_skill(text) -> str | None:
62
+ m = SLASH_RE.match(str(text or ""))
63
+ if not m:
64
+ return None
65
+ name = m.group(1).removeprefix("skill:") # Pi spells skills "/skill:name"
66
+ return None if name in BUILTIN_COMMANDS else name
67
+
68
+
69
+ def _skill_arg(raw) -> str:
70
+ try:
71
+ val = json.loads(raw) if raw else {}
72
+ except (TypeError, json.JSONDecodeError):
73
+ return ""
74
+ return str(val.get("skill") or "").lstrip("/") if isinstance(val, dict) else ""
75
+
76
+
77
+ def uses(conn: sqlite3.Connection) -> list[dict]:
78
+ """Every skill use, oldest first; one row per skill per message."""
79
+ msgs = conn.execute("""
80
+ SELECT m.session_id, m.idx AS msg_idx, m.user_kind, m.text, m.ts, s.agent, s.model
81
+ FROM messages m JOIN sessions s ON s.session_id = m.session_id
82
+ WHERE m.role = 'user' AND (m.text LIKE '/%' OR m.text LIKE '%<skill>%')
83
+ """).fetchall()
84
+ calls = conn.execute("""
85
+ SELECT c.session_id, c.msg_idx, c.name, c.input, m.ts, s.agent, s.model
86
+ FROM tool_calls c
87
+ JOIN sessions s ON s.session_id = c.session_id
88
+ LEFT JOIN messages m ON m.session_id = c.session_id AND m.idx = c.msg_idx
89
+ WHERE (s.agent = 'Claude Code' AND c.name = 'Skill')
90
+ OR (s.agent != 'Claude Code' AND c.input LIKE '%SKILL.md%' AND COALESCE(c.writes, 0) = 0
91
+ AND c.name NOT IN ('apply_patch', 'edit', 'write'))
92
+ """).fetchall()
93
+ rows = []
94
+ for r in msgs:
95
+ block = SKILL_BLOCK_RE.match(str(r[3] or ""))
96
+ skill = block.group(1).strip() if block else (slash_skill(r[3]) if r[2] == "human" else None)
97
+ if skill:
98
+ rows.append((r[0], r[1], skill, "human", r[5], r[6], r[4]))
99
+ for r in calls:
100
+ found = [_skill_arg(r[3])] if r[2] == "Skill" else skills_read(r[3])
101
+ rows += [(r[0], r[1], s, "agent", r[5], r[6], r[4]) for s in found if s]
102
+ seen, out = set(), []
103
+ for row in sorted(rows, key=lambda x: (x[6] or "", x[0], x[1])):
104
+ if (key := row[:3]) not in seen:
105
+ seen.add(key)
106
+ out.append(dict(zip(COLUMNS, row, strict=True)))
107
+ return out