Prompt file imported from darksilenxe/darksast (
.github/prompts/add-rule.prompt.md). Fill in{{input}}before use. Copyright stays with the author.
Author or refine exactly one scanner rule for this repository based on this request:
{{input}}
Use these repo instructions as the source of truth:
Required workflow:
- Inspect the most similar existing rules under rules before editing.
- Add or refine one rule file under rules with required fields:
- id
- severity
- framework
- description
- query
- Add or update the smallest relevant test coverage under tests when needed to prove the detection.
- Keep id uppercase with hyphen separators and keep the query precise and deterministic.
- Validate with:
- powershell -NoProfile -ExecutionPolicy Bypass -File ./scripts/scan_entry.ps1 -TargetKey tests
- Review and summarize impact from:
- If the rule appears structurally broad or the test-target results suggest likely noise, run a repo-wide scan and summarize whether the additional findings look acceptable.
Output format:
- Rule change: file updated or created, brief reasoning, and whether this was a new rule or refinement.
- Test coverage: what sample was added or adjusted, or why no test edit was needed.
- Validation: command run and the relevant result summary.
- Impact: intended detections, likely false-positive risk, and any recommended follow-up.