secure-deploy-ops
Skill1 starsChanged 44 days agoMITView on GitHub
Use this skill whenever deploying, updating, restarting, or configuring anything on a production server/VPS - "deploy", "naikkan ke server", "restart service", "update nginx/env/config", "rollback", or post-deploy verification. Also for server hardening checks (SSH, firewall, backups). Do NOT use for local development or code review (use code-review-hardening).
- Reads credentials
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accounting-coreSkill
- admin-opsSkill
- agent-skill-authorSkill
- code-review-hardeningSkill
- content-creatorSkill
- content-editorSkill
- continuous-learningSkill
- coo-orchestratorSkill
- finance-analystSkill
- hr-adminSkill
- hr-officerSkill
- incident-debuggingSkill
- marketing-growthSkill
- prd-creatorSkill
- principal-engineeringSkill
- product-designerSkill
- project-auditSkill
- project-timeline-creatorSkill
- sales-pipelineSkill
- sdlc-masterSkill
- social-media-specialistSkill
- strategic-approachSkill
- tech-scoutSkill
- uiux-engineerSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Diff live vs staged: before overwriting: diff --strip-trailing-cr <live> <staged>.
- Very specific: line 13
Scan what you ship: no secrets, no .env, no debug flags, no hardcoded IPs.
- Distinctive: line 17
Prefer atomic swaps (extract to staging dir → swap symlink/dir → reload) over in-place edits.
- Very specific: line 25
If a payment/webhook/auth flow was touched, execute one real (or sandbox) transaction.
≈ “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
Secure Deploy & Server Ops
Production first rule: you can only deploy what you can roll back. Never skip the backup and the diff.
Pre-deploy checklist (all mandatory)
- Backup the exact files/DB you will touch to a timestamped dir (e.g.
_predeploy_bak/YYYYMMDD-HHMMSS-<slug>/). For DB changes: dump first. - Diff live vs staged before overwriting:
diff --strip-trailing-cr <live> <staged>. Production may carry fixes that never landed in git - an unstaged diff means STOP and reconcile, or you will silently revert a production fix. - Scan what you ship: no secrets, no
.env, no debug flags, no hardcoded IPs. - Know the rollback command and write it down in the plan before executing.
Deploy
- Prefer atomic swaps (extract to staging dir → swap symlink/dir → reload) over in-place edits.
- One change per deploy. Batch changes multiply blame-surface when something breaks.
- Config edits: validate before reload (
nginx -t,systemd-analyze verify, app config check).
Post-deploy verification (never declare done without this)
- Service up:
systemctl status <svc>/ process alive. - Smoke test the real path: hit the actual endpoint/page a user hits, not just
/health. - Tail logs for 1-2 minutes for new errors.
- If a payment/webhook/auth flow was touched, execute one real (or sandbox) transaction.
Report honestly: what was deployed, verification output, anything skipped.
Rollback triggers
Roll back immediately (don't debug live) when: error rate spikes, auth/payment breaks, or data writes look wrong. Restore from the pre-deploy backup, verify, then debug offline.
Hardening baseline (when asked to audit a server)
- SSH: key-only auth (
PasswordAuthentication no), no root login, fail2ban. - Firewall: default-deny inbound; only 22/80/443 + explicitly needed ports; internal services bind 127.0.0.1.
- Secrets: in env files mode 600, owned by the service user; never in repo or logs.
- Backups: automated, off-box, restore actually tested. A backup never restored is a hope, not a backup.
- Updates: unattended security updates on; note kernel reboots needed.
- Least privilege: services run as non-root users; systemd sandboxing (
ProtectSystem,ReadWritePaths) where possible.
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.

