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 agentmods add skills/huangwb8/skills/prompt-programmingnpx skills add huangwb8/skills --skill prompt-programminggit clone --depth 1 https://github.com/huangwb8/skillsWrote 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/huangwb8/skills/prompt-programming)<a href="https://agentmods.dev/skills/huangwb8/skills/prompt-programming"><img src="https://agentmods.dev/badge/skills/huangwb8/skills/prompt-programming.svg" alt="Measured on agentmods" 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.00091 | $0.02421 |
| Opus 5 | $0.00046 | $0.01210 |
| Sonnet 5 | $0.00018 | $0.00484 |
| Haiku 4.5 | $0.00009 | $0.00242 |
Grade A, and why
prompt-programming 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 today.
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 — 234 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prompt Programming
目标
当用户明确要求“把 prompt 改写成伪代码”“将提示词翻译成可编程自然语言”“输出具有程序结构的人类语言指令”或直接提到 prompt-programming 时使用。将用户原始 prompt 翻译为一种简洁、严谨、可组合的 Prompt Program 方言:形式上像假代码,语义上仍是人类自然语言。
流程
输入
适用与不适用
适用:
- 把普通 prompt 变成研究论文式假代码
- 把散乱任务说明重构成统一结构
- 把长 prompt 压缩成可组合、可讨论、可评审的逻辑骨架
不适用:
- 用户只想润色语气,不想改变表达结构
- 用户只想执行任务,不关心 prompt 的架构
- 原始输入不是 prompt,而是完整代码实现请求
执行步骤
核心模型
- 单一真相来源是
config.yaml。 - 底层只使用
config.yaml:kernel.semantic_atoms定义的 6 个原子:Entity:对象、角色、输入、输出、工具、状态Intent:目标、交付物、成功条件Operation:分析、生成、转换、比较、总结、规划Constraint:必须、禁止、偏好、格式、长度、风格Control:条件、分支、循环、顺序、回退、优先级Check:自检、验收、异常处理、结束条件
- 不新增原子;复杂任务靠组合表达。
- 详细定义与块映射见
references/primitives.md。
渲染方言
- 块顺序、必需块、可选块、块语义与句式模板,以
config.yaml:rendering.*为准。 - 必守规则:
输出只定义目标产物、目标格式或目标效果。返回只定义对输出的交付动作,不能引入新产物。程序、定义、缺口处理属于可选块;为空就省略。- 若
config.yaml:rendering.omit_empty_blocks=true,禁止为了“看起来完整”补空块。
工作流
输入验证
先按 config.yaml:translation.input_validation 检查输入:
- 空输入:拒绝翻译,并要求提供原始 prompt。
- 过短输入:说明信息不足,不输出伪完整结构。
- 非 prompt 型输入:说明本 skill 不适用。
理解原始 prompt
恢复以下信息:
- 真实目标与交付物
- 输入对象与隐含上下文
- 输出契约与验收口径
- 强约束与软偏好
- 控制逻辑:条件、分支、迭代、失败回退
映射为 6 个原子
Entity:关键对象是什么Intent:最终要得到什么Operation:核心动作链是什么Constraint:哪些条件不能丢Control:是否存在 if / for each / until / fallbackCheck:如何判断结果合格
若原 prompt 混乱,先重建逻辑,再翻译;不要保留混乱结构。若没有显式控制逻辑,只能在“显式或强隐含”时补出最小控制结构,不凭空发明分支或循环。
组织为 Prompt Program
- 默认按
config.yaml:rendering.block_order输出。 - 组织顺序:
- 先边界,后执行
- 先主流程,后异常路径
- 先硬约束,后风格偏好
- 若用户原 prompt 缺少显式校验,必须补出最小可执行校验。
- 若存在显式格式契约,必须保留到
输出或约束。 - 若用户指定字段、章节或步骤顺序,默认按原顺序保留。
- 若存在关键术语、变量名或实体名,默认保留原词,不擅自改名。
冲突时严格遵循 config.yaml:translation.conflict_resolution_order:
- 核心意图
- 硬约束
- 输出契约
- 校验要求
- 风格偏好
压缩表达
- 保留逻辑,不保留冗余修辞。
- 保留可执行约束,不保留客套表达。
- 能通过结构表达的,不重复解释。
- 句子预算以
config.yaml:quality_bar.soft_sentence_budget为软上限;复杂任务可放宽,但不能丢逻辑。
最小自检
输出前确认:
- 仍然等价于原 prompt 的真实意图
- 具备清晰的输入、输出、流程和校验
- 关键分支与缺口处理已显式表达
- 足够像“程序”,但仍是自然语言
What ships with it
6 files 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.
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.
- today Changed · +30 lines 5e162cba67b4
- yesterday Changed · -19 lines 44a954a1f04d
- 5d ago First seen · 223 lines · 91 tokens per session scan A d6dbd2ef1441
prompt-programming is a skill published in the GitHub repository huangwb8/skills (48 stars, last pushed today), licensed MIT. It adds 91 tokens to every session and 2,421 once invoked, about $0.0005 per session on Opus 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-08-30.
Other skills, from other repositories
claude-cookbooks
Claude AI cookbooks - code examples, tutorials, and best practices for using Claude API. Use when learning Claude API integration, building Claude-powered applications, or exploring Claude capabilities.
prompt-engineering
Prompt engineering workflow for designing, rewriting, debugging, evaluating, and optimizing LLM prompts, system prompts, developer prompts, few-shot examples, structured-output instructions, tool-use prompts, and prompt eval cases. Use when prompt behavior, reliability, safety, cost, latency, or model fit is the main…
prompt-optimization
Improve and rewrite user prompts to reduce ambiguity and improve LLM output quality. Use when a user asks to optimize, refine, clarify, or rewrite a prompt for better results, or when the request is about prompt optimization or prompt rewriting.
prompt-engineering
Crafting effective prompts for LLMs. Use when designing prompts, improving output quality, structuring complex instructions, or debugging poor model responses.
prompt-engineer
Writes, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, implementing chain-of-thought or few-shot…
baoyu-danger-gemini-web
Generates images and text via reverse-engineered Gemini Web API. Supports text generation, image generation from prompts, reference images for vision input, and multi-turn conversations. Use when other skills need image generation backend, or when user requests "generate image with Gemini", "Gemini text generation"…