Skip to content

feat(musecode): generate and import Muse Code custom agents - #3919

Merged
dyoshikawa merged 6 commits into
mainfrom
resolve-issue-2790-musecode-subagents
Nov 20, 2026
Merged

dyoshikawa merged 6 commits into
mainfrom
resolve-issue-2790-musecode-subagents

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Muse Code now publishes a custom agents page (raised in the 2026-11-19 re-check on #2790). Agents are Markdown files with YAML frontmatter, and the body is the prompt. The documented keys are name, description, model, effort, tools and disallowedTools. Project agents live in .agents/agents/ and load once the workspace is trusted. User agents live in ~/.config/muse/agents/, or under $XDG_CONFIG_HOME/muse/agents/ when that is set.

This PR adds a native musecode subagents target for both scopes:

  • Project (.agents/agents/<name>.md). The Antigravity targets and the simulated agentsmd writer already generate into this directory, with one shared frontmatter builder so the file doesn't depend on which target ran last. MusecodeSubagent reuses that writer (it extends AntigravitySharedSubagent). The musecode: block joins the merge every writer of this file performs, through the new AGENTS_DIR_SHARED_SUBAGENT_SECTION_KEYS = musecode → antigravity-ide → antigravity-cli. It sits lowest, so a key the Antigravity blocks already set keeps its current value. The bytes on disk stay identical across all four writers, and a test checks this.
  • Global (~/.config/muse/agents/<name>.md). Only Muse Code reads this directory, so only the musecode: block is merged here. Global Antigravity output (~/.gemini/config/agents/) and the Antigravity plugin bundle now ignore the musecode: block.
  • Name check. Rulesync warns when a name is not lowercase words joined by single hyphens, which is the rule the agents page gives.
  • Import. Extra keys go into the musecode: section.
  • Docs. The file-formats docs gain a musecode: example block, a Muse Code note, and updates to the Antigravity and .agents/agents/ ownership notes. The supported-tools tables are regenerated.

Design trade-off (worth a maintainer look)

The issue suggested stripping every non-Muse key, because an unknown key can disable an agent. That isn't possible for the project file without breaking the shared-file guarantee, since Muse Code reads .agents/agents/ whether or not the musecode target is enabled. The agents page also only says unknown keys invalidate --agents JSON definitions. It doesn't say what happens to Markdown files. So Antigravity-only keys set in antigravity-* blocks still reach Muse Code, and this is documented. If the maintainer prefers a stricter Muse-only render for the project file, that's a separate design decision.

Remaining on #2790 (still blocked upstream)

  • Hooks: there is still no per-hook entry schema.
  • Permissions / ignore: there is still no custom-profile location or schema, and approval-policy.json still has no published schema.

Test notes

  • New src/features/subagents/musecode-subagent.test.ts covers paths, documented fields, identical shared-file output across the musecode, antigravity-cli, antigravity-ide and agentsmd writers, global/plugin isolation of the musecode block, the name warning, import, and targeting.
  • Updated the processor target lists and the e2e generate, global and import matrices.
  • pnpm cicheck passes (619 files / 17151 tests). src/e2e/e2e-subagents.spec.ts passes (177 tests).

Refs #2790

🤖 Generated with Claude Code

https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4

dyoshikawa and others added 6 commits November 20, 2026 11:30
Muse Code now documents file-based custom agents: Markdown with YAML
frontmatter (name, description, model, effort, tools, disallowedTools)
loaded from `.agents/agents/` (project) and `~/.config/muse/agents/`
(user). Add a `musecode` subagents target for both scopes.

The project directory is already written by the Antigravity targets and
the simulated agentsmd writer, so the musecode section joins the merge
every writer of that file performs (below the Antigravity blocks), and
the file stays identical whichever target runs last. Global agents live
in per-tool directories, so each global writer merges only its own
sections. Warn when a name is not lowercase words joined by hyphens.

Refs #2790

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…secode-subagents

# Conflicts:
#	src/generated/docs-content.ts
…ecode block

The project `.agents/agents/` file is shared with the Antigravity
writers, so its content cannot be narrowed to Muse Code's documented
keys. Warn instead when it carries keys outside name, description,
model, effort, tools and disallowedTools, and when an antigravity-*
block overrides a musecode block value. Document the global --delete
sweep and the Meta provider rejecting effort `none`.

Refs #2790

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…secode-subagents

# Conflicts:
#	src/generated/docs-content.ts
@dyoshikawa
dyoshikawa merged commit 7d3a520 into main Nov 20, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2790-musecode-subagents branch November 20, 2026 03:31
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.

1 participant