share-lint-matchers-with-parity-tests

Extract shared regex fragments across duplicate lint scanners and prove parity with one probe corpus.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/shuddl/shuddl-os --skill share-lint-matchers-with-parity-tests-shuddl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: share-lint-matchers-with-parity-tests
Source: https://github.com/shuddl/shuddl-os/tree/main/.claude/skills/share-lint-matchers-with-parity-tests
Command: npx skills add https://github.com/shuddl/shuddl-os --skill share-lint-matchers-with-parity-tests-shuddl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? When the same rule is enforced by two hand-copied regexes in different places (migration SQL vs TypeScript source, rate-config side A vs side B), the copies drift and the weaker one becomes an evasion vector — for example, a source scanner that misses INSERT OR REPLACE INTO"events" or schema-qualified main.events while the migration matcher catches both. ## Core Features & Use Cases - Shared matcher fragments: Build the target-matching regex once from shared delimiter, schema, and quote fragments, and have every enforcement surface consume the same builder instead of re-authoring patterns. - Parity testing: Run one evasion probe corpus (abutting quotes, schema-qualified names, bracket and backtick delimiters) through every scanner so divergence fails the test and cannot merge. - Review guidance: Use it when writing identifier/schema/delimiter regexes or reviewing anything under tools/checks/; any new check on a guarded identifier must call the shared builder. - Use Case: While adding a lint rule guarding the append-only tables events, positions, and money_lines, derive both the migration-SQL and TS-source scanners from one guardedTargetMatcher() builder and lock them with a parity test over a shared evasion corpus. ## Quick Start Ask the AI to refactor the duplicated forbidden-replace regexes in tools/checks so both scanners share one matcher builder and add a parity test over a common evasion corpus.

Frequently Asked Questions about share-lint-matchers-with-parity-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep two lint regexes enforcing the same rule in sync?▼

Extract the target-matching fragment once into a shared builder function and have every scanner import it instead of copying the pattern. Then add a parity test that feeds one probe corpus through all scanners so any divergence fails the test.

How do I write a parity test for multiple SQL scanners?▼

Define one corpus of evasion strings — abutting quotes, schema-qualified names, bracket and backtick delimiters — and assert every scanner flags every probe. If one scanner passes a probe another blocks, the test fails and the divergence cannot merge.

What SQL forms commonly evade hand-written lint regexes?▼

The classic bypasses are an abutting quote with no whitespace like INTO"events", and schema-qualified names like main.events or "main".events. Bracket and backtick delimiters also slip past patterns that only handle bare identifiers after whitespace.

When should I not use a shared matcher with parity tests?▼

Skip it when a rule is enforced in exactly one place with no second surface, because there is nothing to keep in parity. The pattern only pays off when the same invariant is guarded in two or more locations.

Why did the copied regex miss schema-qualified table names?▼

The hand-copied scanner required literal whitespace before the table and had no schema fragment, so it only matched bare identifiers after spaces. The shared matcher includes an optional schema qualifier and a zero-width delimiter lookahead, covering both evasion forms.