Skills are reusable prompt templates that define multi-step workflows. They're markdown files with YAML frontmatter, loaded from .agent/skills/ or ~/.config/agent-code/skills/.

Creating a skill

Create a file in .agent/skills/test-and-fix.md:

---
description: Run tests and fix failures
whenToUse: When the user asks to test or fix failing tests
userInvocable: true
---

Run the test suite with the project's test command. If any tests fail:

1. Read the failing test file
2. Read the source code being tested
3. Identify the root cause
4. Fix the issue
5. Re-run tests to verify

Repeat until all tests pass. Do not skip or delete failing tests.

Frontmatter options

FieldTypeDescription
descriptionstringWhat this skill does
whenToUsestringHints for the LLM about when to suggest this skill
userInvocablebooleanWhether users can invoke it via /skill-name
disableNonInteractivebooleanDisable in one-shot mode
pathsstring[]File patterns that trigger this skill suggestion

Invoking skills

As a slash command

If userInvocable: true, invoke with the filename (minus .md):

> /test-and-fix

With arguments

Use {{arg}} in the template for argument substitution:

---
description: Review a specific file
userInvocable: true
---

Review {{arg}} for bugs, security issues, and code quality problems.
Focus on edge cases and error handling.
> /review src/auth.rs

Programmatically via the Skill tool

The LLM can invoke skills when it determines one is appropriate:

{
  "name": "Skill",
  "input": {
    "skill": "test-and-fix",
    "args": null
  }
}

Directory skills

For complex skills with supporting files, use a directory:

.agent/skills/
  deploy/
    SKILL.md      ← the skill definition
    checklist.md  ← referenced by the skill

Skill locations

LocationScope
.agent/skills/Project-specific
~/.config/agent-code/skills/Available in all projects

Bundled skills

agent-code ships with 12 built-in skills. These are always available and can be overridden by placing a skill with the same name in your project or user skills directory.

SkillPurpose
/commitCreate well-crafted git commits
/reviewReview diff for bugs and security issues
/testRun tests and fix failures
/explainExplain how code works
/debugDebug errors with root cause analysis
/prCreate pull requests
/refactorRefactor code for quality
/initInitialize project configuration
/security-reviewOWASP-oriented vulnerability scan
/advisorArchitecture and dependency health analysis
/bughunterSystematic bug search
/planStructured implementation planning

Commands

> /skills
Loaded 15 skills:
  commit [invocable] — Create a well-crafted git commit
  review [invocable] — Review code changes for bugs and issues
  test-and-fix [invocable] — Run tests and fix failures
  deploy — Production deployment checklist