gabriel / muse public
feat BREAKING task/agent-config #1 / 1
gabriel · 168 days ago · Apr 13, 2026 · Diff

feat: add muse agent-config command

Implements muse agent-config with four subcommands: - init: generate .muse/agent.md with sane defaults (standalone, workspace_root, workspace_member) - sync: derive IDE adapter files (CLAUDE.md, AGENTS.md, .cursorrules, copilot-instructions.md, .windsurfrules) - show: print agent.md content with --scope repo|workspace|merged - status: report which adapters exist and whether they are in sync with agent.md

Claude adapter uses @include syntax; all others embed full content. Workspace hierarchy is respected — workspace-level rules prepend to repo-level rules. 45 tests, zero typing violations. Also fixes stale Python 3.12 comment in invariants.py.

sha256:e204518ffa2fe70d73194a3d2ff4712eb6d1be5bc4688ef0afbf885b9a2ca0ef sha
+101 ~107 symbols
sha256:60948f7fcb3b8bc44f1d3e2947cf940bbbbe6c06835391d25fe8655a77c92db2 snapshot
+101
symbols added
~107
symbols modified
0
dead code introduced
Semantic Changes 208 symbols
~ muse/cli/commands/agent_config.py .py 36 symbols added
+ AdapterRegistry variable variable AdapterRegistry L105–105
+ AdapterSpec class class AdapterSpec L74–85
+ StatusAdapterEntry class class StatusAdapterEntry L96–102
+ SyncAdapterResult class class SyncAdapterResult L88–93
+ _ADAPTERS variable variable _ADAPTERS L107–117
+ _STANDALONE_TEMPLATE variable variable _STANDALONE_TEMPLATE L123–184
+ _WORKSPACE_MEMBER_TEMPLATE variable variable _WORKSPACE_MEMBER_TEMPLATE L245–259
+ _WORKSPACE_ROOT_TEMPLATE variable variable _WORKSPACE_ROOT_TEMPLATE L186–243
+ _build_members_table function function _build_members_table L355–360
+ _compute_rel_path function function _compute_rel_path L287–296
+ _detect_context function function _detect_context L267–284
+ _find_operation_root function function _find_operation_root L363–377
+ _load_workspace_manifest function function _load_workspace_manifest L330–352
+ _render_adapter function function _render_adapter L299–327
+ _show_help function function _show_help L841–850
+ Callable import import Callable L56–56
+ ExitCode import import ExitCode L59–59
+ TypedDict import import TypedDict L57–57
+ WorkspaceManifestDict import import WorkspaceManifestDict L61–61
+ WorkspaceMemberDict import import WorkspaceMemberDict L61–61
+ annotations import import annotations L48–48
+ argparse import import argparse L50–50
+ find_workspace_root import import find_workspace_root L61–61
+ json import import json L51–51
+ logging import import logging L52–52
+ os import import os L53–53
+ pathlib import import pathlib L54–54
+ sys import import sys L55–55
+ write_text_atomic import import write_text_atomic L60–60
+ logger variable variable logger L67–67
+ register function function register L709–838
+ run function function run L853–859
+ run_init function function run_init L385–439
+ run_show function function run_show L561–623
+ run_status function function run_status L631–701
+ run_sync function function run_sync L447–553
~ tests/test_cmd_agent_config.py .py 64 symbols added
+ TestComputeRelPath class class TestComputeRelPath L125–142
+ test_direct_child method method test_direct_child L126–131
+ test_nested_child method method test_nested_child L133–138
+ test_same_dir method method test_same_dir L140–142
+ TestDetectContext class class TestDetectContext L94–117
+ test_standalone_repo method method test_standalone_repo L95–100
+ test_workspace_member method method test_workspace_member L109–117
+ test_workspace_root method method test_workspace_root L102–107
+ TestInitStandalone class class TestInitStandalone L198–247
+ test_agent_md_contains_branch_flow method method test_agent_md_contains_branch_flow L212–216
+ test_agent_md_contains_muse_rule method method test_agent_md_contains_muse_rule L205–210
+ test_agent_md_contains_repo_name method method test_agent_md_contains_repo_name L218–222
+ test_creates_agent_md method method test_creates_agent_md L199–203
+ test_force_overwrites method method test_force_overwrites L231–238
+ test_json_schema method method test_json_schema L240–247
+ test_no_force_on_existing_exits_1 method method test_no_force_on_existing_exits_1 L224–229
+ TestInitWorkspaceMember class class TestInitWorkspaceMember L282–300
+ test_creates_repo_level_agent_md method method test_creates_repo_level_agent_md L283–290
+ test_member_agent_md_references_workspace method method test_member_agent_md_references_workspace L292–300
+ TestInitWorkspaceRoot class class TestInitWorkspaceRoot L255–274
+ test_creates_agent_md_at_workspace_root method method test_creates_agent_md_at_workspace_root L256–260
+ test_workspace_agent_md_contains_shared_rules method method test_workspace_agent_md_contains_shared_rules L269–274
+ test_workspace_agent_md_lists_members method method test_workspace_agent_md_lists_members L262–267
+ TestRenderAdapter class class TestRenderAdapter L150–190
+ test_embed_adapter_contains_content method method test_embed_adapter_contains_content L165–176
+ test_embed_adapter_with_workspace_prepends_ws_content method method test_embed_adapter_with_workspace_prepends_ws_content L178–190
+ test_include_adapter_uses_at_syntax method method test_include_adapter_uses_at_syntax L151–156
+ test_include_adapter_with_workspace method method test_include_adapter_with_workspace L158–163
+ TestShow class class TestShow L420–456
+ test_show_json_schema method method test_show_json_schema L434–442
+ test_show_merged_workspace method method test_show_merged_workspace L444–456
+ test_show_missing_exits_1 method method test_show_missing_exits_1 L429–432
+ test_show_prints_agent_md_content method method test_show_prints_agent_md_content L421–427
+ TestStatus class class TestStatus L464–505
+ test_status_after_sync method method test_status_after_sync L473–478
+ test_status_before_sync method method test_status_before_sync L465–471
+ test_status_json_schema method method test_status_json_schema L480–492
+ test_status_shows_out_of_sync_after_edit method method test_status_shows_out_of_sync_after_edit L494–505
+ TestSync class class TestSync L308–412
+ standalone method method standalone L310–313
+ test_agents_md_embeds_content method method test_agents_md_embeds_content L341–348
+ test_claude_md_uses_include_syntax method method test_claude_md_uses_include_syntax L336–339
+ test_dry_run_creates_no_files method method test_dry_run_creates_no_files L356–360
+ test_dry_run_prints_what_would_be_written method method test_dry_run_prints_what_would_be_written L362–364
+ test_force_overwrites_existing method method test_force_overwrites_existing L371–377
+ test_json_schema method method test_json_schema L385–394
+ test_missing_agent_md_exits_1 method method test_missing_agent_md_exits_1 L379–383
+ test_no_force_on_existing_exits_1 method method test_no_force_on_existing_exits_1 L366–369
+ test_sync_adapters_flag_limits_output method method test_sync_adapters_flag_limits_output L350–354
+ test_sync_creates_agents_md method method test_sync_creates_agents_md L320–322
+ test_sync_creates_claude_md method method test_sync_creates_claude_md L315–318
+ test_sync_creates_copilot_instructions method method test_sync_creates_copilot_instructions L328–330
+ test_sync_creates_cursorrules method method test_sync_creates_cursorrules L324–326
+ test_sync_creates_windsurfrules method method test_sync_creates_windsurfrules L332–334
+ test_workspace_member_claude_includes_both_levels method method test_workspace_member_claude_includes_both_levels L396–412
+ _init_repo function function _init_repo L67–69
+ _init_workspace function function _init_workspace L72–86
+ _invoke function function _invoke L57–64
+ CliRunner import import CliRunner L47–47
+ annotations import import annotations L40–40
+ json import import json L42–42
+ pathlib import import pathlib L43–43
+ pytest import import pytest L45–45
+ runner variable variable runner L49–49
← Older Oldest on task/agent-config
All commits
Newer → Latest on task/agent-config

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:e204518ffa2fe70d73194a3d2ff4712eb6d1be5bc4688ef0afbf885b9a2ca0ef --body "your comment"