Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • My contribution adds a new instruction, prompt, agent, or skill file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, or skill with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description

The getResourceType() function used .includes("/hooks/") and .includes("/skills/") which failed to match relative paths stored in URL hashes (e.g., hooks/pre-commit/README.md), causing deep links to classify resources as "unknown" and break modal behavior.

Changes:

  • Replaced .includes("/hooks/") with regex /(^|\/)hooks\//.test() to match both relative and absolute paths
  • Applied same fix to skills path matching

Before:

if (filePath.includes("/hooks/") && filePath.endsWith("README.md"))
  return "hook";

After:

if (/(^|\/)hooks\//.test(filePath) && filePath.endsWith("README.md"))
  return "hook";

Pattern matches:

  • hooks/pre-commit/README.md
  • /hooks/pre-commit/README.md

Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New collection file.
  • New skill file.
  • Update to existing instruction, prompt, agent, collection or skill.
  • Other (please specify):

Additional Notes

This PR addresses review feedback from #685: #685 (comment)

Merges into the copilot/pr-685 branch, not main.


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 10, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/awesome-copilot/awesome-copilot/website/node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update PR to address feedback on Hooks implementation Fix path matching in getResourceType to handle relative paths Feb 10, 2026
Copilot AI requested a review from aaronpowell February 10, 2026 03:34
@aaronpowell aaronpowell marked this pull request as ready for review February 10, 2026 03:35
Copilot AI review requested due to automatic review settings February 10, 2026 03:35
@aaronpowell aaronpowell merged commit a23d39a into hooks Feb 10, 2026
@aaronpowell aaronpowell deleted the copilot/sub-pr-685 branch February 10, 2026 03:35
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 fixes getResourceType() path classification so deep links using relative paths (stored in the URL hash) correctly detect hook and skill resources, restoring expected modal behavior.

Changes:

  • Update skills path detection to match both relative (skills/...) and absolute (/skills/...) paths.
  • Update hooks path detection to match both relative (hooks/...) and absolute (/hooks/...) paths.

Comment on lines 229 to 233
if (filePath.endsWith(".agent.md")) return "agent";
if (filePath.endsWith(".prompt.md")) return "prompt";
if (filePath.endsWith(".instructions.md")) return "instruction";
if (filePath.includes("/skills/") && filePath.endsWith("SKILL.md"))
if (/(^|\/)skills\//.test(filePath) && filePath.endsWith("SKILL.md"))
return "skill";
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

getResourceType() returns "instruction" for .instructions.md, but the VS Code install config (VSCODE_INSTALL_CONFIG) is keyed by "instructions". In openFileModal(), getVSCodeInstallUrl(type, ...) will therefore return null for instruction files, hiding the install dropdown in the modal for instructions opened from the list or via deep link. Consider normalizing the type names (e.g., use "instructions" everywhere) or adding an alias mapping in getVSCodeInstallUrl so both "instruction" and "instructions" resolve to the same config entry.

Copilot uses AI. Check for mistakes.
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