@silo-ai/silo 0.0.0 → 0.1.0
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.
- package/LICENSE +224 -0
- package/README.md +110 -0
- package/dist/bin.d.mts +1 -0
- package/dist/bin.mjs +3338 -0
- package/dist/report-viewer.css +428 -0
- package/package.json +49 -8
- package/skills/silo/SKILL.md +101 -0
- package/skills/silo/agents/openai.yaml +4 -0
- package/skills/silo/schemas/report-put.schema.json +45 -0
- package/skills/silo/schemas/row-write.schema.json +7 -0
- package/skills/silo/schemas/table-alter.schema.json +15 -0
- package/skills/silo/schemas/table-create.schema.json +188 -0
- package/skills/silo/tasks/alter-table.md +25 -0
- package/skills/silo/tasks/create-report.md +43 -0
- package/skills/silo/tasks/create-table.md +36 -0
- package/skills/silo/tasks/query-with-sql.md +27 -0
- package/skills/silo/tasks/synchronize.md +34 -0
- package/skills/silo/tasks/update-with-revision.md +22 -0
- package/skills/silo/tasks/upsert-rows.md +18 -0
- package/templates/tasks.json +287 -0
- package/readme.md +0 -1
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light dark;
|
|
3
|
+
--background: #f4f1ea;
|
|
4
|
+
--surface: rgba(255, 255, 255, 0.88);
|
|
5
|
+
--surface-strong: #ffffff;
|
|
6
|
+
--ink: #18201d;
|
|
7
|
+
--muted: #68716d;
|
|
8
|
+
--line: rgba(24, 32, 29, 0.13);
|
|
9
|
+
--accent: #1d6b52;
|
|
10
|
+
--accent-soft: #dcece5;
|
|
11
|
+
--danger: #a44037;
|
|
12
|
+
--shadow: 0 24px 70px rgba(51, 45, 32, 0.1);
|
|
13
|
+
font-family:
|
|
14
|
+
Inter,
|
|
15
|
+
ui-sans-serif,
|
|
16
|
+
-apple-system,
|
|
17
|
+
BlinkMacSystemFont,
|
|
18
|
+
'Segoe UI',
|
|
19
|
+
sans-serif;
|
|
20
|
+
font-synthesis: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
* {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
margin: 0;
|
|
29
|
+
min-width: 320px;
|
|
30
|
+
min-height: 100vh;
|
|
31
|
+
color: var(--ink);
|
|
32
|
+
background:
|
|
33
|
+
radial-gradient(circle at 8% 0%, rgba(29, 107, 82, 0.1), transparent 30rem),
|
|
34
|
+
linear-gradient(180deg, #f8f6f1, var(--background));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.site-header {
|
|
38
|
+
position: sticky;
|
|
39
|
+
z-index: 10;
|
|
40
|
+
top: 0;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
min-height: 4.25rem;
|
|
45
|
+
padding: 0.7rem max(1.25rem, calc((100vw - 90rem) / 2));
|
|
46
|
+
border-bottom: 1px solid var(--line);
|
|
47
|
+
background: rgba(248, 246, 241, 0.82);
|
|
48
|
+
backdrop-filter: blur(18px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.brand {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
gap: 0.7rem;
|
|
54
|
+
align-items: center;
|
|
55
|
+
color: inherit;
|
|
56
|
+
font-size: 0.82rem;
|
|
57
|
+
font-weight: 750;
|
|
58
|
+
letter-spacing: 0.08em;
|
|
59
|
+
text-decoration: none;
|
|
60
|
+
text-transform: uppercase;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.brand-mark {
|
|
64
|
+
display: grid;
|
|
65
|
+
width: 2rem;
|
|
66
|
+
height: 2rem;
|
|
67
|
+
place-items: center;
|
|
68
|
+
border-radius: 0.6rem;
|
|
69
|
+
color: #fff;
|
|
70
|
+
background: var(--accent);
|
|
71
|
+
box-shadow: 0 5px 16px rgba(29, 107, 82, 0.24);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.refresh-state {
|
|
75
|
+
display: flex;
|
|
76
|
+
gap: 0.5rem;
|
|
77
|
+
align-items: center;
|
|
78
|
+
color: var(--muted);
|
|
79
|
+
font-size: 0.82rem;
|
|
80
|
+
font-weight: 650;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.status-dot {
|
|
84
|
+
width: 0.55rem;
|
|
85
|
+
height: 0.55rem;
|
|
86
|
+
border-radius: 999px;
|
|
87
|
+
background: var(--accent);
|
|
88
|
+
box-shadow: 0 0 0 0.25rem var(--accent-soft);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[data-refresh-state='refreshing'] .status-dot {
|
|
92
|
+
animation: pulse 1.2s ease-in-out infinite;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[data-refresh-state='stale'] .status-dot {
|
|
96
|
+
background: var(--danger);
|
|
97
|
+
box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--danger) 14%, transparent);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.page-shell {
|
|
101
|
+
display: grid;
|
|
102
|
+
grid-template-columns: minmax(0, 1fr) 19rem;
|
|
103
|
+
gap: 1.5rem;
|
|
104
|
+
width: min(90rem, 100%);
|
|
105
|
+
margin: 0 auto;
|
|
106
|
+
padding: clamp(1.25rem, 3vw, 3rem);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.report-card,
|
|
110
|
+
.metadata-card,
|
|
111
|
+
.query-panel {
|
|
112
|
+
border: 1px solid var(--line);
|
|
113
|
+
background: var(--surface);
|
|
114
|
+
box-shadow: var(--shadow);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.report-card {
|
|
118
|
+
min-width: 0;
|
|
119
|
+
padding: clamp(1.5rem, 4vw, 4.5rem);
|
|
120
|
+
border-radius: 1.25rem;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.report-sidebar {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 1rem;
|
|
127
|
+
align-self: start;
|
|
128
|
+
position: sticky;
|
|
129
|
+
top: 5.75rem;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.metadata-card,
|
|
133
|
+
.query-panel {
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
border-radius: 1rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.metadata-card {
|
|
139
|
+
padding: 1.25rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.eyebrow {
|
|
143
|
+
margin: 0 0 0.35rem;
|
|
144
|
+
color: var(--accent);
|
|
145
|
+
font-size: 0.72rem;
|
|
146
|
+
font-weight: 800;
|
|
147
|
+
letter-spacing: 0.12em;
|
|
148
|
+
text-transform: uppercase;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.metadata-card h2 {
|
|
152
|
+
margin: 0;
|
|
153
|
+
font-family: Georgia, 'Times New Roman', serif;
|
|
154
|
+
font-size: 1.25rem;
|
|
155
|
+
line-height: 1.2;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.metadata-card dl {
|
|
159
|
+
display: grid;
|
|
160
|
+
gap: 0.8rem;
|
|
161
|
+
margin: 1.25rem 0 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.metadata-card dl div {
|
|
165
|
+
display: grid;
|
|
166
|
+
gap: 0.2rem;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.metadata-card dt {
|
|
170
|
+
color: var(--muted);
|
|
171
|
+
font-size: 0.72rem;
|
|
172
|
+
font-weight: 700;
|
|
173
|
+
letter-spacing: 0.05em;
|
|
174
|
+
text-transform: uppercase;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.metadata-card dd {
|
|
178
|
+
margin: 0;
|
|
179
|
+
font-size: 0.86rem;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.refresh-error {
|
|
183
|
+
margin: 1rem 0 0;
|
|
184
|
+
padding: 0.75rem;
|
|
185
|
+
border-radius: 0.65rem;
|
|
186
|
+
color: var(--danger);
|
|
187
|
+
background: color-mix(in srgb, var(--danger) 8%, transparent);
|
|
188
|
+
font-size: 0.82rem;
|
|
189
|
+
line-height: 1.45;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.query-panel summary {
|
|
193
|
+
padding: 1rem 1.15rem;
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
font-size: 0.85rem;
|
|
196
|
+
font-weight: 720;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.query-panel summary:focus-visible,
|
|
200
|
+
a:focus-visible {
|
|
201
|
+
outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent);
|
|
202
|
+
outline-offset: 3px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.query-list {
|
|
206
|
+
display: grid;
|
|
207
|
+
gap: 1rem;
|
|
208
|
+
padding: 0 1rem 1rem;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.query-list h3 {
|
|
212
|
+
margin: 0 0 0.45rem;
|
|
213
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
214
|
+
font-size: 0.78rem;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.query-list pre {
|
|
218
|
+
max-height: 18rem;
|
|
219
|
+
margin: 0;
|
|
220
|
+
padding: 0.8rem;
|
|
221
|
+
overflow: auto;
|
|
222
|
+
border: 1px solid var(--line);
|
|
223
|
+
border-radius: 0.65rem;
|
|
224
|
+
background: color-mix(in srgb, var(--surface-strong) 72%, var(--background));
|
|
225
|
+
font-size: 0.72rem;
|
|
226
|
+
line-height: 1.5;
|
|
227
|
+
white-space: pre-wrap;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.report-markdown {
|
|
231
|
+
font-family: Georgia, 'Times New Roman', serif;
|
|
232
|
+
font-size: clamp(1rem, 0.96rem + 0.18vw, 1.12rem);
|
|
233
|
+
line-height: 1.75;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.report-markdown > :first-child {
|
|
237
|
+
margin-top: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.report-markdown > :last-child {
|
|
241
|
+
margin-bottom: 0;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.report-markdown h1,
|
|
245
|
+
.report-markdown h2,
|
|
246
|
+
.report-markdown h3 {
|
|
247
|
+
color: var(--ink);
|
|
248
|
+
line-height: 1.14;
|
|
249
|
+
text-wrap: balance;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.report-markdown h1 {
|
|
253
|
+
max-width: 18ch;
|
|
254
|
+
margin: 0 0 2rem;
|
|
255
|
+
font-size: clamp(2.35rem, 6vw, 5.3rem);
|
|
256
|
+
font-weight: 500;
|
|
257
|
+
letter-spacing: -0.045em;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.report-markdown h2 {
|
|
261
|
+
margin: 2.8rem 0 1rem;
|
|
262
|
+
padding-top: 1.5rem;
|
|
263
|
+
border-top: 1px solid var(--line);
|
|
264
|
+
font-size: clamp(1.55rem, 3vw, 2.15rem);
|
|
265
|
+
font-weight: 560;
|
|
266
|
+
letter-spacing: -0.025em;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.report-markdown h3 {
|
|
270
|
+
margin-top: 2rem;
|
|
271
|
+
font-size: 1.25rem;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.report-markdown a {
|
|
275
|
+
color: var(--accent);
|
|
276
|
+
text-decoration-thickness: 0.08em;
|
|
277
|
+
text-underline-offset: 0.14em;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.report-markdown code {
|
|
281
|
+
border-radius: 0.28rem;
|
|
282
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
283
|
+
font-size: 0.84em;
|
|
284
|
+
background: var(--accent-soft);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.report-markdown :not(pre) > code {
|
|
288
|
+
padding: 0.12em 0.35em;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.report-markdown pre {
|
|
292
|
+
padding: 1rem 1.1rem;
|
|
293
|
+
overflow: auto;
|
|
294
|
+
border: 1px solid var(--line);
|
|
295
|
+
border-radius: 0.8rem;
|
|
296
|
+
background: #18201d;
|
|
297
|
+
color: #edf3ef;
|
|
298
|
+
line-height: 1.55;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.report-markdown pre code {
|
|
302
|
+
background: transparent;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.report-markdown blockquote {
|
|
306
|
+
margin: 1.5rem 0;
|
|
307
|
+
padding: 0.15rem 0 0.15rem 1.2rem;
|
|
308
|
+
border-left: 3px solid var(--accent);
|
|
309
|
+
color: var(--muted);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.report-markdown table {
|
|
313
|
+
display: block;
|
|
314
|
+
width: 100%;
|
|
315
|
+
margin: 1.25rem 0 2rem;
|
|
316
|
+
overflow-x: auto;
|
|
317
|
+
border-collapse: collapse;
|
|
318
|
+
font-family:
|
|
319
|
+
ui-sans-serif,
|
|
320
|
+
-apple-system,
|
|
321
|
+
BlinkMacSystemFont,
|
|
322
|
+
'Segoe UI',
|
|
323
|
+
sans-serif;
|
|
324
|
+
font-size: 0.88rem;
|
|
325
|
+
line-height: 1.45;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.report-markdown th,
|
|
329
|
+
.report-markdown td {
|
|
330
|
+
padding: 0.75rem 0.85rem;
|
|
331
|
+
border-bottom: 1px solid var(--line);
|
|
332
|
+
text-align: left;
|
|
333
|
+
vertical-align: top;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.report-markdown th {
|
|
337
|
+
color: var(--muted);
|
|
338
|
+
font-size: 0.72rem;
|
|
339
|
+
font-weight: 800;
|
|
340
|
+
letter-spacing: 0.055em;
|
|
341
|
+
text-transform: uppercase;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.report-markdown tbody tr:hover {
|
|
345
|
+
background: color-mix(in srgb, var(--accent) 5%, transparent);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@keyframes pulse {
|
|
349
|
+
50% {
|
|
350
|
+
opacity: 0.4;
|
|
351
|
+
transform: scale(0.82);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@media (max-width: 900px) {
|
|
356
|
+
.page-shell {
|
|
357
|
+
grid-template-columns: 1fr;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.report-sidebar {
|
|
361
|
+
position: static;
|
|
362
|
+
grid-row: 1;
|
|
363
|
+
display: grid;
|
|
364
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
@media (max-width: 620px) {
|
|
369
|
+
.site-header {
|
|
370
|
+
padding-inline: 1rem;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.page-shell {
|
|
374
|
+
padding: 0.75rem;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.report-sidebar {
|
|
378
|
+
grid-template-columns: 1fr;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.report-card {
|
|
382
|
+
padding: 1.25rem;
|
|
383
|
+
border-radius: 0.9rem;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.report-markdown h1 {
|
|
387
|
+
font-size: 2.4rem;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
@media (prefers-reduced-motion: reduce) {
|
|
392
|
+
*,
|
|
393
|
+
*::before,
|
|
394
|
+
*::after {
|
|
395
|
+
scroll-behavior: auto !important;
|
|
396
|
+
animation-duration: 0.01ms !important;
|
|
397
|
+
animation-iteration-count: 1 !important;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
@media (prefers-color-scheme: dark) {
|
|
402
|
+
:root {
|
|
403
|
+
--background: #111714;
|
|
404
|
+
--surface: rgba(27, 35, 31, 0.9);
|
|
405
|
+
--surface-strong: #202a25;
|
|
406
|
+
--ink: #edf3ef;
|
|
407
|
+
--muted: #aab7b0;
|
|
408
|
+
--line: rgba(237, 243, 239, 0.12);
|
|
409
|
+
--accent: #75c6a6;
|
|
410
|
+
--accent-soft: #203d32;
|
|
411
|
+
--danger: #f19a90;
|
|
412
|
+
--shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
body {
|
|
416
|
+
background:
|
|
417
|
+
radial-gradient(circle at 8% 0%, rgba(117, 198, 166, 0.08), transparent 30rem),
|
|
418
|
+
var(--background);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.site-header {
|
|
422
|
+
background: rgba(17, 23, 20, 0.84);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.brand-mark {
|
|
426
|
+
color: #102019;
|
|
427
|
+
}
|
|
428
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silo-ai/silo",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT OR Apache-2.0",
|
|
5
|
+
"author": "Alec Larson",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/silo-ai/silo.git"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"silo": "./dist/bin.mjs"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"skills",
|
|
16
|
+
"templates"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
6
19
|
"scripts": {
|
|
7
|
-
"
|
|
20
|
+
"dev": "tsdown --sourcemap --watch",
|
|
21
|
+
"build": "tsdown",
|
|
22
|
+
"docs:dev": "lildocs dev ./docs",
|
|
23
|
+
"docs:build": "lildocs build ./docs --out ./dist/docs",
|
|
24
|
+
"format": "oxfmt .",
|
|
25
|
+
"lint": "oxlint src",
|
|
26
|
+
"typecheck": "tsc --noEmit && tsc -p test --noEmit",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"prepublishOnly": "pnpm build",
|
|
29
|
+
"sync-agent-rules": "curl -fsSL https://gist.githubusercontent.com/aleclarson/4c80686b1c3e204a01cdbe82f8e2c084/raw/AGENTS.md -o AGENTS.md && git add AGENTS.md && git commit -m 'chore: sync agent rules'"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@aws-sdk/client-s3": "^3.1079.0",
|
|
33
|
+
"cmd-ts": "^0.15.0",
|
|
34
|
+
"react": "^19.2.7",
|
|
35
|
+
"react-dom": "^19.2.7",
|
|
36
|
+
"react-markdown": "^10.1.0",
|
|
37
|
+
"remark-gfm": "^4.0.1"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^26.1.0",
|
|
41
|
+
"@types/react": "^19.2.17",
|
|
42
|
+
"@types/react-dom": "^19.2.3",
|
|
43
|
+
"lildocs": "^0.1.20",
|
|
44
|
+
"oxfmt": "^0.57.0",
|
|
45
|
+
"oxlint": "^1.72.0",
|
|
46
|
+
"tsdown": "^0.22.3",
|
|
47
|
+
"typescript": "^6.0.3",
|
|
48
|
+
"vitest": "^4.1.9"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=24.10.0"
|
|
8
52
|
},
|
|
9
|
-
"
|
|
10
|
-
"author": "",
|
|
11
|
-
"license": "All rights reserved",
|
|
12
|
-
"type": "commonjs"
|
|
53
|
+
"packageManager": "pnpm@11.5.1"
|
|
13
54
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: silo
|
|
3
|
+
description: Design, operate, explicitly synchronize, and publish refreshable Markdown reports from strictly typed, Git-scoped SQLite databases with the Silo CLI. Use when an agent needs durable structured state for a repository, needs to define or inspect Silo tables, choose semantic types or policies, safely mutate rows, query a workspace's Silo database, exchange it through a configured S3-compatible remote, or publish a saved-query report for human viewers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Silo
|
|
7
|
+
|
|
8
|
+
Treat Silo as durable repository state, not scratch storage. Resolve the current Git workspace first with `silo status`; never assume two checkouts with different normalized origins share a database.
|
|
9
|
+
|
|
10
|
+
## Common operations
|
|
11
|
+
|
|
12
|
+
Resolve and inspect before working with unfamiliar data:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
silo status
|
|
16
|
+
silo schema show
|
|
17
|
+
silo table show issues
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Add one row, list rows, or retrieve a known key:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
printf '%s\n' '{"title":"Document release process"}' | silo row add issues
|
|
24
|
+
silo row list issues --limit 20
|
|
25
|
+
silo row get issues 550e8400-e29b-41d4-a716-446655440000
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Row add and upsert output the complete persisted rows, including generated identities, defaults, timestamps, and revisions. Use the exact table and column names returned by inspection. Read [the row request schema](schemas/row-write.schema.json) before constructing unfamiliar or bulk row input.
|
|
29
|
+
|
|
30
|
+
## Task guides
|
|
31
|
+
|
|
32
|
+
Read only the guide needed for workflows with additional design or safety considerations:
|
|
33
|
+
|
|
34
|
+
- [Create a table](tasks/create-table.md) — define the first table or add another durable entity.
|
|
35
|
+
- [Update with optimistic revision](tasks/update-with-revision.md) — avoid overwriting a concurrent agent's changes.
|
|
36
|
+
- [Perform an idempotent upsert](tasks/upsert-rows.md) — repeat a write safely through a declared natural key.
|
|
37
|
+
- [Query with SQL](tasks/query-with-sql.md) — join, filter, aggregate, or inspect data through a read-only query.
|
|
38
|
+
- [Make an additive schema change](tasks/alter-table.md) — add a nullable/defaulted column or index.
|
|
39
|
+
- [Synchronize a database](tasks/synchronize.md) — pull, push, inspect status, and recover from conflicts safely.
|
|
40
|
+
- [Create a refreshable report](tasks/create-report.md) — combine durable Markdown framing with current saved-query results.
|
|
41
|
+
|
|
42
|
+
## Design schemas
|
|
43
|
+
|
|
44
|
+
- Start from access patterns and durable entities. Keep each table comment explicit about what one row represents, when an agent should read or write it, and what it must not contain.
|
|
45
|
+
- Follow every attributed agent-instruction block shown by `silo schema show`; template imports copy these schema-wide workflow rules into the local authoritative schema.
|
|
46
|
+
- Give every column a non-empty comment describing domain meaning, units, canonical form, and null meaning when non-obvious.
|
|
47
|
+
- Prefer a semantic type over a bare storage type when its validation contract matches the domain. Do not use semantic names as decoration.
|
|
48
|
+
- Supply native objects, arrays, strings, numbers, or booleans to `text/json`; Silo stores canonical compact JSON. JSON `null` means SQL `NULL`.
|
|
49
|
+
- Use `any` only for SQLite scalar values. It accepts strings, finite numbers, booleans, and `null`, but not objects or arrays; booleans are stored as `0` or `1`.
|
|
50
|
+
- Use `text/datetime` for instants and `text/date` for calendar dates. Store exact money as minor-unit integers or `text/decimal` with explicit precision and scale; do not use `REAL` for exact amounts.
|
|
51
|
+
- Expect literal defaults to follow the same semantic validation and canonicalization rules as row input.
|
|
52
|
+
- Declare stable primary or natural keys. Add indexes only for demonstrated lookup, join, ordering, or uniqueness needs.
|
|
53
|
+
- Put durable invariants in keys, checks, foreign keys, unique constraints, or policies. Comments guide agents but do not enforce behavior.
|
|
54
|
+
- Prefer small additive schema changes. Initial Silo alterations cannot rebuild tables or change existing types, keys, checks, generated columns, or policies.
|
|
55
|
+
|
|
56
|
+
Read [table-create.schema.json](schemas/table-create.schema.json) before constructing a table request and [table-alter.schema.json](schemas/table-alter.schema.json) before altering one. Use generated `silo <group> <command> --help` output for syntax and examples; do not infer flags from this skill.
|
|
57
|
+
|
|
58
|
+
## Select policies
|
|
59
|
+
|
|
60
|
+
- Use `generated_identity` only when the domain lacks a stable natural identifier. UUID and ULID values are generated by the CLI; integer identities use SQLite rowid behavior.
|
|
61
|
+
- Use `timestamps` for operational creation/update instants. Preserve domain event time in separate columns.
|
|
62
|
+
- Use `optimistic_revision` when agents may race to update the same row. Read the row, retain its revision, and pass `_expected_revision` on update; on conflict, reread and reconcile.
|
|
63
|
+
- Use `immutable_columns` for facts fixed after insertion, `immutable_rows` when a row can never change or be deleted, and `append_only` for log-like tables. These are integrity controls, not tamper-proof auditing.
|
|
64
|
+
- Use `natural_key_upsert` only for truly idempotent writes with an unambiguous conflict key and deliberately limited update columns.
|
|
65
|
+
|
|
66
|
+
Inspect `silo table show` to distinguish `constraint`, `trigger`, and `cli` enforcement. External SQLite clients can bypass CLI-only canonicalization and generation.
|
|
67
|
+
|
|
68
|
+
## Mutate safely
|
|
69
|
+
|
|
70
|
+
Read [row-write.schema.json](schemas/row-write.schema.json) for row request shape.
|
|
71
|
+
|
|
72
|
+
1. Inspect the schema or table before writing unfamiliar data.
|
|
73
|
+
2. Canonicalize meaning at the source; let Silo validate and normalize representation.
|
|
74
|
+
3. Prefer one atomic array write for rows that must succeed together.
|
|
75
|
+
4. Use upsert only when the table declares it. Otherwise choose insert or an explicit read/update flow.
|
|
76
|
+
5. Treat constraint failures as domain feedback. Do not weaken the schema merely to accept one value.
|
|
77
|
+
6. Use explicit delete commands only after verifying the key and downstream foreign-key behavior.
|
|
78
|
+
|
|
79
|
+
## Query and interpret
|
|
80
|
+
|
|
81
|
+
- Prefer row commands for key-based operations and `silo sql` for joins, aggregates, CTEs, window functions, and JSON reads.
|
|
82
|
+
- Add `ORDER BY` whenever result order matters; raw SQL follows SQLite ordering semantics.
|
|
83
|
+
- Remember that exact decimals and semantic versions stored as text do not have numerically meaningful native lexical ordering.
|
|
84
|
+
- Treat Markdown output as presentation. Success and failure are determined by exit status.
|
|
85
|
+
- Use `schema export` for portable logical metadata and `schema ddl` only to diagnose compiled artifacts. Never reconstruct semantic meaning from raw DDL.
|
|
86
|
+
|
|
87
|
+
## Publish reports
|
|
88
|
+
|
|
89
|
+
- Use reports for stable human-facing briefs, status summaries, and data-quality views that benefit from deterministic refresh.
|
|
90
|
+
- Put changing facts in named query slots and durable framing in ordinary Markdown. Refresh reruns SQL; it does not invoke an agent or rewrite prose.
|
|
91
|
+
- Read [report-put.schema.json](schemas/report-put.schema.json) before constructing a report definition, and follow [Create a refreshable report](tasks/create-report.md) for the complete workflow.
|
|
92
|
+
- Treat a saved report as part of the Silo that contains its source data. Do not duplicate report output into repository files as a second source of truth.
|
|
93
|
+
|
|
94
|
+
## Avoid common mistakes
|
|
95
|
+
|
|
96
|
+
- Do not create placeholder comments, duplicate JSON output modes, raw SQL mutations, hidden soft deletion, or audit claims.
|
|
97
|
+
- Do not edit `_silo_` objects or metadata directly.
|
|
98
|
+
- Do not move active databases into network or cloud-synchronized storage.
|
|
99
|
+
- Do not assume synchronization is automatic. Pull before shared work and push only after reviewing pending local state.
|
|
100
|
+
- Do not resolve a changeset conflict by editing `_silo_` metadata or by retrying blindly. Use the transaction-aware discard and reconciliation workflow.
|
|
101
|
+
- Do not assume changing `origin` migrates data; it intentionally selects a different identity and database.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/silo-ai/silo/schemas/report-put.schema.json",
|
|
4
|
+
"title": "Silo report definition",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["slug", "title", "markdown", "queries"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"slug": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
|
|
12
|
+
},
|
|
13
|
+
"title": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1
|
|
16
|
+
},
|
|
17
|
+
"markdown": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"minLength": 1
|
|
20
|
+
},
|
|
21
|
+
"queries": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"minItems": 1,
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["name", "sql"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"name": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
32
|
+
},
|
|
33
|
+
"sql": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"minLength": 1
|
|
36
|
+
},
|
|
37
|
+
"empty_markdown": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"minLength": 1
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/silo-ai/silo/skills/silo/schemas/row-write.schema.json",
|
|
4
|
+
"title": "Silo row write request",
|
|
5
|
+
"description": "A single row or an atomic batch. Field names are constrained by the target logical schema.",
|
|
6
|
+
"oneOf": [{ "type": "object" }, { "type": "array", "minItems": 1, "items": { "type": "object" } }]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/silo-ai/silo/skills/silo/schemas/table-alter.schema.json",
|
|
4
|
+
"title": "Silo additive table alteration request",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"minProperties": 1,
|
|
8
|
+
"properties": {
|
|
9
|
+
"add_columns": {
|
|
10
|
+
"type": "array",
|
|
11
|
+
"items": { "$ref": "table-create.schema.json#/$defs/column" }
|
|
12
|
+
},
|
|
13
|
+
"add_indexes": { "type": "array", "items": { "$ref": "table-create.schema.json#/$defs/index" } }
|
|
14
|
+
}
|
|
15
|
+
}
|