Skip to content

refactor: introduce @perstack/skill-manager package#539

Merged
FL4TLiN3 merged 6 commits intomainfrom
refactor/skill-manager-package
Feb 16, 2026
Merged

refactor: introduce @perstack/skill-manager package#539
FL4TLiN3 merged 6 commits intomainfrom
refactor/skill-manager-package

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Introduce packages/skill-manager as a standalone package with 3-layer architecture:
    • SkillAdapter (abstract): unified interface adapting MCP stdio/SSE/in-memory, delegate, and interactive skill sources
    • SkillManager: 1-Expert-1-SkillManager lifecycle manager with fromExpert()/fromLockfile() static factories and dynamic addSkill()/removeSkill()/addDelegate()/removeDelegate() methods
    • Utilities: command-args, ip-validator, mcp-converters, base-skill-helpers (moved from runtime)
  • Migrate runtime from Record<string, BaseSkillManager> to SkillManager across:
    • State machine context (skillManagersskillManager)
    • CoordinatorExecutor using SkillManager.fromExpert/fromLockfile
    • Tool execution layer (executor-factory, mcp-executor, tool-classifier)
  • Comprehensive tests: 5 adapter test suites + SkillManager test suite (all passing)

Motivation

Decouples skill lifecycle management from the runtime to enable:

  • Dynamic skill addition/removal during execution
  • Built-in delegate support (future)
  • Transport modernization (SSE → Streamable HTTP, WebSocket) (future)
  • lazyInit removal in favor of lockfile-based initialization strategy (future)

Test plan

  • pnpm typecheck — 23/23 packages pass
  • pnpm test — 102 files, 1196 tests pass
  • pnpm build — 23/23 packages build
  • pnpm format-and-lint — clean (1 pre-existing issue in filesystem/event.ts)

🤖 Generated with Claude Code

@FL4TLiN3 FL4TLiN3 force-pushed the refactor/skill-manager-package branch from 48c1c2c to dcc3d84 Compare February 16, 2026 16:50
FL4TLiN3 and others added 5 commits February 16, 2026 17:40
- Create packages/skill-manager with 3-layer architecture:
  - SkillAdapter (abstract): unified interface for MCP/delegate/interactive skills
  - SkillManager: 1-Expert-1-SkillManager lifecycle manager with dynamic add/remove
  - Utilities: command-args, ip-validator, mcp-converters, base-skill-helpers
- Migrate runtime state machine from Record<string, BaseSkillManager> to SkillManager
- Update CoordinatorExecutor to use SkillManager.fromExpert/fromLockfile
- Refactor tool-execution layer (executor-factory, mcp-executor, tool-classifier)
- Add comprehensive tests for all adapters and SkillManager

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The old packages/runtime/src/skill-manager/ is fully replaced by
@perstack/skill-manager. Remove @modelcontextprotocol/sdk and
@perstack/base from runtime deps, and @perstack/runtime from
installer deps, since they are no longer needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The old skill-manager code emitted skillConnected events from each
manager's init method. Add spawnDurationMs/connectDurationMs tracking
to SkillAdapter and emit skillConnected events from coordinator-executor
after SkillManager creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Skills whose required environment variables are not available are now
filtered out during SkillManager initialization. This replaces the old
lazyInit behavior with a cleaner approach: availability is determined
by env vars, not a config flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 force-pushed the refactor/skill-manager-package branch 3 times, most recently from d54f96c to a89b2ea Compare February 16, 2026 17:44
Bridge SkillManager's addSkill/removeSkill/addDelegate/removeDelegate
methods to the LLM via MCP tools. Uses a deferred binding pattern where
InMemoryBaseSkillAdapter registers tools with placeholder callbacks,
then SkillManager.fromExpert() binds real implementations after
construction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 force-pushed the refactor/skill-manager-package branch from a89b2ea to ff591a7 Compare February 16, 2026 17:56
@FL4TLiN3 FL4TLiN3 merged commit 1ffecd1 into main Feb 16, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 mentioned this pull request Feb 16, 2026
@FL4TLiN3 FL4TLiN3 deleted the refactor/skill-manager-package branch February 25, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant