As a "meta-skill", this skill reviews and refactors AI capability definitions that are still in draft form. It applies an advanced prompt-engineering lens to raise logical robustness, scenario coverage, and instruction adherence, so that every capability meets LLM best practices.
Core Objective
Primary goal: produce a reviewed and refactored skill document that meets spec compliance, the repository's asset boundaries, and LLM best practices.
Success criteria (all must be met):
✅ Structurally compatible: the skill follows the standard template (YAML, purpose, use cases, behavior, input and output, restrictions, self-check, examples)
✅ Logic is clear: the input → behavior → output chain is clear and unambiguous
✅ Constraints defined: the restrictions section covers the failure modes common to the domain
✅ Asset boundaries clear: the Skill embeds no authoritative definition that belongs to a Spec / Protocol / Rule; where needed it references one instead, or proposes a split
✅ Execution adaptation explicit: external tools, MCP tools, the runtime environment, and missing capabilities all have a discovery, mapping, and failure-handling path
✅ Repository contract compliant: obeys AGENTS.md, the terminology definitions, and the external-link, language, and asset-priority rules
✅ Examples are thorough: at least 2 examples, one of them an edge case or a challenging scenario
✅ Changes recorded: the diff summary lists every change together with its section, description, and reason
✅ Version proposed: a SemVer proposal with its rationale
Acceptance test: can an AI Agent apply this refined skill consistently across different environments, with no ambiguity?
Scope Boundaries
This skill does:
Review an existing skill draft for quality and compliance
Refactor the skill's structure and content to meet the spec
Audit the Skill / Spec / Protocol / Rule boundary, to avoid burying a structural contract, an interaction protocol, or a single-point rule inside a Skill
Audit the tool adaptation layer, so that discovery, capability mapping, and missing-tool handling for MCP / CLI / API tools are executable
Audit the repository's local contract, so the optimised Skill obeys AGENTS.md and the local terminology definitions
Raise logical clarity and instruction precision
Add the missing sections or strengthen the weak areas
Provide the diff summary and a version proposal
This skill does not do:
Generate the full skeleton of a new Skill from scratch
Install an external Skill or initialiser at runtime
Decide, in the maintainer's place, the licence and vendoring scope of an externally derived Skill
Generate the project docs/ structure (taken on by the AgentFabric runtime or a human)
Handoff point: once the SKILL is refined and the diff summary is delivered, hand off to the user for review and a version-control commit.
Use Cases
New skill onboarding: an expert review after an agent has drafted a new skill.
Quality repair: when a skill behaves inconsistently on a new model, adjust the logic and strengthen the examples.
Consistency review: check that a new skill matches the tag system and naming in INDEX.md; make sure description, tags, and triggers are enough to support semantic discovery.
Upgrade: turn a plain "formatter" into a full agent capability with an interaction policy and error handling.
Scope: this skill is for reviewing and refactoring an existing skill, not for creating one from scratch. A new Skill is handled separately, through the repository contribution process and the agentskills.io spec; an external skill-creator must not be installed at runtime for that purpose.
Behavior
Meta-Audit Model
Intent: is the purpose specific enough? Avoid vague terms such as "assistant" or "utility".
Logic: do input → behavior → output form a clear chain?
Constraints: do the restrictions cover the most common failure modes in the domain?
Examples: do the examples run from simple to complex and include at least one edge case?
Interaction policy (spec §4.3): does the behavior state the defaults, the choice options, and which items need user confirmation? Defaults first, then choices, then context inference.
Asset boundary: is the Skill defining the structure of a thing (Spec), a multi-party message sequence (Protocol), or an atomic prohibition (Rule)? If so, keep the execution orchestration and turn the authoritative definition into a reference to an existing asset, or name where the split belongs.
Execution adaptation: does the Skill depend on MCP / CLI / API / an external service? If it does, does it state how to discover the available tools, build the capability mapping, handle a missing tool, and avoid hard-coding a tool name that does not exist?
Repository contract: when optimising inside the AI Cortex repository, AGENTS.md, docs/architecture/terminology.md, and skills/SOURCES.yaml must be read and applied; external HTTP/HTTPS links must not be fetched by default, and a Skill must not be installed at runtime. A pinned upstream version can be read only where an externally derived copy is maintained and the context explicitly declares allow_external_fetch=true.
Triggers (optional): for a high-discoverability skill, consider putting "triggers" (3-5 English phrases) up front, for fast invocation matching.
Optimisation Process
Structure: apply the standard template (YAML, purpose, use cases, behavior, I/O, restrictions, self-check, examples).
Interaction: for complex logic, add "confirm before continuing" or "choose an option". Keep it in line with the spec's interaction policy (defaults preferred, then choices).
Boundaries: demote authoritative structural definitions, message sequences, and atomic rules from the Skill body to references; where the asset does not yet exist, list the suggested new Spec / Protocol / Rule in the diff summary, and do not conjure unrelated assets inside this skill.
Adaptation: add "discover → map → execute → handle absence" steps for the tool dependencies; a tool name is whatever the current runtime actually exposes, and an example tool name serves only as a capability hint.
Local contract: check external links, raw URLs, language, asset priority, and the local-path-first policy; on a violation, switch to a local reference or a conditional note.
Metadata: align the tags with INDEX.md; suggest triggers for a high-discoverability skill; suggest a sensible SemVer.
Apply the changes: unless the user explicitly asks for a dry run or a temporary refined file, write the refined content straight back to the source SKILL.md, and attach both the diff summary and the version proposal to the output, so it can be reviewed and audited.
Input & Output
Input
A SKILL Markdown document that needs optimising, or a draft.
Output
Optimised skill: production-grade Markdown that meets the spec.
Diff summary: what changed, and why.
Version proposal: a SemVer recommendation.
Output Persistence (document handling)
Rule: by default, improve and overwrite the original SKILL.md in place, together with an auditable diff summary and a version proposal; only when the user explicitly asks for "a refined draft only, leave the source file alone" is a temporary or new refined file written. Every run must pick one of the three strategies below:
Strategy
Path pattern
Behavior
Overwrite in place (default)
skills/<skill-name>/SKILL.md
Overwrite the source file directly, keep the frontmatter version updated, and carry the change summary in the output, which is what makes it auditable
Fixed temp file (opt-out)
skills/<skill-name>/SKILL.refined.md
Used when the user asks "do not touch the original, just give me the refinement"; every run overwrites the same temporary file
New file per run (opt-out)
skills/<skill-name>/SKILL.refined.YYYYMMDD.md
Used when the user asks "keep a separate file for this refinement"; every run creates a new refined file
User override: if the user names a path or a strategy, follow it. Otherwise use overwrite in place.
Restrictions
Hard Boundaries
Overwrite by default, but it must stay auditable: the default strategy overwrites the source SKILL.md directly, but the frontmatter version must be updated in step and the output carries a complete change summary, which is what keeps it auditable.
Respect an explicit "draft mode" request: where the user explicitly asks "do not modify the original", "only produce a refined draft" or the like, the source SKILL.md must not be overwritten; write only to a temporary or new refined file.
Do not change the intent: the optimisation must preserve the skill's core purpose.
Do not dress a split suggestion up as done: if only the Skill's reference changed and no Spec / Protocol / Rule was actually created, the output must say "split suggested" and must not claim the asset already exists.
Do not route around the local contract: in a repository that forbids external fetching by default, an external URL must not be written in as a source that execution depends on; it serves only as a reference source where conditions allow.
Write less prose: prefer lists and tables over long narrative paragraphs.
Several examples: do not keep only one "happy path" example; include at least one challenging or extreme case.
Skill Boundaries (avoid overlap)
Do not do these (other skills handle them):
Create a new skill from scratch: generating the initial skill structure and content → handled separately through the repository contribution process; an external skill-creator must not be installed ad hoc
Project documentation: generate a README → use generate-standard-readme; generate AGENTS.md → use generate-agent-entry
Decontextualise text: strip PII or sensitive information → use decontextualize-text
When to stop and hand off:
The user says "looks good", "approved", "commit this" → the refinement is done; hand off to the user for version control
The user asks "how do I create a new skill?" → hand off to the repository contribution guide and the agentskills.io spec
Self-Check
Core Success Criteria (all must be met)
Structurally compatible: the skill follows the standard template (YAML, purpose, use cases, behavior, input and output, restrictions, self-check, examples)
Logic is clear: the input → behavior → output chain is clear and unambiguous
Constraints defined: the restrictions section covers the failure modes common to the domain
Asset boundaries: the Skill carries no authoritative definition that belongs to a Spec / Protocol / Rule; any necessary split is stated
Execution adaptation: external tools and MCP tools have a discovery, capability-mapping, and missing-tool handling path
Repository contract: AGENTS.md, the terminology definitions, and the external-link and language rules are applied
Examples are thorough: at least 2 examples, one of them an edge case or a challenging scenario
Changes recorded: the diff summary lists every change together with its section, description, and reason
Version proposed: a SemVer proposal is given, with its rationale
Process Quality Checks
Bootstrapping: can this skill be applied to itself successfully (refine itself)?
Clarity: can an agent with no domain background reproduce the behavior's result?
Compliance: are all the required sections and metadata fields present?
Intent preserved: does the refined skill keep the original skill's core purpose?
Precision: are the verbs concrete and unambiguous (not a vague term such as "process")?
Interaction policy (spec §4.3): does the behavior have default-based or choice-based interaction, where that applies?
Triggers (optional): for a high-discoverability skill, are "triggers" suggested?
Acceptance Test
Can an AI Agent apply this refined skill consistently across different environments, with no ambiguity?
If no: the skill needs further refinement. Go through the "Behavior" section for clarity and add more specific instructions.
If yes: the refinement is done. Give the user the diff summary and the version recommendation.
Examples
Before
Name: spell-check
This skill checks spelling.
Input: multilingual text.
Output: the corrected text.
After
Name: polish-text-spelling
Description: context-aware spelling and terminology correction for multilingual documents.
Tags: [writing, quality-control]
Version: 1.1.0
Skill: Spelling and Terminology
Purpose: find and fix low-level spelling errors and terminology inconsistencies without changing the author's intent or tone
Behavior
Detect the language.
If the text is long, build a terminology list.
Tell a "typo" apart from "deliberate style".
Restrictions: do not change proper nouns or specific abbreviations unless they are plainly wrong
Example 2: Edge case — an ambiguous draft
Input: a skill draft whose purpose is "help users process files", with no use cases and no restrictions.
Expected: pin down the intent (replace "process" with a concrete verb: parse, convert, merge, and so on); add use cases and restrictions (e.g. do not overwrite the source; do not modify binary files); add at least one edge-case example (e.g. an empty file, a very large file, permission denied).
1---2name: refine-skill-design3description: Audit and refactor existing SKILLs to meet spec compliance, repository asset boundaries, tool adaptation requirements, and LLM best practices.4license: MIT5---67# Skill: Refine Skill Design89## Purpose1011As a "meta-skill", this skill **reviews and refactors** AI capability definitions that are still in draft form. It applies an advanced prompt-engineering lens to raise logical robustness, scenario coverage, and instruction adherence, so that every capability meets LLM best practices.1213---1415## Core Objective1617**Primary goal**: produce a reviewed and refactored skill document that meets spec compliance, the repository's asset boundaries, and LLM best practices.1819**Success criteria** (all must be met):20211. ✅ **Structurally compatible**: the skill follows the standard template (YAML, purpose, use cases, behavior, input and output, restrictions, self-check, examples)222. ✅ **Logic is clear**: the input → behavior → output chain is clear and unambiguous233. ✅ **Constraints defined**: the restrictions section covers the failure modes common to the domain244. ✅ **Asset boundaries clear**: the Skill embeds no authoritative definition that belongs to a Spec / Protocol / Rule; where needed it references one instead, or proposes a split255. ✅ **Execution adaptation explicit**: external tools, MCP tools, the runtime environment, and missing capabilities all have a discovery, mapping, and failure-handling path266. ✅ **Repository contract compliant**: obeys `AGENTS.md`, the terminology definitions, and the external-link, language, and asset-priority rules277. ✅ **Examples are thorough**: at least 2 examples, one of them an edge case or a challenging scenario288. ✅ **Changes recorded**: the diff summary lists every change together with its section, description, and reason299. ✅ **Version proposed**: a SemVer proposal with its rationale3031**Acceptance test**: can an AI Agent apply this refined skill consistently across different environments, with no ambiguity?3233---3435## Scope Boundaries3637**This skill does**:3839- Review an existing skill draft for quality and compliance40- Refactor the skill's structure and content to meet the spec41- Audit the Skill / Spec / Protocol / Rule boundary, to avoid burying a structural contract, an interaction protocol, or a single-point rule inside a Skill42- Audit the tool adaptation layer, so that discovery, capability mapping, and missing-tool handling for MCP / CLI / API tools are executable43- Audit the repository's local contract, so the optimised Skill obeys `AGENTS.md` and the local terminology definitions44- Raise logical clarity and instruction precision45- Add the missing sections or strengthen the weak areas46- Provide the diff summary and a version proposal4748**This skill does not do**:4950- Generate the full skeleton of a new Skill from scratch51- Install an external Skill or initialiser at runtime52- Decide, in the maintainer's place, the licence and vendoring scope of an externally derived Skill53- Generate the project docs/ structure (taken on by the AgentFabric runtime or a human)5455**Handoff point**: once the SKILL is refined and the diff summary is delivered, hand off to the user for review and a version-control commit.5657---5859## Use Cases6061- **New skill onboarding**: an expert review after an agent has drafted a new skill.62- **Quality repair**: when a skill behaves inconsistently on a new model, adjust the logic and strengthen the examples.63- **Consistency review**: check that a new skill matches the tag system and naming in INDEX.md; make sure `description`, `tags`, and `triggers` are enough to support semantic discovery.64- **Upgrade**: turn a plain "formatter" into a full agent capability with an interaction policy and error handling.6566**Scope**: this skill is for **reviewing and refactoring an existing skill**, not for creating one from scratch. A new Skill is handled separately, through the repository contribution process and the agentskills.io spec; an external skill-creator must not be installed at runtime for that purpose.6768---6970## Behavior7172### Meta-Audit Model73741. **Intent**: is the purpose specific enough? Avoid vague terms such as "assistant" or "utility".752. **Logic**: do input → behavior → output form a clear chain?763. **Constraints**: do the restrictions cover the most common failure modes in the domain?774. **Examples**: do the examples run from simple to complex and include at least one edge case?785. **Interaction policy** (spec §4.3): does the behavior state the defaults, the choice options, and which items need user confirmation? Defaults first, then choices, then context inference.796. **Asset boundary**: is the Skill defining the structure of a thing (Spec), a multi-party message sequence (Protocol), or an atomic prohibition (Rule)? If so, keep the execution orchestration and turn the authoritative definition into a reference to an existing asset, or name where the split belongs.807. **Execution adaptation**: does the Skill depend on MCP / CLI / API / an external service? If it does, does it state how to discover the available tools, build the capability mapping, handle a missing tool, and avoid hard-coding a tool name that does not exist?818. **Repository contract**: when optimising inside the AI Cortex repository, `AGENTS.md`, `docs/architecture/terminology.md`, and `skills/SOURCES.yaml` must be read and applied; external HTTP/HTTPS links must not be fetched by default, and a Skill must not be installed at runtime. A pinned upstream version can be read only where an externally derived copy is maintained and the context explicitly declares `allow_external_fetch=true`.829. **Triggers** (optional): for a high-discoverability skill, consider putting "triggers" (3-5 English phrases) up front, for fast invocation matching.8384### Optimisation Process85861. **Structure**: apply the standard template (YAML, purpose, use cases, behavior, I/O, restrictions, self-check, examples).872. **Verbs**: use precise, unambiguous verbs (e.g. "process" → "parse", "convert", "trim").883. **Interaction**: for complex logic, add "confirm before continuing" or "choose an option". Keep it in line with the spec's interaction policy (defaults preferred, then choices).894. **Boundaries**: demote authoritative structural definitions, message sequences, and atomic rules from the Skill body to references; where the asset does not yet exist, list the suggested new Spec / Protocol / Rule in the diff summary, and do not conjure unrelated assets inside this skill.905. **Adaptation**: add "discover → map → execute → handle absence" steps for the tool dependencies; a tool name is whatever the current runtime actually exposes, and an example tool name serves only as a capability hint.916. **Local contract**: check external links, raw URLs, language, asset priority, and the local-path-first policy; on a violation, switch to a local reference or a conditional note.927. **Metadata**: align the tags with INDEX.md; suggest triggers for a high-discoverability skill; suggest a sensible SemVer.938. **Apply the changes**: unless the user explicitly asks for a dry run or a temporary refined file, write the refined content **straight back to the source `SKILL.md`**, and attach both the diff summary and the version proposal to the output, so it can be reviewed and audited.9495---9697## Input & Output9899### Input100101- A SKILL Markdown document that needs optimising, or a draft.102103### Output104105- **Optimised skill**: production-grade Markdown that meets the spec.106- **Diff summary**: what changed, and why.107- **Version proposal**: a SemVer recommendation.108109### Output Persistence (document handling)110111**Rule**: by default, improve and overwrite the original `SKILL.md` in place, together with an auditable diff summary and a version proposal; only when the user explicitly asks for "a refined draft only, leave the source file alone" is a temporary or new refined file written. Every run must pick one of the three strategies below:112113| Strategy | Path pattern | Behavior |114| :--- | :--- | :--- |115| **Overwrite in place** (default) | `skills/<skill-name>/SKILL.md` | Overwrite the source file directly, keep the frontmatter `version` updated, and carry the change summary in the output, which is what makes it auditable |116| **Fixed temp file** (opt-out) | `skills/<skill-name>/SKILL.refined.md` | Used when the user asks "do not touch the original, just give me the refinement"; every run overwrites the same temporary file |117| **New file per run** (opt-out) | `skills/<skill-name>/SKILL.refined.YYYYMMDD.md` | Used when the user asks "keep a separate file for this refinement"; every run creates a new refined file |118119User override: if the user names a path or a strategy, follow it. Otherwise use **overwrite in place**.120121---122123## Restrictions124125### Hard Boundaries126127- **Overwrite by default, but it must stay auditable**: the default strategy overwrites the source `SKILL.md` directly, but the frontmatter `version` must be updated in step and the output carries a complete change summary, which is what keeps it auditable.128- **Respect an explicit "draft mode" request**: where the user explicitly asks "do not modify the original", "only produce a refined draft" or the like, the source `SKILL.md` must not be overwritten; write only to a temporary or new refined file.129- **Do not change the intent**: the optimisation must preserve the skill's core purpose.130- **Do not dress a split suggestion up as done**: if only the Skill's reference changed and no Spec / Protocol / Rule was actually created, the output must say "split suggested" and must not claim the asset already exists.131- **Do not route around the local contract**: in a repository that forbids external fetching by default, an external URL must not be written in as a source that execution depends on; it serves only as a reference source where conditions allow.132- **Write less prose**: prefer lists and tables over long narrative paragraphs.133- **Several examples**: do not keep only one "happy path" example; include at least one challenging or extreme case.134135### Skill Boundaries (avoid overlap)136137**Do not do these (other skills handle them)**:138139- **Create a new skill from scratch**: generating the initial skill structure and content → handled separately through the repository contribution process; an external skill-creator must not be installed ad hoc140- **Project documentation**: generate a README → use `generate-standard-readme`; generate AGENTS.md → use `generate-agent-entry`141- **Decontextualise text**: strip PII or sensitive information → use `decontextualize-text`142143**When to stop and hand off**:144145- The user says "looks good", "approved", "commit this" → the refinement is done; hand off to the user for version control146- The user asks "how do I create a new skill?" → hand off to the repository contribution guide and the agentskills.io spec147148---149150## Self-Check151152### Core Success Criteria (all must be met)153154- [ ] **Structurally compatible**: the skill follows the standard template (YAML, purpose, use cases, behavior, input and output, restrictions, self-check, examples)155- [ ] **Logic is clear**: the input → behavior → output chain is clear and unambiguous156- [ ] **Constraints defined**: the restrictions section covers the failure modes common to the domain157- [ ] **Asset boundaries**: the Skill carries no authoritative definition that belongs to a Spec / Protocol / Rule; any necessary split is stated158- [ ] **Execution adaptation**: external tools and MCP tools have a discovery, capability-mapping, and missing-tool handling path159- [ ] **Repository contract**: `AGENTS.md`, the terminology definitions, and the external-link and language rules are applied160- [ ] **Examples are thorough**: at least 2 examples, one of them an edge case or a challenging scenario161- [ ] **Changes recorded**: the diff summary lists every change together with its section, description, and reason162- [ ] **Version proposed**: a SemVer proposal is given, with its rationale163164### Process Quality Checks165166- [ ] **Bootstrapping**: can this skill be applied to itself successfully (refine itself)?167- [ ] **Clarity**: can an agent with no domain background reproduce the behavior's result?168- [ ] **Compliance**: are all the required sections and metadata fields present?169- [ ] **Intent preserved**: does the refined skill keep the original skill's core purpose?170- [ ] **Precision**: are the verbs concrete and unambiguous (not a vague term such as "process")?171- [ ] **Interaction policy** (spec §4.3): does the behavior have default-based or choice-based interaction, where that applies?172- [ ] **Triggers** (optional): for a high-discoverability skill, are "triggers" suggested?173174### Acceptance Test175176**Can an AI Agent apply this refined skill consistently across different environments, with no ambiguity?**177178If no: the skill needs further refinement. Go through the "Behavior" section for clarity and add more specific instructions.179180If yes: the refinement is done. Give the user the diff summary and the version recommendation.181182---183184## Examples185186### Before187188> Name: spell-check189> This skill checks spelling.190> Input: multilingual text.191> Output: the corrected text.192193### After194195> Name: polish-text-spelling196> Description: context-aware spelling and terminology correction for multilingual documents.197> Tags: [writing, quality-control]198> Version: 1.1.0199>200> ---201>202> **Skill: Spelling and Terminology**203>204> **Purpose**: find and fix low-level spelling errors and terminology inconsistencies without changing the author's intent or tone205>206> **Behavior**207>208> 1. Detect the language.209> 2. If the text is long, build a terminology list.210> 3. Tell a "typo" apart from "deliberate style".211>212> **Restrictions**: do not change proper nouns or specific abbreviations unless they are plainly wrong213214### Example 2: Edge case — an ambiguous draft215216- **Input**: a skill draft whose purpose is "help users process files", with no use cases and no restrictions.217- **Expected**: pin down the intent (replace "process" with a concrete verb: parse, convert, merge, and so on); add use cases and restrictions (e.g. do not overwrite the source; do not modify binary files); add at least one edge-case example (e.g. an empty file, a very large file, permission denied).
Run npx skillmds@latest add nesnilnehc/refine-skill-design in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Audit and refactor existing SKILLs to meet spec compliance, repository asset boundaries, tool adaptation requirements, and LLM best practices. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
nesnilnehc (@nesnilnehc) published this skill. Their other Agent Skills are listed on their SkillMD profile.