Skip to content

Conversation

@jqnatividad
Copy link
Collaborator

Given qsv's rapid development pace, the MCP server should be able to update its skills JSON file when a new qsv release is made.

as qsv has a fast release tempo, qsv MCP Server should be able to auto-update the SKILLS json file using a similar auto-update mechanism to the qsv binary
as we removed the extended examples section that we'll revisit once we come up with a bullet-proof USAGE text example parser (as examples are not part of doc-opt spec)
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements an auto-update system for MCP (Model Context Protocol) skills that keeps skill definitions synchronized with qsv releases. The implementation converts the standalone qsv-skill-gen binary into an integrated module accessible via the qsv --update-mcp-skills flag, and adds comprehensive update detection and auto-regeneration capabilities to the TypeScript MCP server.

Key changes:

  • Converts standalone qsv-skill-gen binary to integrated module behind mcp feature flag
  • Adds --update-mcp-skills flag to main qsv binary for generating MCP skills JSON files
  • Implements TypeScript UpdateChecker class for version detection, GitHub release monitoring, and optional auto-regeneration
  • Provides configurable update workflows (conservative manual, automatic, and CI/CD)

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/mcp_skills_gen.rs Converts standalone binary to public module function; adds repository root detection; changes from main() to pub fn generate_mcp_skills()
src/main.rs Integrates MCP skills generation behind feature flag; adds --update-mcp-skills flag; uses const_format for conditional USAGE string
src/bin/README.md Removed (old standalone binary documentation)
Cargo.toml Removes qsv-skill-gen binary definition; adds mcp feature and const_format dependency
Cargo.lock Adds const_format crate dependencies
.claude/skills/src/update-checker.ts New UpdateChecker class for version detection, GitHub API integration, and skill auto-regeneration
.claude/skills/src/mcp-server.ts Integrates update checker on startup with quick local check and background GitHub check
.claude/skills/qsv/qsv-sample.json Updates description with additional examples reference
.claude/skills/package.json Adds test-update-checker script
.claude/skills/examples/update-checker-demo.js New demo script showcasing update checker functionality
.claude/skills/UPDATE_SYSTEM_SUMMARY.md New technical implementation summary
.claude/skills/README.md Updates skill regeneration command references from old binary to new flag
.claude/skills/README-MCP.md Adds update-related environment variables and AUTO_UPDATE.md reference
.claude/skills/AUTO_UPDATE.md New comprehensive auto-update user guide with workflows and troubleshooting
.claude/skills/.gitignore Adds .qsv-mcp-versions.json to gitignore
Comments suppressed due to low confidence (1)

src/mcp_skills_gen.rs:612

  • The repository root detection logic requires the command to be run from within the qsv repository directory tree. This creates a usability issue: users who install qsv via package managers (brew, cargo install, etc.) will have the binary installed in a different location and won't have the repository checked out. The documentation suggests users can simply run qsv --update-mcp-skills from anywhere, but this will fail unless they're in the repository directory.

Consider either:

  1. Adding an environment variable or CLI argument to specify the repository path (e.g., --repo-path /path/to/qsv)
  2. Using the binary's own location to determine a default skills output directory (e.g., in user config directory)
  3. Clearly documenting in AUTO_UPDATE.md that this command must be run from within the qsv repository directory

This affects the auto-regeneration feature as well, since it spawns qsv --update-mcp-skills which would fail if the current working directory isn't within the repository.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 15 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (3)

src/mcp_skills_gen.rs:618

  • The error message on line 618 calls std::env::current_dir()? again, which could potentially fail differently than the original call on line 603 if the directory was deleted or permissions changed during execution. This would result in a propagated error instead of the intended error message.

Consider storing the original current directory path before the loop and using that in the error message, or handle the potential error from the second current_dir() call explicitly.
src/mcp_skills_gen.rs:621

  • The repository root detection logic has a potential issue with symlinks. If the current directory contains symlinks in its path, repo_root.pop() might fail to navigate correctly through the directory tree, or it might exit the repository without finding Cargo.toml.

Additionally, on some filesystems or configurations, repeatedly calling pop() until it returns false could reach the root directory ("/") and continue checking, which is inefficient. Consider adding a maximum iteration count or checking for the filesystem root explicitly.
src/mcp_skills_gen.rs:599

  • The commands vector is hardcoded and manually maintained. If new commands are added to qsv or existing commands are renamed/removed, this list needs to be manually updated. This creates a maintenance burden and risk of the list becoming stale.

Consider either:

  1. Dynamically discovering command files by reading the src/cmd directory
  2. Adding a comment with instructions for how to regenerate this list
  3. Adding a test that verifies all .rs files in src/cmd (except mod.rs) are included in this list

This would make the code more maintainable and less error-prone as the project evolves.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 15 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

src/mcp_skills_gen.rs:614

  • The loop logic has a subtle bug: the iteration counter is incremented before checking if the repository root was found, which means the loop can execute MAX_ITERATIONS + 1 times instead of MAX_ITERATIONS times.

The iteration count should be incremented after the check on line 610-612, not before attempting to pop the path. This ensures the loop executes exactly MAX_ITERATIONS times before failing.
src/mcp_skills_gen.rs:643

  • The repository root detection logic has a potential issue: after incrementing iterations and checking MAX_ITERATIONS (line 614-629), the code then checks if pop() fails (line 631-643). However, the error message at line 631-643 will never be reached because if we've hit MAX_ITERATIONS, we've already returned an error on line 616.

The condition at line 631 should be checked before incrementing and checking MAX_ITERATIONS to provide a more accurate error message when the filesystem root is reached without finding the repository.

@jqnatividad jqnatividad merged commit 231f897 into master Jan 7, 2026
23 checks passed
@jqnatividad jqnatividad deleted the mcp-skills-auto-update branch January 7, 2026 17:25
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