Skip to content

feat(claudecode): add first-class subagent frontmatter fields - #1899

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

feat(claudecode): add first-class subagent frontmatter fields#1899
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-1878-claudecode-subagent-fields

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Follow up Claude Code upstream updates by promoting the full set of subagent frontmatter fields documented at https://code.claude.com/docs/en/sub-agents to first-class, validated fields on ClaudecodeSubagentFrontmatterSchema.

Previously the schema only modeled name, description, model, tools, permissionMode, and skills. The remaining fields still round-tripped via z.looseObject passthrough, so this is a schema-completeness/validation improvement (type checking + documentation), not a data-loss fix.

Changes

  • src/features/subagents/claudecode-subagent.ts: extended ClaudecodeSubagentFrontmatterSchema (kept z.looseObject) with optional first-class fields:
    • disallowedTools (string or array, mirroring tools)
    • maxTurns (number)
    • color, memory, effort, isolation (plain strings for forward-compat)
    • background (boolean)
    • initialPrompt (string)
    • mcpServers and hooks accepted loosely as z.unknown() — nested schemas are deferred to a follow-up.
  • src/features/subagents/claudecode-subagent.test.ts: added tests asserting the new fields validate, round-trip through the claudecode: section (generate + import), and reject invalid types (maxTurns: "x", background: "yes").
  • docs/reference/file-formats.md (+ auto-synced skills/rulesync/file-formats.md): enumerated the new fields in the claudecode: subagent example with inline comments.
  • cspell.json: added xhigh (a documented effort enum value).

No rules-processor.ts additionalConvention change is needed (Claude Code subagents are native, not simulated). The new fields apply identically to project and global scope, so no scope-specific work. The README support matrix already shows Claude Code subagents as supported — no matrix change.

Note on deferred fields

mcpServers and hooks are accepted loosely (z.unknown()) for now so they round-trip without data loss; dedicated nested schemas are intentionally deferred to a follow-up.

Verification

pnpm cicheck is fully green (format, oxlint, typecheck, 6426 tests, sync-skill-docs, cspell, secretlint).

Closes #1878

🤖 Generated with Claude Code

Closes #1878

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit 70ff943 into main Jun 16, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-1878-claudecode-subagent-fields branch June 16, 2026 11:22
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

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 Claude Code upstream updates: subagent frontmatter fields

2 participants