Replies: 1 comment
-
|
@WilliamBerryiii @agreaves-ms I've started this thinking, not entirely finished as we need to ensure our fix works well with relative paths once we distribute through Extension and Plugins (see related issues above), but once we do validate, I believe having a CI linting addition could be beneficial for new AI artifacts contributions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Distributed AI artifacts (agents, instructions, prompts, skills) contain hardcoded
.github/paths in prose content that break when loaded outside the source repository — VS Code extension installs, peer clones, and Copilot CLI plugins. We propose adding a lint validation gate to prevent future regressions and surface existing violations.Background
Issue #741 documents the root problem: artifacts instruct the AI to read files using workspace-root-anchored paths like
.github/instructions/design-thinking/dt-coaching-identity.instructions.md. When installed via extension, the actual file location is something like~/.vscode-server-insiders/data/User/globalStorage/ise-hve-essentials.hve-core/.github/...— the AI resolves.github/relative to the workspace root, not the artifact's disk location, so the file is not found.The skills contributing guide already documents path portability rules and has structural validation via
validate:skills. Agents, instructions, and prompts have no equivalent documentation or validation.Proposal
New validation script
A PowerShell script at
scripts/linting/Validate-ArtifactPathPortability.ps1that:.agent.md,.instructions.md,.prompt.md,SKILL.md) under.github/{agents,instructions,prompts,skills}/{collection-id}/....github/path references in prose content only (outside fenced code blocks)LintingHelpers.psm1+CIHelpers.psm1, supports-ChangedFilesOnly,-WarningsAsErrors,-BaseBranchlogs/artifact-path-portability-results.jsonIntegration
lint:path-portabilitylint:allbetweenlint:version-consistencyandvalidate:skillsWhat is NOT scanned
copilot-instructions.md.github/instructions/workflows.instructions.md)applyToand other fields legitimately use.github/glob patternsdocs/,scripts/,collections/,plugins/.github/deprecated/**Risks and Edge Cases
1. False positives on informational/structural references
Some artifacts reference
.github/paths as documentation about repo structure, not as file paths the AI should resolve. Example fromcommit-message.instructions.md:This describes a scope mapping. The AI doesn't navigate to it.
2. Teaching and meta content
prompt-builder.instructions.mdteaches authors how artifacts are structured — it must reference.github/paths to explain the directory layout. These are instruction-about-instructions.3. Subagent glob patterns
Many agents use
.github/agents/**/researcher-subagent.agent.mdas a resolution pattern. These are real violations (they break in extension context), but fixing them requires changing how subagents are referenced — not just removing the path.4.
#file:directives with workspace-root paths#file:.github/...is also workspace-root-anchored and should be flagged. The fix is to use relative paths like#file:../../instructions/....Proposed Suppression Mechanisms
To handle legitimate
.github/references, authors can suppress detection:Line-level suppression
Block-level suppression
Severity and Rollout
-WarningsAsErrors(exit 1)Starting as warnings-only avoids blocking CI while providing visibility into the ~50 existing violations across the codebase.
Current Violations (Preview)
Based on analysis of the affected files listed in #741:
rpi-agent.agent.mddoc-ops.agent.mdprompt-builder.instructions.mdcommit-message.instructions.mddt-coach.agent.mdDocumentation Updates
The contributor docs gap should be addressed alongside or shortly after the lint gate:
Questions for Discussion
-WarningsAsErrorsbe flipped in the same PR that fixes fix: Distributed AI artifacts reference hardcoded workspace-root paths that break in extension and peer-clone installs #741 violations, or as a separate follow-up?/workspaces/hve-core/...orC:\Users\...? These are rare but equally non-portable.copilot-instructions.mdProject Structure section — This file is repo-specific and excluded from the scan, but its.github/references are still consumed by the AI in-workspace. Should it be separately addressed?References
.copilot-trackingfiles produce broken relative paths#file:directives and markdown links after collection directory reorgBeta Was this translation helpful? Give feedback.
All reactions