Skip to content

Conversation

@code-crusher
Copy link
Member

  • Implement skill tool functionality and update dependencies
  • Update CHANGELOG.md for v5.3.0
  • Update assistant message handling and tool integration
  • Fix type error in useSkillTool - use ask instead of say
  • fix skill use tool
  • clean up skill tool

@matter-ai-bot
Copy link
Contributor

matter-ai-bot bot commented Jan 29, 2026

Context

Summary By MatterAI MatterAI logo

🔄 What Changed

Introduced a Workspace Skills system allowing the assistant to load specialized instructions from .agent/skills. Optimized the Code Indexing service with state persistence and a "watcher-only" mode to prevent redundant re-indexing on extension restarts. Enhanced the UI with improved streaming word animations and robust API error handling.

🔍 Impact of the Change

Enables users to extend assistant capabilities via local markdown files, providing niche context (e.g., specific security rules or framework patterns). Improves performance and resource usage by persisting indexing state across sessions.

📁 Total Files Changed

Click to Expand
File ChangeLog
packages/types/src/tool.ts Added use_skill to the tool names enum.
src/core/assistant-message/presentAssistantMessage.ts Integrated useSkillTool into the message processing logic.
src/core/prompts/system.ts Added logic to inject available skills into the system prompt.
src/core/prompts/tools/index.ts Registered the use_skill tool description generator.
src/core/tools/skills/index.ts Implemented skill discovery and retrieval logic.
src/core/tools/useSkillTool.ts Created the execution handler for the use_skill tool.
src/services/code-index/state-manager.ts Added persistence for indexing state using VS Code globalState.
src/services/code-index/orchestrator.ts Implemented startWatcherOnly mode for optimized restarts.
webview-ui/src/components/chat/ChatRow.tsx Updated UI for skill tool display and streaming animations.

🧪 Test Added/Recommended

Added

  • useSkillTool.spec.ts: Validates tool execution, parameter validation, and error handling.
  • skills/index.spec.ts: Tests skill discovery, directory scanning, and symlink handling.
  • skills/parser.spec.ts: Validates frontmatter parsing and content extraction from SKILL.md files.

🔒 Security Vulnerabilities

  • N/A: The skill discovery is restricted to the .agent/skills directory within the workspace. Input validation is performed on the skill_name parameter.

Implementation

The feature uses gray-matter to parse markdown files with YAML frontmatter. The CodeIndexManager was refactored to load its state before initializing services, allowing it to decide whether a full re-scan or just a file watcher is needed. The UI uses a useMemo hook for streaming words to ensure consistent animation states.

Screenshots

before after
N/A N/A

How to Test

  1. Create a directory .agent/skills/test-skill/ in your workspace.
  2. Create a SKILL.md file inside with YAML frontmatter (name, description) and some content.
  3. Start a chat and ask the assistant to "use the test-skill".
  4. Verify the assistant loads the content and follows the instructions.
  5. Restart the extension and verify the Code Indexer restores its "Indexed" state without a full re-scan.

Get in Touch

N/A

Copy link
Contributor

@matter-ai-bot matter-ai-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 PR Review is completed: The Skills system implementation is robust, with clean integration into the toolchain. The Code Indexing state persistence changes are well-handled. I've identified a prompt optimization to reduce token usage and correct typos.

Skipped files
  • CHANGELOG.md: Skipped file pattern

Comment on lines +74 to +81
const skillList = skills
.map((skill) => {
return ` - ${skill.metadata.name}: ${skill.metadata.description}`
})
.join("\n")

return `You are provided Skills below, these skills are to be used by you as per your descretion. The purpose of these skills is to provide you additional niche context for you tasks. You might get skills for React, Security or even third-party tools. Use the tool use_skill to get the skill context:
${skillList}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Logic/Performance

Issue: Listing all skills in the system prompt is redundant as they are already listed in the use_skill tool description (which is required for the model to know valid arguments). This consumes unnecessary tokens. Additionally, there are typos in the text ("descretion", "for you tasks").

Fix: Remove the detailed list from the system prompt and direct the model to refer to the use_skill tool definition.

Impact: Reduces token usage and improves prompt clarity.

Suggested change
const skillList = skills
.map((skill) => {
return ` - ${skill.metadata.name}: ${skill.metadata.description}`
})
.join("\n")
return `You are provided Skills below, these skills are to be used by you as per your descretion. The purpose of these skills is to provide you additional niche context for you tasks. You might get skills for React, Security or even third-party tools. Use the tool use_skill to get the skill context:
${skillList}`
// Skills are already listed in the use_skill tool description
return `You have access to a library of skills that provide specialized instructions for tasks. Use the 'use_skill' tool to access them. Refer to the 'use_skill' tool definition for the list of available skills.`

@code-crusher
Copy link
Member Author

/matter review-max

@matter-ai-bot
Copy link
Contributor

matter-ai-bot bot commented Jan 29, 2026

I couldn't clone the repository.

@code-crusher code-crusher merged commit 909f2e1 into main Jan 29, 2026
6 of 13 checks passed
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