The file references/wcag-1.3.1.md is only supporting documentation for the a11y-agent. However, if it contains YAML frontmatter (or even just the standard Markdown --- separator), Cursor exposes it as another subagent.
Example:
---
title: WCAG 1.3.1
---
...
Or
## Section 1
---
## Section 2
The — syntax is a standard part of Markdown. It is commonly used for YAML frontmatter, document metadata, or section separators, so its presence alone should not cause a file to be interpreted as a subagent.
Open chat and type /wcag- you will see suggestion of wcag-1.3.1 subagent.
Expected Behavior
Only actual agent definition files should be discovered as agents.
Nested documentation, reference material, examples, prompts, specifications, or any other supporting Markdown files should not appear as separate agents.
Hey, thanks for the detailed report with screenshots and the suggested options, it really helps.
I reproduced it, this is a bug on our side. The scan of .cursor/agents/ runs recursively through all subfolders, and any markdown file with YAML frontmatter or a pair of --- separators gets detected as a separate sub-agent. The name is taken from the filename, which is why you see /wcag-1.3.1. I’ve reported it internally. I can’t share an ETA for the fix yet.
Small repro note: a single --- by itself doesn’t trigger it. You specifically need a pair of --- (two horizontal rules) or a real frontmatter block. Your Section 1/2/3 example triggers because it has two separators.
Workaround for now:
Keep reference/supporting materials outside .cursor/agents/, for example in a separate folder like .cursor/agent-docs/, or
Remove paired --- blocks and frontmatter from nested documents.
Your Option 2 (a folder-based structure with AGENT.md, similar to skills) makes sense. I included it with the report. I’ll post an update in the thread once we have a fix.