library/specializations/security-compliance/skills/semantic-code-analyzer/SKILL.md
LLM-powered semantic analysis of code diffs to detect business-logic trojans
npx skillsauth add a5c-ai/babysitter semantic-code-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.
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.
{
"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)"
}
}
}
{
"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" }
}
}
skill: {
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)development
Model documentation skill for generating model cards following Google's model card framework.
development
MLflow integration skill for experiment tracking, model registry, and artifact management. Enables LLMs to log experiments, compare runs, manage model lifecycle, and retrieve artifacts through the MLflow API.
data-ai
LIME-based local explanation skill for individual predictions across tabular, text, and image data.
devops
Kubeflow Pipelines skill for ML workflow orchestration, component management, and Kubernetes-native ML.