@grainulation/barn 1.0.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +87 -0
  4. package/bin/barn.js +98 -0
  5. package/lib/index.js +93 -0
  6. package/lib/server.js +368 -0
  7. package/package.json +52 -0
  8. package/public/grainulation-tokens.css +321 -0
  9. package/public/index.html +907 -0
  10. package/templates/README.md +48 -0
  11. package/templates/adr.html +223 -0
  12. package/templates/adr.json +29 -0
  13. package/templates/brief.html +297 -0
  14. package/templates/brief.json +26 -0
  15. package/templates/certificate.html +247 -0
  16. package/templates/certificate.json +23 -0
  17. package/templates/changelog.html +239 -0
  18. package/templates/changelog.json +19 -0
  19. package/templates/ci-workflow.yml +52 -0
  20. package/templates/comparison.html +248 -0
  21. package/templates/comparison.json +21 -0
  22. package/templates/conflict-map.html +240 -0
  23. package/templates/conflict-map.json +19 -0
  24. package/templates/dashboard.html +515 -0
  25. package/templates/dashboard.json +22 -0
  26. package/templates/email-digest.html +178 -0
  27. package/templates/email-digest.json +18 -0
  28. package/templates/evidence-matrix.html +232 -0
  29. package/templates/evidence-matrix.json +21 -0
  30. package/templates/explainer.html +342 -0
  31. package/templates/explainer.json +23 -0
  32. package/templates/handoff.html +343 -0
  33. package/templates/handoff.json +24 -0
  34. package/templates/one-pager.html +248 -0
  35. package/templates/one-pager.json +22 -0
  36. package/templates/postmortem.html +303 -0
  37. package/templates/postmortem.json +20 -0
  38. package/templates/rfc.html +199 -0
  39. package/templates/rfc.json +32 -0
  40. package/templates/risk-register.html +231 -0
  41. package/templates/risk-register.json +22 -0
  42. package/templates/slide-deck.html +239 -0
  43. package/templates/slide-deck.json +23 -0
  44. package/templates/template.schema.json +25 -0
  45. package/templates/wiki-page.html +222 -0
  46. package/templates/wiki-page.json +23 -0
  47. package/tools/README.md +31 -0
  48. package/tools/build-pdf.js +43 -0
  49. package/tools/detect-sprints.js +292 -0
  50. package/tools/generate-manifest.js +237 -0
@@ -0,0 +1,178 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+ <title>Sprint Update — {{SPRINT_NAME}}</title>
8
+ <!--
9
+ barn/templates/email-digest.html — email-safe sprint update
10
+ Inline styles only. Table layout for Gmail/Outlook compatibility.
11
+ No external dependencies, no style blocks, no classes.
12
+ -->
13
+ </head>
14
+ <body style="margin:0; padding:0; background-color:#0a0e1a; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Inter',sans-serif; -webkit-font-smoothing:antialiased;">
15
+
16
+ <table role="presentation" aria-label="Sprint digest email" width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color:#0a0e1a;">
17
+ <tr>
18
+ <td align="center" style="padding:24px 16px;">
19
+
20
+ <!-- Main container -->
21
+ <table role="presentation" width="600" cellpadding="0" cellspacing="0" border="0" style="max-width:600px; width:100%;">
22
+
23
+ <!-- Header -->
24
+ <tr>
25
+ <td style="padding:24px 32px; border-bottom:1px solid rgba(255,255,255,0.06);">
26
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
27
+ <tr>
28
+ <td style="font-size:20pt; font-weight:800; color:#f1f5f9; letter-spacing:-0.02em; padding-bottom:8px;">
29
+ Sprint Update
30
+ </td>
31
+ </tr>
32
+ <tr>
33
+ <td style="font-size:10pt; color:#94a3b8; line-height:1.5;">
34
+ {{SPRINT_NAME}} -- {{DATE}} -- From: {{AUTHOR}}
35
+ </td>
36
+ </tr>
37
+ </table>
38
+ </td>
39
+ </tr>
40
+
41
+ <!-- Progress bar -->
42
+ <tr>
43
+ <td style="padding:24px 32px;">
44
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
45
+ <tr>
46
+ <td style="font-size:8pt; font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:#64748b; padding-bottom:10px;">
47
+ Progress
48
+ </td>
49
+ </tr>
50
+ <tr>
51
+ <td>
52
+ {{PROGRESS}}
53
+ <!-- Expected structure:
54
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
55
+ <tr>
56
+ <td style="background-color:#1a2332; border-radius:6px; padding:0;">
57
+ <table role="presentation" cellpadding="0" cellspacing="0" border="0" style="width:65%;">
58
+ <tr>
59
+ <td style="background:linear-gradient(90deg,#3b82f6,#2563eb); border-radius:6px; height:24px; padding-left:10px; font-size:8pt; font-weight:700; color:rgba(255,255,255,0.9); text-transform:uppercase; letter-spacing:0.05em;">
60
+ 65%
61
+ </td>
62
+ </tr>
63
+ </table>
64
+ </td>
65
+ </tr>
66
+ </table>
67
+ -->
68
+ </td>
69
+ </tr>
70
+ </table>
71
+ </td>
72
+ </tr>
73
+
74
+ <!-- Key findings -->
75
+ <tr>
76
+ <td style="padding:0 32px 24px 32px;">
77
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color:#1e293b; border-radius:12px; border:1px solid rgba(255,255,255,0.06);">
78
+ <tr>
79
+ <td style="padding:20px 24px;">
80
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
81
+ <tr>
82
+ <td style="font-size:8pt; font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:#64748b; padding-bottom:14px;">
83
+ Key Findings
84
+ </td>
85
+ </tr>
86
+ {{TOP_FINDINGS}}
87
+ <!-- Each finding follows this structure:
88
+ <tr>
89
+ <td style="padding:10px 0; border-bottom:1px solid rgba(255,255,255,0.06);">
90
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
91
+ <tr>
92
+ <td style="font-family:monospace; font-size:9pt; color:#60a5fa; font-weight:700; width:60px; vertical-align:top;">
93
+ r042
94
+ </td>
95
+ <td style="font-size:10pt; color:#94a3b8; line-height:1.4;">
96
+ SSE handles real-time updates for wheat and barn without WebSocket overhead.
97
+ </td>
98
+ </tr>
99
+ </table>
100
+ </td>
101
+ </tr>
102
+ -->
103
+ </table>
104
+ </td>
105
+ </tr>
106
+ </table>
107
+ </td>
108
+ </tr>
109
+
110
+ <!-- Blockers -->
111
+ <tr>
112
+ <td style="padding:0 32px 24px 32px;">
113
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color:#1e293b; border-radius:12px; border:1px solid rgba(255,255,255,0.06);">
114
+ <tr>
115
+ <td style="padding:20px 24px;">
116
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
117
+ <tr>
118
+ <td style="font-size:8pt; font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:#e11d48; padding-bottom:14px;">
119
+ Blockers and Risks
120
+ </td>
121
+ </tr>
122
+ {{BLOCKERS}}
123
+ <!-- Each blocker follows this structure:
124
+ <tr>
125
+ <td style="padding:8px 0; border-bottom:1px solid rgba(255,255,255,0.06); font-size:10pt; color:#94a3b8; line-height:1.4;">
126
+ -- Farmer hook bleeds across repos, blocks CLI in non-farmer projects
127
+ </td>
128
+ </tr>
129
+ -->
130
+ </table>
131
+ </td>
132
+ </tr>
133
+ </table>
134
+ </td>
135
+ </tr>
136
+
137
+ <!-- Next steps -->
138
+ <tr>
139
+ <td style="padding:0 32px 24px 32px;">
140
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color:#1e293b; border-radius:12px; border:1px solid rgba(255,255,255,0.06);">
141
+ <tr>
142
+ <td style="padding:20px 24px;">
143
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
144
+ <tr>
145
+ <td style="font-size:8pt; font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:#22c55e; padding-bottom:14px;">
146
+ Next Steps
147
+ </td>
148
+ </tr>
149
+ {{NEXT_STEPS}}
150
+ <!-- Each step follows this structure:
151
+ <tr>
152
+ <td style="padding:8px 0; border-bottom:1px solid rgba(255,255,255,0.06); font-size:10pt; color:#94a3b8; line-height:1.4;">
153
+ 1. Run /prototype to validate SSE approach
154
+ </td>
155
+ </tr>
156
+ -->
157
+ </table>
158
+ </td>
159
+ </tr>
160
+ </table>
161
+ </td>
162
+ </tr>
163
+
164
+ <!-- Footer -->
165
+ <tr>
166
+ <td style="padding:16px 32px; font-size:8pt; color:#64748b; text-align:center; border-top:1px solid rgba(255,255,255,0.06);">
167
+ Compiled with barn -- {{CERTIFICATE_HASH}}
168
+ </td>
169
+ </tr>
170
+
171
+ </table>
172
+
173
+ </td>
174
+ </tr>
175
+ </table>
176
+
177
+ </body>
178
+ </html>
@@ -0,0 +1,18 @@
1
+ {
2
+ "title": "Email Digest",
3
+ "description": "Email-safe sprint update for async communication. Uses inline styles and table layout for Gmail and Outlook compatibility.",
4
+ "tags": ["email", "digest", "update", "async", "communication"],
5
+ "author": "grainulation",
6
+ "version": "1.0.0",
7
+ "exportPresets": [
8
+ { "name": "static-site", "format": "html" }
9
+ ],
10
+ "seedPacks": [],
11
+ "scaffoldConfig": {
12
+ "defaultPlaceholders": {
13
+ "SPRINT_NAME": "Untitled Sprint",
14
+ "AUTHOR": "grainulation"
15
+ },
16
+ "postInit": ["load-claims", "select-top-findings"]
17
+ }
18
+ }
@@ -0,0 +1,232 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>{{TITLE}} -- {{SPRINT_NAME}}</title>
7
+ <style>
8
+ :root {
9
+ --bg: #0a0e1a;
10
+ --bg2: #111827;
11
+ --bg3: #1e293b;
12
+ --accent: #3b82f6;
13
+ --accent-light: #60a5fa;
14
+ --green: #22c55e;
15
+ --green-dim: rgba(34,197,94,0.15);
16
+ --orange: #f59e0b;
17
+ --orange-dim: rgba(245,158,11,0.15);
18
+ --red: #e11d48;
19
+ --red-dim: rgba(225,29,72,0.15);
20
+ --purple: #a78bfa;
21
+ --text: #f1f5f9;
22
+ --text-muted: #94a3b8;
23
+ --text-dim: #64748b;
24
+ --border: rgba(255,255,255,0.06);
25
+ --heat-0: rgba(59,130,246,0.00);
26
+ --heat-1: rgba(59,130,246,0.12);
27
+ --heat-2: rgba(59,130,246,0.25);
28
+ --heat-3: rgba(59,130,246,0.40);
29
+ --heat-4: rgba(59,130,246,0.55);
30
+ --heat-5: rgba(59,130,246,0.70);
31
+ --gap-bg: rgba(225,29,72,0.08);
32
+ }
33
+ * { margin: 0; padding: 0; box-sizing: border-box; }
34
+ html { scroll-snap-type: y mandatory; scroll-behavior: smooth; }
35
+ body {
36
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
37
+ background: var(--bg);
38
+ color: var(--text);
39
+ font-size: 10pt;
40
+ line-height: 1.5;
41
+ -webkit-font-smoothing: antialiased;
42
+ }
43
+ section {
44
+ scroll-snap-align: start;
45
+ min-height: 100vh;
46
+ padding: 40px;
47
+ display: flex;
48
+ flex-direction: column;
49
+ justify-content: center;
50
+ }
51
+ .header-section { justify-content: flex-end; padding-bottom: 80px; }
52
+ .header-section h1 {
53
+ font-size: 28pt;
54
+ font-weight: 800;
55
+ letter-spacing: -0.02em;
56
+ background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
57
+ -webkit-background-clip: text;
58
+ -webkit-text-fill-color: transparent;
59
+ margin-bottom: 12px;
60
+ }
61
+ .meta-row {
62
+ display: flex;
63
+ gap: 24px;
64
+ color: var(--text-muted);
65
+ font-size: 10pt;
66
+ }
67
+ .coverage-badge {
68
+ display: inline-block;
69
+ padding: 4px 14px;
70
+ border-radius: 6px;
71
+ font-size: 14pt;
72
+ font-weight: 800;
73
+ color: var(--accent-light);
74
+ background: rgba(59,130,246,0.12);
75
+ margin-top: 16px;
76
+ }
77
+ .panel {
78
+ background: var(--bg2);
79
+ border-radius: 12px;
80
+ padding: 24px;
81
+ border: 1px solid var(--border);
82
+ }
83
+ .panel-title {
84
+ font-size: 9pt;
85
+ font-weight: 700;
86
+ text-transform: uppercase;
87
+ letter-spacing: 0.1em;
88
+ color: var(--text-dim);
89
+ margin-bottom: 16px;
90
+ }
91
+ .matrix-table {
92
+ width: 100%;
93
+ border-collapse: collapse;
94
+ font-size: 9pt;
95
+ }
96
+ .matrix-table th {
97
+ padding: 10px 12px;
98
+ text-align: center;
99
+ font-weight: 700;
100
+ text-transform: uppercase;
101
+ letter-spacing: 0.06em;
102
+ font-size: 8pt;
103
+ color: var(--text-dim);
104
+ background: var(--bg3);
105
+ border-bottom: 2px solid var(--border);
106
+ }
107
+ .matrix-table th:first-child { text-align: left; }
108
+ .matrix-table td {
109
+ padding: 10px 12px;
110
+ text-align: center;
111
+ border-bottom: 1px solid var(--border);
112
+ color: var(--text-muted);
113
+ font-weight: 600;
114
+ }
115
+ .matrix-table td:first-child {
116
+ text-align: left;
117
+ font-weight: 700;
118
+ text-transform: uppercase;
119
+ font-size: 8pt;
120
+ letter-spacing: 0.06em;
121
+ color: var(--text);
122
+ }
123
+ .matrix-table td.total-cell {
124
+ color: var(--text);
125
+ font-weight: 800;
126
+ background: var(--bg3);
127
+ }
128
+ .matrix-table td.gap-cell {
129
+ background: var(--gap-bg);
130
+ color: var(--red);
131
+ font-style: italic;
132
+ font-size: 8pt;
133
+ }
134
+ .matrix-table td.heat-1 { background: var(--heat-1); }
135
+ .matrix-table td.heat-2 { background: var(--heat-2); }
136
+ .matrix-table td.heat-3 { background: var(--heat-3); }
137
+ .matrix-table td.heat-4 { background: var(--heat-4); }
138
+ .matrix-table td.heat-5 { background: var(--heat-5); color: #fff; }
139
+ .gap-item {
140
+ display: flex;
141
+ align-items: center;
142
+ gap: 12px;
143
+ padding: 10px 0;
144
+ border-bottom: 1px solid var(--border);
145
+ font-size: 9pt;
146
+ color: var(--text-muted);
147
+ }
148
+ .gap-item:last-child { border-bottom: none; }
149
+ .gap-indicator {
150
+ width: 8px;
151
+ height: 8px;
152
+ border-radius: 50%;
153
+ background: var(--red);
154
+ flex-shrink: 0;
155
+ }
156
+ .compilation-bar {
157
+ margin-top: 32px;
158
+ padding: 16px 24px;
159
+ background: var(--bg2);
160
+ border-radius: 8px;
161
+ border: 1px solid var(--border);
162
+ display: flex;
163
+ justify-content: space-between;
164
+ font-size: 9pt;
165
+ color: var(--text-dim);
166
+ }
167
+ @media (max-width: 768px) {
168
+ section { padding: 20px; min-height: auto; }
169
+ .header-section h1 { font-size: 18pt; }
170
+ .meta-row { flex-wrap: wrap; gap: 8px; }
171
+ .matrix-table { font-size: 8pt; }
172
+ .matrix-table th, .matrix-table td { padding: 6px 8px; }
173
+ .panel { padding: 16px; overflow-x: auto; }
174
+ }
175
+ @media print {
176
+ html { scroll-snap-type: none; }
177
+ section { min-height: auto; page-break-inside: avoid; padding: 16px 0; }
178
+ body { background: #fff; color: #111; }
179
+ .panel { border-color: #ccc; background: #f9f9f9; }
180
+ .matrix-table td.gap-cell { background: #fee; }
181
+ .compilation-bar { background: #f9f9f9; border-color: #ccc; }
182
+ }
183
+ </style>
184
+ </head>
185
+ <body>
186
+
187
+ <section class="header-section" aria-label="Evidence matrix header">
188
+ <h1>{{TITLE}}</h1>
189
+ <div class="meta-row">
190
+ <span>Sprint: {{SPRINT_NAME}}</span>
191
+ </div>
192
+ <div class="coverage-badge">{{COVERAGE_PCT}}% Coverage</div>
193
+ </section>
194
+
195
+ <section aria-label="Evidence heatmap">
196
+ <div class="panel">
197
+ <div class="panel-title">Claim Type / Evidence Tier Matrix</div>
198
+ <table class="matrix-table" role="grid" aria-label="Evidence coverage heatmap">
199
+ <thead>
200
+ <tr>
201
+ <th>Type</th>
202
+ <th>Stated</th>
203
+ <th>Web</th>
204
+ <th>Documented</th>
205
+ <th>Tested</th>
206
+ <th>Production</th>
207
+ <th>Total</th>
208
+ </tr>
209
+ </thead>
210
+ <tbody>
211
+ {{MATRIX_DATA}}
212
+ </tbody>
213
+ </table>
214
+ </div>
215
+ </section>
216
+
217
+ <section aria-label="Gap analysis">
218
+ <div class="panel">
219
+ <div class="panel-title">Gap Analysis</div>
220
+ {{GAP_SUMMARY}}
221
+ </div>
222
+ </section>
223
+
224
+ <section aria-label="Compilation footer">
225
+ <div class="compilation-bar">
226
+ <div>Compiled with barn</div>
227
+ <div style="font-family: monospace; font-size: 8pt;">{{CERTIFICATE_HASH}}</div>
228
+ </div>
229
+ </section>
230
+
231
+ </body>
232
+ </html>
@@ -0,0 +1,21 @@
1
+ {
2
+ "title": "Evidence Matrix",
3
+ "description": "Gap analysis heatmap showing claim types against evidence tiers. Color intensity indicates claim density, empty cells are flagged as coverage gaps.",
4
+ "tags": ["evidence", "matrix", "heatmap", "gap-analysis", "audit"],
5
+ "author": "grainulation",
6
+ "version": "1.0.0",
7
+ "exportPresets": [
8
+ { "name": "pdf", "format": "pdf" },
9
+ { "name": "static-site", "format": "html" }
10
+ ],
11
+ "seedPacks": [
12
+ "compliance"
13
+ ],
14
+ "scaffoldConfig": {
15
+ "defaultPlaceholders": {
16
+ "TITLE": "Evidence Matrix",
17
+ "SPRINT_NAME": "Untitled Sprint"
18
+ },
19
+ "postInit": ["load-claims", "compute-matrix"]
20
+ }
21
+ }