Applicable Scenarios
Trigger this Skill when a developer describes the following scenarios:
- Deploy FH Skeleton to their own server (plain machine / Docker Compose / Kubernetes)
- Pre-deployment environment preparation, option consultation, secret/password generation
- Guided configuration filling, building, startup, and verification during deployment
- Troubleshooting after deployment failure (log localization, error code investigation)
- Clean up/uninstall a deployed FH Skeleton(stop services, remove containers/K8s resources, delete data as needed)
Semi-automatic interaction protocol (hard rules)
Deployment is aguided semi-automaticprocess: the AI is responsible for thinking and generation, and the user is responsible for executing system-level operations and reporting output.
| Operation | Who does it |
|---|---|
| Environment detection, secret generation, configuration assembly, command generation, result parsing, log troubleshooting | AI |
sudo apt / `docker build |
push/kubectl apply/systemctl/mysql` |
| Dangerous operations (deleting data, rebuilding volumes, overwriting existing configurations) | Must be confirmed first |
Cleanup deployment (docker compose down -v / kubectl delete namespace / delete database / rm -rf configuration) |
Must first confirm "keep data or clear data", and confirm each deletion command a second time |
Process Constraints:
- Give only one command per step (or one group of strongly related commands), and proceed to the next step only after the user reports the output; do not throw all commands out at once
- After the user reports the output, the AI firstdetermines success or failure(success marker/error marker), then decides whether to continue or troubleshoot
- If any
FH_JWT_SECRETand other required variables are missing, generate them first and then continue;replacing them with default values/placeholders is prohibited - When encountering an error not covered by the deployment guide, load
references/部署排障.mdto locate it by symptom - When cleaning up a deployment: first load
references/清理部署.mdand confirm the data retention/clearing policy, then proceed step by step
Three-form Decision Tree
用户说"帮我部署"
→ 加载 prompts/env-probe.sh 内容,让用户执行(或读取环境)
→ 解析探测结果:OS / 架构 / JDK / Maven / Node / Docker / kubectl / MySQL
→ 按以下逻辑推荐形态:
├─ 已有 K8s 集群 + 镜像仓库 → 推荐 Kubernetes(加载 references/k8s部署步骤.md)
├─ 单机 + Docker 24+ → 推荐 Docker Compose(加载 references/docker部署步骤.md)
└─ 单机无 Docker(或已有物理机/虚拟机)→ 推荐普通机器(加载 references/普通机器部署步骤.md)
→ 架构判断:SDK 分 amd64 / arm64 两个包,Linux x86_64 与 Linux aarch64 都支持
sdk 模式;Windows / Intel Mac 只能用 mock 模式或 Docker。
构建镜像时 SDK_ARCH 必须与目标架构一致(--build-arg SDK_ARCH=amd64|arm64)
→ 与用户确认形态后,进入对应 references 的步骤清单逐步推进
Step entry points for each form
| Form | Step list | Key artifacts |
|---|---|---|
| Plain machine | references/普通机器部署步骤.md |
deploy/native-lib-extract.sh、deploy/skeleton.service、deploy/skeleton-ui.conf |
| Docker Compose | references/docker部署步骤.md |
docker/docker-compose.yml、deploy-compose.yml、deploy.env.example |
| Kubernetes | references/k8s部署步骤.md |
deploy/k8s/*.yaml(9 manifests) |
| Cleanup/uninstall (all three forms) | references/清理部署.md |
Complete uninstall commands for keeping data vs clearing data |
Required Variables Quick Reference (stop if missing)
See references/环境变量速查.md. Core required:
| Variable | Generation command | Description |
|---|---|---|
FH_JWT_SECRET |
openssl rand -hex 32 |
JWT signing secret, at least 32 bytes;startup fails if not configured |
FH_DB_PASSWORD / MYSQL_ROOT_PASSWORD |
openssl rand -hex 24 |
Database password |
FH_SKELETON_SDK_TOKEN |
Obtained from the DJI Cloud API 2 console | SDK identity token (sdk profile) |
FH_SKELETON_SDK_ADDRESS |
— | SDK service address |
FH_SKELETON_SDK_NOTIFICATION_SERVER |
— | SDK notification service address (required for sdk profile) |
Troubleshooting Routing
用户回报报错信息 / 部署卡住
→ 加载 references/部署排障.md,按"现象→排查动作"定位
→ 常见:JWT 未配 / SDK init 失败 / .so 加载失败 / 健康检查超时 / SSE 被 buffer / 前端 404
→ 修复后回到原步骤继续
Cleanup Routing
用户说"清理/卸载/下线 skeleton"
→ 加载 references/清理部署.md(确认形态 + 保留数据 or 清除数据)
→ 按三形态卸载步骤逐步执行:先停服务/移除运行态资源,删除命令(卷/PVC/库)逐条二次确认
→ 最后引导验证无残留(无容器 / 无 namespace / 无监控进程)
Anti-hallucination Rules
- Deployment commands, image paths, ports, and context-path must come from
skeleton/docs/部署指南.mdorreferences/*.md, do not fabricate from memory - When unsure about a configuration item/command, first read the corresponding chapter of the deployment guide to confirm, then provide
- Any citation must be traceable to a deployment guide chapter or
deploy/asset file
Shared conventions
The deployment constraints of this Skill are documented in
constraints.yaml(aligned with the general constraint style of_shared/constraints-common.yaml). For cross-Skill routing rules, seeskills/_shared/skill-routing.md. Deployment guide (knowledge base):skeleton/docs/部署指南.md, and the references are all action checklists distilled from it.