Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add jianchen08/Agent-os-open --skill prompt-rule-engineeringgit clone --depth 1 https://github.com/jianchen08/Agent-os-openWrote 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.
[](https://agentmods.dev/skills/jianchen08/agent-os-open/prompt-rule-engineering)<a href="https://agentmods.dev/skills/jianchen08/agent-os-open/prompt-rule-engineering"><img src="https://agentmods.dev/badge/skills/jianchen08/agent-os-open/prompt-rule-engineering/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.
<a href="https://agentmods.dev/skills/jianchen08/agent-os-open/prompt-rule-engineering"><img src="https://agentmods.dev/badge/skills/jianchen08/agent-os-open/prompt-rule-engineering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00114 | $0.02811 |
| Opus 5.5 | $0.00046 | $0.01124 |
| Sonnet 5.5 | $0.00023 | $0.00562 |
| Haiku 4.5 | $0.00011 | $0.00281 |
Grade A, and why
提示词规则工程方法论 scanned grade A with 0 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 28d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.
提示词 / Skill 规则工程方法论 v1.1
本技能是流程指引,不是逐条打勾清单:按场景判断使用,遇不适用情况保持裁量,不机械执行。
适用范围
LLM 系统提示词、Skill 规则、agent 工作流、RAG 指令、工具调用规范。 目标:省 token、准确、无歧义、可调试、可回归、可版本化。
一、总原则
- 提示词 = 接口规格:条件可判定、动作可执行、结果可验证、解释唯一。
- 改提示词 = 改代码:先复现失败,再定位最小部分,做最小补丁,最后回归测试。
- 一次只改一个因果维度:多版本并行(Candidate Beam)时,每个候选也各只改一处,否则无法归因哪个修改有效。
- 优先级固定,且在使用前声明:
- 跨类冲突:P0 安全 > P1 任务正确性 > P2 输出格式 > P3 风格;高覆盖低。
- 文档内冲突:规则 > 流程 > 示例。示例没有优先级位,永不推翻规则——示例与规则冲突时改示例或删示例,规则为准。
- P# 只标注在存在真实冲突可能的规则上;无冲突可能的普通规则不强制编号。
- 术语全局唯一:关键名词定义一次全文一致;禁用「它/该/这个」跨句指代。
- 输出契约兜底:格式、字段、长度必须可验证;空/超长/失败/未知/冲突输入的行为必须定义。
- 版本化:每次变更留一行记录(格式见 §五),能回滚。
二、新写:契约结构(六层 + 两个可选层)
目标:一句话。
范围:做什么;非目标:不做什么(任务偏移先改这里)。
术语:A=…;B=…。
规则:当<可判定条件>,必须<可执行动作>;否则<默认>。
禁止:<禁止项> → <替代动作>(只写"不要"不给出路 = 不合格)。
输出:格式、字段、长度、异常输入处理(写得出验证方法才写)。
可选-流程:S# 输入→动作→输出→失败分支→下一步条件(多步骤任务时)。
可选-示例:仅边界例/反例,每类 ≤1;示例集跨输入类型/长度/复杂度多样化(防锚定)。
三、规则写法
- 一条规则只做一件事;句式「当 X → 必须 Y;否则 Z」。
- 用 必须 / 禁止 / 可;黑名单:尽量、适当、可能、一般来说、考虑、酌情、相关。
- 量化只落在模型输出可控维度:字数、句数、条目数、轮次、字段名、必须包含的标记。时延、耗时等模型不可控量不得作为提示词量化指标。
- 肯定句优先;禁止必须配替代动作。
- 形态双轨:契约型用规则行,流程型用编号步骤或表格。合规判据是「可判定/可执行/可验证」,不是句式——表格行、流程步与规则行同等对待。
四、省 token
- 删:客套、解释、重复、模型已知常识(通用教科书代码、概念科普不入提示词)。
- 用:列表、短句、符号 → = ≠ ≤ ≥。
- 合并同条件或同动作规则;用编号引用,不复述。
- 变量占位:
{input}、{lang}、{{path:…}}。 - 冗余检查(瘦身测试):删去 30% 内容后行为契约不变 → 说明有冗余,删之。这是冗余检测,不是健壮性测试。
五、修复:症状 → 部分 → 改法
| 症状 | 先改 | 改法 |
|---|---|---|
| 任务偏移 | 目标/范围 | 缩非目标,重写目标一句 |
| 理解不一致 | 术语 | 加定义,全文统一替换 |
| 条件歧义 | 规则 | 量化条件,黑名单词清零 |
| 规则冲突 | 规则 | 加优先级声明,高覆盖低 |
| 步骤漏/乱 | 流程 | 编号步骤,加输入输出和前置条件 |
| 循环/不终止 | 流程 | 加最大轮次、终止条件 |
| 工具调用错 | 流程 | 明确调用条件、参数、失败分支 |
| 格式漂移 | 输出/规则 | 固定字段、长度、JSON schema |
| 风格不对 | 示例/规则 | 加边界示例 + 禁止项 |
| 边界错 | 示例/规则 | 只加边界例或反例 |
| 引用断链/事实锚点过期 | 事实锚点 | 引用带路径;落档前验证目标存在(ls/读原文),过期锚点改为去路径化表述或更新为现状 |
| 多副本漂移 | 副本结构 | 单源 + 薄指针(见本仓 credit-delegation 先例),禁止多处存全文 |
| 回归口径不一 | 评估节 | 阈值与用例集规模集中定义一处 |
修复流程(单失败快路径)
- 收集失败样本:输入、输出、期望、环境。
- 最小复现:去掉无关上下文,仍失败才改。
- 归类到部分:目标 / 术语 / 规则 / 流程 / 示例 / 输出 / 上下文。
- 写测试:原失败 + 相似 + 反例 + 空/超长/异常。快速迭代默认 5–10 例,至少 1 例留出。
- 最小修改:只改归类部分。
- 回归:新旧版本同一评估集跑分对比,涨了才保留;否则回滚。
- 版本记录一行:
v# 日期 | 改了什么 | 归因(失败签名) | 前分→后分 | 回滚点。
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.
- 28d ago First seen · 131 lines · 114 tokens per session scan A 4bf606250914
提示词规则工程方法论 is a skill published in the GitHub repository jianchen08/Agent-os-open (7 stars, last pushed 9d ago), licensed Apache-2.0. It adds 114 tokens to every session and 2,811 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-19.
Other skills, from other repositories
background-task
Add or modify work that runs outside the request/response cycle — emails, document ingestion, webhooks, cleanups, scheduled jobs. Use when something is slow or fire-and-forget, or when adding a periodic/cron task. This project's queue is {{ cookiecutter.backgroundtasks }}.
agent-tool
Add a new tool/function the AI agent can call (e.g. look something up, hit an external API, perform an action). Use when extending the assistant's capabilities, wiring a new function into the agent, or when the model needs a new action. This project uses {{ cookiecutter.aiframework }}.
frontend-feature
Build a new page, view, or data-driven feature in the Next.js frontend. Use when adding a route under the dashboard/marketing area, wiring UI to a backend endpoint, adding client state, or creating a localized page. Covers App Router, data fetching, Zustand stores, and i18n.
rag-knowledge
Work with the RAG knowledge base — ingest documents, run semantic search, manage collections, or add a sync source/connector (Google Drive, S3). Use when populating or debugging the knowledge base, tuning retrieval, or adding a new document source. This project uses {{ cookiecutter.vectorstore }} + {{…
alembic-migration
Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.
channel-bot
Work with messaging-channel bots (Telegram / Slack) — register a bot, route inbound messages through the AI agent, handle webhooks vs polling, or add a new channel adapter. Use when wiring chat into a messaging platform or debugging bot delivery.