Skip to content

refactor(skill): effectify SkillService as scoped service#17849

Merged
kitlangton merged 3 commits intodevfrom
effectify-skill
Mar 16, 2026
Merged

refactor(skill): effectify SkillService as scoped service#17849
kitlangton merged 3 commits intodevfrom
effectify-skill

Conversation

@kitlangton
Copy link
Contributor

@kitlangton kitlangton commented Mar 16, 2026

Summary

  • Convert Skill namespace to SkillService class extending ServiceMap.Service with Effect.fn methods
  • Lazy init via ensureScanned() promise memoization — scan runs on first get/all/dirs/available call, not in layer constructor
  • Dynamic import("@/session") in error handler to break circular dep (instances.tsskill.ts@/session@/tool)
  • Legacy promise facade preserved via runPromiseInstance
  • Pure function fmt() stays on the Skill namespace (no state needed)

Test plan

  • All 11 skill discovery tests pass
  • Full suite passes (1340 pass, 0 fail)
  • Typecheck clean

Restacked from #17810 onto dev after parent merge.

Stack

Base: dev

Current / Remaining

  1. refactor(skill): effectify SkillService as scoped service #17849 effectify-skill - current

Convert Skill namespace to SkillService class with Effect.fn methods.
Scanning runs eagerly in layer constructor — needs lazy init to avoid
breaking unrelated tests (same pattern as FileService).
@kitlangton kitlangton enabled auto-merge (squash) March 16, 2026 23:49
@kitlangton kitlangton merged commit 3849822 into dev Mar 16, 2026
8 checks passed
@kitlangton kitlangton deleted the effectify-skill branch March 16, 2026 23:51
ConanXu-math pushed a commit to ConanXu-math/opencode that referenced this pull request Mar 17, 2026
AvatarGanymede pushed a commit to AvatarGanymede/opencode-dev that referenced this pull request Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant