mondoohq/secure-stack/author-detections
- community
Checking that the SKILL.md file is still in the repository.
Catch a security pattern nothing else catches — author a custom, tested xgrep/Semgrep detection rule (including taint-mode dataflow rules), or port an existing rule to new languages. Use when a vulnerability or anti-pattern needs its own detection, or to extend coverage to another language.
Install
npx vskill@latest install mondoohq/secure-stack/author-detectionsSKILL.md
Author Detections
Author production-quality xgrep detection rules — tested and validated — to catch a pattern no existing rule covers, or port an existing rule to new target languages.
When to Use
- Writing xgrep rules for specific bug patterns or security vulnerabilities
- Writing taint mode rules for data flow vulnerabilities
- Writing rules to enforce coding standards
- Porting an existing rule to one or more new target languages
When NOT to Use
- Running existing rulesets (just use
xgrep -f rules.yaml target/) - Triaging scan findings (use the
triage-findingsskill)
Detecting Intent
From scratch (default): The user describes a vulnerability or pattern to detect. Porting: The user provides an existing rule file AND specifies target language(s). Follow the porting workflow in workflow.md.
Rationalizations to Reject
- "The pattern looks complete" -- Still run
xgrep testto verify. Untested rules have hidden false positives/negatives. - "It matches the vulnerable case" -- Matching vulnerabilities is half the job. Verify safe cases don't match (false positives break trust).
- "Taint mode is overkill" -- If data flows from user input to a dangerous sink, taint mode gives better precision than pattern matching.
- "One test is enough" -- Include edge cases: different coding styles, sanitized inputs, safe alternatives, boundary conditions.
- "It passes the tests, so it's done" -- a rule can be correct and still be a
defect. Correctness and cost are separate properties, and the tests only measure the first. Check what the rule costs on a real codebase (workflow.md Step 5).
- "I'll optimize first" -- Write correct patterns first, optimize after all tests pass. Premature optimization causes regressions.
- "The rule found nothing, so the code is clean" -- Far more often the rule is
silently broken. A rule that validates and reports nothing is the single most common failure mode; see Silent-Failure Anti-Patterns in workflow.md and work down the diagnosis checklist before believing a zero.
Anti-Patterns
Read [Silent-Failure Anti-Patterns]({baseDir}/references/workflow.md#silent-failure-anti-patterns) before writing taint rules. Those five produce no finding rather than a wrong one, so a green validate and a passing fixture do not rule them out: a trailing ... binds only the last argument; an out-parameter source without focus-metavariable taints nothing reachable; a bare call pattern also matches the declaration; folding pattern-inside alternatives collapses seeding to one finding per file; and a shape rule tagged subcategory: vuln inflates the false-positive rate instead.
Too broad -- matches everything:
Missing safe cases in tests -- undetected false positives:
Using regex when AST patterns are better:
A taint rule whose sink has no distinctive literal -- scans everything:
This shape is pathological on any large codebase: the vast majority of files cannot contain the sink, but nothing tells the engine that, so the rule seeds taint in all of them. Expect it to dominate scan time and return little.
Overly specific -- misses variations:
Strictness Level
This workflow is strict -- do not skip steps:
- Test-first is mandatory: Never write a rule without tests
- 100% test pass required: "Most tests pass" is not acceptable
- Optimize last: Only simplify patterns after all tests pass
- Avoid generic patterns: Rules must be specific
- Prefer taint mode for data flow vulnerabilities
- One YAML file, one rule: Don't combine multiple rules in a single file
- No generic language: Avoid
languages: genericwhen targeting a specific language - No `todoruleid`: Don't use
todoruleidannotations as a crutch for unfinished rules
Overview
Rules are created iteratively: analyze the problem, write tests first, write the rule, iterate until all tests pass, then optimize.
Approach selection:
- Taint mode (prefer for injection/flow bugs): Tracks data from untrusted sources to dangerous sinks
- Pattern matching: Simple syntactic patterns without data flow requirements
Switching approaches: If taint mode isn't working well (propagation issues, too many FPs), switch to pattern matching. If pattern matching has too many FPs on safe cases, try taint mode. The goal is a working rule.
Output structure -- rule + clean source file + Go table test:
Reference resources:
cve/<lang>/lang/security/<category>/-- Real CVE code samples for test casesdocs/contributing/secure-coding.md-- Dangerous vs safe patterns per languagerules/<lang>/.../<rule>/-- existing rules per language (the live source of coverage)
Quick Start
Source file (insecure-eval.py) -- clean, no annotations:
Go test (test/rules/python/security_test.go):
Run: go test ./test/rules/python/ -run TestPythonInsecureEval -v
References
- Pattern syntax and operators: quick-reference.md
- Step-by-step workflow (creation and porting): workflow.md
- Language capabilities and idiom mapping: language-guide.md
Workflow Checklist
Copy and track progress:
Step 7 is not optional for taint rules. validate checks syntax; it cannot tell a precise rule from one that matches nothing. Verify each source pattern and each sink pattern fires on its own before trusting the combined rule, and check the finding count on a real project — a rule that is correct on a 20-line fixture and silent on a real codebase is the normal shape of these bugs.
Documentation
Before writing rules, read the Semgrep documentation for rule syntax fundamentals:
Part of the secure-your-stack toolkit
Authoring a rule extends what secure-pipeline scans for. Once a rule ships, its findings flow through triage-findings → fix-findings like any other, and the secure-guard mod picks them up automatically as an agent writes code.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/author-detections/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 22 Oct 2026, 5 days ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mondoohq/secure-stack/author-detections)