Summary
Distributed AI artifacts (agents, instructions, prompts) contain hve-core-specific references that break, confuse, or degrade when installed in consumer repositories via the VS Code extension or plugin system. A portability audit identified 8 categories of non-portable references across 30+ files, with a two-phase migration plan to fix them.
Related: #741 (covers workspace-root .github/ path references — a subset of this work)
Problem
When a developer installs hve-core artifacts via extension into a repos with React SPA, C# backend, or Python, or other repo, the following categories of references fail:
| # |
Category |
Severity |
Files Affected |
| 1 |
Hardcoded scripts/ paths in PowerShell and bash instructions |
breaking |
pester.instructions.md, powershell.instructions.md, bash.instructions.md |
| 2 |
Hardcoded npm run commands that don't exist in consumer repos |
breaking |
pester.instructions.md, powershell.instructions.md, bash.instructions.md, doc-ops.agent.md, markdown.instructions.md |
| 3 |
Missing template fallbacks — agents fail when docs/templates/ absent |
breaking |
brd-builder.agent.md, ux-ui-designer.agent.md, code-review-full.agent.md, adr-creation.agent.md, system-architecture-reviewer.agent.md, incident-response.prompt.md |
| 4 |
Hardcoded output directories (docs/prds/, docs/brds/, docs/decisions/, docs/risks/) |
confusing |
prd-builder.agent.md, brd-builder.agent.md, adr-creation.agent.md, system-architecture-reviewer.agent.md, risk-register.prompt.md |
| 5 |
extension/, collections/, logs/ directory assumptions |
degraded |
doc-ops.agent.md, commit-message.instructions.md, pester.instructions.md, powershell.instructions.md |
| 6 |
Commit message scope list hardcodes hve-core directories |
confusing |
commit-message.instructions.md |
| 7 |
Collection/plugin system assumptions in prompt-builder |
confusing |
prompt-builder.instructions.md |
| 8 |
Schema validation paths and HVE Core example text |
degraded |
markdown.instructions.md |
The code-review-standards agent already demonstrates the correct fallback pattern ("If the file is not found, apply a best-effort structure") after #1286 was fixed. This issue extends that pattern to remaining artifacts.
Proposed Solution
A two-phase migration ensures hve-core retains identical behavior while distributed artifacts become portable:
Phase 1: Add hve-core-specific content to copilot-instructions.md
Add ~54 lines across 6 new subsections to .github/copilot-instructions.md. These sections preserve hve-core-specific paths, npm scripts, and conventions that will be removed from distributed artifacts. Some content already exists in copilot-instructions.md (npm scripts, scripts organization, PowerShell testing) and only needs cross-referencing.
New subsections needed:
- Documentation Templates — maps
docs/templates/*.md files to their consuming agents
- Documentation Output Conventions — maps PRDs to
docs/prds/, BRDs to docs/brds/, etc.
- Commit Message Scopes — maps scopes like
(agents), (scripts), (extension) to directories
- Frontmatter Schema Validation — records
scripts/linting/schemas/ path and validation command
- PowerShell Conventions — records copyright header script, CI helpers module, test directory patterns
- Documentation Operations — records doc-ops scanning targets and validation commands
Phase 2: Replace hardcoded references in distributed artifacts with discoverable patterns
For each distributed artifact, replace hve-core-specific content with generic language:
| Pattern |
Before |
After |
| Script paths |
scripts/linting/PSScriptAnalyzer.psd1 |
"Use the PSScriptAnalyzer configuration found in your repository" |
| npm commands |
npm run lint:md |
"Run available lint scripts from package.json" |
| Template refs |
Read docs/templates/brd-template.md |
"Read the output format template if one exists in the repository; if not found, apply a best-effort structure" |
| Output dirs |
"Place PRDs in docs/prds/" |
"Place the output in the repository's standard location for this artifact type" |
| Commit scopes |
Hardcoded scope list |
"Derive commit scopes from the repository's top-level directory structure" |
| Branding |
"9-method HVE framework" |
"9-method Design Thinking framework" |
Files to edit
Phase 1 (copilot-instructions.md only):
.github/copilot-instructions.md — add 6 new subsections
Phase 2 (18 distributed artifact edits):
.github/agents/coding-standards/code-review-full.agent.md — template fallback
.github/agents/project-planning/brd-builder.agent.md — template fallback, output dir
.github/agents/project-planning/ux-ui-designer.agent.md — template fallback
.github/agents/project-planning/adr-creation.agent.md — template fallback, output dir, remove "for HVE Core"
.github/agents/project-planning/system-architecture-reviewer.agent.md — template fallback, output dir
.github/agents/project-planning/prd-builder.agent.md — output dir
.github/agents/hve-core/doc-ops.agent.md — npm scripts, directory scanning, logs
.github/instructions/coding-standards/powershell/pester.instructions.md — script paths, npm scripts
.github/instructions/coding-standards/powershell/powershell.instructions.md — script paths, npm scripts
.github/instructions/coding-standards/bash/bash.instructions.md — copyright script path
.github/instructions/hve-core/commit-message.instructions.md — scope list
.github/instructions/hve-core/markdown.instructions.md — schema paths, example text
.github/instructions/hve-core/prompt-builder.instructions.md — collection manifest reference
.github/prompts/security/incident-response.prompt.md — template fallback
.github/prompts/security/risk-register.prompt.md — output dir
Acceptance Criteria
Out of Scope
Summary
Distributed AI artifacts (agents, instructions, prompts) contain hve-core-specific references that break, confuse, or degrade when installed in consumer repositories via the VS Code extension or plugin system. A portability audit identified 8 categories of non-portable references across 30+ files, with a two-phase migration plan to fix them.
Related: #741 (covers workspace-root
.github/path references — a subset of this work)Problem
When a developer installs hve-core artifacts via extension into a repos with React SPA, C# backend, or Python, or other repo, the following categories of references fail:
scripts/paths in PowerShell and bash instructionsnpm runcommands that don't exist in consumer reposdocs/templates/absentdocs/prds/,docs/brds/,docs/decisions/,docs/risks/)extension/,collections/,logs/directory assumptionsThe code-review-standards agent already demonstrates the correct fallback pattern ("If the file is not found, apply a best-effort structure") after #1286 was fixed. This issue extends that pattern to remaining artifacts.
Proposed Solution
A two-phase migration ensures hve-core retains identical behavior while distributed artifacts become portable:
Phase 1: Add hve-core-specific content to copilot-instructions.md
Add ~54 lines across 6 new subsections to
.github/copilot-instructions.md. These sections preserve hve-core-specific paths, npm scripts, and conventions that will be removed from distributed artifacts. Some content already exists in copilot-instructions.md (npm scripts, scripts organization, PowerShell testing) and only needs cross-referencing.New subsections needed:
docs/templates/*.mdfiles to their consuming agentsdocs/prds/, BRDs todocs/brds/, etc.(agents),(scripts),(extension)to directoriesscripts/linting/schemas/path and validation commandPhase 2: Replace hardcoded references in distributed artifacts with discoverable patterns
For each distributed artifact, replace hve-core-specific content with generic language:
scripts/linting/PSScriptAnalyzer.psd1npm run lint:mdRead docs/templates/brd-template.mddocs/prds/"Files to edit
Phase 1 (copilot-instructions.md only):
.github/copilot-instructions.md— add 6 new subsectionsPhase 2 (18 distributed artifact edits):
.github/agents/coding-standards/code-review-full.agent.md— template fallback.github/agents/project-planning/brd-builder.agent.md— template fallback, output dir.github/agents/project-planning/ux-ui-designer.agent.md— template fallback.github/agents/project-planning/adr-creation.agent.md— template fallback, output dir, remove "for HVE Core".github/agents/project-planning/system-architecture-reviewer.agent.md— template fallback, output dir.github/agents/project-planning/prd-builder.agent.md— output dir.github/agents/hve-core/doc-ops.agent.md— npm scripts, directory scanning, logs.github/instructions/coding-standards/powershell/pester.instructions.md— script paths, npm scripts.github/instructions/coding-standards/powershell/powershell.instructions.md— script paths, npm scripts.github/instructions/coding-standards/bash/bash.instructions.md— copyright script path.github/instructions/hve-core/commit-message.instructions.md— scope list.github/instructions/hve-core/markdown.instructions.md— schema paths, example text.github/instructions/hve-core/prompt-builder.instructions.md— collection manifest reference.github/prompts/security/incident-response.prompt.md— template fallback.github/prompts/security/risk-register.prompt.md— output dirAcceptance Criteria
scripts/paths in runtime instructionsnpm runcommands without conditional/discoverable framingdocs/templates/files include a missing-file fallbacknpm run lint:md,npm run lint:frontmatterpass after all editsnpm run plugin:generateandnpm run plugin:validatepassOut of Scope
.github/path-to-#file:conversions (tracked separately)