An open source design system that's fully customizable and agent ready
TypeScript
feat(cli): add muse agent preset to init --agent (#6045)
oliprovscode21a4bfd3bbac
diff --git a/.changeset/muse-agent-preset.md b/.changeset/muse-agent-preset.mdnew file mode 100644index 0000000000..dd16f3b41c--- /dev/null+++ b/.changeset/muse-agent-preset.md@@ -0,0 +1,7 @@+---+'@astryxdesign/cli': patch+---++[feat] Add `muse` preset to `astryx init --agent` targeting `AGENTS.md` for Muse Code.++@oliprovscodediff --git a/packages/cli/api/init/init.doc.mjs b/packages/cli/api/init/init.doc.mjsindex 7895f833d5..c89f686ddc 100644--- a/packages/cli/api/init/init.doc.mjs+++ b/packages/cli/api/init/init.doc.mjs@@ -46,7 +46,7 @@ export const doc = {{name: 'options.agent',type: 'string',- description: 'Agent preset: claude, cursor, codex, hermes, all.',+ description: 'Agent preset: claude, cursor, codex, hermes, muse, all.',},{name: 'options.agentDocsPath',@@ -76,7 +76,7 @@ export const doc = {throws: [{code: 'ERR_UNKNOWN_AGENT',- when: '`agent` is not one of claude, cursor, codex, hermes, all',+ when: '`agent` is not one of claude, cursor, codex, hermes, muse, all',},{code: 'ERR_UNKNOWN_FEATURE',diff --git a/packages/cli/api/init/init.type.mjs b/packages/cli/api/init/init.type.mjsindex 80cf89acb6..2cf6fb2746 100644--- a/packages/cli/api/init/init.type.mjs+++ b/packages/cli/api/init/init.type.mjs@@ -38,7 +38,7 @@* @property {string} [features] Comma-separated features to install (agents, theme, template).* @property {boolean} [all] Install all features.* @property {boolean} [removeAgents] Remove the managed agent-docs block instead of installing.- * @property {string} [agent] Agent preset: claude, cursor, codex, hermes, all.+ * @property {string} [agent] Agent preset: claude, cursor, codex, hermes, muse, all.* @property {string | string[]} [agentDocsPath] Explicit agent-docs file path(s).* @property {string} [templateName] Scaffold a named page template (programmatic only; the CLI never sets it).*/diff --git a/packages/cli/api/init/run/run.mjs b/packages/cli/api/init/run/run.mjsindex d90af31558..b0b6189db8 100644--- a/packages/cli/api/init/run/run.mjs+++ b/packages/cli/api/init/run/run.mjs@@ -30,7 +30,7 @@ import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';import {logger} from '../../logger.mjs';const VALID_FEATURES = ['agents', 'theme', 'template'];-const VALID_AGENTS = ['claude', 'cursor', 'codex', 'hermes', 'all'];+const VALID_AGENTS = ['claude', 'cursor', 'codex', 'hermes', 'muse', 'all'];/*** Build the "Next steps" lines printed at the end of `astryx init`.diff --git a/packages/cli/assets/docs/working-with-ai.doc.mjs b/packages/cli/assets/docs/working-with-ai.doc.mjsindex 08246fc846..42990daf22 100644--- a/packages/cli/assets/docs/working-with-ai.doc.mjs+++ b/packages/cli/assets/docs/working-with-ai.doc.mjs@@ -50,7 +50,8 @@ export const docs = {label: 'Manual options',code: `npx @astryxdesign/cli init --features agents --agent claude # .claude/CLAUDE.mdnpx @astryxdesign/cli init --features agents --agent cursor # .cursorrules-npx @astryxdesign/cli init --features agents --agent codex # AGENTS.md (Copilot, Codex, etc.)`,+npx @astryxdesign/cli init --features agents --agent codex # AGENTS.md (Copilot, Codex, etc.)+npx @astryxdesign/cli init --features agents --agent muse # AGENTS.md (Muse)`,},],},diff --git a/packages/cli/clients/cli/commands/init.doc.mjs b/packages/cli/clients/cli/commands/init.doc.mjsindex 0d0c521f77..9cc978ebd6 100644--- a/packages/cli/clients/cli/commands/init.doc.mjs+++ b/packages/cli/clients/cli/commands/init.doc.mjs@@ -41,9 +41,9 @@ export const doc = {{flag: '--agent <tool>',param: 'options.agent',- choices: ['claude', 'cursor', 'codex', 'hermes', 'all'],+ choices: ['claude', 'cursor', 'codex', 'hermes', 'muse', 'all'],description:- 'Target AI tool for agent docs: claude, cursor, codex, hermes, all',+ 'Target AI tool for agent docs: claude, cursor, codex, hermes, muse, all',},{flag: '--agent-docs-path <path...>',diff --git a/packages/cli/foundation/agent-docs/agent-doc-state.mjs b/packages/cli/foundation/agent-docs/agent-doc-state.mjsindex 632422477e..5d1c178541 100644--- a/packages/cli/foundation/agent-docs/agent-doc-state.mjs+++ b/packages/cli/foundation/agent-docs/agent-doc-state.mjs@@ -47,7 +47,7 @@ export const LEGACY_MARKER_END = '<!-- XDS:END -->';* targets are user-chosen and not enumerable here.)*/export const AGENT_DOC_PATHS = [- AGENTS_MD, // Codex / ChatGPT / generic+ AGENTS_MD, // Codex / ChatGPT / Muse / genericCLAUDE_MD, // Claude Code (root)CLAUDE_DIR_MD, // Claude Code (.claude/CLAUDE.md)CURSOR_RULES, // Cursordiff --git a/packages/cli/foundation/agent-docs/agent-docs.mjs b/packages/cli/foundation/agent-docs/agent-docs.mjsindex 70d84a27c2..dbdc04735e 100644--- a/packages/cli/foundation/agent-docs/agent-docs.mjs+++ b/packages/cli/foundation/agent-docs/agent-docs.mjs@@ -9,12 +9,13 @@* - Claude Code: CLAUDE.md (root) or .claude/CLAUDE.md* - Cursor: .cursorrules* - Codex/generic: AGENTS.md+ * - Muse: AGENTS.md* - Hermes Agent: .hermes.md or HERMES.md (existing), else AGENTS.md** Auto-detect: discovers existing files and updates them in place.* Default (no existing files): creates AGENTS.md (the tool-agnostic standard).*- * --agent <tool>: target a specific tool preset (claude, cursor, codex, hermes, all)+ * --agent <tool>: target a specific tool preset (claude, cursor, codex, hermes, muse, all)* --agent-docs-path <path>: explicit file path(s)*/@@ -181,6 +182,7 @@ const AGENT_PRESETS = {cursor: [CURSOR_RULES, AGENTS_MD],codex: [AGENTS_MD],hermes: [HERMES_DOT_MD, HERMES_MD, AGENTS_MD],+ muse: [AGENTS_MD],};/**@@ -280,7 +282,7 @@ export function inspectAgentDocs(targetDir, installedVersion, expectedBlock) {* Searches for existing files first, falls back to default creation path.** @param {string} targetDir- * @param {string} agent - Preset name: 'claude', 'cursor', 'codex', 'hermes', 'all'+ * @param {string} agent - Preset name: 'claude', 'cursor', 'codex', 'hermes', 'muse', 'all'* @returns {{inject: string[], create: string[]}} Files to inject into vs create fresh*/export function resolveAgentPaths(targetDir, agent) {@@ -739,7 +741,7 @@ export function removeAgentDocs(targetDir) {* @param {object} [options]* @param {boolean} [options.zh]* @param {string} [options.lang]- * @param {string} [options.agent] - Tool preset: 'claude', 'cursor', 'codex', 'hermes', 'all'+ * @param {string} [options.agent] - Tool preset: 'claude', 'cursor', 'codex', 'hermes', 'muse', 'all'* @param {string[]} [options.paths] - Explicit paths (overrides agent/auto-detect)* @param {boolean} [options.onlyReplace] - Only update files that already have Astryx markers (for upgrades)* @param {string[]} [options.topics] - Doc topics to list in the block; defaults@@ -852,9 +854,9 @@ export function installAgentDocs(}// Nothing exists — create root AGENTS.md as the default (skip if onlyReplace).- // AGENTS.md is the tool-agnostic standard (Codex/Copilot, Cursor, and most- // agents read it), so it's the safe default. Claude-specific output is opt-in- // via `--agent claude` (→ .claude/CLAUDE.md); `--agent all` writes both.+ // AGENTS.md is the tool-agnostic standard (Codex/Copilot, Cursor, Muse, and+ // most agents read it), so it's the safe default. Claude-specific output is+ // opt-in via `--agent claude` (→ .claude/CLAUDE.md); `--agent all` writes both.if (onlyReplace) return written;const defaultPath = AGENTS_MD;diff --git a/packages/cli/foundation/agent-docs/agent-docs.test.mjs b/packages/cli/foundation/agent-docs/agent-docs.test.mjsindex 7906442577..ed332e350d 100644--- a/packages/cli/foundation/agent-docs/agent-docs.test.mjs+++ b/packages/cli/foundation/agent-docs/agent-docs.test.mjs@@ -793,6 +793,15 @@ describe('installAgentDocs', () => {expect(fs.existsSync(path.join(tmpDir, '.claude'))).toBe(false);});+ it('respects --agent muse preset: creates AGENTS.md', () => {+ setupCorePackage(tmpDir);++ const written = installAgentDocs(tmpDir, {agent: 'muse'});++ expect(written).toEqual(['AGENTS.md']);+ expect(fs.existsSync(path.join(tmpDir, 'AGENTS.md'))).toBe(true);+ });+it('respects explicit --paths', () => {setupCorePackage(tmpDir);@@ -911,6 +920,11 @@ describe('resolveAgentPaths', () => {expect(result).toEqual({inject: ['HERMES.md'], create: []});});+ it('muse preset creates AGENTS.md when nothing exists', () => {+ const result = resolveAgentPaths(tmpDir, 'muse');+ expect(result).toEqual({inject: [], create: ['AGENTS.md']});+ });+it('claude preset still creates .claude/CLAUDE.md when nothing exists (hermes is additive)', () => {const result = resolveAgentPaths(tmpDir, 'claude');expect(result).toEqual({inject: [], create: ['.claude/CLAUDE.md']});diff --git a/packages/core/scripts/agent-doc-state.mjs b/packages/core/scripts/agent-doc-state.mjsindex d16dd30b66..0e0682fa92 100644--- a/packages/core/scripts/agent-doc-state.mjs+++ b/packages/core/scripts/agent-doc-state.mjs@@ -57,7 +57,7 @@ export const LEGACY_MARKER_END = '<!-- XDS:END -->';* targets are user-chosen and not enumerable here.)*/export const AGENT_DOC_PATHS = [- AGENTS_MD, // Codex / ChatGPT / generic+ AGENTS_MD, // Codex / ChatGPT / Muse / genericCLAUDE_MD, // Claude Code (root)CLAUDE_DIR_MD, // Claude Code (.claude/CLAUDE.md)CURSOR_RULES, // Cursor