Skip to content
Shahryar Sabir Muhammed
Shahryar Sabir
Software & AI Engineer
← Back to Systems
Solo Engineered
TypeScriptASTCLIGitHub Actionsnpm

arch-guard

The architecture and quality guardrail for AI-generated code — a static linter that blocks AI PRs from introducing architectural technical debt, in under a second.

$ npx arch-guard scan .

arch-guard — guardrails for machine-written code

As AI tools write more of your codebase, architecture decays quietly: agents reinvent helpers that already exist, reach across layers they should never touch, and spin dependency cycles. arch-guard is the static linter that says no — in pre-commit hooks and in CI.

What it enforces

  • Layered Boundary Enforcement: declarative rules like “UI components cannot import DB models directly” — defined per-layer in arch-guard.config.json.
  • Duplicate Utility Detection: flags when an agent writes a helper that already exists in src/utils/.
  • Circular Dependency Prevention: instant cyclic module graph checker.
  • Zero-Overhead CLI: a full audit in < 1 second using fast AST parsing — cheap enough to run on every commit.

Why it exists

The AI-codegen era needs referees, not just players. arch-guard is one of a pair with langgraph-zod: one guards the graph at runtime, the other guards the repo at commit time.

System Specifications

0
C
1
r
2
e
3
a
4
t
5
e
6
d
7
8
a
9
r
10
c
11
h
12
-
13
g
14
u
15
a
16
r
17
d
18
19
a
20
f
21
t
22
e
23
r
24
25
w
26
a
27
t
28
c
29
h
30
i
31
n
32
g
33
34
A
35
I
36
37
c
38
o
39
d
40
i
41
n
42
g
43
44
a
45
g
46
e
47
n
48
t
49
s
50
51
i
52
n
53
v
54
e
55
n
56
t
57
58
d
59
u
60
p
61
l
62
i
63
c
64
a
65
t
66
e
67
68
h
69
e
70
l
71
p
72
e
73
r
74
s
75
,
76
77
i
78
m
79
p
80
o
81
r
82
t
83
84
d
85
a
86
t
87
a
88
b
89
a
90
s
91
e
92
93
m
94
o
95
d
96
e
97
l
98
s
99
100
i
101
n
102
t
103
o
104
105
R
106
e
107
a
108
c
109
t
110
111
c
112
o
113
m
114
p
115
o
116
n
117
e
118
n
119
t
120
s
121
,
122
123
a
124
n
125
d
126
127
i
128
n
129
t
130
r
131
o
132
d
133
u
134
c
135
e
136
137
c
138
i
139
r
140
c
141
u
142
l
143
a
144
r
145
146
d
147
e
148
p
149
e
150
n
151
d
152
e
153
n
154
c
155
i
156
e
157
s
158
.
159
160
a
161
r
162
c
163
h
164
-
165
g
166
u
167
a
168
r
169
d
170
171
r
172
u
173
n
174
s
175
176
a
177
s
178
179
a
180
181
s
182
t
183
a
184
t
185
i
186
c
187
188
a
189
r
190
c
191
h
192
i
193
t
194
e
195
c
196
t
197
u
198
r
199
e
200
201
l
202
i
203
n
204
t
205
e
206
r
207
208
i
209
n
210
211
p
212
r
213
e
214
-
215
c
216
o
217
m
218
m
219
i
220
t
221
222
h
223
o
224
o
225
k
226
s
227
228
a
229
n
230
d
231
232
G
233
i
234
t
235
H
236
u
237
b
238
239
A
240
c
241
t
242
i
243
o
244
n
245
s
246
:
247
248
l
249
a
250
y
251
e
252
r
253
e
254
d
255
256
b
257
o
258
u
259
n
260
d
261
a
262
r
263
y
264
265
e
266
n
267
f
268
o
269
r
270
c
271
e
272
m
273
e
274
n
275
t
276
277
w
278
i
279
t
280
h
281
282
d
283
e
284
c
285
l
286
a
287
r
288
a
289
t
290
i
291
v
292
e
293
294
r
295
u
296
l
297
e
298
s
299
,
300
301
d
302
u
303
p
304
l
305
i
306
c
307
a
308
t
309
e
310
-
311
u
312
t
313
i
314
l
315
i
316
t
317
y
318
319
d
320
e
321
t
322
e
323
c
324
t
325
i
326
o
327
n
328
329
a
330
g
331
a
332
i
333
n
334
s
335
t
336
337
s
338
r
339
c
340
/
341
u
342
t
343
i
344
l
345
s
346
,
347
348
a
349
n
350
d
351
352
a
353
n
354
355
i
356
n
357
s
358
t
359
a
360
n
361
t
362
363
c
364
y
365
c
366
l
367
i
368
c
369
370
m
371
o
372
d
373
u
374
l
375
e
376
377
g
378
r
379
a
380
p
381
h
382
383
c
384
h
385
e
386
c
387
k
388
e
389
r
390
391
—
392
393
a
394
395
z
396
e
397
r
398
o
399
-
400
o
401
v
402
e
403
r
404
h
405
e
406
a
407
d
408
409
C
410
L
411
I
412
413
t
414
h
415
a
416
t
417
418
c
419
o
420
m
421
p
422
l
423
e
424
t
425
e
426
s
427
428
a
429
430
f
431
u
432
l
433
l
434
435
a
436
u
437
d
438
i
439
t
440
441
i
442
n
443
444
u
445
n
446
d
447
e
448
r
449
450
o
451
n
452
e
453
454
s
455
e
456
c
457
o
458
n
459
d
460
461
u
462
s
463
i
464
n
465
g
466
467
f
468
a
469
s
470
t
471
472
A
473
S
474
T
475
476
p
477
a
478
r
479
s
480
i
481
n
482
g
483
.

Need this in production?

I build and deploy custom speech AI models and persistent agent systems for businesses and teams.

Schedule Architecture Call →