Why Do AI Coding Agents Need Strict Skill Naming Conventions?
AI coding agents require strict skill library naming conventions because agent tool selection relies on semantic similarity matching between user prompt embeddings and skill catalog descriptions. When skills use ambiguous slugs or generic verbs like clean, test, or helper, autonomous runtimes experience high semantic collision rates, triggering accidental tool invocations that waste context tokens and degrade execution reliability.
As individual developers and engineering teams scale from 5 to 50+ custom agent skills, the cognitive and programmatic surface area expands rapidly. In single-agent setups, a folder named deploy might appear completely harmless. However, when that same developer switches between Claude Code in the terminal, Cursor IDE during code reviews, and Google Antigravity for automated background audits, the agent runtime must dynamically inspect registered capabilities.
AI agent runtimes execute tool discovery by calculating semantic similarity between prompt intent and skill descriptions, meaning generic slugs like "helper" or "clean" incur an ambiguity penalty that increases agent hallucination rates. According to the official Anthropic Claude Code documentation, “Skills are modular capabilities that extend Claude's core functionality through structured instructions and scripts.” When Claude Code or OpenAI Codex parses SKILL.md definitions across both personal (~/.claude/skills/) and repository (.claude/skills/) scopes, identical or colliding names force the agent into silent fallback behaviors. Without a structured naming protocol, the agent may execute a stale legacy script rather than your updated production runbook.
Moreover, modern AI agents operate under finite context budgets. Injecting dozens of unstructured or duplicate instructions bloats prompt preambles by 1,500 to 4,000 tokens per interaction. Strict naming schemas enable precise keyword filtering, selective lazy-loading, and zero-collision multi-agent orchestration.
Cross-Runtime Naming and Discovery Matrix
Different AI agent runtimes enforce distinct file paths, slug regex constraints, and discovery triggers. Understanding these technical parameters is essential before architecting a universal cross-agent skill library.
| Agent Runtime | Directory / File Schema | Slug Regex & Character Limit | Discovery & Parsing Trigger | Precedence Collision Rule |
|---|---|---|---|---|
| Claude Code | ~/.claude/skills/<slug>/SKILL.md | ^[a-z0-9_-]{1,64}$ | Dynamic catalog matching on description | Repo .claude/skills overrides personal ~/.claude/skills |
| Cursor IDE | .cursor/rules/<slug>.mdc | ^[a-z0-9_-]+\.mdc$ (64 chars) | File glob matching + alwaysApply boolean | Project rules merge with user rules; specific globs win |
| Google Antigravity | ~/.gemini/antigravity/skills/<slug>/SKILL.md | ^[a-z0-9-]{1,64}$ (kebab-only) | Autonomous workflow router & declared tool manifest | Workspace custom skills override builtin plugins |
| OpenAI Codex | ~/.codex/skills/<slug>/SKILL.md | ^[a-z0-9_-]{1,64}$ | Instruction preamble injection & CLI slash command | Local repository .codex/skills takes priority |
Notice the cross-platform common denominator: restricting skill directory slugs to lowercase kebab-case regex ^[a-z0-9_-]{1,64}$ ensures deterministic cross-platform compatibility across macOS APFS, Linux ext4, and Windows NTFS without POSIX path truncation. Adhering to this baseline guarantees that a skill written on macOS syncs cleanly into a remote Linux development container without case-sensitivity or illegal character exceptions.
How Should You Structure Hierarchical Namespaces to Prevent Agent Collisions?
You should structure hierarchical namespaces by adopting a three-part kebab-case schema: [domain]-[subsystem]-[action]. This explicit taxonomy guarantees that related skills cluster together alphabetically in file explorers, provides immediate context to AI semantic parsers, and prevents multi-repo naming collisions.
Consider what happens when an engineering team relies on flat, generic skill slugs. An engineer working across frontend, backend, and infrastructure repositories might author the following files:
build(in the frontend Next.js repo)build(in the Docker containerization repo)lint(in the Python data pipeline)lint(in the TypeScript monorepo)
When these repositories are aggregated into a single developer environment or synced into a centralized library, the agent encounters catastrophic namespace collisions. To resolve this, adopt standardized domain prefixes across your entire library:
| Domain Scope | Standard Prefix | Approved Slug Example | Anti-Pattern (Collision Risk) |
|---|---|---|---|
| Infrastructure & DevOps | infra- | infra-k8s-ingress-audit | k8s-audit, ingress |
| Database & Storage | db- | db-pg-migrate-verify | migrate, sql-check |
| Security & Compliance | sec- | sec-auth-jwt-validate | auth, jwt, security |
| Code Quality & Reviews | review- | review-pr-risk-checklist | review, pr-check |
| Testing & QA | test- | test-e2e-playwright-gen | test, e2e |
By maintaining consistent three-part slugs, developers achieve instant visual clarity when reviewing local folders or Git logs. For larger organizations consolidating scattered instructions across dozens of microservices, follow our step-by-step framework on detecting and consolidating duplicate AI agent skills across repositories.
The Sprawl Moment: The Production Outage and the Colliding Rollback Skill
At 4:45 PM on a Friday before a holiday weekend, a senior platform engineer deploys a critical payment reconciliation update across a distributed Kubernetes cluster. Minutes after release, worker pods begin reporting connection pool saturation, and checkout endpoints return 504 gateway timeouts. The engineer opens terminal and IDE windows across two monitors to trigger an automated rollback procedure using Claude Code and Cursor. They invoke the agent with an instruction to execute the rollback. Because their local workstation has accumulated 38 custom skills across four repository clones with informal names, two separate skills share the bare slug rollback: a modern Helm chart rollback skill residing in the active infrastructure monorepo, and a legacy AWS ECS task definition rollback script from an archived repository cloned six months earlier. Without explicit namespace prefixes or semantic versioning tags in frontmatter, the agent indexes the archived repository's skill first and executes deprecated AWS CLI commands against the Kubernetes cluster. The command fails with authentication exceptions, wasting 18 critical minutes of triage time while customer checkout transaction failures climb to 34% on the live status board.
This incident highlights the hidden danger of skill sprawl without strict naming standards. When skills live across multiple repositories, worktrees, and agent runtimes, a bare verb like rollback creates severe operational risk. To guarantee predictability during high-pressure troubleshooting, engineering workflows require standardized slug schemas, hierarchical domain prefixes, and semantic versioning.
How Do You Implement Semantic Versioning in SKILL.md Frontmatter?
You implement semantic versioning in SKILL.md frontmatter by declaring a formal version: "MAJOR.MINOR.PATCH" field conforming to the official Semantic Versioning 2.0.0 specification. Embedding explicit version numbers directly in YAML frontmatter allows developers, CI/CD validation gates, and AI skill managers to track breaking changes, enforce minimum runtime compatibility, and automate deprecation lifecycles.
As the SemVer 2.0.0 specification outlines: “Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.” Once an AI agent skill enters active team usage, its instructions, required variables, and tool invocation parameters form a contract with the agent runtime. Embedding SemVer 2.0.0 version numbers in YAML frontmatter allows engineering teams to detect breaking instruction changes before agents execute deprecated tool parameters in production environments.
Below is a production-grade SKILL.md specification demonstrating frontmatter schema conventions:
---
name: db-pg-migrate-verify
version: "2.1.0"
schema_version: "1.0.0"
min_runtime_version: ">=1.0.0"
author: "Platform Engineering <infra@example.com>"
deprecated: false
description: "Verify PostgreSQL schema migrations, check foreign key indexes, and test rollback scripts. Use when creating or modifying SQL migrations in Drizzle, Prisma, or Flyway."
metadata:
domain: "database"
subsystem: "postgres"
action: "migration-verification"
agent_compatibility:
- claude-code
- cursor
- codex
- antigravity
---
# PostgreSQL Migration Verification Protocol
## Pre-Migration Safety Checks
1. Inspect migration diff against target schema:
```bash
pnpm drizzle-kit generate
```
2. Verify that all non-nullable columns include default values or backfill migration steps.
3. Confirm rollback script exists and executes cleanly in local Docker test container.
## Execution Rules
- Never run `DROP TABLE` or `DROP COLUMN` without explicit two-phase deprecation flags.
- Check lock timeouts on high-traffic tables before applying concurrent indexes.
- Output a structured migration manifest summarizing affected tables and lock durations.Follow these strict rules when bumping skill versions:
- MAJOR Version (e.g.,
1.4.2→2.0.0): Bump when introducing breaking changes to required input arguments, deleting sub-commands, fundamentally restructuring expected output schemas, or altering tool permission scopes. - MINOR Version (e.g.,
1.4.2→1.5.0): Bump when adding backward-compatible capabilities, supporting additional database drivers, adding optional flags, or extending instruction edge cases. - PATCH Version (e.g.,
1.4.2→1.4.3): Bump when refining prompt phrasing, fixing typos, updating documentation links, or optimizing token efficiency without altering behavioral intent.
A well-structured frontmatter block adds only 35 to 50 tokens of overhead, yet delivers total transparency into the evolution and compatibility of your instructions. For multi-runtime conversion patterns, explore our guide on establishing a single cross-agent skill library.
Automating Skill Validation: A POSIX Audit Script for Developer Libraries
Automating skill validation with a pre-commit or CI/CD audit script prevents ill-formed slugs and unversioned frontmatter from polluting team repositories. A robust audit script scans skill directories, verifies slug regex compliance, enforces character limits, and confirms required YAML fields before code is pushed to production.
Below is a production-ready POSIX shell script (audit-skill-conventions.sh) that validates skills in ~/.claude/skills/, .claude/skills/, and .cursor/rules/:
#!/usr/bin/env bash
# audit-skill-conventions.sh: Validate AI agent skill naming & SemVer standards
set -euo pipefail
SKILL_DIRS=(
"$HOME/.claude/skills"
"./.claude/skills"
"./.cursor/rules"
)
MAX_SLUG_LENGTH=64
SLUG_REGEX='^[a-z0-9]+(-[a-z0-9]+)*$'
SEMVER_REGEX='^[0-9]+\.[0-9]+\.[0-9]+$'
ERRORS=0
TOTAL_SKILLS=0
declare -A SEEN_SLUGS
echo "=== Starting AI Agent Skill Convention Audit ==="
for dir in "${SKILL_DIRS[@]}"; do
if [[ ! -d "$dir" ]]; then
continue
fi
echo "Checking directory: $dir"
while IFS= read -r -d '' skill_file; do
TOTAL_SKILLS=$((TOTAL_SKILLS + 1))
skill_name=""
if [[ "$skill_file" =~ \.cursor/rules/(.+)\.mdc$ ]]; then
skill_name="${BASH_REMATCH[1]}"
elif [[ "$skill_file" =~ /([^/]+)/SKILL\.md$ ]]; then
skill_name="${BASH_REMATCH[1]}"
else
continue
fi
# 1. Validate slug length
if [[ ${#skill_name} -gt $MAX_SLUG_LENGTH ]]; then
echo " [FAIL] Slug exceeds $MAX_SLUG_LENGTH characters: '$skill_name' ($skill_file)"
ERRORS=$((ERRORS + 1))
fi
# 2. Validate kebab-case slug regex
if [[ ! "$skill_name" =~ $SLUG_REGEX ]]; then
echo " [FAIL] Invalid slug naming format: '$skill_name' ($skill_file). Must match $SLUG_REGEX"
ERRORS=$((ERRORS + 1))
fi
# 3. Detect duplicate slugs across directories
if [[ -n "${SEEN_SLUGS[$skill_name]:-}" ]]; then
echo " [FAIL] Duplicate slug collision: '$skill_name' already seen in '${SEEN_SLUGS[$skill_name]}'"
ERRORS=$((ERRORS + 1))
else
SEEN_SLUGS["$skill_name"]="$skill_file"
fi
# 4. Check for SemVer in frontmatter (if SKILL.md)
if [[ "$skill_file" =~ SKILL\.md$ ]]; then
if ! grep -q "^version:" "$skill_file"; then
echo " [FAIL] Missing 'version:' field in frontmatter: $skill_file"
ERRORS=$((ERRORS + 1))
else
version_val=$(grep "^version:" "$skill_file" | head -n1 | awk -F: '{print $2}' | tr -d ' "'')
if [[ ! "$version_val" =~ $SEMVER_REGEX ]]; then
echo " [FAIL] Invalid SemVer string '$version_val' in $skill_file (must match X.Y.Z)"
ERRORS=$((ERRORS + 1))
fi
fi
# 5. Check description presence and minimum length
if ! grep -q "^description:" "$skill_file"; then
echo " [FAIL] Missing 'description:' field in frontmatter: $skill_file"
ERRORS=$((ERRORS + 1))
fi
fi
done < <(find "$dir" -type f \( -name "SKILL.md" -o -name "*.mdc" \) -print0)
done
echo "------------------------------------------------"
echo "Audit complete: $TOTAL_SKILLS skills checked."
if [[ $ERRORS -gt 0 ]]; then
echo "FAILED: Encountered $ERRORS convention violation(s)."
exit 1
else
echo "SUCCESS: All skills adhere to naming and SemVer standards."
exit 0
fiIntegrating this script into Git pre-commit hooks or GitHub Actions ensures that no unversioned or colliding skill enters the shared codebase. If you need help diagnosing instruction precedence conflicts in monorepos, review our troubleshooting guide on resolving multi-agent instruction precedence conflicts.
Deprecation Lifecycles: How to Sunset Stale Skills Without Breaking Workflows
Deprecating outdated agent skills requires a structured lifecycle rather than abrupt file deletion. Deleting a skill immediately breaks team members' active workflows, leaves orphaned shell aliases, and causes agent misfires when cached instructions attempt to call removed files.
Follow this four-phase deprecation protocol:
- Phase 1: Mark as Deprecated in Frontmatter. Set
deprecated: trueand declare the successor slug inreplaced_by: "infra-k8s-rollback". Keep the skill active for a 30-day grace period. - Phase 2: Add Agent Warning Directive. Inject a prominent warning block at the very top of the Markdown body instructing the AI assistant to inform the user of the pending deprecation:
> [!WARNING] > This skill (db-migrate) is deprecated and will be removed on 2026-11-30. > Please use 'db-pg-migrate-verify' for future schema updates. - Phase 3: Soft Sunset (Forwarding Proxy). Replace the execution commands inside the old skill with an explicit redirect instruction telling the agent to invoke the successor skill.
- Phase 4: Hard Prune. Remove the directory from your repository or centralized library after the grace period expires.
For broader library maintenance techniques, read our complete guide on how to organize a Claude skill library that scales.
How Does Prompttly Enforce Consistent Skill Conventions Across Tools?
Prompttly enforces consistent skill conventions by providing a centralized, version-controlled library that automatically translates and syncs instructions into native agent directories with strict naming validation. Instead of manually maintaining separate folders for Claude Code, Cursor, and Codex, Prompttly manages your entire collection as a single source of truth.
Prompttly is a skill manager for AI agents — one library for your skills and prompts that syncs into Claude Code, Codex, ChatGPT, and Claude and is one hotkey away on your Mac, so your setup follows you across every machine, repo, and tool.
Prompttly eliminates naming collisions and versioning drift through three core capabilities:
- Unified Schema Enforcement: Prompts and skills created in Prompttly are automatically validated against cross-agent naming regexes and character constraints, ensuring every slug syncs cleanly across macOS, Linux, and Windows.
- Automated Version History: Every modification to a prompt or skill is tracked with full version history, making it effortless to roll back broken instructions or review changes across review cycles.
- Instant Hotkey Retrieval (<200ms latency): On macOS, Prompttly provides a native menu bar and global command palette. Pressing a custom hotkey opens your entire library in under 200 milliseconds, allowing you to search, filter by domain tags, and insert approved instructions directly into Cursor, Ghostty, or Chrome without copy-pasting.
- Two-Way Native Sync: Changes made directly in
~/.claude/skills/or.cursor/rules/sync bidirectionally to your central cloud library, ensuring secondary laptops and teammates remain perfectly aligned.
When your library expands past 100+ instructions, rapid search latency is just as vital as strict naming. Check out our technical benchmark on searching a large prompt library in under five seconds. If you are authoring a new skill from scratch, try our free Claude Skill Creator to generate structured YAML frontmatter instantly.
Frequently Asked Questions About Skill Library Naming Conventions
What is the best naming convention for AI agent skills?
The most robust naming convention for AI agent skills is a three-part hierarchical kebab-case slug: [domain]-[subsystem]-[action] (for example, k8s-ingress-audit or db-pg-migrate). Restricting directory names to lowercase alphanumeric characters with hyphens under 64 characters prevents POSIX path collisions, eliminates agent routing ambiguities, and ensures deterministic compatibility across Claude Code, Cursor, and Google Antigravity.
How does semantic versioning work for SKILL.md frontmatter?
Semantic versioning in a SKILL.md file uses the standard SemVer 2.0.0 three-part format (MAJOR.MINOR.PATCH) in the YAML frontmatter. Increment the MAJOR version when altering required input arguments or breaking task assumptions, the MINOR version when adding backward-compatible sub-tasks or capabilities, and the PATCH version when refining prompt clarity, fixing typos, or updating documentation.
What happens if two AI agent skills share the same name?
When two skills share an identical slug, agent runtimes exhibit undefined precedence behavior. For example, Claude Code and OpenAI Codex prioritize repository-local project skills (.claude/skills/) over global user skills (~/.claude/skills/), silently overriding personal defaults. If two skills share the same name within the same scope, agent catalog parsers either fail on startup or randomly execute whichever skill was indexed first.
Why do AI coding assistants misfire when skill names are too generic?
AI coding assistants misfire because agent tool selection relies on semantic similarity scoring between user prompt embeddings and skill catalog descriptions. A skill named with a generic verb like clean, test, or helper incurs high semantic collision with everyday conversation tokens, triggering unintended tool invocations that consume context tokens and degrade execution accuracy.
Can you use uppercase letters, underscores, or slashes in agent skill slugs?
No, avoid uppercase letters, underscores, and slashes in skill slugs. While macOS APFS is case-insensitive, Linux ext4 file systems are case-sensitive, creating broken references when syncing between local Mac workstations and remote CI/CD containers. Slashes break nested directory discovery in flat agent registries, while underscores cause regex validation failures in tools like Google Antigravity and Cursor rules.
Related Prompt Resources
Maintain versioned, conflict-free skills across all your AI agents
Prompttly synchronizes your skills across Claude Code, Codex, and Cursor with automatic version tracking and sub-200ms hotkey retrieval on macOS.