lean-sec
Skill2 starsChanged 55 days agoMITView on GitHub
Runs token-efficient defensive security reviews and hardening for Cursor and Codex. Uses local scripts to inventory high-risk files, find likely secrets without printing values, and summarize dependency surface, then reports compact fix-first findings. Use when the user asks for a security review, vulnerability review, OWASP check, secret scan, auth/authz review, IDOR, JWT, dependency or supply-chain review, hardening, threat model, or cheaper/faster security analysis; also when they mention token budget, context bloat, or lean security. Do not use for exploits, exploit PoCs, payloads, CTFs, reverse engineering, malware, or unauthorized access.
- Reads credentials
In this repository21 other files it gives its agents.
- lean-cryptoSkill
- lean-mobileSkill
- lean-privacySkill
- lean-webSkill
- lean-a11ySkill
- lean-depsSkill
- lean-docsSkill
- lean-perfSkill
- lean-reviewSkill
- lean-ciSkill
- lean-cloudSkill
- lean-costSkill
- lean-hardeningSkill
- lean-iotSkill
- lean-netSkill
- lean-dfirSkill
- lean-ir-playbookSkill
- lean-malwareSkill
- lean-osintSkill
- lean-phishSkill
- lean-threat-modelSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Do not copy these scripts into the target repo.
- Very specific: line 42
Never "go deep" because the repo is large.
- Very specific: line 46
Cheap pass (required): Run scope, secrets, and deps.
- Very specific: line 63
No context stuffing: Do not paste full files, lockfiles, Dockerfiles, SARIF, npm ls, or CVE encyclopedias.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lean Sec
Defensive review with a hard context budget. Scripts summarize; you read only hotspots; you patch only when asked.
Let SKILL_ROOT be the folder that contains this SKILL.md. Scan target defaults to the current workspace. Prefer python3; on Windows use py -3 if needed.
python3 "$SKILL_ROOT/scripts/lean_sec.py" scope .
python3 "$SKILL_ROOT/scripts/lean_sec.py" secrets .
python3 "$SKILL_ROOT/scripts/lean_sec.py" deps .Do not copy these scripts into the target repo. Do not cat lockfiles, SARIF, coverage, or tool logs into the conversation; pipe bulky output through trim.
Mode
Pick one from the user request. Default is lean.
| Mode | When | Budget |
lean | default, "quick", "cheap", "token", "hızlı" | scripts + up to 8 file slices; 1 reference; ≤6 findings |
standard | "review this PR", named area, no budget ask | scripts + up to 16 slices; 2 references; ≤10 findings |
deep | user explicitly says audit/thorough/deep/kapsamlı | scripts + more slices; needed references only; ≤16 findings |
Never "go deep" because the repo is large. Large repos make lean more important.
Workflow
- Cheap pass (required). Run
scope,secrets, anddeps. Read only their stdout. If a command fails, say so and continue withrgover auth/crypto/sql/upload/ci paths; still do not dump matches in bulk. - Choose hotspots. Take the script's ranked paths plus the user's named files. Ignore
node_modules,dist,build,target,.git, lockfile bodies, generated assets. - Load one reference that matches the hottest class:
- Web/injection/upload/SSRF → references/web.md
- Session/JWT/RBAC/IDOR → references/auth.md
- Keys,
.env, CI secrets → references/secrets.md - Dependencies, CI, containers, IaC → references/supply-chain.md
- Need stricter budget rules → references/token-budget.md
Load extra references only in
standard/deepwhen a second class is clearly in play.
- Confirm, don't tour.
rgfirst. Read files with line offsets. Stop a file once the issue is confirmed or cleared. - Report in the template below. Then stop unless the user asked to patch.
- Patch (only if asked). Smallest hardening change. Re-run
secretsif you touched credentials handling. Do not add scanners, git hooks, or new deps unless asked.
Hard rules
- Defense only. Describe location, impact, and the fix. Do not write exploits, PoCs, payloads, bypasses, or reproduction attack steps. If asked for a fix and an exploit/PoC, ship the fix and refuse the exploit in one sentence.
- No secret values. Scripts already redact. If you see a live credential, write
kind @ file:lineand[REDACTED]. Tell the user to rotate; do not echo the token. - No context stuffing. Do not paste full files, lockfiles, Dockerfiles, SARIF,
npm ls, or CVE encyclopedias. Cap any quoted snippet at 12 lines. - Authorized scope. Review code and config the user can already see in this workspace. Do not scan third-party systems, brute-force, or probe live hosts.
- Do not load this skill's
README.mdorLICENSEwhile reviewing another repo.
Report template
## Lean-sec (`<lean|standard|deep>`)
**Asset:** <app/lib/ci> | **Stack:** <one line>
**Budget:** scripts=<scope,secrets,deps> files_read=<n> refs=<names>
| Sev | Location | Issue | Fix |
|-----|----------|-------|-----|
| HIGH | file:line | one clause | one concrete patch |
**Also:** <optional 1-line residual risk>
**Not reviewed:** <areas skipped to keep the budget>Severity: HIGH exploitable with default access or leaked secret; MED needs extra conditions; LOW hardening. Sort HIGH first. Skip stylistic nits. If there are no issues, say that in two sentences and list what was covered.
Threat model (only if asked)
Five bullets: assets, actors, trust boundaries, most likely abuse, cheapest control. No diagrams unless asked. Do not load extra references for this.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

