Formalize script for enumerating skill references - #2181
Merged
JasonYeMSFT (JasonYeMSFT) merged 1 commit intoMay 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR formalizes the references CLI by adding a JSON “list mode” that enumerates discovered local + remote links per skill, enabling detection of dead reference files and link inventories.
Changes:
- Adds local link details to per-skill validation results (
localLinks) and propagates them through validation. - Introduces
--listCLI flag that outputs a structured JSON inventory of local/remote links plus totals. - Updates CLI usage docs and adds exported list-result types.
Show a summary per file
| File | Description |
|---|---|
| scripts/src/references/cli.ts | Adds local-link capture to validation results and implements --list JSON output for enumerating all links. |
Copilot's findings
Comments suppressed due to low confidence (2)
scripts/src/references/cli.ts:493
--listand--jsoncan both be supplied, in which case--listsilently wins due to ordering. To avoid surprising CLI behavior, consider making these flags mutually exclusive (emit a clear error + non-zero exit), or explicitly document precedence in the usage header.
const jsonOutput = values.json ?? false;
const listOutput = values.list ?? false;
const requestedSkill = positionals[0];
const skills = requestedSkill ? [requestedSkill] : listSkills();
scripts/src/references/cli.ts:493
- In
--listmode, the CLI still runs the fullvalidateSkill()pipeline (including issue/orphan checks) even thoughbuildListJson()only consumeslocalLinksandremoteLinks. If orphan detection and issue validation are non-trivial, consider adding a lighter-weight collection path for list mode (e.g., acollectLinksForSkill()that skips orphan detection/issue checks) to reduce runtime and I/O when generating inventories.
const skills = requestedSkill ? [requestedSkill] : listSkills();
- Files reviewed: 1/1 changed files
- Comments generated: 3
Tom Meschter (tmeschter)
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR formalizes the reference script for reference file listing and added local references files to the output. This script will help detect dead reference files to guide clean up and optimization.
Checklist
cd tests && npm test)npm run test:skills:integration -- <skill>)USE FOR/DO NOT USE FOR/PREFER OVERclauses: confirmed no routing regressions for competing skillsRelated Issues
#2180