stackhawk-optimize Cursor ruleA
stackhawk-optimize from stackhawk/agent-skills is a Cursor rule: instructions the Cursor agent follows in that repo.
mdr add stackhawk/agent-skills/cursor/.cursor/rules/stackhawk-optimize.mdc@git:20260914.5fe0d68Pins git:20260914.5fe0d68 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 14 of 14 checks passed
- Kind
- Cursor rule
- Repository
- stackhawk/agent-skills
- Path
cursor/.cursor/rules/stackhawk-optimize.mdc- Versions recorded
- 3
- Latest version
- git:20260914.5fe0d68, committed Sep 14, 2026
- First version recorded
- Jun 30, 2026
- Size
- 7,101 bytes
- Repository stars
- 16
- License
- MIT
Use when the user asks to optimize, tune, or speed up a HawkScan scan, reduce false positives, or pick the right scan policy/plugins/tech flags for an app — or invokes /optimize. Analyzes the codebase, builds an isolated trial scan policy, runs one trial scan, and promotes or discards. Do NOT use for a normal scan or fixing vulns (use stackhawk-hawkscan) or for querying findings/posture (use stackhawk-api).
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Optimize Skill Turn a codebase into an optimal HawkScan configuration. The skill detects the real tech stack and app shape, expresses that as a **trial scan policy** (tech flags + plugins) plus local `stackhawk.yml` corrections, runs one trial scan so the user sees real results, and then promotes the setup or discards it with no residue. ## Why a trial policy (not editing the app) Org scan policies are stored as hosted assets and downloaded by the scanner at scan time when `app.scanPolicy.name` is set (see `references/trial-lifecycle.md`). Creating a trial policy and referencing it in `stackhawk.yml` therefore leaves the application's own policy, plugins, and tech flags **untouched** until the user promotes. This is the core safety property. ## Preflight (run before anything else) ```bash # Identify the driving skill for CLI usage telemetry (read by hawk/hawkop). export _STACKHAWK_SKILL=optimize ``` 1. **CLI versions / auth** — reuse the hawkscan skill's preflight (`hawk version`, `hawk config --help`, `hawk op` auth). Additionally confirm the policy write commands exist: `hawk op policy create --help` must succeed. If it errors with "unrecognized …
Read the whole file at its exact version.
How to install
mdr add stackhawk/agent-skills/cursor/.cursor/rules/stackhawk-optimize.mdc@sha256:d395cb7fef3cfe43The line at the top of this page pins the label git:20260914.5fe0d68, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_m3wp7dovswdz4xtq)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 3 versions of this file, between Jun 30, 2026 and Sep 14, 2026, about one every 38 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260914.5fe0d68 latest | 2026-09-14 | 5fe0d68 | 7,101 B | A | view · diff |
| git:20260708.5dcc3eb | 2026-07-08 | 5dcc3eb | 7,072 B | A | view · diff |
| git:20260630.b97573a | 2026-06-30 | b97573a | 6,950 B | A | view |
Audit of the latest version
- pass: Size between 200 bytes and 200 KB (7101 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
stackhawk/agent-skills · 16 stars · license MIT · pushed 2026-11-06 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_m3wp7dovswdz4xtq GET https://markdownregistry.com/api/v1/resolve?ref=stackhawk/agent-skills/cursor/.cursor/rules/stackhawk-optimize.mdc GET https://markdownregistry.com/api/v1/blob/d395cb7fef3cfe437b16f94719a6670448da573390b8a48741b45278984dbe65
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: Cursor rules vs AGENTS.md · which agent file does what.
More from stackhawk/agent-skills
Every file in stackhawk/agent-skills