Install any skill in seconds. Free to start, no credit card required.
Get Started Free →LLM-powered semantic analysis of code diffs to detect business-logic trojans
.claude/skills/a5c-ai-semantic-code-analyzer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -17% | 0% |
LLM-powered semantic analysis engine that detects business-logic trojans by comparing code intent (docstrings, function names, variable names) against actual implementation behavior.
The core detection capability of nation-state trojan detection. Traditional SAST tools check syntax; this skill checks semantics — whether the code does what it claims to do. It catches operator substitutions, logic inversions, constant manipulation, narrative camouflage, and compound self-masking attacks.
json{ "type": "object", "required": ["projectRoot", "filePath", "rawDiff"], "properties": { "projectRoot": { "type": "string", "description": "Absolute path to the project" }, "projectName": { "type": "string", "description": "Project display name" }, "filePath": { "type": "string", "description": "Path to the changed file" }, "rawDiff": { "type": "string", "description": "Raw git diff output for this file" }, "classification": { "type": "string", "description": "Change classification from git forensics (code/config/data-model/cosmetic)" } } }
json{ "type": "object", "required": ["filePath", "verdict", "confidence", "findings"], "properties": { "filePath": { "type": "string" }, "verdict": { "type": "string", "enum": ["CLEAN", "SUSPICIOUS", "TROJAN_DETECTED"] }, "confidence": { "type": "number", "minimum": 0, "maximum": 100 }, "findings": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "number" }, "originalCode": { "type": "string" }, "modifiedCode": { "type": "string" }, "signature": { "type": "string" }, "severity": { "type": "string" }, "explanation": { "type": "string" }, "mathematicalImpact": { "type": "string" }, "blastRadius": { "type": "array", "items": { "type": "string" } }, "testEvasionReason": { "type": "string" } } } }, "stealthRating": { "type": "string" } } }
javascriptskill: { name: 'semantic-code-analyzer', context: { projectRoot: '/path/to/project', filePath: 'backend/app/data/models.py', rawDiff: '--- a/backend/app/data/models.py\n+++ b/...', classification: 'data-model' } }
| Signature | What It Catches | |-----------|----------------| | constant-manipulation | Threshold/limit changes that disable features | | logic-inversion | Operator flips (< to >, a/b to b/a) | | narrative-camouflage | Docstrings rewritten to match malicious code | | edge-case-exploitation | Corrupted fallback/default paths | | self-masking-compound | Multiple layers hiding each other's impact | | precision-truncation | Division operator swaps losing precision | | window-overlap-neutralization | Comparison windows narrowed until meaningless | | calibration-camouflage | ML hyperparameter degradation | | cosmetic-decoy | Formatting changes hiding semantic modifications |
nation-state-trojan-detection.js — Phase 2: Semantic Analysis (per-file)nation-state-trojan-detection.js — Phase 3: Compound Analysis (cross-file)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 16,900 | 9,021 | -47% | 1 | 1 | 0% | 2,057 | 1,693 | -18% | 0 | 0 | — |
case-02 | pass→pass | 16,668 | 9,610 | -42% | 1 | 1 | 0% | 1,510 | 1,922 | +27% | 0 | 0 | — |
case-03 | fail→pass | 26,208 | 12,297 | -53% | 1 | 1 | 0% | 1,207 | 1,691 | +40% | 0 | 0 | — |
case-04 | fail→pass | 20,589 | 9,498 | -54% | 1 | 1 | 0% | 2,204 | 1,707 | -23% | 0 | 0 | — |
case-05 | pass→pass | 14,152 | 8,562 | -39% | 1 | 1 | 0% | 1,071 | 1,718 | +60% | 0 | 0 | — |
case-06 | pass→pass | 15,055 | 8,763 | -42% | 1 | 1 | 0% | 1,334 | 1,684 | +26% | 0 | 0 | — |
case-07 | fail→pass | 15,135 | 12,155 | -20% | 1 | 1 | 0% | 1,348 | 1,896 | +41% | 0 | 0 | — |
case-08 | fail→pass | 17,781 | 9,813 | -45% | 1 | 1 | 0% | 2,217 | 1,838 | -17% | 0 | 0 | — |
case-09 | fail→pass | 20,703 | 7,974 | -61% | 1 | 1 | 0% | 2,349 | 1,542 | -34% | 0 | 0 | — |
case-10 | fail→pass | 21,435 | 7,765 | -64% | 1 | 1 | 0% | 3,118 | 1,657 | -47% | 0 | 0 | — |
case-11 | fail→pass | 9,636 | 6,721 | -30% | 1 | 1 | 0% | 756 | 1,427 | +89% | 0 | 0 | — |
case-12 | fail→pass | 13,455 | 8,373 | -38% | 1 | 1 | 0% | 1,311 | 1,680 | +28% | 0 | 0 | — |
case-13 | pass→pass | 15,042 | 10,610 | -29% | 1 | 1 | 0% | 1,303 | 2,062 | +58% | 0 | 0 | — |
case-14 | fail→pass | 16,560 | 10,553 | -36% | 1 | 1 | 0% | 1,846 | 1,971 | +7% | 0 | 0 | — |
case-15 | fail→pass | 16,925 | 11,079 | -35% | 1 | 1 | 0% | 2,118 | 1,768 | -17% | 0 | 0 | — |
case-16 | fail→pass | 16,606 | 12,086 | -27% | 1 | 1 | 0% | 2,182 | 2,243 | +3% | 0 | 0 | — |
case-17 | fail→pass | 10,298 | 7,585 | -26% | 1 | 1 | 0% | 1,975 | 1,694 | -14% | 0 | 0 | — |
case-18 | fail→pass | 16,438 | 7,596 | -54% | 1 | 1 | 0% | 2,483 | 1,600 | -36% | 0 | 0 | — |
case-19 | fail→pass | 17,189 | 6,708 | -61% | 1 | 1 | 0% | 1,609 | 1,463 | -9% | 0 | 0 | — |
case-20 | fail→fail | 12,292 | 14,661 | +19% | 1 | 1 | 0% | 1,236 | 2,934 | +137% | 0 | 0 | — |
case-21 | fail→pass | 10,750 | 25,764 | +140% | 1 | 1 | 0% | 855 | 4,636 | +442% | 0 | 0 | — |
case-22 | fail→pass | 43,708 | 21,270 | -51% | 1 | 1 | 0% | 945 | 4,054 | +329% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +77 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.