Skip to content

refactor(cli): keep each tool's formats in its own profile #1143

Done

Description

@blafourcade

Problem

The CLI's own rule says application code never branches on the targeted tool and reads its capability instead (cli/.claude/rules/00-architecture/0-hexagonal.md), and a tool may only be named in its profile (cli/tests/architecture/tool-addition-cost.arch.test.ts). That test only sees a tool named in a string literal. Identifiers escape it: measured, 30 files outside src/contexts/tools/domain/profiles/ carry a tool name in what they declare or import, 9 of them in an application/ layer. A second host that needs the same behaviour means editing application code again.

#1141 moves every hook format into its tool's profile, hands the project-hooks format through PluginsCapability, and adds the guardrail for application/ and domain/formats/, with today's remaining violations as a baseline that may only shrink. This issue empties that baseline.

Scope

  • OpenCode's MCP merge: formats/opencode-mcp-merge.ts, called by name from install-runtime-config-use-case.ts, flat-mcp-materializer.ts, plugin-remove-use-case.ts and project-plugin-cleanup.ts.
  • formats/vscode-mcp-merge.ts and formats/agent-frontmatter-strip.ts (Copilot and Cursor agent frontmatter).
  • clean-user-scope-use-case.ts (purgeCursorUserScopeFiles), telemetry-on-use-case.ts (claudeSettings), flat-build-strategy.ts (the Claude root rewrite).
  • Same method as refactor(aidd-context): lean the project-memory skill for small models #1141: move each tool's format into its profile, expose what the application needs through the capability, behaviour unchanged, the golden snapshot identical.

Acceptance criteria

  • The guardrail's baseline for application/ and domain/formats/ is empty.
  • No application file imports a module from a tool's profile or a function named after a tool.
  • The golden snapshot is unchanged, and the CLI suite and the touched mutation scopes hold their floors.

Prior art in this repo

Out of scope

  • The composition root (src/runtime/wiring/) and readers whose job is one tool's own files (telemetry transcript readers, host plugin registry readers): naming the tool is their purpose.

Activity

  1. added theissue type on Nov 3, 2026
  2. moved this from Ideation to In Progress in AIDD Roadmapon Nov 6, 2026
  3. blafourcade commented on Nov 25, 2026

    @blafourcade
    ContributorAuthor

    Delivered on next, checked against the current code after the CLI convergence (#1253) and the follow-up merges.

    Evidence: #1253: cli/src/composition/tool-profiles/*.ts; opencode-mcp-merge, vscode-mcp-merge, agent-frontmatter-strip no longer under domain/formats; purgeCursorUserScopeFiles gone; tool-addition-cost.arch.test.ts ("no file outside a profile names a tool in a form a new tool would have to join")

    Closing as completed. Reopen with a reproduction if something is still missing.

  4. moved this from In Progress to Done in AIDD Roadmapon Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions