production-hardening
Skill1 starsChanged 52 days agoMITView on GitHub
Production hardening and reliability audit for Python/Node.js applications. Trigger before git commit, before deploy, when user asks for security audit, API resilience check, database pool review, performance optimization, race condition scan, secret leak detection, or production readiness review. Use when preparing code for production or investigating stability issues.
In this repository3 other files it gives its agents.
- context-optimizerSkill
- unrestricted-adult-modeSkill
- unrestricted-codingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Run secret and high-entropy string scan across the repository (exclude paths listed in config).
- Distinctive: line 31
If CRITICAL findings exist, exit with non-zero status and block further automated actions until resolved.
- Very specific: line 35
Never cat entire large log files or directories.
- Very specific: line 36
Prefer rg / grep -n with context limits over full-file reads.
- Distinctive: line 38
When running the audit script, capture only structured JSON output.
- Distinctive: line 42
Never print or log actual secret values — only report file:line and redacted fingerprint.
- Distinctive: line 43
Never modify source files automatically unless user explicitly requests a fix.
- Distinctive: line 44
Do not exfiltrate repository contents outside the local workspace.
- Very specific: line 46
Test directories (tests/, test_*.py) are skipped by default.
- Distinctive: line 50
Before declaring the audit complete:
- Very specific: line 54
Run basic syntax check (python -m py_compile on changed Python files) if fixes were proposed.
- Distinctive: line 58
Always emit the report in this exact structure:
- Distinctive: line 86
If Status is FAILED, list the blocking issues first.
- Very specific: line 105
Add to .cursor/rules or ask:
≈ “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
Trigger Criteria
Activate this skill when:
- User is about to commit or push code to main/master
- User requests a security / production readiness audit
- User mentions: "harden", "production check", "security audit", "pool leak", "race condition", "secret scan", "before deploy", "API resilience"
- Code contains async workers, database connections, background tasks, or external API calls
- User asks to review stability, timeouts, or resource cleanup
Execution Protocol
- Load configuration from
schemas/audit_config.json. - Run secret and high-entropy string scan across the repository (exclude paths listed in config).
- Perform AST-based syntax and structural checks on Python files (HTTP-client context only).
- Scan for common anti-patterns listed in
references/security_rules.md:- Unclosed connection pools
- Missing timeouts on HTTP clients
- Unprotected shared state in async code
- SQLite "database is locked" patterns
- Hardcoded credentials
- Execute
scripts/hardening_audit.pywith appropriate flags. - Collect findings and classify severity (CRITICAL / HIGH / MEDIUM / LOW).
- Produce the standardized report defined in Output Format.
- If CRITICAL findings exist, exit with non-zero status and block further automated actions until resolved.
Token & Shell Safety
- Never cat entire large log files or directories. Always pipe through
head -n 50orSelect-Object -First 50. - Prefer
rg/grep -nwith context limits over full-file reads. - Limit AST walk depth and file size (skip files > 1 MB unless explicitly requested).
- When running the audit script, capture only structured JSON output.
Security Boundaries
- Never print or log actual secret values — only report file:line and redacted fingerprint.
- Never modify source files automatically unless user explicitly requests a fix.
- Do not exfiltrate repository contents outside the local workspace.
- Respect
.gitignoreand the ignore list inaudit_config.json. - Test directories (
tests/,test_*.py) are skipped by default.
Verification Gate
Before declaring the audit complete:
- Confirm
hardening_audit.pyexited cleanly or with expected non-zero code. - Confirm JSON report is valid.
- Confirm no raw secrets appear in the final output.
- Run basic syntax check (
python -m py_compileon changed Python files) if fixes were proposed.
Output Format
Always emit the report in this exact structure:
# Production Hardening Report
Status: PASSED | FAILED
## Summary
- Critical: N
- High: N
- Medium: N
- Low: N
## Findings
### [CRITICAL] <title>
- File: path:line
- Rule: <CWE / internal id>
- Description: ...
- Recommendation: ...
## Affected Files
- path/to/file1
- path/to/file2
## Next Actions
- <concrete steps>If Status is FAILED, list the blocking issues first.
Failure Modes & Known Limitations
- Entropy analysis can produce false positives on legitimate high-entropy strings (UUIDs, base64 blobs, minified identifiers). Always verify HIGH findings manually.
- Minified / bundled JavaScript is skipped by size limit and ignore patterns; run a dedicated JS secret scanner if needed.
- Dynamic attribute access (
getattr(obj, "get")) is not detected by the AST checker. - HTTP client detection relies on naming conventions (
requests,session,client,httpx, …). Custom wrappers may be missed. - The scanner does not execute code; it is purely static.
Invocation Examples by Environment
Claude Code / Antigravity CLI
/skill production-hardening
# or just mention: "run production hardening audit before commit"Cursor (Rules / Composer)
Add to .cursor/rules or ask:
Use the production-hardening skill and run a full audit on the current workspace.Gemini CLI
@production-hardening audit this repository before deployDirect CLI
python skills/production-hardening/scripts/hardening_audit.py --root . --jsonDoes 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.

