Discover, validate, and invoke .agent.md custom agents. Use when finding agent files, checking frontmatter, verifying disable-model-invocation/invocability settings, or determining agentName for runSubagent calls.
Use symptom -> action triggers: when one matches, apply this skill and verify with the protocol below.
Activate this skill when:
.agent.md file structure and frontmatteragentName to use for delegationCustom agents for this environment are discovered from these directories:
C:\Users\LOQ\.claude\agentsC:\Users\LOQ\AppData\Roaming\Code - Insiders\User\promptsNotes:
*.agent.md when discovering subagents..prompt.md and .instructions.md files that are not subagents.To discover agents:
*.agent.md files in the configured Claude and VS Code Insiders directories..prompt.md and .instructions.md files when the goal is subagent delegation.Key frontmatter fields in .agent.md:
| Field | Purpose | Required? |
|--------|-----------|-----------|
| name | Display name used in agentName parameter | Recommended |
| description | What the agent specializes in | Recommended |
| tools | Tools available to the agent | Optional |
| disable-model-invocation | If false, agent can be invoked as subagent | Required |
CRITICAL: Only agents with disable-model-invocation: false in frontmatter can be invoked as subagents.
Check frontmatter:
---
name: "Code Explainer"
description: For analyzing and documenting existing code
disable-model-invocation: false # Must be false for subagent delegation
tools: [Read, Search]
---
Search the real agent directories and keep only *.agent.md files:
Get-ChildItem `
'C:\Users\LOQ\.claude\agents', `
'C:\Users\LOQ\AppData\Roaming\Code - Insiders\User\prompts' `
-Filter *.agent.md `
-File
Or use the helper script:
node .\scripts\agent-finder.js
Verify disable-model-invocation: false is set.
Use the name field from frontmatter exactly as is.
name field value, use that value in quotes..agent.md extension.runSubagent({
agentName: "Playwright Tester Mode", // Must match 'name' from frontmatter exactly
description: "Test checkout flow",
prompt: "Perform exploratory testing on the checkout flow: product selection -> cart -> payment confirmation. Generate comprehensive Playwright tests covering success scenarios, validation errors, edge cases (empty cart, payment failures), and accessibility."
})
<!-- MCP:START -->
<!-- PORTABILITY:START -->
This skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.
$CODEX_HOME/skills/custom-agent-usage and restart Codex after major changes.Preferred MCP Server: None required
Before claiming "skill applied successfully":
// Step 1: Main agent analyzes task and identifies need for testing
// "I need comprehensive testing for the checkout flow"
// Step 2: Discover custom testing agent
// Found: C:\Users\LOQ\.claude\agents\playwright-tester.agent.md
// disable-model-invocation: false and name: "Playwright Tester Mode"
// Step 3: Delegate to custom agent
runSubagent({
agentName: "Playwright Tester Mode",
description: "Test checkout flow",
prompt: "Perform exploratory testing on the checkout flow: product selection -> cart -> payment confirmation. Generate comprehensive Playwright tests covering success scenarios, validation errors, edge cases (empty cart, payment failures), and accessibility."
})
// Step 4: Review test output and integrate into test suite
npx skills add PracticalSwan/custom-agent-usage下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Category:developer