Install
openclaw skills install skill-design-patternsGuides the design of effective agent skills. Use when creating a new skill, improving an existing skill, reviewing a skill's structure, or establishing skill-writing conventions for a project. Covers anti-rationalization tables, red flags, verification checklists, core operating behaviors, and progressive disclosure.
openclaw skills install skill-design-patternsBest practices for designing agent skills that produce reliable, high-quality results. These patterns were distilled from real-world use across dozens of production skills and address the most common failure mode: the agent knows what to do but finds reasons not to do it.
This skill should be used whenever you create or review a skill. It encodes patterns that prevent subtle quality erosion.
Every well-designed skill must include these four sections. Skills that omit them degrade over time as the agent finds rationalizations to skip steps.
Placement: After the role/persona definition, before the main workflow.
Purpose: Prevent false triggering. Explicitly list scenarios where this skill should NOT activate, and point to the correct alternative.
Guidelines:
Example (for a database migration skill):
- Pure SQL script migration with no corresponding application code → use the SQL linting tool instead
- Stored procedure changes → use the stored-procedure-migration skill
- Configuration-only changes → use the config-management skill
Placement: After the main workflow/rules, before the verification checklist.
Purpose: Preempt the excuses agents use to skip steps. This is the single most impactful pattern — it directly addresses the agent's tendency to find plausible-sounding reasons to take shortcuts.
Guidelines:
Example (for a code review skill):
| Rationalization | Why It's Wrong |
|---|---|
| "It works, that's good enough" | Working code that's unreadable or insecure creates compounding debt. |
| "I wrote it, so I know it's correct" | Authors are blind to their own assumptions. Every change benefits from another set of eyes. |
| "The tests pass, so it's good" | Tests don't catch architecture problems, security issues, or readability concerns. |
Placement: After the anti-rationalization table.
Purpose: Provide observable warning signs that the skill is being violated. These serve as a quick health check for both the agent and human reviewers.
Guidelines:
Example (for a deployment skill):
Placement: At the end of the skill.
Purpose: Replace vague "acceptance criteria" with an evidence-based checkbox list. Every item must be verifiable with concrete output.
Guidelines:
- [ ] (checkbox format)Example (for a data migration skill):
These six non-negotiable behaviors should be defined in your platform's entry-point configuration (AGENTS.md or equivalent). They apply across all skills and sessions.
Surface Assumptions — Before implementing anything non-trivial, explicitly state your assumptions about the codebase, requirements, and scope. The most expensive failure mode is making wrong assumptions and running with them unchecked.
Manage Confusion Actively — When you encounter inconsistencies, conflicting requirements, or unclear specifications: STOP. Name the specific confusion. Present the tradeoff or ask a clarifying question. Wait for resolution before continuing.
Push Back When Warranted — You are not a yes-machine. When an approach has clear problems, point out the issue directly, explain the concrete downside (quantify when possible), and propose an alternative. Sycophancy is a failure mode.
Enforce Simplicity — Your natural tendency is to overcomplicate. Actively resist it. Before finishing: can this be done in fewer lines? Are these abstractions earning their complexity? Prefer the boring, obvious solution.
Maintain Scope Discipline — Touch only what you're asked to touch. Do not "clean up" orthogonal code, remove comments you don't understand, add features not in the spec, or delete code that seems unused without explicit approval.
Verify, Don't Assume — Every skill ends with a verification step. A task is not complete until verification passes. "Seems right" is never sufficient — there must be evidence.
Structure your skill suite so the agent loads information in layers, keeping token usage efficient:
Level 1 — Always in context
├── Platform entry file (AGENTS.md / CLAUDE.md): role, core behaviors, workflow overview
└── SKILL.md frontmatter description field (for skill matching)
Level 2 — Loaded when skill triggers
└── SKILL.md body: role definition, execution steps, rules, verification checklist
Level 3 — Loaded on demand
├── references/: templates, checklists, detailed guides
├── rules/: domain-specific rules, loaded during execution
└── scripts/: executed directly, source code read only for debugging
Loading guidelines:
> 💡 Load on demand: only when {specific scenario}Your platform's entry configuration should include a general-purpose anti-rationalization table covering shortcuts that span multiple skills:
| Rationalization | Why It's Wrong |
|---|---|
| "This is simple, I don't need the full workflow" | Simple changes cause subtle regressions. The workflow exists because edge cases are invisible at first glance. |
| "I'll batch everything and verify at the end" | Bugs compound. An error in step 1 makes steps 2–5 produce wrong output. Verify each step before proceeding. |
| "I'll add the boilerplate later" | "Later" never comes. Missing annotations, config, or scaffolding don't fail at compile time — they fail in production. |
| "The old code can stay, I'll clean it up eventually" | Dead code confuses future readers and agents. Either deprecate with a clear migration path or remove with approval. |
| "Tests can wait until the feature is done" | Test debt accumulates faster than you expect. Each untested module increases the blast radius of future changes. |
| "It looks right, probably fine" | Confidence is not evidence. Differences between environments, versions, and edge cases hide where things "look right." |
| "While I'm here, I'll just optimize this too" | Scope creep is the leading cause of project delays. One change per task. |
The following should NOT be written into SKILL.md — they belong elsewhere:
git log / git blame are authoritative sourcesUse this checklist when creating a new skill or reviewing an existing one:
description field in frontmatter includes both what the skill does AND when to trigger itskill-name/
├── SKILL.md # Required: skill definition
│ ├── YAML frontmatter # name + description (required)
│ └── Markdown body # workflow, rules, anti-rationalization, red flags, verification
├── references/ # Optional: loaded on demand
│ ├── template.md # Templates and detailed guides
│ └── checklist.md # Long checklists (>50 lines) extracted to separate files
└── scripts/ # Optional: executable utilities
└── helper.py # Bundled scripts to avoid reinventing the wheel
docs/skill-anatomy.md in the agent-skills repository for the original skill structure specification