backend-production-deploy

backend-production-deploy is a skill for Claude Code, Codex from lh17708357536-gif/flutter-cn-overseas-app-skills. It costs 66 tokens per session (3,486 once invoked), scanned B, original, MIT.

A production deployment procedure for NestJS and Prisma backends running with PM2 and Nginx on a remote server. Prisma manages database access, PM2 keeps the application running, and Nginx handles web traffic.

In plain words
What is it for?
Use it to prepare and perform approved deployments, update dependencies and the database, rebuild and restart the backend, synchronise uploaded files, and run health checks.
Why use it?
It reduces deployment mistakes by requiring a preview of file changes, protecting production settings, synchronising uploads, and checking the service after restart.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; positional $N argument.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./build/app/outputs/flutter-apk/app-cn-release.apk \.

Good fit Use it to prepare and perform approved deployments, update dependencies and the database, rebuild and restart the backend, synchronise uploaded files, and run health checks.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/lh17708357536-gif/flutter-cn-overseas-app-skills
agentmods
npx agentmods add skills/lh17708357536-gif/flutter-cn-overseas-app-skills/backend-production-deploy

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backend-production-deploy

README.md
[![agentmods](https://agentmods.dev/badge/skills/lh17708357536-gif/flutter-cn-overseas-app-skills/backend-production-deploy/github.svg)](https://agentmods.dev/skills/lh17708357536-gif/flutter-cn-overseas-app-skills/backend-production-deploy)
Your own site
<a href="https://agentmods.dev/skills/lh17708357536-gif/flutter-cn-overseas-app-skills/backend-production-deploy"><img src="https://agentmods.dev/badge/skills/lh17708357536-gif/flutter-cn-overseas-app-skills/backend-production-deploy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for backend-production-deploy

Your own site · 80×15
<a href="https://agentmods.dev/skills/lh17708357536-gif/flutter-cn-overseas-app-skills/backend-production-deploy"><img src="https://agentmods.dev/badge/skills/lh17708357536-gif/flutter-cn-overseas-app-skills/backend-production-deploy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,486 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00066 $0.03486
Opus 5 $0.00033 $0.01743
Sonnet 5 $0.00013 $0.00697
Haiku 4.5 $0.00007 $0.00349

Measured 12d ago against content hash 29edc732f956, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

backend-production-deploy scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

chmod 600 "$SSH_KEY" 2>/dev/null || true

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

6. 健康检查:curl 内网 + 外网 + pm2 logs 末 60 行无 error
skills/backend-production-deploy/SKILL.md · 285 lines

How it starts

The opening of the file, as written. The whole thing — 285 lines — stays where its author put it; the contents beside it link to each section on GitHub.

后端生产部署 SOP

本 skill 蒸馏自实际生产经验,覆盖 NestJS + Prisma + PM2 + Nginx 的标准部署链路。所有 <PLACEHOLDER> 在新项目落地前需替换为真实值(建议放到 scripts/deploy-backend.sh 顶部变量段)。

强约束(不可违反)

  1. 未经用户明确同意,禁止任何对生产的写操作rsync 上传 / pm2 restart / prisma db push / npm install / .env 修改 / nginx reload / 写生产 uploads 都属于"写操作"。本地代码完善随时可做,部署前必须 ask & wait
  2. 生产 .env 永远不被覆盖 — 只允许"追加缺失键",禁止 rsync 同步 .env*
  3. dry-run 先于正式 rsync — 任何代码同步前先跑 rsync -n --itemize-changes 看实际要传的文件清单,向用户确认无意外。
  4. uploads 必须双向补齐 — 本地与生产共享数据库但分别本地磁盘存上传文件,任意一方生成图片对方就 404;必须 --ignore-existing 双向 rsync。
  5. buildNumber 重用风险 — 触发部署的客户端版本如果牵涉 iOS/Android,参考 ios-app-store skill 的版本号纪律。

6 步标准 SOP

1. git status --short            # 摸底:本次涉及哪些文件
2. rsync -n(dry-run)            # 看实际要传什么;用户审核
3. rsync 正式上传                 # 排除 .env / node_modules / uploads / dist / logs / ...
4. uploads 双向补齐               # remote→local,再 local→remote,都 --ignore-existing
5. 远程:npm install / db push / build / pm2 restart --update-env
6. 健康检查:curl 内网 + 外网 + pm2 logs 末 60 行无 error

每步对应模板见下文。


1. 配置变量(写在 scripts/deploy-backend.sh 顶部)

SSH_KEY="${SSH_KEY:-<SSH_KEY_PATH>}"          # 例:/tmp/prod_server_key
REMOTE_HOST="<REMOTE_USER>@<PROD_HOST>"        # 例:[email protected]
REMOTE_PATH="<REMOTE_PROJECT_PATH>"            # 例:/www/wwwroot/server
LOCAL_PATH="<LOCAL_PROJECT_PATH>/server"        # 例:/Users/me/code/myapp/server
PM2_APP_NAME="<PM2_APP_NAME>"                  # 例:myapp-api
PROD_DOMAIN="<PROD_DOMAIN>"                    # 例:myapp.com

校验:

if [[ ! -f "$SSH_KEY" ]]; then
  echo "❌ SSH 密钥不存在: $SSH_KEY"; exit 1
fi
chmod 600 "$SSH_KEY" 2>/dev/null || true

2. dry-run 模板(read-only,让用户先审)

rsync -avzn --itemize-changes -e "ssh -i $SSH_KEY -o StrictHostKeyChecking=no" \
  --exclude ".env" \
  --exclude ".env.*" \
  --exclude "*.backup-*" \
  --exclude ".DS_Store" \
  --exclude "node_modules/" \
  --exclude "dist/" \
  --exclude "coverage/" \
  --exclude "logs/" \
  --exclude "uploads/" \
  --exclude "keys/" \
  --exclude "scripts/rembg-env/" \
  --exclude "prisma/dev.db" \
  --exclude "prisma/test.db" \
  --exclude "prisma/prisma/" \
  --exclude "src/h5/public/downloads/*.apk" \
  --exclude "src/h5/public/downloads/*.aab" \
  "$LOCAL_PATH/" \
  "$REMOTE_HOST:$REMOTE_PATH/"

Read the full file on GitHub · 285 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 285 lines · 66 tokens per session scan B 29edc732f956

Subscribe to this mod's changes

backend-production-deploy is a skill published in the GitHub repository lh17708357536-gif/flutter-cn-overseas-app-skills (20 stars, last pushed 2mo ago), licensed MIT. It adds 66 tokens to every session and 3,486 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

domestic-integration

A reference for integrating Chinese services, including WeChat Pay, Alipay, Alibaba Cloud, Tencent Cloud, Huawei Cloud, messaging platforms, and SMS providers.

ChanningLua/prax-agent · 23 tokens

firebase-cloud-functions

Use for Firebase Cloud Functions callable functions, HTTP functions, triggers, server-side validation, security, deployment and local testing.

GDvega/super-android-kotlin-firebase-skill · 28 tokens

stripe-projects

Provision SaaS services + sync creds via Stripe Projects.

NousResearch/hermes-agent · 15 tokens

azure-eventhub-dotnet

Azure Event Hubs SDK for .NET. Use for high-throughput event streaming: sending events (EventHubProducerClient, EventHubBufferedProducerClient), receiving events (EventProcessorClient with checkpointing), partition management, and real-time data ingestion. Triggers: "Event Hubs", "event streaming"…

microsoft/skills · 94 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

wikipedia

Search and read Wikipedia via x wkp — MediaWiki API, no API key, zero install; query, extract, suggest, and DDG route in one module. Load for wiki, wikipedia, encyclopedia lookup, article summary.

x-cmd/x-cmd · 49 tokens