.claude/skills/pr-extension-workflow/SKILL.md
Analyze pull requests for detection coverage gaps and recommend additional detections, story alignments, and test coverage to extend PRs before merge.
npx skillsauth add mhaggis/security-detections-mcp PR Extension WorkflowInstall 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.
When a PR adds new detections, there are often opportunities to extend coverage before merge — additional sub-techniques, missing analytic story associations, untested scenarios, or related detections that should ship together. This skill provides a systematic workflow for analyzing and extending detection PRs.
Examine every detection file in the PR:
For each technique in the PR, check:
For each detection:
Finding stories:
search_stories("<threat_name>")
search_stories("<technique_category>")
For each detection in the PR:
Based on the gap analysis, recommend:
When recommending PR extensions, use this format:
## PR Extension Recommendations
### Current Coverage
- Detections: N new, M modified
- Techniques: T1059.001, T1059.003
- Stories: "Windows Command Line Abuse"
### Recommended Additions
#### 1. [Priority: High] Add T1059.007 JavaScript Detection
- **Reason:** PR covers PowerShell and cmd.exe but misses JavaScript/JScript execution
- **Data source:** Sysmon EventCode 1 (process creation)
- **Suggested approach:** Monitor for wscript.exe/cscript.exe with suspicious arguments
#### 2. [Priority: Medium] Create Analytic Story "Script Interpreter Abuse"
- **Reason:** Detections span multiple scripting sub-techniques but no unifying story
- **Suggested detections to include:** All T1059.* from this PR + existing T1059.005
#### 3. [Priority: Low] Add Linux Coverage for T1059.004 (Unix Shell)
- **Reason:** PR is Windows-only but T1059 has Linux sub-techniques
- **Data source:** auditd / syslog process creation
Use these to quickly identify what a PR is missing:
# Find all sub-techniques under a parent
get_technique("T1059") → Lists all sub-techniques
# Check existing detection coverage
get_technique_count("T1059.001") → How many detections exist
get_technique_count("T1059.007") → Is this sub-technique covered?
# Find similar detections already in the repo
find_similar_detections("JavaScript execution via wscript")
# Check what stories exist for this area
search_stories("command line")
search_stories("scripting")
| PR Contains | Often Missing | Priority | |------------|---------------|----------| | Process creation detections | Parent process context checks | High | | Single-platform detection | Cross-platform variant | Medium | | Execution detection | Corresponding persistence detection | High | | Generic technique detection | Specific sub-technique variants | Medium | | Detections without story | Story association or new story | Medium | | High-severity detections | Corresponding hunting queries | Low | | Signature-based detection | Behavioral/anomaly variant | Medium |
If your detection repo has CI/CD validation:
contentctl validatesigma check rule.yml or sigma convert -t <backend>python -m detection_rules validate-ruletesting
Expert at analyzing unstructured threat intelligence reports (CISA alerts, vendor blogs, research papers) and extracting actionable detection logic, TTPs, behavioral indicators, and MITRE ATT&CK mappings. Focuses on behaviors over IOCs. Use when provided with threat reports, security advisories, or campaign documentation.
testing
Analyze software supply chain attacks across package registries (npm, PyPI, RubyGems), CI/CD pipelines (GitHub Actions, GitLab CI), and container ecosystems. Includes detection engineering patterns for Splunk, Sentinel, Elastic, and Sigma.
testing
Optimize detection queries for performance across Splunk (SPL), Microsoft Sentinel (KQL), and Elastic Security (EQL/ES|QL). Covers search pipeline internals, common anti-patterns, and optimization techniques for detection rules on each platform.
testing
Expert at creating and validating detection rule files for multiple SIEM platforms. Supports Splunk security_content YAML, Sigma rules, Elastic detection TOML, and KQL analytics. Ensures compliance with repository conventions and optimal query performance. Use when creating or modifying detection rules.