Back to Skills

security-pattern-detection

verified

Detect OWASP Top 10 vulnerabilities via static analysis. Calculate security score (0.00-1.00) for code quality. Auto-generate remediation suggestions with implementation examples. Integrate with Serena for vulnerability tracking and SLA compliance. Use when: securing code, detecting vulnerabilities, improving security posture, validating fixes, enforcing security standards.

View on GitHub

Marketplace

shannon-framework

krzemienski/shannon-framework

Plugin

shannon

Repository

krzemienski/shannon-framework
1stars

skills/security-pattern-detection/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/krzemienski/shannon-framework/blob/main/skills/security-pattern-detection/SKILL.md -a claude-code --skill security-pattern-detection

Installation paths:

Claude
.claude/skills/security-pattern-detection/
Powered by add-skill CLI

Instructions

# Security Pattern Detection - Quantified Vulnerability Assessment

## Purpose

Scan code for OWASP Top 10 vulnerabilities using static analysis. Calculate security score (0.00-1.00) showing vulnerability density. Generate auto-remediation suggestions with code examples. Track vulnerabilities via Serena for SLA compliance and trending.

## When to Use

- Securing new code before deployment
- Identifying OWASP Top 10 patterns
- Enforcing security standards (require 0.85+ score)
- Tracking vulnerability fixes over time
- Validating remediation implementations
- Measuring security improvement ROI

## Core Metrics

**Security Score Calculation:**
```
Score = 1.0 - (Critical×0.2 + High×0.1 + Medium×0.05)
Range: 0.00 (many vulns) to 1.00 (secure)

Critical: ≥0.2 deduction each (auth, injection, secrets)
High: ≥0.1 deduction each (XSS, CSRF, path traversal)
Medium: ≥0.05 deduction each (weak crypto, logging)
```

**Vulnerability Categories (OWASP Top 10):**
- A1: Broken Authentication (score impact: -0.20)
- A2: Sensitive Data Exposure (score impact: -0.20)
- A3: Injection (SQL, NoSQL, command) (score impact: -0.20)
- A4: Broken Access Control (score impact: -0.20)
- A5: Security Misconfiguration (score impact: -0.10)
- A6: XSS (Reflected, Stored, DOM) (score impact: -0.10)
- A7: Insufficient Authentication (score impact: -0.15)
- A8: CSRF (score impact: -0.10)
- A9: Using Components with Known Vulnerabilities (score impact: -0.10)
- A10: Insufficient Logging & Monitoring (score impact: -0.05)

## Workflow

### Phase 1: Vulnerability Detection
1. **Run Semgrep/Bandit**: Scan for OWASP patterns
2. **Classify severity**: Critical, High, Medium, Low
3. **Calculate score**: Apply deductions per formula
4. **Generate report**: List vulnerabilities with locations

**Detection Example:**
```
[CRITICAL] SQL Injection (A3)
File: src/database.js:45
Pattern: query("SELECT * FROM users WHERE id=" + userId)
Fix: Use parameterized query
Score impact: -0.20

[HIGH] Hardcoded Secret (A2)

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4229 chars