Before the write
the engine reads only what the change introduces and refuses known violations with the line, the rule and the expected fix. The file is left untouched.
line 1 [rls] table "clients" created without RLSAI agents write code faster than anyone can review it, and every shortcut they leave makes the next change harder. Smugan refuses those shortcuts before the file exists, runs your project's checks after it, and asks for proof before a task counts as done.
Don't live with broken windows.
Andrew Hunt and David Thomas, The Pragmatic Programmer
Leave one bad decision in a codebase and the next one comes easier. Past a point, the code stops being something you build on and becomes something you patch.
An agent writes in an hour what used to take a week, and its shortcuts pile up just as fast: a test quietly skipped, an error swallowed, a function copied instead of reused.
Pick a change an agent might make. Each problem is pinned to its line, straight from what smugan check printed for that file; then the agent fixes it and the same check runs again.
create table clientes ( id uuid primary key, nome_completo text);create table clients ( id uuid primary key, user_id uuid not null, full_name text);alter table clients enable row level security;create policy clients_owner_select on clients for select to authenticated using ((select auth.uid()) = user_id);Names and RLS are fixed. The write still waits for a pgTAP test of the table and a line about it in SECURITY_NOTES.md.
export async function loadPrices(url: string) { try { const res = await fetch(url); return await res.json(); } catch (e) {}}export async function loadPrices(url: string) { const res = await fetch(url, { signal: AbortSignal.timeout(5000) }); if (!res.ok) throw new Error(`prices: HTTP ${res.status}`); return await res.json();}A deadline on the call and the failure raised instead of swallowed.
import { test, expect } from 'vitest';import { total } from '../src/cart'; test.skip('applies the discount', () => { expect(total([10, 20], 0.1)).toBe(27);});import { test, expect } from 'vitest';import { total } from '../src/cart'; test('applies the discount', () => { expect(total([10, 20], 0.1)).toBe(27);});The test runs again; the code is what has to change.
const amount: any = req.body.amount;const key = 'sk_live_51HxQ2eKz8mN3pQ7rT9vW2yA4bC6dE8fG0hJ1kL';const amount = Body.parse(req.body).amount;const key = env.STRIPE_SECRET_KEY;The input validated at the boundary and the key read from the environment.
the engine reads only what the change introduces and refuses known violations with the line, the rule and the expected fix. The file is left untouched.
line 1 [rls] table "clients" created without RLSit runs the project's own lint and type checks. Errors the edit introduced go straight back to the agent.
eslint src/cart.ts → 1 error introduced by this editit re-checks every touched file, runs the related tests and compares existing tests against the start of the turn. A turn only ends clean when the proof is there.
vitest related src/cart.ts → 12 passedseparate reviewers read the diff against the original request and the acceptance criteria, never against the author's own summary. A finding that does not reproduce is dropped.
critic → 2 findings, each with a command that reproduces itWe ran smugan check on popular open-source repositories and read every finding. These are real, at the commit linked; test fixtures and code its authors marked as intentional were left out.
★ 50.3KOpen-source scheduling, an alternative to Calendly
const response = await fetch(subscriberUrl, {
method: "POST",
...
},
redirect: "manual",
body,
packages/features/webhooks/lib/sendPayload.ts:312 [fetch-timeout] server fetch() has no deadline — pass AbortSignal.timeout(...) or signal: so a hang dies fast; a slow peer is worse than a fast error
Webhook delivery POSTs to a subscriber URL that any user registers, with no deadline, so a slow or tarpitting endpoint holds the booking-path worker for up to undici's 300 s default per event instead of failing fast.
Found on the default branch at ae027bb, Nov 13, 2026.
★ 61.3KOpen-source CRM, an alternative to Salesforce
it.only('should fail to execute a query with too many root resolvers', async () => {
const response = await makeGraphqlApiRequest({packages/twenty-server/test/integration/graphql/suites/query-complexity/query-complexity.integration-spec.ts:39 [test-weakening] it.only focuses this test and silently skips the rest of the suite — remove it before finishing
A committed it.only makes Jest skip the other three tests in this suite, so the query-complexity limits that protect the GraphQL API from expensive queries are no longer exercised in CI.
Found on the default branch at 5e6ff7b, Nov 22, 2026.
★ 37.4KHeadless e-commerce platform in Node.js
const listedSets2 = await service.listFulfillmentSets(
{
...
expect(listedSets2).toEqual(listedSets2)
packages/modules/fulfillment/integration-tests/__tests__/fulfillment-module-service/fulfillment-set.spec.ts:107 [test-weakening] assertion compares a constant with itself and passes whatever the code does — assert the result of the code under test
The assertion compares listedSets2 with itself instead of with listedSets, so the check that listing is deterministic in order always passes even if ordering breaks.
Found on the default branch at f3c5aa7, Nov 20, 2026, after the v2.23.0 release.
★ 25.2KLink shortener and link attribution platform
if (body.action === "disconnect") {
try {
await prisma.installedIntegration.delete({
where: {
...
} catch {}
apps/web/app/(ee)/api/shopify/integration/callback/route.ts:83 [empty-catch] empty catch swallows the error — handle it, rethrow, or log with context; never fail silently
On Shopify disconnect a failed delete (e.g. the integration was installed by another workspace member, since the key includes userId) is swallowed and the route still returns success, leaving the encrypted Shopify access token active.
Found on the default branch at 6b463b4, Oct 26, 2026.
Narrow, deterministic rules, where a fixed answer is worth more than an opinion. Choose a row.
A Supabase table created without row-level security in the same migration.
A policy that lets a browser role update or delete every row, or trusts user_metadata.
Permissions granted to the anonymous role.
SQL identifiers that are not English snake_case.
Known secret formats in source files of any language, and database URLs that carry a password.
A server network call with no deadline, so a slow peer hangs the request.
A catch block that swallows the error.
Skipped, focused, pending or assertion-free tests, and markers that make a failing test pass.
Floating-point types used for money.
A mutation that changes data without updating the screen.
An existing test that lost or loosened assertions while production code changed.
A repro script nothing references, or config changed without the request mentioning it.
The engine is the same everywhere. What changes is how much each platform lets a hook block.
Smugan is the Old Germanic verb that, by Tolkien's own account, gave the dragon of The Hobbit his name: to squeeze through a hole. His armour had one bare patch.
No. It runs your lint, typecheck and the tests related to the touched files inside the agent's turn, so problems get fixed before the work is handed back. Full builds and mutation testing stay in CI.
Claude Code (global install or plugin), Codex, OpenCode, Antigravity and Grok Build. The engine is the same; each adapter documents what that platform lets a hook block.
The rules favor precision, so an ambiguous pattern may pass. When a rule is wrong for a line, add // smugan-ignore <rule>: <reason> next to it; the reason must be at least six characters and stays in the code for the next reader.
No. Only what the change introduces blocks; old problems in a file stay visible without blocking. For a codebase with a lot of debt, "mode": "warn" reports without blocking while you clean up.
Before a write it only reads the change. At the end of the turn the scripts share one deadline, and if Smugan itself fails or times out, the work goes through rather than hang. Verification follows risk: a typo gets no reviewer, a migration gets the full set.
Yes. SMUGAN_DISABLE at install, or "disable" in smugan.config.json for one project, turns off a reviewer, a skill or a stack rule. Cost profiles choose which model reviews.
Nothing. It is MIT licensed open source.
Node 22 or newer and Claude Code. The installer can run again safely and only touches the blocks it manages.
git clone https://github.com/DenisCDev/smugan.git smugan
cd smugan
./install.sh
smugan doctorgit clone https://github.com/DenisCDev/smugan.git smugan
cd smugan
cd adapters/codex && ./install.shgit clone https://github.com/DenisCDev/smugan.git smugan
cd smugan
cd adapters/opencode && ./install.shgit clone https://github.com/DenisCDev/smugan.git smugan
cd smugan
cd adapters/antigravity && ./install.shgit clone https://github.com/DenisCDev/smugan.git smugan
cd smugan
cd adapters/grok && ./install.sh