Running npx skills add ast-grep/agent-skill did not list VSCode, so I opened VSCode documentation and followed their steps instead https://code.visualstudio.com/docs/copilot/customization/agent-skills
First, enable Chat: Use Agent Skills Experimental
I then created the ~/.copilot directory, downloaded the repository zip as it contained the required folder structure skills/ast-grep/SKILL.md and extracted it.
C:\Users\Qwerty\.copilot>tree /F
.copilot
└───skills
└───ast-grep
│ SKILL.md
│
└───references
rule_reference.md
I was concerned whether it could access the rule_reference.md so I asked it
I uploaded the skill file, can you verify that you can access it?
Yes, I can access the skill file at c:\Users\Qwerty.copilot\skills\ast-grep\SKILL.md. If you want me to use or reference its contents, just let me know what you’d like to do!
The skill file references another file, can you find it and read it too?
The skill file references references/rule_reference.md, but that file does not exist in the .copilot/skills/ast-grep directory or its subdirectories. If you want this reference to work, you should add the referenced file to the appropriate location. Let me know if you want help creating or locating it!
I can confirm that it does contain the file. Can you not access it if it's in a sub folder?
C:\Users\Qwerty.copilot>tree /F
.copilot
└───skills
└───ast-grep
│ SKILL.md
│
└───references
rule_reference.md
Read rule_reference.md, lines 1 to 40
I can access files in subfolders, including c:\Users\Qwerty.copilot\skills\ast-grep\references\rule_reference.md. If you need to reference or use its contents, just let me know what you want to do!
Can you in fact read the file without me explicitly prompting you to? I am concerned that if you use the ast-grep SKILL.md file and find the instruction to read the referenced file, you will "not find it" as in your previous attempt.
I can read referenced files in subfolders if I am explicitly instructed to do so, or if my workflow includes following references as part of a skill’s instructions. However, I do not automatically read referenced files unless the skill or your request specifically directs me to.
In your earlier test, I searched for the file using a file search tool, which may not always find files in all subfolders due to search limitations or settings. If the skill’s instructions clearly say to read a referenced file (like rule_reference.md), and I have access to the path, I can read it as part of executing the skill.
If you want to ensure referenced files are always found, it’s best to use absolute or well-defined relative paths and, if needed, prompt me to read them. If you want me to always follow references in a skill, you can specify that in the skill’s instructions.
Then I continued reading the VSCode documentation and found this
You can reference files within the skill directory using relative paths. For example, to reference a script in your skill directory, use [test script](./test-template.js).
https://code.visualstudio.com/docs/copilot/customization/agent-skills#_body
So I changed the references in the SKILLS.md file to use links instead [rule_reference.md](./references/rule_reference.md)
and opened a new chat and it worked right away:
I uploaded a skill file, can you verify that you can access it and all references within? Please provide a proof, a short snippet from all files found.
Read rule_reference.md, lines 1 to 20
Proof of access:
From SKILL.md:
See references/rule_reference.md for comprehensive rule documentation.
From references/rule_reference.md:
ast-grep rules are categorized into three types:
- Atomic Rules: Match individual AST nodes based on intrinsic properties like code patterns (pattern), node type (kind), or text content (regex).
- Relational Rules: Define conditions based on a target node's position or relationship to other nodes (e.g., inside, has, precedes, follows).
- Composite Rules: Combine other rules using logical operations (AND, OR, NOT) to form complex matching criteria (e.g., all, any, not, matches).
This demonstrates I can access both the skill file and its referenced documentation. If you need more snippets or other references, let me know!
Though, I am not sure if it was caused by me explicitly asking it to provide a proof, or by changing the references.
Running
npx skills add ast-grep/agent-skilldid not listVSCode, so I opened VSCode documentation and followed their steps instead https://code.visualstudio.com/docs/copilot/customization/agent-skillsFirst, enable Chat: Use Agent Skills Experimental
I then created the
~/.copilotdirectory, downloaded the repository zip as it contained the required folder structureskills/ast-grep/SKILL.mdand extracted it.I was concerned whether it could access the rule_reference.md so I asked it
Then I continued reading the VSCode documentation and found this
So I changed the references in the SKILLS.md file to use links instead
[rule_reference.md](./references/rule_reference.md)and opened a new chat and it worked right away:
Though, I am not sure if it was caused by me explicitly asking it to provide a proof, or by changing the references.