内容
<p align="center">
<img src=".github/assets/prompt-ops-maker-logo.svg" alt="prompt-ops-maker" width="640">
</p>
<p align="center">
<a href="https://www.python.org/"><img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10+-green.svg"></a>
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
<a href="#security-first-reverse-analysis"><img alt="No AI call" src="https://img.shields.io/badge/analysis-no%20AI%20call-0F766E.svg"></a>
<a href="#security-first-reverse-analysis"><img alt="No secret echo" src="https://img.shields.io/badge/secrets-no%20echo-B45309.svg"></a>
<a href="#what-it-produces"><img alt="Agent Ops" src="https://img.shields.io/badge/agent--ops-verification%20gates-blue.svg"></a>
<a href="https://modelcontextprotocol.io"><img alt="MCP Ready" src="https://img.shields.io/badge/MCP-prompt%20workflow-blueviolet.svg"></a>
</p>
<p align="center">
<a href="README-ko_kr.md">한국어</a> ·
<a href="#quick-start">快速开始</a> ·
<a href="#security-first-reverse-analysis">分析提示</a> ·
<a href="#security-boundary">安全边界</a>
</p>
<p align="center">
<img src=".github/assets/prompt-ops-maker-hero.svg" alt="Reverse analyze existing prompts before agents run" width="960">
</p>
# 提示操作生成器
**当提示包含范围、拒绝列表、验证门控和结果优先报告格式时,AI 代理运行更好。这些规则在每个项目使用不同的模型或运行时容易被遗忘。**
`prompt-ops-maker` 为 Claude Fable 5 风格的长任务、Claude、Codex、Hermes、MCP 代理、Gemini 和通用 AI 代理生成可重用的操作提示。
> 一个命令。项目配置或预设输入。验证聚焦的代理提示输出。
---
## 一行结果
```text
prompt-ops-maker = 提示生成器和本地分析器,用于代理范围 + 安全边界 + 验证门控
```
## 安全优先的反向分析
现有的提示通常缺少在长任务中保持 AI 代理安全的运营规则。`analyze` 命令在重用提示之前本地检查这些规则。
```bash
prompt-ops-maker analyze --input existing-prompt.txt --format text
prompt-ops-maker analyze --input existing-prompt.txt --format json --output analysis.json
```
示例报告形状:
```text
# 提示操作分析 — existing-prompt.txt
得分:14/100
## 概要
- 现有检查:2
- 缺失检查:5
- 类似机密模式:1 个检测到
- 源策略:确定性本地启发式;无 AI 调用;无机密值回声
## 缺失 / 风险项
- [BLOCKER] secret_literal_risk
- [HIGH] deny_list
- [HIGH] verification_gates
- [MEDIUM] evidence_first_report
- [MEDIUM] tool_result_grounding
## 检查
- 执行边界:存在(BLOCKER)
- 未验证项目报告:存在(MEDIUM)
- 验证门控:缺失(HIGH)
```
分析器仅使用确定性本地检查。它不推断私有基础设施,也不打印检测到的机密值。
## 为什么存在
代理任务以可重复的方式失败:
```text
问题 什么会损坏
没有执行边界 代理在批准之前编辑、部署或上传
没有验证门控 生成的提示被误认为是完成的工作
没有目标运行时上下文 Claude、Codex、MCP 和 CI 接收相同的模糊提示
没有拒绝列表 机密、客户数据和环境值可能会泄漏到输出中
没有结果优先报告格式 长日志隐藏阻塞和未验证的项目
没有项目预设 每个审计/修复/部署提示都是从头开始重写的
```
这些不是模型问题。它们是 AI 工作操作系统的问题。`prompt-ops-maker` 将缺失的规则打包到可以跨项目和代理重用的提示中。
它**不**声称具有与 Fable 5 相当的模型性能。它重用 Fable 5 提示指南模式作为模型无关的提示操作:努力程度、执行边界、验证门控、证据优先报告和明确的未验证项目报告。
## 它生成什么
```text
输入 输出
────────────────────────────────────────────────────────────────────────────
项目 YAML 配置 项目感知的代理提示
类型预设 没有项目配置的临时代理提示
现有提示文件 缺失操作边界的反向分析
任务描述 具体目标和风险焦点
目标 AI Claude / Codex / Hermes / MCP / Gemini / 通用指导
运行时环境 本地 / mcp / discord / ci / 浏览器 / api 指令
努力程度 低 / 中 / 高 / xhigh 行为
拒绝列表 代理必须在批准前不采取的行动
验证门控 代理必须检查的命令、文件、URL 或证据
报告章节 结论、证据、BLOCKER/HIGH/MEDIUM/LOW、未验证项目
```
## 用法
### 从 GitHub 安装
```bash
git clone https://github.com/verisworks-ai/prompt-ops-maker.git
cd prompt-ops-maker
python3 -m pip install -e '.[test]'
prompt-ops-maker list-types
```
### 直接脚本使用
```bash
python3 prompt_ops_maker.py list-projects
python3 prompt_ops_maker.py list-types
```
`fable5_prompt_maker.py` 仍然作为旧本地工作流的兼容性包装器。
## 快速开始
### 项目提示
```bash
prompt-ops-maker make \
--project mobile-miniapp \
--mode ad-qa \
--task "Ad integration QA" \
--effort high \
--target-ai codex \
--environment local \
--dry-run
```
### 没有项目配置的临时提示
```bash
prompt-ops-maker make-adhoc \
--name "Webhook monitor" \
--type automation-pipeline \
--task "Operational audit" \
--risk "duplicate runs, secret output, failed alerts" \
--effort high \
--target-ai hermes \
--environment mcp \
--dry-run
```
### 分析现有提示
```bash
prompt-ops-maker analyze \
--input existing-prompt.txt \
--format text
```
此反向分析模式仅使用确定性本地检查。它不调用 AI 模型,不推断私有基础设施,也不回声检测到的机密值。它报告缺失的执行边界、拒绝列表、验证门控、未验证项目处理和证据优先报告。
结构化输出可用于自动化:
```bash
prompt-ops-maker analyze --input existing-prompt.txt --format json --output analysis.json
prompt-ops-maker analyze --input existing-prompt.txt --format yaml --output analysis.yaml
```
### 保存提示文件
```bash
prompt-ops-maker make \
--project brand-hub \
--mode seo-geo \
--task "Public search and AI citation audit" \
--effort high \
--target-ai claude \
--environment discord \
--output outputs/brand-hub-seo-geo.md
```
## 示例输出
```text
# DRY RUN — mobile-miniapp / ad-qa / high / codex / local
You are the Mobile Miniapp ad QA agent.
이번 작업은 high effort로 진행해.
대상 AI/실행자: Codex
실행 환경: Local CLI
수정하지 말고 광고 연동 상태만 평가해.
검증 게이트:
1. Bundle artifact output 확인
2. Full-screen ad load/show 경로 확인
3. 실제 테스트 결과와 미검증 항목 분리
금지:
- 파일 수정
- 콘솔 변경
- live 광고 ID 반복 테스트
- secret 출력
보고 형식:
첫 문장은 사용자가 가장 궁금해할 결과 하나만 말해.
내부 추론은 쓰지 말고, 결론 / 확인한 증거 / 미검증 항목만 보고해.
```
## 内置模式
```text
模式 目的
────────────────────────────────────────────────────────────────────────────
audit 启动和运营审计
fix 批准的最小修复
deploy 发布或上传就绪检查
ad-qa 广告集成 QA
seo-geo 搜索、GEO 和 AI 引用就绪
appsec 公共/私有/安全边界审计
ux 用户流程和移动 UX 审计
```
## 内置目标
```text
目标 使用场景
────────────────────────────────────────────────────────────────────────────
fable5 Claude Fable 5 风格的长任务提示结构
claude 通用 Claude 工作流
codex 代码实现、测试和验证
hermes Hermes 代理技能/工具/网关环境
mcp MCP 工具/资源/提示环境
gemini 研究、草稿和比较分析
generic 通用 AI 代理
```
## 内置环境
```text
环境 证据焦点
────────────────────────────────────────────────────────────────────────────
local 本地 CLI、文件、git、测试
mcp MCP 工具、资源和提示
discord Discord 状态和结果报告
ci CI/CD 日志和工件
browser 浏览器和 UI 验证
api API/服务器验证
generic 通用运行时
```
## 类型预设
```text
预设 用例
────────────────────────────────────────────────────────────────────────────
generic 通用任务
automation-pipeline 调度器、批处理、警报、Webhook 操作
web-public 公共 Web 服务就绪
mobile-miniapp WebView、miniapp、SDK、广告包就绪
```
## 项目配置
在 `configs/<project>.yaml` 下添加私有 YAML 文件,或在 `configs/examples/<project>.yaml` 下发布净化示例:
```yaml
project:
name: "Example Service"
type: "web-public"
root: "/path/to/public-web-service"
domain: "https://example.com"
agent_role: "Example Service audit agent"
description: "Public web service example."
core_focus:
- "Public page UX"
- "robots.txt, sitemap.xml, JSON-LD"
verification_gates:
- "Run tests"
- "Check live HTTP status"
forbidden:
- "Unapproved deploy"
- "Secret output"
```
然后运行:
```bash
prompt-ops-maker make --project example --mode audit --task "Launch audit" --effort high --dry-run
```
## 实际场景
### 发布前 — 强制证据优先于声明
```bash
prompt-ops-maker make \
--project brand-hub \
--mode deploy \
--task "Production release gate" \
--effort xhigh \
--target-ai codex \
--environment ci \
--dry-run
```
### 对于 MCP 代理 — 将工具输出与最终声明分开
```bash
prompt-ops-maker make-adhoc \
--name "MCP server audit" \
--type automation-pipeline \
--task "Check available tools, permissions, and side effects" \
--risk "credential leakage, tool side effects" \
--target-ai mcp \
--environment mcp \
--dry-run
```
### 对于 Claude 或 Gemini — 防止草稿变成虚假验证
```bash
prompt-ops-maker make-adhoc \
--name "Market research handoff" \
--type generic \
--task "Compare options and list unverified assumptions" \
--target-ai gemini \
--environment generic \
--dry-run
```
## 架构
```text
prompt-ops-maker/
├── prompt_ops_maker.py ← 公共 CLI 入口
├── fable5_prompt_maker.py ← 兼容性包装器
├── configs/
│ ├── examples/
│ │ ├── mobile-miniapp.yaml ← 净化示例配置
│ │ ├── public-real-estate-service.yaml ← 净化示例配置
│ │ └── brand-hub.yaml ← 净化示例配置
│ └── _types/
│ ├── generic.yaml
│ ├── automation-pipeline.yaml
│ ├── web-public.yaml
│ └── mobile-miniapp.yaml
├── tests/test_prompt_maker.py ← CLI、提示和分析回归测试
├── service-ontology.json ← 可选服务本体清单
├── examples/README.md
└── docs/ontology-notes/README.md
```
## 验证
```bash
python3 -m pytest -q
python3 prompt_ops_maker.py list-projects
python3 prompt_ops_maker.py list-types
python3 prompt_ops_maker.py make --project brand-hub --mode audit --task 'smoke test' --effort high --target-ai codex --environment local --dry-run
python3 prompt_ops_maker.py analyze --input README.md --format json
```
当前发布烟雾测试:
```text
pytest 9 passed
list-projects examples/brand-hub, examples/mobile-miniapp, examples/public-real-estate-service
list-types automation-pipeline, generic, mobile-miniapp, web-public
clean editable install prompt-ops-maker list-types OK
```
## 安全和隐私边界
- 不要在配置中存储 API 密钥、令牌、私钥、客户数据或完整的 `.env` 值。
- 在示例中使用占位符路径。
- 将生成的提示视为指令,而不是证明目标项目已验证。
- 将部署、上传、数据库和帐户设置更改保留在明确批准后。
- 机密值不应出现在生成的提示或报告中。
## 要求
Python 3.10+
## 许可证
MIT — [veris](https://veris.kr) · [hello@veris.kr](mailto:hello@veris.kr)
连接信息
猜你喜欢
暂无推荐服务器