Skill authoring

From ahmadulhoq/agentskel · View interactive version

Skill authoring is an AI agent skill from the GitHub repository ahmadulhoq/agentskel. When creating a new skill or workflow, or improving an existing skill's effectiveness. Use when the user asks to add a capability, write a new workflow, or when a skill isn't triggering or being followed reliably.

How to use this skill

Skill file

Skill Authoring Guide

Purpose: Create skills that agents actually discover, trigger, and follow.


Step 1 — Skill Anatomy

Every skill is a SKILL.md file with this structure:

---
name: kebab-case-name          # required; must match directory name
license: MIT                   # optional; license name or bundled file ref
compatibility: Designed for X  # optional; only if skill has specific env needs
description: CSO-optimized triggering description (see Step 2)  # required
---

Required fields: name, description. Optional standard fields (agentskills.io):

license (add for any distributed/public skill), compatibility (add only when

the skill body depends on a specific tool — e.g. references .claude/ paths).

Body conventions:


Step 2 — CSO: Write Discoverable Descriptions

The description field determines whether agents find your skill. Agents match

skills to situations by scanning descriptions.

Rules:

  1. Describe triggering conditions, not workflow summaries
  2. Use the language a user would use in their request
  3. Start with "When..." or include "Use when..."
  4. Include the scenario, not the mechanism
  5. Keep the description under 1024 characters (agentskills.io spec hard limit). Multi-line YAML folded scalars (>) are supported — the validator and stub generator normalize them to a single string. If the description needs more than 2-3 sentences, the skill scope is probably too broad. A pre-commit hook enforces the 1024-char limit on staged files.

| Bad (summary) | Good (triggering condition) |

|---|---|

| "Maps the codebase into MAP.md and SYMBOLS.md" | "When codebase structure has changed, MAP.md/SYMBOLS.md are missing or stale, or after major refactors and initial setup." |

| "Full feature development workflow" | "When the user asks to implement a new feature end-to-end requiring planning, branch creation, implementation, testing, and PR." |

| "Monthly maintenance tasks" | "When Knowledge Bus entries are older than 30 days, or memory files have stale content. Run monthly or when bus/ is cluttered." |

Test: Read the description out of context. Can you tell when to use this skill

without reading the body? If not, rewrite it.


Step 3 — Rationalization Resistance

Enforcement-critical skills (gates, mandatory procedures) need a rationalization

table. Agents will try to skip steps. Anticipate and block the excuses.

Format:

## Common Rationalizations

| Rationalization | Why it's wrong | Do this instead |
|---|---|---|
| "I already know this" | You don't. Context was reset. | Follow the procedure. |

How to write entries:

  1. Run the skill mentally. At each step, ask: "What excuse would an agent make to skip this?"
  2. Write the excuse in the agent's voice ("I already...", "This is too...", "The user said...")
  3. Write a short, direct rebuttal — address the specific excuse, not a generic "follow the rules"
  4. Write the correct action in imperative form

When to include: Any skill with a Gate statement, mandatory steps, or "do not skip"

language. Not needed for advisory skills (developer, domain-expert).

Target 6-12 entries per enforcement skill. Cover the most tempting shortcuts.


Step 4 — Token Budget

Every skill loads into the agent's context window. Respect the budget.


Step 5 — Quality Gates

Before finalizing a new or modified skill, verify all items:


Step 6 — Testing a Skill

  1. Baseline test: Imagine (or run) the agent doing the task without the skill.

Note the failures — what does the agent skip, get wrong, or rationalize away?

  1. Write the skill to close those specific gaps.
  2. Verify: Does each baseline failure have a corresponding step, rule, or

rationalization counter in the skill?

  1. Iterate: If the agent still skips a step, strengthen the gate or add a

rationalization entry. Don't add more content — sharpen what exists.


Step 7 — Self-Sync Checklist

Every skill change must update all 5 locations. Missing any causes drift.

| # | Location | Purpose |

|---|---|---|

| 1 | core/skills/X/SKILL.md (or roles/dev/skills/X/) | Source of truth (template) |

| 2 | .agents/skills/X/SKILL.md | Installed copy (project agents read this) |

| 3 | .claude/skills/X.md | Claude Code stub (discovery pointer) |

| 4 | AGENTS.md Skills/Workflows catalog table | Universal catalog entry |

| 5 | core/AGENTS.md.template | Template for downstream projects |

For workflows, location 1 is roles/dev/workflows/X.md and location 2 is

.agents/workflows/X.md. Same sync requirement.

Stub format (.claude/skills/X.md):

---
description: [CSO description — normalize multi-line folded scalars to a single line]
---

Read and follow the full skill at `.agents/skills/X/SKILL.md`.

Gate: Do not finalize a skill until all quality gates (Step 5) pass and

all 5 self-sync locations (Step 7) are updated.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.