Skip to content

feat(cursor): add first-class model, readonly, is_background subagent frontmatter fields - #1898

Merged
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-1882-cursor-subagent-fields
Jun 16, 2026
Merged

feat(cursor): add first-class model, readonly, is_background subagent frontmatter fields#1898
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-1882-cursor-subagent-fields

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Follow up Cursor upstream updates by promoting the documented Cursor subagent frontmatter fields to first-class, typed optional fields on CursorSubagentFrontmatterSchema:

  • model (string, default inherit)
  • readonly (boolean, default false)
  • is_background (boolean, default false)

Previously these three fields already round-tripped through the cursor: section via z.looseObject passthrough, so there was no data-loss bug — this change makes them first-class so they are explicitly typed and validated (e.g. wrong types like readonly: "yes" are now rejected).

The schema keeps z.looseObject, and toRulesyncSubagent/fromRulesyncSubagent continue to spread the fields into/out of the namespaced cursor: section, so no processor wiring change was needed. Cursor subagents remain project-scope only (.cursor/agents/); no global scope was added.

Out of scope (intentional)

The issue also mentions a canonical top-level model mapping. This is intentionally skipped: rulesync has no canonical top-level subagent model, and each tool keeps model in its own namespaced section (e.g. claudecode.model, opencode.model, kilo.model). Adding a canonical mapping would contradict that existing convention.

Evidence

Changes

  • src/features/subagents/cursor-subagent.ts: extend schema with model, readonly, is_background.
  • src/features/subagents/cursor-subagent.test.ts: add happy-path tests for parsing the fields as first-class and round-tripping them through the cursor: section (file import + generate), plus an invalid-type rejection test.
  • docs/reference/file-formats.md and skills/rulesync/file-formats.md (auto-synced): document the cursor: subagent block.

Verification

pnpm cicheck is fully green (code: fmt/oxlint/typecheck/267 test files, 6422 tests passing; content: skill-docs sync, cspell, secretlint all passing).

Closes #1882

🤖 Generated with Claude Code

… frontmatter fields

Closes #1882

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit 72e82ad into main Jun 16, 2026
6 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-1882-cursor-subagent-fields branch June 16, 2026 11:10
@dyoshikawa dyoshikawa mentioned this pull request Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow up Cursor upstream updates: subagent frontmatter fields (model/readonly/is_background)

2 participants