Skip to content

Conversation

@lvndry
Copy link
Owner

@lvndry lvndry commented Jan 19, 2026

Summary

This PR introduces an Agent Skills subsystem (progressive disclosure) and integrates it end-to-end: skill discovery + loading for agents, a user-facing /skills chat command, and safer interactive CLI prompts with Escape cancellation.

What changed

  • Skill runtime + DI

    • Added SkillService implementation at src/core/skills/skill-service.ts.
    • Wired SkillsLive.layer into src/app-layer.ts so skills are available wherever ToolRequirements/chat/agent runner are used.
    • Skill discovery:
      • Scans global skills under ~/.jazz with a cache file at ~/.jazz/global-skills-index.json.
      • Scans local skills in the current project (process.cwd()).
      • Merges results with local overriding global by name.
    • Parses SKILL.md frontmatter (name, description) using gray-matter.
    • Uses fast-glob to locate **/SKILL.md with node_modules/.git ignored.
    • Provides loadSkillSection(...) with path normalization and directory-escape protection.
  • Agent prompt + execution context

    • Extended AgentPromptOptions and AgentRunContext to include knownSkills metadata.
    • Appends skills guidance + <available_skills> XML to the system prompt when skills exist (src/core/agent/agent-prompt.ts, src/core/agent/prompts/shared.ts).
    • AgentRunner now:
      • Lists skills at start of run (metadata only) and passes them into both prompt builder and tool execution context.
      • Always includes load_skill and load_skill_section in the tool allowlist (even if the agent config omits them).
  • Tools: Skill system tools

    • Added src/core/agent/tools/skill-tools.ts implementing:
      • load_skill(skill_name)
      • load_skill_section(skill_name, section_name)
    • Registered tools under a new Skills tool category (SKILLS_CATEGORY) in src/core/agent/tools/register-tools.ts.
  • Chat command: /skills

    • Added command parsing and handling for /skills (src/services/chat/commands/parser.ts, src/services/chat/commands/handler.ts).
    • Interactive flow:
      • Lists discovered skills with name + description.
      • Loads selected skill content and renders it via formatMarkdown(...) for terminal-friendly display.
  • CLI prompt cancellation / UX hardening

    • Added optional reject to PromptState and Escape handling via useInput in the Ink prompt component (src/cli/ui/types.ts, src/cli/ui/Prompt.tsx).
    • Updated TerminalService.select and TerminalService.search to return T | undefined on cancellation (src/core/interfaces/terminal.ts) and implemented it in src/services/terminal.ts.
    • Updated create/edit agent flows to treat cancelled selections as cancellation instead of proceeding with undefined (src/cli/commands/create-agent.ts, src/cli/commands/edit-agent.ts).

Dependencies

  • Updated @openrouter/ai-sdk-provider to ^2.0.0.
  • Added fast-glob, gray-matter, fs-extra (and @types/fs-extra) to support skill discovery/parsing.

User-facing behavior

  • In chat:
    • /skills lets users browse and view available skills (global + local).
  • For agents:
    • Agents are informed about available skills and can load skill instructions on demand via tools.
  • In interactive prompts:
    • Escape cancels select/search prompts cleanly; create/edit flows now exit safely when cancelled.

Test plan

  • Manual
    • Create a local skill (e.g. skills/example/SKILL.md with name/description frontmatter).
    • Run jazz agent chat <name> and execute /skills; verify skills are listed and selecting one prints formatted content.
    • In jazz agent create / jazz agent edit, press Escape during provider/model/type selections and confirm the flow cancels cleanly.
  • Automated
    • Run bun test.

@lvndry lvndry merged commit f14ed57 into main Jan 20, 2026
5 checks passed
@lvndry lvndry deleted the agent-skills branch January 20, 2026 07:47
daryllundy added a commit to daryllundy/jazz that referenced this pull request Jan 20, 2026
* main:
  chore: reduce bundle size by 50% (lvndry#129)
  feat: Agent skills (lvndry#127)
  feat: edit file show diff (lvndry#128)
  0.6.2
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