提示词库

DevOps提示词

用于交付与运维的提示词:审查流水线、编写运行手册,以及加固容器镜像。

提示词是英文的,即它们的编写和测试所用的语言。这些页面上的说明和指引已翻译。

  • ci/cd
  • pipelines
  • review
100/100 · 141 token

CI/CD 流水线审查

审查流水线定义,找出缓慢的步骤、缺失的关卡和暴露的密钥。

适用场景: 流水线很慢或不稳定,或者你即将让它部署到生产环境。

prompt
You are a senior DevOps engineer reviewing a CI/CD pipeline.

## Task
Review the pipeline definition below for correctness, speed, and security.

## Requirements
- Flag every secret written in plain text or printed to logs.
- Flag every deployment step that runs without a preceding test step.
- Flag every action or image referenced by a mutable tag instead of a version or digest.
- Name the steps that can run in parallel or be cached.
- Quote the line for every finding.

## Output format
Return a markdown table with the columns Line, Finding, Severity (blocker, major, or minor), and Fix, ordered by severity.

## Input
<pipeline>
{{pipeline}}
</pipeline>

变量

{{pipeline}}
流水线文件,例如 GitHub Actions 工作流或 GitLab CI 文件。

示例输入

pipeline: a GitHub Actions workflow that uses actions/checkout@main and deploys on every push without running tests.

示例输出

| Line | Finding | Severity | Fix |
|---|---|---|---|
| `uses: actions/checkout@main` | Mutable reference | major | Pin to a release tag or commit SHA |
| `run: ./deploy.sh` | Deploys without tests | blocker | Add `needs: test` |

仅为示意:为展示预期的形式而编写,并非由模型生成。

  • runbook
  • incident response
  • operations
97/100 · 165 token

故障处理运行手册

为某个告警编写分步骤的运行手册,包含检查项、命令和升级对象。

适用场景: 告警会呼叫不了解系统的人,你想把最初 15 分钟的处理写下来。

prompt
You are a site reliability engineer writing an on-call runbook.

## Task
Write a runbook for responding to the alert described below.

## Requirements
- Order the steps so the fastest check that rules out the most causes comes first.
- Give the exact command or dashboard for every step, using only the tools named in the system description.
- State what result is expected and what to do when the result differs.
- Mark every step that changes production with "CHANGES PRODUCTION".
- End with the condition that triggers escalation and who to escalate to.

## Output format
Return markdown with five sections: Alert, Impact, Diagnosis (numbered steps), Mitigation (numbered steps), and Escalation.

## Input
<alert>
{{alert}}
</alert>

<system>
{{system}}
</system>

变量

{{alert}}
告警名称、触发条件及其衡量的内容。
{{system}}
服务、它的依赖,以及值班工程师可用的工具。

示例输入

alert: API p95 latency above 2 s for 5 minutes.
system: a Node service on Kubernetes with a Postgres database; engineers have kubectl and Grafana.

示例输出

## Diagnosis
1. Open the Grafana dashboard "API overview". Expected: latency is high on all pods. If only one pod is slow, go to step 4.
2. Run `kubectl top pods -n api`...

## Mitigation
1. CHANGES PRODUCTION: `kubectl rollout undo deployment/api -n api`...

仅为示意:为展示预期的形式而编写,并非由模型生成。

改成你的

修改需求以符合你的标准,然后检查结果。提示词分析器会在你输入时重新评分,优化器会在不丢失任何需求的前提下去掉冗词,安全扫描器会在你发送给模型之前标出密钥和个人数据。

更多类别