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

Aperta
#1,143 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
cli, tooling

Direzione di ricerca

Start with cli/tests/architecture/tool-addition-cost.arch.test.ts and the rules in cli/.claude/rules/00-architecture/0-hexagonal.md to see what the guardrail checks. Then trace the tool-named identifiers in formats/opencode-mcp-merge.ts, formats/vscode-mcp-merge.ts and formats/agent-frontmatter-strip.ts, and their callers. Done means the application/ and domain/formats/ baseline is empty and the golden snapshot is unchanged. This depends on #1141, which is not merged yet.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 #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
  • #1141 and the guardrail it adds.
  • cli/.claude/rules/00-architecture/0-hexagonal.md, 0-contexts.md; tool-addition-cost.arch.test.ts, context-boundary.arch.test.ts.
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.
Lingua principale
TypeScript
Stelle
481
Fork
45
Merge medio
1g 13h
PR unite (30g)
91

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ai-driven-dev/framework

Tutte le issue di ai-driven-dev/framework

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.