Problem
packages/cli/src/commands/install.ts has a single execute() method spanning 726 lines. It handles:
- Provider detection & validation
- Well-known URL discovery
- Git cloning & skill discovery
- List mode
- Skill filtering (--skills flag)
- Interactive skill selection
- Agent selection
- Install method selection
- Quality checking
- Security scanning
- Confirmation prompt
- Actual file installation (copy/symlink)
- npm dependency installation
- Metadata saving
- AGENTS.md updates
- Summary display
- Skills.sh stats
- Pro tips
This violates single responsibility and makes the command hard to test, debug, and extend.
Proposed Solution
Extract into focused private methods:
async execute() {
const provider = await this.resolveProvider();
const skills = await this.discoverSkills(provider);
const selected = await this.selectSkills(skills);
const agents = await this.selectAgents();
const method = await this.selectMethod(agents);
await this.runSecurityScan(selected);
const results = await this.performInstall(selected, agents, method);
this.showResults(results);
}
Also extract duplicated skill/agent selection patterns that appear in:
install.ts (lines 275-316)
onboarding/index.ts (lines 156-241)
agent.ts
find.ts
Acceptance Criteria
Problem
packages/cli/src/commands/install.tshas a singleexecute()method spanning 726 lines. It handles:This violates single responsibility and makes the command hard to test, debug, and extend.
Proposed Solution
Extract into focused private methods:
Also extract duplicated skill/agent selection patterns that appear in:
install.ts(lines 275-316)onboarding/index.ts(lines 156-241)agent.tsfind.tsAcceptance Criteria
execute()under 50 lines