Files
skillshare/cmd
Willie 43d6bd1948 refactor(agents): simplify — extract shared helpers, fix path bug, use DirEntry.Type
From 3-agent review (reuse, quality, efficiency):

Bug fix:
- syncAgentsProject: use resolveProjectAgentTargetPath instead of
  inline path resolution (~ was not expanded for absolute paths)

Deduplication:
- Extract syncAgentTarget() shared by global + project sync loops
  (eliminates 30-line copy-paste)
- Extract renderAgentCheck() shared by project + global check
  (eliminates duplicate rendering block)
- Consolidate countLinkedAgents → delegates to countAgentLinksAndBroken

Efficiency:
- Use DirEntry.Type() instead of os.Lstat in diff_agents.go and
  doctor_agents.go (saves one syscall per .md file)

Cleanup:
- Remove dead start param from cmdCollectAgents
- Remove unused imports

Net: -76 lines.
2026-04-07 18:05:40 +08:00
..