crewforth 3.2.0-rc.2 → 3.2.0-rc.3

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 (61) hide show
  1. package/CHANGELOG.md +100 -3
  2. package/README.md +2 -0
  3. package/VERSION +1 -1
  4. package/adopt.sh +10 -1
  5. package/bin/cli.js +3 -2
  6. package/kit/CLAUDE.md +3 -3
  7. package/kit/agents/crew-review-agent.md +2 -0
  8. package/kit/eval/doctor.sh +13 -2
  9. package/kit/eval/gate-report.sh +2 -0
  10. package/kit/eval/lib/crew-map/narrative.mjs +42 -8
  11. package/kit/eval/lib/crew-map/project.mjs +3 -2
  12. package/kit/eval/lib/crew-map/rules/tech.json +35 -0
  13. package/kit/eval/lib/crew-map/scan.mjs +56 -4
  14. package/kit/eval/lib/crew-map/stacks.mjs +114 -8
  15. package/kit/eval/lib/crew-map/surface.mjs +62 -1
  16. package/kit/eval/lib/gate-log.sh +52 -0
  17. package/kit/eval/lib/json-string.awk +27 -0
  18. package/kit/eval/lib/preset.sh +109 -0
  19. package/kit/eval/lib/presets/default.json +7 -0
  20. package/kit/eval/lib/presets/solo.json +7 -0
  21. package/kit/eval/lib/presets/strict.json +11 -0
  22. package/kit/eval/lib/preview.sh +150 -0
  23. package/kit/eval/lib/review-bench/bench.mjs +273 -0
  24. package/kit/eval/lib/review-prepass/prepass.mjs +203 -0
  25. package/kit/eval/lib/review-prepass/prepass.sh +23 -0
  26. package/kit/eval/lib/settings-json.awk +4 -0
  27. package/kit/eval/lib/statusline.sh +1 -1
  28. package/kit/eval/lib/verify-cmd.sh +17 -0
  29. package/kit/eval/review-bench.sh +26 -0
  30. package/kit/eval/smoke-test.sh +142 -20
  31. package/kit/hooks/board-sync.sh +2 -23
  32. package/kit/hooks/guard-agent-model.sh +32 -23
  33. package/kit/hooks/guard-bash.sh +36 -21
  34. package/kit/hooks/guard-write.sh +3 -7
  35. package/kit/hooks/precompact-snapshot.sh +75 -0
  36. package/kit/hooks/session-rehydrate.sh +25 -2
  37. package/kit/settings.json +12 -0
  38. package/kit/skills/crew-code-review/SKILL.md +16 -0
  39. package/kit/skills/crew-map/SKILL.md +16 -5
  40. package/kit/skills/crew-review/SKILL.md +2 -1
  41. package/kit/studio/README.md +21 -10
  42. package/kit/studio/server/index.js +74 -22
  43. package/kit/studio/server/lib/graph.js +9 -1
  44. package/kit/studio/server/lib/kit-telemetry.js +30 -5
  45. package/kit/studio/server/lib/lan.js +87 -0
  46. package/kit/studio/server/lib/redact.js +60 -0
  47. package/kit/studio/server/lib/remote.js +104 -18
  48. package/kit/studio/server/lib/session.js +1 -1
  49. package/kit/studio/server/lib/terminal.js +51 -13
  50. package/kit/studio/server/lib/transcript.js +32 -0
  51. package/kit/studio/web/app.js +69 -7
  52. package/kit/studio/web/canvas.js +14 -2
  53. package/kit/studio/web/chat.js +32 -7
  54. package/kit/studio/web/graph-plan.js +3 -2
  55. package/kit/studio/web/map-plan.js +72 -3
  56. package/kit/studio/web/map.js +103 -10
  57. package/kit/studio/web/qr.js +200 -0
  58. package/kit/studio/web/style.css +34 -0
  59. package/kit/studio/web/tokens.css +6 -0
  60. package/package.json +1 -1
  61. package/start.sh +14 -1
@@ -0,0 +1,200 @@
1
+ // qr.js — a QR code for a viewer's link, made in the page: no dependency, no request.
2
+ //
3
+ // Byte mode, error correction level M (a phone reads it off a laptop screen at an angle), versions 1 to 10: up to
4
+ // 213 bytes, which a Wi-Fi link with a token (about 70) fits in with room to spare. The construction is ISO/IEC
5
+ // 18004's, in the order Project Nayuki's reference implementation lays it out: data and padding, Reed–Solomon error
6
+ // correction per block, interleaving, the function patterns, the codewords in their zigzag, the eight masks scored by
7
+ // the standard's four penalty rules, and the format (and, from version 7, version) bits. Checked against an
8
+ // independent decoder (OpenCV's QRCodeDetector) on every version and mask; the self-check pins the result.
9
+
10
+ const ECC_M = { perBlock: [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26], blocks: [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5], formatBits: 0 };
11
+ const MAX_VERSION = 10;
12
+
13
+ function rawModules(ver) {
14
+ let n = (16 * ver + 128) * ver + 64;
15
+ if (ver >= 2) {
16
+ const align = Math.floor(ver / 7) + 2;
17
+ n -= (25 * align - 10) * align - 55;
18
+ if (ver >= 7) n -= 36;
19
+ }
20
+ return n;
21
+ }
22
+ const dataCodewords = (ver) => Math.floor(rawModules(ver) / 8) - ECC_M.perBlock[ver] * ECC_M.blocks[ver];
23
+
24
+ // GF(256) with the QR polynomial x^8 + x^4 + x^3 + x^2 + 1.
25
+ function mul(x, y) {
26
+ let z = 0;
27
+ for (let i = 7; i >= 0; i--) { z = (z << 1) ^ ((z >>> 7) * 0x11d); z ^= ((y >>> i) & 1) * x; }
28
+ return z & 0xff;
29
+ }
30
+ function divisor(degree) {
31
+ const r = new Array(degree).fill(0); r[degree - 1] = 1;
32
+ let root = 1;
33
+ for (let i = 0; i < degree; i++) {
34
+ for (let j = 0; j < r.length; j++) { r[j] = mul(r[j], root); if (j + 1 < r.length) r[j] ^= r[j + 1]; }
35
+ root = mul(root, 0x02);
36
+ }
37
+ return r;
38
+ }
39
+ function remainder(data, div) {
40
+ const r = div.map(() => 0);
41
+ for (const b of data) {
42
+ const f = b ^ r.shift(); r.push(0);
43
+ div.forEach((c, i) => { r[i] ^= mul(c, f); });
44
+ }
45
+ return r;
46
+ }
47
+
48
+ function alignmentPositions(ver) {
49
+ if (ver === 1) return [];
50
+ const n = Math.floor(ver / 7) + 2;
51
+ const size = ver * 4 + 17;
52
+ const step = Math.ceil((ver * 4 + 4) / (n * 2 - 2)) * 2;
53
+ const out = [6];
54
+ for (let pos = size - 7; out.length < n; pos -= step) out.splice(1, 0, pos);
55
+ return out;
56
+ }
57
+
58
+ /** The bytes of `text` (UTF-8) as the codewords of the smallest version that holds them, error correction included. */
59
+ function codewords(bytes) {
60
+ let ver = 1;
61
+ for (; ver <= MAX_VERSION; ver++) {
62
+ const cap = dataCodewords(ver) * 8;
63
+ if (4 + (ver < 10 ? 8 : 16) + bytes.length * 8 <= cap) break;
64
+ }
65
+ if (ver > MAX_VERSION) throw new Error(`qr: ${bytes.length} bytes do not fit version ${MAX_VERSION}`);
66
+ const bits = [];
67
+ const put = (v, n) => { for (let i = n - 1; i >= 0; i--) bits.push((v >>> i) & 1); };
68
+ put(0b0100, 4); put(bytes.length, ver < 10 ? 8 : 16);
69
+ for (const b of bytes) put(b, 8);
70
+ const cap = dataCodewords(ver) * 8;
71
+ put(0, Math.min(4, cap - bits.length));
72
+ put(0, (8 - (bits.length % 8)) % 8);
73
+ for (let pad = 0xec; bits.length < cap; pad ^= 0xec ^ 0x11) put(pad, 8);
74
+ const data = [];
75
+ for (let i = 0; i < bits.length; i += 8) data.push(bits.slice(i, i + 8).reduce((a, b) => (a << 1) | b, 0));
76
+
77
+ const nBlocks = ECC_M.blocks[ver]; const eccLen = ECC_M.perBlock[ver];
78
+ const raw = Math.floor(rawModules(ver) / 8);
79
+ const nShort = nBlocks - (raw % nBlocks); const shortLen = Math.floor(raw / nBlocks);
80
+ const div = divisor(eccLen);
81
+ const blocks = [];
82
+ for (let i = 0, k = 0; i < nBlocks; i++) {
83
+ const d = data.slice(k, k + shortLen - eccLen + (i < nShort ? 0 : 1)); k += d.length;
84
+ const e = remainder(d, div);
85
+ if (i < nShort) d.push(0); // a placeholder, skipped when interleaving
86
+ blocks.push(d.concat(e));
87
+ }
88
+ const out = [];
89
+ for (let i = 0; i < blocks[0].length; i++) {
90
+ blocks.forEach((b, j) => { if (i !== shortLen - eccLen || j >= nShort) out.push(b[i]); });
91
+ }
92
+ return { ver, out };
93
+ }
94
+
95
+ const MASKS = [
96
+ (x, y) => (x + y) % 2 === 0, (x, y) => y % 2 === 0, (x) => x % 3 === 0, (x, y) => (x + y) % 3 === 0,
97
+ (x, y) => (Math.floor(x / 3) + Math.floor(y / 2)) % 2 === 0, (x, y) => ((x * y) % 2) + ((x * y) % 3) === 0,
98
+ (x, y) => (((x * y) % 2) + ((x * y) % 3)) % 2 === 0, (x, y) => (((x + y) % 2) + ((x * y) % 3)) % 2 === 0,
99
+ ];
100
+
101
+ /**
102
+ * The QR code for `text`: { size, modules } where modules[y][x] is true for a dark module, quiet zone not included.
103
+ * `mask` forces one of the eight masks (the self-check reads every one); otherwise the one the penalty rules pick.
104
+ */
105
+ export function qr(text, { mask = null } = {}) {
106
+ const bytes = [...new TextEncoder().encode(String(text))];
107
+ const { ver, out } = codewords(bytes);
108
+ const size = ver * 4 + 17;
109
+ const m = Array.from({ length: size }, () => new Array(size).fill(false));
110
+ const fn = Array.from({ length: size }, () => new Array(size).fill(false));
111
+ const set = (x, y, dark) => { m[y][x] = dark; fn[y][x] = true; };
112
+
113
+ for (let i = 0; i < size; i++) { set(6, i, i % 2 === 0); set(i, 6, i % 2 === 0); }
114
+ for (const [cx, cy] of [[3, 3], [size - 4, 3], [3, size - 4]]) {
115
+ for (let dy = -4; dy <= 4; dy++) for (let dx = -4; dx <= 4; dx++) {
116
+ const x = cx + dx; const y = cy + dy;
117
+ if (x >= 0 && x < size && y >= 0 && y < size) { const d = Math.max(Math.abs(dx), Math.abs(dy)); set(x, y, d !== 2 && d !== 4); }
118
+ }
119
+ }
120
+ const al = alignmentPositions(ver);
121
+ al.forEach((ax, i) => al.forEach((ay, j) => {
122
+ if ((i === 0 && j === 0) || (i === 0 && j === al.length - 1) || (i === al.length - 1 && j === 0)) return;
123
+ for (let dy = -2; dy <= 2; dy++) for (let dx = -2; dx <= 2; dx++) set(ax + dx, ay + dy, Math.max(Math.abs(dx), Math.abs(dy)) !== 1);
124
+ }));
125
+ const format = (mk) => {
126
+ const d = (ECC_M.formatBits << 3) | mk;
127
+ let r = d; for (let i = 0; i < 10; i++) r = (r << 1) ^ ((r >>> 9) * 0x537);
128
+ const b = ((d << 10) | r) ^ 0x5412; const bit = (i) => ((b >>> i) & 1) === 1;
129
+ for (let i = 0; i <= 5; i++) set(8, i, bit(i));
130
+ set(8, 7, bit(6)); set(8, 8, bit(7)); set(7, 8, bit(8));
131
+ for (let i = 9; i < 15; i++) set(14 - i, 8, bit(i));
132
+ for (let i = 0; i < 8; i++) set(size - 1 - i, 8, bit(i));
133
+ for (let i = 8; i < 15; i++) set(8, size - 15 + i, bit(i));
134
+ set(8, size - 8, true);
135
+ };
136
+ format(0); // reserves the format area before the data is drawn
137
+ if (ver >= 7) {
138
+ let r = ver; for (let i = 0; i < 12; i++) r = (r << 1) ^ ((r >>> 11) * 0x1f25);
139
+ const b = (ver << 12) | r;
140
+ for (let i = 0; i < 18; i++) { const dark = ((b >>> i) & 1) === 1; const a = size - 11 + (i % 3); const c = Math.floor(i / 3); set(a, c, dark); set(c, a, dark); }
141
+ }
142
+
143
+ let i = 0;
144
+ for (let right = size - 1; right >= 1; right -= 2) {
145
+ if (right === 6) right = 5;
146
+ for (let v = 0; v < size; v++) for (let j = 0; j < 2; j++) {
147
+ const x = right - j; const up = ((right + 1) & 2) === 0; const y = up ? size - 1 - v : v;
148
+ if (!fn[y][x] && i < out.length * 8) { m[y][x] = ((out[i >>> 3] >>> (7 - (i & 7))) & 1) === 1; i++; }
149
+ }
150
+ }
151
+
152
+ const apply = (mk) => { for (let y = 0; y < size; y++) for (let x = 0; x < size; x++) if (!fn[y][x] && MASKS[mk](x, y)) m[y][x] = !m[y][x]; };
153
+ let chosen = mask;
154
+ if (chosen === null) {
155
+ let best = Infinity;
156
+ for (let mk = 0; mk < 8; mk++) {
157
+ apply(mk); format(mk);
158
+ const p = penalty(m, size);
159
+ if (p < best) { best = p; chosen = mk; }
160
+ apply(mk);
161
+ }
162
+ }
163
+ apply(chosen); format(chosen);
164
+ return { size, version: ver, mask: chosen, modules: m };
165
+ }
166
+
167
+ // The standard's four penalty rules: runs of five or more, 2x2 blocks, finder-like patterns, dark/light balance.
168
+ function penalty(m, size) {
169
+ let p = 0;
170
+ const line = (get) => {
171
+ let run = 0; let prev = null; const hist = [];
172
+ for (let i = 0; i < size; i++) {
173
+ const c = get(i);
174
+ if (c === prev) { run++; if (run === 5) p += 3; else if (run > 5) p += 1; } else { run = 1; prev = c; }
175
+ hist.push(c ? 1 : 0);
176
+ }
177
+ const s = hist.join('');
178
+ for (const pat of ['10111010000', '00001011101']) { let k = s.indexOf(pat); while (k !== -1) { p += 40; k = s.indexOf(pat, k + 1); } }
179
+ };
180
+ for (let y = 0; y < size; y++) line((x) => m[y][x]);
181
+ for (let x = 0; x < size; x++) line((y) => m[y][x]);
182
+ let dark = 0;
183
+ for (let y = 0; y < size; y++) for (let x = 0; x < size; x++) {
184
+ if (m[y][x]) dark++;
185
+ if (x < size - 1 && y < size - 1 && m[y][x] === m[y][x + 1] && m[y][x] === m[y + 1][x] && m[y][x] === m[y + 1][x + 1]) p += 3;
186
+ }
187
+ const total = size * size;
188
+ p += Math.floor(Math.abs(dark * 20 - total * 10) / total) * 10;
189
+ return p;
190
+ }
191
+
192
+ /** The code as an SVG string: one path and a quiet zone of four modules. Its two colours are tokens.css's
193
+ * --qr-dark and --qr-light, the same in both themes: a camera reads contrast, not the palette. */
194
+ export function qrSvg(text, { px = 4 } = {}) {
195
+ const { size, modules } = qr(text);
196
+ const q = 4; const n = size + q * 2;
197
+ let d = '';
198
+ for (let y = 0; y < size; y++) for (let x = 0; x < size; x++) if (modules[y][x]) d += `M${x + q} ${y + q}h1v1h-1z`;
199
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n} ${n}" width="${n * px}" height="${n * px}" shape-rendering="crispEdges" role="img" aria-label="QR code of the viewer link"><rect class="qr-light" width="${n}" height="${n}"/><path class="qr-dark" d="${d}"/></svg>`;
200
+ }
@@ -417,6 +417,19 @@ mark { background: color-mix(in srgb, var(--studio-accent) 30%, transparent); co
417
417
  .rv-give .rv-say { padding: 0; }
418
418
  .rv-url { font-size: 12px; line-height: 16px; overflow-wrap: anywhere; user-select: all; color: var(--ink); }
419
419
  .rv-acts { display: flex; gap: var(--space-2); }
420
+ /* The QR code is dark on white whatever the theme: a phone's camera reads contrast, not the palette. */
421
+ .rv-qr { align-self: center; line-height: 0; border-radius: var(--radius-md); overflow: hidden; }
422
+ .rv-qr svg { display: block; width: 168px; height: auto; max-width: 100%; }
423
+ .rv-qr .qr-light { fill: var(--qr-light); }
424
+ .rv-qr .qr-dark { fill: var(--qr-dark); }
425
+ .rv-opt { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1); font-size: 12px; color: var(--ink-dim); }
426
+ /* A viewer link past its eight hours: the page is covered, with what happened and what to do. */
427
+ .expired {
428
+ position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
429
+ gap: var(--space-2); padding: var(--space-4); text-align: center; background: var(--surface); color: var(--ink);
430
+ }
431
+ .expired h1 { margin: 0; font-size: 20px; }
432
+ .expired p { margin: 0; max-width: 34ch; color: var(--ink-dim); }
420
433
  /* A viewer's page offers no way to start a session: the server refuses it, and a button that only fails is noise. */
421
434
  body[data-role="viewer"] #new-session { display: none; }
422
435
 
@@ -666,6 +679,25 @@ body[data-role="viewer"] #new-session { display: none; }
666
679
  .mp-cite:hover { color: var(--ink); text-decoration: underline; }
667
680
  .mp-pill[data-tone="model"] { color: var(--studio-accent); background: color-mix(in srgb, var(--studio-accent) 14%, transparent); }
668
681
  /* A phone shows the findings and a list of the modules in place of the pane (spec §11). */
682
+ /* CM3: a module card names itself in full (the kind line gives way), carries what it is built with, and folds the
683
+ outside services it calls into one line under it. A search dims what it does not name; the tour sits over the
684
+ bottom of the pane. */
685
+ .mp-mod { gap: 6px; }
686
+ .mp-mod .mp-row .mp-name { flex: none; overflow: visible; }
687
+ .mp-mod .mp-row .mp-kind { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
688
+ .mp-fold { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
689
+ .mp-fold.none { color: var(--ink-faint); }
690
+ .mp-card[data-match="false"] { opacity: 0.3; }
691
+ .mp-card[data-match="true"] { border-color: var(--studio-accent); }
692
+ .mp-search { height: 30px; min-width: 200px; padding: 0 10px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; }
693
+ .mp-search::placeholder { color: var(--ink-dim); }
694
+ .mp-tour { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 6; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--studio-accent); border-radius: var(--radius-md); background: var(--surface-raised); cursor: default; }
695
+ .mp-tour p { margin: 0; font-size: 14px; line-height: 21px; }
696
+ .mp-tour[hidden] { display: none; }
697
+ .mp-inside { flex-direction: row; align-items: center; gap: 10px; }
698
+ .mp-inside .mp-ev { margin-left: auto; }
699
+ .mp-inside .mp-cite, .mp-inside .mp-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
700
+ .mp-inside .mp-ev:last-child { flex: none; }
669
701
  .mp-modlist { display: none; flex-direction: column; gap: 2px; padding: 10px 14px; border-top: 1px solid var(--line); }
670
702
  .mp-mrow { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
671
703
  .mp-mrow:hover { background: var(--surface-raised); }
@@ -1210,6 +1242,8 @@ button.tl-lab { cursor: pointer; }
1210
1242
  and do not shrink. */
1211
1243
  .cv-sub { font-size: 12px; line-height: 16px; color: var(--ink-dim); white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
1212
1244
  .cv-sub[hidden] { display: none; }
1245
+ /* Agent calls the model gate refused: no agent started, so this line is the only trace on the canvas. */
1246
+ .cv-refused { color: var(--status-waiting); }
1213
1247
  .cv-node > .cv-row, .cv-node > .cv-under, .cv-node > .cv-name, .cv-node > .cv-sub { max-width: 100%; }
1214
1248
  .cv-word { font-size: 11px; color: var(--ink-dim); white-space: nowrap; flex: none; }
1215
1249
 
@@ -10,6 +10,8 @@
10
10
  --ink: #e6e9f0;
11
11
  --ink-dim: #9aa7cc;
12
12
  --ink-faint: #5c6472;
13
+ --qr-dark: #000000;
14
+ --qr-light: #ffffff;
13
15
  --accent: #A78BFA;
14
16
  --on-accent: #0B1020;
15
17
  --wordmark-ink: #FFFFFF;
@@ -86,6 +88,8 @@
86
88
  --ink: #1a1d24;
87
89
  --ink-dim: #5c6472;
88
90
  --ink-faint: #8d95a3;
91
+ --qr-dark: #000000;
92
+ --qr-light: #ffffff;
89
93
  --accent: #6D28D9;
90
94
  --on-accent: #ffffff;
91
95
  --wordmark-ink: #0F172A;
@@ -113,6 +117,8 @@
113
117
  --ink: #1a1d24;
114
118
  --ink-dim: #5c6472;
115
119
  --ink-faint: #8d95a3;
120
+ --qr-dark: #000000;
121
+ --qr-light: #ffffff;
116
122
  --accent: #6D28D9;
117
123
  --on-accent: #ffffff;
118
124
  --wordmark-ink: #0F172A;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crewforth",
3
- "version": "3.2.0-rc.2",
3
+ "version": "3.2.0-rc.3",
4
4
  "description": "Crewforth — your engineering crew for Claude Code: agents, skills and tool-level gates, in any stack.",
5
5
  "bin": {
6
6
  "crewforth": "bin/cli.js"
package/start.sh CHANGED
@@ -191,6 +191,8 @@ Crewforth her zaman eksiksiz kurulur: tüm ajanlar ve skill'ler — backend, web
191
191
  (CLAUDE.md ## Stack ya da depo). React Native/Expo, hazır isteğe bağlı katmanlardan yalnız biridir.
192
192
  --backend | --frontend | --mobile | --fullstack hâlâ kabul edilir ama etkisi yok (eski komutlar bozulmasın diye)
193
193
  --private | --shared kurulum yalnızca sizin mi, yoksa ekiple paylaşılıp commit'lenecek mi? (varsayılan: private)
194
+ --preset <ad|dosya> bir kurum preset'i uygula: kritik yollar, model tabanları, izinli verify komutları
195
+ (gelenler: default, strict, solo; ya da kendi .json dosyanız)
194
196
  --lang tr|en kurulum dili (verilmezse sihirbaz sorar)
195
197
  --yes, -y tüm sorulara evet de (gözetimsiz kurulum)
196
198
  --version, -v Crewforth sürümünü yazdırıp çık
@@ -209,6 +211,8 @@ Every install ships everything: all agents, all skills — backend, web and mobi
209
211
  (CLAUDE.md ## Stack, or the repo). React Native/Expo is only one of the optional ready-made layers.
210
212
  --backend | --frontend | --mobile | --fullstack accepted, no effect (kept so older commands still run)
211
213
  --private | --shared is the install yours alone, or committed for the team? (default: private)
214
+ --preset <name|file> apply an organisation preset: critical paths, model floors, allowed verify commands
215
+ (shipped: default, strict, solo; or a .json file of your own)
212
216
  --lang tr|en installer language (asked interactively when not given)
213
217
  --yes, -y answer every question with yes (unattended install)
214
218
  --version, -v print the Crewforth version and exit
@@ -432,9 +436,13 @@ case "$CREW_LANG" in tr|en) ;; *) CREW_LANG=en ;; esac
432
436
  # choice made by --lang or the menu above stayed in this shell, and the preflight block printed English.
433
437
  export CREW_LANG
434
438
 
435
- STACK="generic"; DOTNET_FLAG=0; LEGACY_FLAGS=""; ASSUME_YES=0; VISIBILITY=""
439
+ STACK="generic"; DOTNET_FLAG=0; LEGACY_FLAGS=""; ASSUME_YES=0; VISIBILITY=""; PRESET=""; _preset_take=0
436
440
  for a in "$@"; do
441
+ # `--preset NAME`: the next word is its value, whatever it looks like (`--preset strict`, `--preset ./org.json`).
442
+ if [ "$_preset_take" = 1 ]; then _preset_take=0; PRESET="$a"; continue; fi
437
443
  case "$a" in
444
+ --preset=*) PRESET="${a#--preset=}" ;;
445
+ --preset) _preset_take=1 ;;
438
446
  --lang) ;; # value consumed in the language pass above
439
447
  --lang=*) ;;
440
448
  tr|en) ;; # the value of a separated --lang
@@ -448,6 +456,9 @@ for a in "$@"; do
448
456
  *) printf '%s\n' "$(m 'Unknown parameter: %s' "$a")"; echo; usage; exit 1 ;;
449
457
  esac
450
458
  done
459
+ [ "$_preset_take" = 1 ] && { printf '%s\n' "$(m 'Unknown parameter: %s' "--preset (no value)")"; echo; usage; exit 1; }
460
+ # A preset is checked before anything is installed: one that is not valid stops here, with nothing written.
461
+ if [ -n "$PRESET" ]; then bash "$SRC/eval/lib/preset.sh" --check "$PRESET" || exit 1; fi
451
462
 
452
463
  # ===================== COLOR / STYLE HELPERS =====================
453
464
  # Color is emitted ONLY on an interactive TTY + TERM!=dumb + NO_COLOR empty.
@@ -689,6 +700,8 @@ cp "$SRC/README.md" .claude/ 2>/dev/null || true
689
700
  # as if somebody had chosen it. --lang, CREW_LANG and the menu are choices, and are.
690
701
  [ "${_LANG_GUESSED:-0}" = 1 ] || echo "lang=${CREW_LANG:-en}"
691
702
  } > .claude/kit.conf
703
+ # The organisation's preset, now that .claude/ is in place (checked above): a block at the top of crew-model-rules.
704
+ if [ -n "$PRESET" ]; then bash .claude/eval/lib/preset.sh --apply "$PRESET" || exit 1; fi
692
705
 
693
706
  # Discipline (kit-owned, refreshed on every update) vs project section (yours, written once), joined by @import.
694
707
  kit_require_sentinel "$SRC/CLAUDE.md"