joabgonzalez

skill-creation

"Standards-compliant skill creation with templates and validation. Trigger: When creating a new skill or documenting patterns."

joabgonzalez 9 Updated 8mo ago

Resources

2
GitHub

Install

npx skillscat add joabgonzalez/ai-agents-skills/skill-creation

Install via the SkillsCat registry.

SKILL.md

Skill Creation

Create skills from simple single-file to complex multi-reference architectures. Each skill must have unique responsibility and be self-sufficient.

When to Use

  • Creating new skill from scratch
  • Pattern is used repeatedly and AI needs guidance
  • Project conventions differ from generic best practices
  • Technology has multiple sub-topics requiring organization

Don't create when:

  • Pattern is trivial or self-explanatory
  • It's a one-off task

Critical Patterns

โœ… REQUIRED [CRITICAL]: Read Template Before Creating

ALWAYS read the template FIRST before creating any skill or reference:

# For new skill:
# 1. Read skills/skill-creation/assets/SKILL-TEMPLATE.md
# 2. Copy template
cp skills/skill-creation/assets/SKILL-TEMPLATE.md skills/{skill-name}/SKILL.md

# For new reference:
# 1. Read skills/skill-creation/assets/REFERENCE-TEMPLATE.md
# 2. Follow structure exactly

Why: Templates define canonical structure. Reading them ensures consistency and prevents structural errors.

โœ… REQUIRED: Include Trigger in Description

# โœ… CORRECT
description: "TypeScript strict patterns. Trigger: When implementing TypeScript in .ts/.tsx files."

# โŒ WRONG: Missing Trigger
description: "TypeScript strict patterns."

โœ… REQUIRED: Frontmatter Structure

---
name: skill-name              # Required: lowercase-with-hyphens
description: "What it does. Trigger: When to activate." # Required: include Trigger
license: "Apache 2.0"         # Optional: for npx distribution
metadata:
  version: "1.0"              # Required: semantic versioning (X.Y or X.Y.Z)
  type: framework             # Required: behavioral|universal|language|framework|library|tooling|domain
  skills:                     # Skill dependencies (see dependencies-matrix.md)
    - react
    - typescript
  dependencies:                # Package version ranges (if applicable)
    react: ">=17.0.0 <19.0.0"
  allowed-tools:               # Optional: only if skill needs specific tools
    - file-operations
---

CRITICAL: The type field determines which dependencies are allowed. See dependencies-matrix.md for type rules.

See frontmatter.md for full field reference.

โœ… REQUIRED: Include Inline Examples

Place focused example (<15 lines) after each Critical Pattern showing correct vs incorrect.

โœ… REQUIRED: Add Decision Tree

Every skill MUST include a Decision Tree section using conditionโ†’action format.

โœ… REQUIRED: Create References for Complex Skills

When skill has 40+ patterns or 4+ sub-topics:

skills/{skill-name}/
โ”œโ”€โ”€ SKILL.md (300 lines max)
โ””โ”€โ”€ references/
    โ”œโ”€โ”€ {sub-topic-1}.md
    โ””โ”€โ”€ {sub-topic-2}.md

For complex skills, invoke reference-creation skill.

โœ… REQUIRED: Self-Sufficient Content

Don't duplicate universal rules (naming, formatting, accessibility) โ€” they apply everywhere. Include only skill-specific content. Each skill must work on its own without relying on the reader having other skills loaded.

โœ… REQUIRED: Token Efficiency

  • Omit empty frontmatter arrays/objects
  • Description under 150 characters
  • Remove filler words ("comprehensive", "detailed")
  • Every word must add unique value

See token-efficiency.md for compression strategies.

โŒ NEVER: Duplicate Conventions

Don't rewrite rules that already apply universally (naming, formatting). Skills are self-sufficient โ€” include only skill-specific conventions.

โœ… REQUIRED: references/ README.md Structure (Complex Skills Only)

When creating references/ directory, ALWAYS include README.md with this 4-section structure:

# [Skill Name] References

## Quick Navigation

| Reference | Lines | Topic |
|-----------|-------|-------|
| [file1.md](file1.md) | ~300 | Brief description |
| [file2.md](file2.md) | ~450 | Brief description |

## Reading Strategy

**Planning new feature:** Read main SKILL.md โ†’ file1.md โ†’ file2.md โ†’ Implement
**Debugging issue:** Read file2.md โ†’ file3.md
**Building design system:** Read file1.md, file3.md

## File Descriptions

### file1.md (~300 lines)
Detailed description of what this reference covers...

### file2.md (~450 lines)
Detailed description...

## Cross-Reference Map

**Topic A:** See file1.md โ†’ Links to file2.md section X
**Topic B:** See file2.md โ†’ Also covered in file3.md

See interface-design/references/README.md for complete example.


Decision Tree

Creating new skill? (CRITICAL FIRST STEP)
  โ†’ Read assets/SKILL-TEMPLATE.md BEFORE creating
  โ†’ Understand structure: # Title, summary (1-2 lines), ## When to Use, ## Critical Patterns
  โ†’ NO "Overview" or "Objective" sections

Creating new reference file?
  โ†’ Read assets/REFERENCE-TEMPLATE.md BEFORE creating
  โ†’ Follow structure: # Title, summary (1-2 lines), ## Core Patterns
  โ†’ NO "Overview" or "Purpose" sections

Complexity?
  โ†’ <15 patterns, 1 topic โ†’ Simple: SKILL.md only
  โ†’ 15-40 patterns, 2-3 topics โ†’ Medium: SKILL.md + assets/
  โ†’ 40+ patterns, 4+ topics โ†’ Complex: SKILL.md + references/ (invoke reference-creation)

Exceeding 300 lines? โ†’ Move content to references/
Need templates/schemas? โ†’ Create assets/ directory

Determining skill type? (CRITICAL - type determines dependencies)
  โ†’ Read references/dependencies-matrix.md for full guide
  โ†’ Is it process/methodology (not tech-specific)? โ†’ type: behavioral
  โ†’ Tech-agnostic workflow orchestration? โ†’ type: universal
  โ†’ Programming language (JS, TS, Python)? โ†’ type: language
  โ†’ Framework (React, Express, Next)? โ†’ type: framework
  โ†’ Library (MUI, Redux, Zod)? โ†’ type: library
  โ†’ Dev tool (Vite, Jest, ESLint)? โ†’ type: tooling
  โ†’ Domain knowledge (a11y, CSS, patterns)? โ†’ type: domain

Determining dependencies based on type?
  โ†’ Read references/dependencies-matrix.md for type-specific rules
  โ†’ behavioral โ†’ Can ONLY depend on other behavioral (prefer NONE)
  โ†’ universal โ†’ Can ONLY depend on behavioral
  โ†’ language โ†’ Prefer NONE (self-sufficient)
  โ†’ framework โ†’ Can depend on framework, language, domain, behavioral
  โ†’ library โ†’ Can depend on library, framework, language, domain, behavioral
  โ†’ tooling โ†’ Can depend on what it wraps
  โ†’ domain โ†’ Prefer NONE (or related domain, behavioral)

Check for transitive redundancy? (CRITICAL)
  โ†’ Does any current dependency already provide what you need?
  โ†’ If YES โ†’ Remove redundant dependency
  โ†’ If NO โ†’ Keep it
  โ†’ Example: ag-grid depends on react โ†’ Gets javascript + a11y transitively

After creation? โ†’ Run ai-agents-skills sync or make sync

Workflow

  1. Assess complexity โ†’ Determine simple/medium/complex (see Decision Tree)
    • Checkpoint: โœ… Complexity level determined, structure chosen
  2. Create structure โ†’ mkdir skills/{name} + copy SKILL-TEMPLATE.md
    • Checkpoint: โœ… Directory exists, template copied
  3. Determine type and dependencies โ†’ Identify skill type (behavioral/universal/language/framework/library/tooling/domain), then determine dependencies per dependencies-matrix.md
    • Checkpoint: โœ… Type correctly identified, dependencies follow type rules, no transitive redundancies
  4. Fill template โ†’ Frontmatter (name, description+Trigger, version, type, skills), all required sections
    • Checkpoint: โœ… Frontmatter complete with type field, description includes Trigger, dependencies verified
  5. Add patterns โ†’ Critical Patterns with inline examples, Decision Tree, Edge Cases
    • Checkpoint: โœ… Each pattern has โœ…/โŒ example, Decision Tree covers all cases, no duplication
  6. Validate and sync โ†’ Run ai-agents-skills validate --skill {name} then make sync
    • Checkpoint: โœ… Validation passes, skill synced to model directories, SKILL.md under 300 lines (complex)

Example

See examples.md for complete examples:

  • Simple skill (Prettier, <15 patterns)
  • Medium skill (Formik, 15-40 patterns)
  • Complex skill (React, 40+ patterns with references/)

Edge Cases

Migrating to complex: If skill grows beyond 40 patterns, invoke reference-creation skill. Keep top 10-15 patterns in SKILL.md, move rest to references/. REQUIRED: Create README.md in references/ with 4 sections: Quick navigation table (with line counts), Reading strategies by use case, File descriptions, Cross-reference map. See interface-design/references/README.md and tailwindcss/references/README.md for examples.

Version-specific patterns: Use references/current.md, references/legacy.md, references/migration.md. For major versions (e.g., Tailwind v3 โ†’ v4), create dedicated migration guide with breaking changes table.

Transversal topics: Create separate reference file, link from multiple patterns. Examples: design-system.md for token hierarchy patterns (brand โ†’ semantic โ†’ component), dry-principle.md for DRY across frontend/backend.


Checklist

Before finalizing any skill:

Structure & Frontmatter

  • Directory under skills/ (lowercase-with-hyphens)
  • Based on SKILL-TEMPLATE.md
  • name and description (with Trigger) present
  • metadata.version set โ€” new skill starts at 1.0; minor update โ†’ 1.x; breaking change โ†’ 2.0
  • metadata.type set (behavioral|universal|language|framework|library|tooling|domain)
  • metadata.skills follows type rules from dependencies-matrix.md
  • No transitive redundancies (verified against dependency chains)
  • Empty arrays/objects omitted
  • Complex skills: references/ directory created

Content

  • When to Use (with Don't use when)
  • Critical Patterns with โœ…/โŒ markers and inline examples (<15 lines each)
  • Decision Tree (conditionโ†’action format)
  • Example section
  • Edge Cases
  • Delegates to code-conventions/a11y/humanizer (not duplicated)

Quality

  • Token-efficient (no filler, every word adds value)
  • SKILL.md under 300 lines (complex skills)
  • All referenced skills exist
  • Synced to model directories

Resources

Reference When to Read
frontmatter.md Creating any skill
structure.md Medium/complex skills
content-patterns.md Writing patterns/examples
dependencies-matrix.md Determining skill dependencies
token-efficiency.md Optimizing content
examples.md Learning from examples
validation.md Pre-finalization checks
  • SKILL-TEMPLATE.md - Main skill template
  • assets/frontmatter-schema.json - Validation schema (reference only, not enforced by CLI)
  • Agent Skills Spec - Official specification