refactor(cli): four install-use-cases and four capability classes duplicate the same pipeline

Open
#468 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
15/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
cli

Research direction

Review PR #795 first; it contains the shared InstallContentSectionUseCase and the explicit per-capability behavior described here. Done means #795 is merged, the jscpd duplication gate remains green, and this issue is closed; no further deduplication is in scope.

Written by the indexing model from the issue text.

Description

Context

The audit found two duplication clusters. PR #795 resolves them at the correct boundary.

Resolution in #795

Content installation

The four content installers now delegate to one InstallContentSectionUseCase. Thin typed wrappers provide only a section descriptor: capability key, filename acceptance and frontmatter conversion. This shares the walk/filter/transform pipeline without erasing the true differences in agent, command, rule and skill contracts.

Tool capabilities

The capability classes deliberately remain separate domain types. They are not interchangeable:

  • agents carry TOML/Markdown and deserialization behavior;
  • rules derive an installed location through a probe;
  • skills have prefix-mode behavior;
  • commands retain their own conversion contract.

A shared base class would turn these differences into optional switches and weaken the tools-context model. The installer descriptor now absorbs the differing acceptsFileName shapes at the only shared caller, so callers no longer implement incompatible paths.

jscpd is a passing PR gate; no new duplicate cluster is reported.

Acceptance criteria

  • #795 retains the shared InstallContentSectionUseCase for agents, commands, rules and skills.
  • Per-capability behavior stays explicit in its domain type; no generic capability base is introduced.
  • The #795 duplication gate remains green.
  • #795 links this issue; close it after merge.

Boundary

No further deduplication work belongs here. A future repeated behavior must be demonstrated at a shared caller before abstraction.

Dominant language
TypeScript
Stars
481
Forks
45
Avg merge
17h 40m
Merged PRs (30d)
106

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ai-driven-dev/framework

All issues in ai-driven-dev/framework

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.