Install
openclaw skills install coding-promptOptimize and refine AI programming prompts with constraints, scenario focus, and validation to improve coding session instructions and prevent vague or incom...
openclaw skills install coding-promptActivate: 激活编程提示词 | 优化提示词 | improve my prompt
This skill improves the quality of coding prompts sent to AI by diagnosing weaknesses, applying proven principles, and proactively detecting common AI failure patterns during active coding sessions.
| Section | Content | Location |
|---|---|---|
| 1 | Prompt Diagnosis Checklist | references/checklist.md |
| 2 | Core Principles | references/principles.md |
| 3 | Communication Patterns | references/patterns.md |
| 4 | Workflow Templates | references/templates.md |
| 5 | Anti-Pattern Quick Reference | references/anti-patterns.md |
| 6 | Structural Wisdom | references/structure.md |
| 7 | Evolution Protocol | Below (this file) |
This skill operates in two modes. Detailed rules are stored in references/ files — load them only when needed per the instructions below.
When explicit prompt optimization is requested — via trigger phrases, pasting a prompt for review, or prefacing an instruction with "优化提示词" — perform a full diagnosis and return a rewritten/improved version of the prompt.
Trigger phrases:
优化提示词: <your prompt> — Rewrite the prompt following all principles激活编程提示词 / activate coding-prompt — Enter active modeimprove my prompt / 优化提示词 / check my promptprompt review / 提示词审查Before starting diagnosis, load all reference files:
read_file(references/checklist.md)
read_file(references/principles.md)
read_file(references/patterns.md)
read_file(references/templates.md)
read_file(references/anti-patterns.md)
read_file(references/structure.md)
read_file(references/learnings.md)
Then run through the checklist and apply principles to rewrite the prompt.
Output format for optimization:
## 原始提示词
<user's original prompt>
## 诊断结果
- D2 缺少约束: <what's missing>
- D4 缺少场景: <what's missing>
## 优化后的提示词
<rewritten prompt with improvements applied>
Once activated (Mode 1 triggered), the skill remains active for the rest of the session. In this mode, proactively alert when only these high-priority signals are detected:
| Alert | Signal | Response |
|---|---|---|
| 🚨 Fake completion | D12 | AI claims "done" but code contains stubs/TODOs/placeholder returns/sample data. Append: [coding-prompt] ⚠️ 检测到假完成:代码包含 <具体问题>,请替换为真实实现。 |
| 🚨 Rule-based bias | D11 | AI chooses hardcoded rules/regex/scoring when LLM-native would be better. Append: [coding-prompt] ⚠️ 检测到规则匹配偏见:建议使用 LLM 原生能力替代硬编码 <具体规则>。 |
For all other signals (D1-D10): Do NOT proactively interrupt. Only mention them if explicitly asked for a prompt review.
Do NOT load reference files in Mode 2. The rules above are sufficient for proactive monitoring.
Session persistence note: Mode 2 relies on conversation context. If context degradation is suspected (~10+ turns without explicit reference to active monitoring), re-confirm active status before issuing alerts.
Golden rule: The user's original instruction always takes priority. Alerts and suggestions are additive, never overriding.
Evolution on demand: When the user says "更新技能" / "update skill", follow Section 7 below.
Trigger: 更新技能 / update skill Target:
references/learnings.mdONLY
| File | Permission | Reason |
|---|---|---|
SKILL.md | 🔒 READ-ONLY | Constitution — defines the skill |
references/checklist.md | 🔒 READ-ONLY | Structural checklist — completeness over flexibility |
references/principles.md | 🔒 READ-ONLY | Axiom-level rules — universal best practices |
references/patterns.md | 🔒 READ-ONLY | Communication mechanics — objective patterns |
references/anti-patterns.md | 🔒 READ-ONLY | Curated reference — grow via learnings promotion |
references/templates.md | 🔒 READ-ONLY | Workflow structure — behavioral consistency |
references/structure.md | 🔒 READ-ONLY | Architecture wisdom — condensed condition→action |
references/learnings.md | ✅ APPEND-ONLY | Personal experience layer — the sole evolution target |
Rule: Any attempt to modify files outside learnings.md is a violation. Refuse and redirect to learnings.md.
Read references/learnings.md first to understand existing experience. Then analyze the current coding session for:
Filter criteria — only extract experiences that meet ALL of:
Present a structured proposal in the format of learnings.md sections:
## 经验沉淀提案
### 被验证有效的模式
- [模式名称]
- **规则**: <具体做法,一句话>
- **触发场景**: <什么情况下适用>
- **来源**: <本次会话的什么具体情况>
### 反模式(踩过的坑)
- [问题名称]
- **表现**: <AI容易犯的具体错误>
- **预防**: <在prompt中加什么约束>
- **来源**: <本次会话的具体情况>
### 个人偏好
- [偏好项]
- **规则**: <具体偏好描述>
If a section has no content, omit it from the proposal.
Wait for explicit user confirmation before making ANY changes. This is the highest priority rule in this skill.
After confirmation:
references/learnings.md