Find the right code
Rules inspect bounded parser targets and can ask the provider to resolve ambiguous candidates.
Code checks with judgment
Scruple catches problems linters miss. Use its built-in rules or write your own to turn your team's engineering judgment into checks that run on every change.
1 export async function parseReport() { 2 const file = await open("report.txt"); 3 const report = parse(await file.readFile("utf8")); 4 await file.close(); 5 return report; 6 }
$ pnpm exec scruple src/report.ts
src/report.ts
1:8warningEnsure this resource is cleaned up when work fails. (96%)resources/require-cleanup-on-failure
Rules inspect bounded parser targets and can ask the provider to resolve ambiguous candidates.
Each rule asks one clear question with defined answers.
Rules control the message, severity, and source location.
Where Scruple fits
Catch errors the code can prove.
const seats: number = "12";Type error String is not assignable to number.
Catch valid code that breaks a written standard.
test("creates a user", async () => {
await createUser();
});Scruple warning This test does not verify behavior.
Catch choices that depend on context outside the file.
export const checkoutRollout = 100;Review comment The launch plan starts at 5%, not 100%.
AI decision models
Scruple does not ask a chatbot to review your repository. A rule can ask whether a bounded target is relevant, then sends each selected candidate with one fixed decision question.
Custom rules
Every team has standards that live in review comments. Scruple turns those repeated comments into named, tested rules that run the same way on every change.
Write a ruleerrors“We preserve the original error here.”
tests“This test does not prove the behavior.”
resources“Retries need a deadline.”
comments“Explain why, not what.”
If a review comment starts with “we usually,” it may belong in a Scruple rule.
Start with built-in rules