---
name: opengrep
description: "Use when adopting OpenGrep to assess this standard: Test structural rules against real code"
---

# Apply OpenGrep

Encode risky source patterns as reviewed rules. Use positive and negative examples to establish when each rule should report an issue.

## Procedure

1. Inspect the repository configuration and identify the files or targets covered by OpenGrep.
2. Use OpenGrep in this repository to meet this standard: Test structural rules against real code. Encode risky source patterns as reviewed rules. Use positive and negative examples to establish when each rule should report an issue. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.
3. Record the tool version, configuration, scope and findings. Explain any checks that could not run.
4. Use the same invocation after changes and compare the evidence against the baseline.

Refer to [the upstream documentation](https://github.com/opengrep/opengrep) for configuration and prerequisites.

## Worked check

The upstream agent skill instructs agents to test a named YAML rule against annotated source files, interpret missed lines and inspect the call graph when an expected cross-file match is absent.

[Evidence and example](https://github.com/opengrep/skills/blob/main/skills/opengrep/SKILL.md#testing-rules)
