skills/debugging/semantic-szz-analyzer/SKILL.md
Extends classic SZZ with semantic code understanding to reduce false positives and improve accuracy of bug-introducing commit identification. Use after classic SZZ has produced candidates, when SZZ precision is too low for the task, or when the user needs high-confidence bug-introduction data.
npx skillsauth add santosomar/general-secure-coding-agent-skills semantic-szz-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill is a delta over → szz-bug-identifier. Run classic SZZ first; this skill filters and re-ranks its candidates using semantic understanding instead of line-level blame.
Classic SZZ's precision problem: git blame is textual. It tells you who last touched a line, not who last changed its meaning. A variable rename, an indent, a refactor that moves a line unchanged — all of these become false-positive bug-introducers.
| Filter | What it checks | Effect | | ------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------ | | AST-diff meaningfulness | Did the blamed commit change the line's AST, or only its text? | Drops rename/reformat FPs | | Def-use chain relevance | Does the blamed line define/use a variable that the fix reads/writes? | Drops incidental adjacent-line hits | | Semantic-preserving refactor | Is the blamed commit a known-safe refactor (extract method, inline, rename)? | Reroutes blame to the commit before the refactor | | Bug-pattern match | Does the blamed commit's diff look like it introduces the kind of bug the fix addresses? (null check added → look for the commit that removed a guard or added the deref) | Boosts confidence when matched |
When multiple candidates survive filtering, rank by:
Fix: Adds a null check on user.profile before dereferencing.
Classic SZZ candidates:
a1b2c3d — "Rename p → profile" (6 months ago) — blame hits this because the dereference line was touchede4f5g6h — "Remove unused profile validation" (3 weeks ago) — blame misses this; it touched a different linei7j8k9l — "Add profile feature" (1 year ago) — the original dereferenceSemantic pass:
a1b2c3d: AST-diff → rename only, no behavior change → dropped. Re-blame through it.i7j8k9l. But: bug was reported 3 weeks ago. i7j8k9l is 1 year old — survived a year without a report?e4f5g6h removed validateProfile() which checked non-null.Verdict: e4f5g6h is the true introducer. Classic SZZ missed it entirely because the fix and the removal touch different lines.
Same as szz-bug-identifier, with an additional semantic_evidence field per candidate:
fix: <sha>
candidates (semantic-filtered):
<sha> confidence=<high|med|low>
semantic_evidence: <AST change summary / def-use link / pattern match>
classic_szz_hit: <yes|no — found via semantic reroute>
development
Extracts human-readable pseudocode from a verified formal artifact (Dafny, Lean, TLA+) while preserving the verified properties as annotations, so the proof-carrying logic can be reimplemented in a production language. Use when porting verified code to an unverified target, when documenting what a formal spec actually does, or when handing a verified algorithm to an implementer.
development
Translates natural-language or pseudocode descriptions of concurrent and distributed systems into TLA+ specifications ready for the TLC model checker. Identifies state variables, actions, type invariants, safety properties, and liveness properties from the description. Use when formalizing a protocol, when the user describes a distributed algorithm to verify, when designing a consensus or locking scheme, or when starting formal verification of a concurrent system.
testing
Reduces a TLA+ model so TLC can actually check it — shrinks constants, adds state constraints, abstracts data, or applies symmetry — when the state space is too large to enumerate. Use when TLC runs out of memory, when checking takes hours, or when a spec works at N=2 and you need confidence at larger scale.
development
TLA+-specific instance of model-guided repair — reads a TLC error trace, identifies the enabling condition that should have been false, strengthens the corresponding action, and maps the fix to source code. Use when TLC reports an invariant violation or deadlock and you have the code-to-TLA+ mapping from extraction.