Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Analyze pull requests for detection coverage gaps and recommend additional detections, story alignments, and test coverage to extend PRs before merge.
.claude/skills/mhaggis-pr-extension-workflow/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 35% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 77% | 0% |
| case-21 | ✗→✓ | ▲ Improved | 51% | 0% |
| case-22 | ✗→✓ | ▲ Improved | -1% | 0% |
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:
markdown## 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-ruleOther measured skills in the registry, with their headline benchmark lift.