[BUG] Cursor target emits quoted YAML list for globs instead of unquoted comma-separated string
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 362
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 132
Description
The Cursor target compiler (apm install / apm compile) emits the globs frontmatter field
in generated .cursor/rules/*.mdc files in a format that does not match Cursor's documented
.mdc frontmatter format (cursor.com/docs/context/rules).
Two independent deviations, both present in the same output:
- Quoted values. Every glob is wrapped in double quotes (
"services/**/*.py"). Every
globsexample in Cursor's docs uses an unquoted plain scalar
(globs: src/components/**/*.tsx). - YAML list instead of a single string. When an instruction's
applyTocontains multiple
comma-separated globs, APM emitsglobsas a multi-item YAML sequence (one- "..."per
pattern) instead of a single string with the patterns comma-joined, which is the only form
shown anywhere in Cursor's docs (docs/**/*.md, docs/**/*.mdx).
This looks like a side effect of the fix for #1366: that fix made the Claude target correctly
split a comma-separated applyTo into a YAML list under paths:, and the same comma-split →
YAML-list logic was applied to the Cursor globs: field "for consistency across targets"
without adapting to Cursor's own native format, which never uses list syntax for globs.
To Reproduce
- In an APM package, create an instruction with a comma-separated
applyTo, e.g.:--- description: "Python service patterns" applyTo: "services/**/*.py,plugins/services/**/*.py" --- - Set
targets: [cursor](or includecursoramong targets) inapm.yml. - Run
apm install <path-or-git-url-to-package> --target cursor. - Open the generated
.cursor/rules/<name>.mdcand inspect the frontmatter.
Expected behavior
Per Cursor's documented format, a single unquoted string, multiple patterns comma-joined:
---
description: Python service patterns
globs: services/**/*.py, plugins/services/**/*.py
---
Actual behavior
---
description: "Python service patterns"
globs:
- "services/**/*.py"
- "plugins/services/**/*.py"
---
(Note also the description field: non-ASCII characters — em dash, arrow — are emitted as
\uXXXX JSON-style escapes inside a double-quoted YAML scalar rather than as literal UTF-8 text
or via a single-quoted scalar. Valid YAML, but not what any Cursor doc example shows, and it
hurts readability/diffability of the generated .mdc files. Flagging alongside since it's the
same code path; split it into its own issue if unrelated.)
Environment (please complete the following information):
- OS: Windows 11 Pro (10.0.26200)
- APM Version: reproduced on both 0.30.0 and 0.31.0 (upgraded via
self-updatemid-investigation; output byte-for-byte identical on both)
Logs
No error/crash — the CLI completes normally (apm install exits 0). The bug is purely in the
generated file content shown above. Reproduced both via a git: dependency and via a local path dependency
(apm install <local-path> --target cursor) — same output either way.
Additional context
- Both deviations are consistent across every multi-glob instruction we deployed (11 instruction
files touched in our case), not an isolated fluke. - Related: #1366 (fixed the same comma-split problem for the Claude
paths:field) — this looks
like the Cursor-target follow-through from that fix landed in the wrong shape for Cursor's
target format specifically.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Cursor target path exercised by apm install and apm compile, then reproduce the output in .cursor/rules/*.mdc using a comma-separated applyTo. Done means the generated globs field matches Cursor’s documented single comma-joined string format without the quoted YAML list; consider regression coverage for the behavior described in #1366.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, yaml
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100