Skip to content

✨ Skill loader and prompt builder integration#1354

Closed
ibolton336 wants to merge 1 commit into
feature/goosefrom
feature/skill-loader
Closed

✨ Skill loader and prompt builder integration#1354
ibolton336 wants to merge 1 commit into
feature/goosefrom
feature/skill-loader

Conversation

@ibolton336

Copy link
Copy Markdown
Member

Summary

Wires the migration intelligence package (#1353) into the extension by replacing hardcoded prompt strings with skill-based loading. Introduces a three-layer skill discovery system following the architecture described in konveyor/enhancements#274.

What this PR adds

skillLoader.ts — new module

Three-layer skill discovery (later layers override earlier):

  1. Package defaults<extensionPath>/packages/migration-intelligence/skills/
  2. Hub-distributed.konveyor/profiles/<id>/skills/ (all profiles)
  3. Workspace-local.konveyor/skills/

Key exports:

  • buildSkillIndex(extensionPath, workspaceRoot) — scans all layers, returns Map<name, SkillEntry>
  • loadSkillContent(skillMdPath) — reads full SKILL.md on activation
  • loadPrompt(name, extensionPath, workspaceRoot) — loads prompt templates (workspace overrides package)
  • getSkillWithContent(index, skillName) — convenience: lookup + load in one call

YAML frontmatter parsing uses a simple regex (no extra deps). Missing directories are handled gracefully.

promptBuilder.ts — updated

Accepts optional extensionPath via BuildMigrationPromptOptions. When provided:

  • Builds skill index
  • Looks up execute-migration-phase skill
  • Prepends skill content as the system prompt
  • Falls back to existing hardcoded prompt if skill not found

The incident/file block building logic is unchanged.

ProfileSyncClient.ts — updated

Added logging when profile bundles include skills/ or prompts/ directories. The existing TAR extract pipeline already handles all file types — no filter changes needed.

Depends on

What`s still deferred

  • Passing extensionPath from the orchestrator to buildMigrationPrompt (needs call-site update in agentOrchestrator.ts)
  • Guided phase flow UI (skill creation → plan generation → phased execution)
  • Hub API for skill CRUD

Add a skill loader module that reads SKILL.md files from three layers
in priority order (package defaults, hub-distributed profiles, and
workspace-local). Update the prompt builder to optionally use skill
content when available, falling back to the hardcoded prompt.

- Add skillLoader.ts with buildSkillIndex, loadSkillContent, loadPrompt,
  and getSkillWithContent functions
- Update promptBuilder.ts to load execute-migration-phase skill
- Update ProfileSyncClient.ts to log extracted skills/prompts
- Export skill loader types and functions from agent index

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ibolton336
ibolton336 requested a review from a team as a code owner April 14, 2026 21:37
@djzager djzager closed this May 7, 2026
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.

2 participants