Skip to content

feat(agents): replace hve-core-specific references with portable discovery-based language#1335

Merged
WilliamBerryiii merged 2 commits intomainfrom
feat/artifacts-generic
Apr 10, 2026
Merged

feat(agents): replace hve-core-specific references with portable discovery-based language#1335
WilliamBerryiii merged 2 commits intomainfrom
feat/artifacts-generic

Conversation

@katriendg
Copy link
Copy Markdown
Contributor

@katriendg katriendg commented Apr 10, 2026

Description

Distributed AI artifacts contained hardcoded hve-core paths, npm scripts, template references, and branding that broke or confused when installed via extension or plugin in consumer repositories. This PR applied a two-phase migration across 15 files: hve-core-specific content moved into copilot-instructions.md as the canonical reference, then hardcoded references in distributed artifacts were replaced with discovery-based patterns and template fallbacks.

The code-review-standards agent already demonstrated the correct fallback pattern after #1286 — this PR extended that model to the remaining artifacts identified in a portability audit.

copilot-instructions.md Expansion

Six new subsections were added to .github/copilot-instructions.md preserving hve-core-specific details removed from distributed artifacts. Documentation Templates catalogs all docs/templates/*.md files by consuming agent. Commit Message Scopes maps 14 scopes to repository directories. Frontmatter Schema Validation records schema paths and validation commands. PowerShell Conventions captures the copyright header script, CI helpers module, and test directory patterns. Documentation Operations defines doc-ops scanning targets and validation commands. These sections sit within the existing project-structure and script-operations comment boundaries.

Agent and Prompt Template Fallbacks

Six agent and prompt files received template fallback patterns following the code-review-standards model. Each file now checks template availability and provides a minimal but functional structure when the template is absent.

  • code-review-full.agent.md added a best-effort fallback for the full-review-output-format.md template, annotating output with a "template not found" warning
  • brd-builder.agent.md made the template path conditional and added a BRD skeleton fallback derived from the agent's own section structure
  • adr-creation.agent.md removed the "for HVE Core" qualifier and added a minimal ADR fallback (Title, Status, Context, Decision, Consequences)
  • system-architecture-reviewer.agent.md added template availability conditions with the same minimal ADR structure fallback
  • ux-ui-designer.agent.md replaced relative template paths with generic docs/templates/ references and discovery-based fallbacks
  • incident-response.prompt.md changed the RCA template reference to a conditional with a detailed Google SRE-format fallback structure

Instruction Discovery Patterns

Seven instruction files replaced hardcoded paths and commands with discovery-based guidance that works across any repository structure.

  • doc-ops.agent.md underwent a major rewrite, replacing hardcoded directory scanning paths and npm script references with guidance to discover directories and validation commands from package.json
  • pester.instructions.md replaced fixed test directory references with discovery patterns and made test execution flexible between npm runners and direct Pester invocation
  • commit-message.instructions.md converted the fixed 14-item scope list to discovery-based guidance: "Derive the commit scope from the primary directory affected by the change"
  • markdown.instructions.md generalized schema validation references and replaced HVE Core-specific example frontmatter with generic values
  • powershell.instructions.md generalized the PSScriptAnalyzer configuration reference to discover .psd1 files rather than hardcoding a path
  • bash.instructions.md generalized copyright validation to check package.json instead of referencing a specific npm command
  • prompt-builder.instructions.md genericized the subagent path example to a {collection} placeholder and made collection system references conditional

RPI Agent Cleanup

Removed RPI Validator and Implementation Validator from the rpi-agent.agent.md agents frontmatter list in a separate commit. These subagents were never called by the RPI agent — they belong to task-reviewer.agent.md and were leftovers from a prior architecture where the RPI agent had a heavier review phase.

Related Issue(s)

Related to #741 — overlapping scope on hardcoded .github/ path references (tracked separately)
Related to #1286 — precursor fix establishing the template fallback pattern for code-review agents
Related to #643 — structural coordination with collection-based subdirectory reorganization
Closes #1334

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder agent and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)

Note for AI Artifact Contributors:

  • Agents: Research, indexing/referencing other project (using standard VS Code GitHub Copilot/MCP tools), planning, and general implementation agents likely already exist. Review .github/agents/ before creating new ones.
  • Skills: Must include both bash and PowerShell scripts. See Skills.
  • Model Versions: Only contributions targeting the latest Anthropic and OpenAI models will be accepted. Older model versions (e.g., GPT-3.5, Claude 3) will be rejected.
  • See Agents Not Accepted and Model Version Requirements.

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Sample Prompts (for AI Artifact Contributions)

User Request:

Install hve-core artifacts into a consumer repository via the VS Code extension. Then invoke the BRD Builder agent, ADR Creation agent, or incident-response prompt in a repository that does not have docs/templates/ files.

Execution Flow:

  1. Agent attempts to read the referenced template file (e.g., docs/templates/brd-template.md).
  2. Template not found — agent applies the fallback structure defined in its own instructions.
  3. Agent generates the output using the fallback skeleton with a note indicating the template was unavailable.
  4. For instruction files (commit-message, pester, etc.), the agent discovers available tools from package.json or repository structure rather than assuming specific npm scripts exist.

Output Artifacts:

Output varies by artifact. When templates are present, behavior is identical to before. When templates are absent, agents produce the same document types using embedded fallback structures. Instruction-driven agents discover available validation commands rather than failing on missing npm scripts.

Success Indicators:

  • No "file not found" errors when template files are absent.
  • hve-core agents resolve all paths via copilot-instructions.md with no behavior regression.
  • Commit message instructions work in any repository by deriving scopes from directory structure.

Testing

  • Diff-based analysis verified all 15 changed files match the portability transformation pattern.
  • Confirmed all template fallback patterns follow the model from fix: Code Review Standards agent: skill loading and template references fail silently in plugin/extension context #1286 (code-review-standards.agent.md).
  • Verified copilot-instructions.md preserves the hve-core-specific content removed from distributed artifacts.
  • Security analysis: no sensitive data exposure, no dependency changes, no privilege escalation patterns detected.
  • Commit message follows conventional commits format: feat(agents,instructions,prompts): ...
  • Manual testing was not performed.

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable) (N/A — markdown-only changes with no testable code)

AI Artifact Contributions

  • Used /prompt-analyze to review contribution
  • Addressed all feedback from prompt-builder review
  • Verified contribution follows common standards and type-specific requirements

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md
  • Spell checking: npm run spell-check
  • Frontmatter validation: npm run lint:frontmatter
  • Skill structure validation: npm run validate:skills
  • Link validation: npm run lint:md-links
  • PowerShell analysis: npm run lint:ps
  • Plugin freshness: npm run plugin:generate
  • Docusaurus tests: npm run docs:test

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues (N/A — no dependency changes)
  • Security-related scripts follow the principle of least privilege (N/A — no security scripts modified)

GHCP Artifact Maturity

File Type Maturity Notes
.github/agents/coding-standards/code-review-full.agent.md Agent ⚠️ experimental Pre-release only
.github/agents/project-planning/brd-builder.agent.md Agent ✅ stable All builds
.github/agents/project-planning/adr-creation.agent.md Agent ✅ stable All builds
.github/agents/project-planning/system-architecture-reviewer.agent.md Agent ✅ stable All builds
.github/agents/project-planning/ux-ui-designer.agent.md Agent ✅ stable All builds
.github/agents/hve-core/doc-ops.agent.md Agent ✅ stable All builds
.github/agents/hve-core/rpi-agent.agent.md Agent ✅ stable All builds
.github/instructions/coding-standards/bash/bash.instructions.md Instructions ✅ stable All builds
.github/instructions/coding-standards/powershell/pester.instructions.md Instructions ✅ stable All builds
.github/instructions/coding-standards/powershell/powershell.instructions.md Instructions ✅ stable All builds
.github/instructions/hve-core/commit-message.instructions.md Instructions ✅ stable All builds
.github/instructions/hve-core/markdown.instructions.md Instructions ✅ stable All builds
.github/instructions/hve-core/prompt-builder.instructions.md Instructions ✅ stable All builds
.github/prompts/security/incident-response.prompt.md Prompt ⚠️ experimental Pre-release only

Warning

This PR includes experimental GHCP artifacts that may have breaking changes.

  • .github/agents/coding-standards/code-review-full.agent.md
  • .github/prompts/security/incident-response.prompt.md

GHCP Maturity Acknowledgment

  • I acknowledge this PR includes non-stable GHCP artifacts
  • Non-stable artifacts are intentional for this change

…es with portable discovery-based language

Add template fallback patterns to 6 agent/prompt files following
code-review-standards.agent.md model. Replace hardcoded directory paths,
npm scripts, and scope lists with discovery-based guidance in doc-ops,
commit-message, pester, powershell, and bash instructions. Remove HVE
branding from dt-coach and genericize markdown.instructions.md examples.

14 distributed artifact files updated for portability to non-hve-core
repositories while preserving identical behavior via copilot-instructions.md.
@katriendg katriendg changed the title feat(agents,instructions,prompts): replace hve-core-specific references with portable discovery-based language feat(agents): replace hve-core-specific references with portable discovery-based language Apr 10, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.65%. Comparing base (a3acef3) to head (9ff2b59).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1335      +/-   ##
==========================================
- Coverage   87.66%   87.65%   -0.02%     
==========================================
  Files          61       61              
  Lines        9328     9328              
==========================================
- Hits         8177     8176       -1     
- Misses       1151     1152       +1     
Flag Coverage Δ
pester 85.22% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@katriendg katriendg marked this pull request as ready for review April 10, 2026 18:19
@katriendg katriendg requested a review from a team as a code owner April 10, 2026 18:19
@WilliamBerryiii WilliamBerryiii merged commit ef520df into main Apr 10, 2026
52 checks passed
WilliamBerryiii pushed a commit that referenced this pull request Apr 24, 2026
## Pre-Release 3.3.101

### ✨ Features

- add removed maturity tier and retire owasp-docker (#1444)
- add evaluation dataset creator (#1279)
- align RAI planner with guide, remove scoring, improve UX (#1287)
- add PSGallery staleness check and BOM cleanup (#1379)
- ISA-95 network planner agent (#1177)
- auto-generate collection.md with maturity filtering (#1316)
- add folder-consistency check and standardize WARN outp… (#1350)
- add synth-data-generate prompt to data-science collection (#1419)
- add canonical deck workflow and customer-card rendering for design
thinking (#1413)
- add Figma MCP integration for DT artifact export (#1222)
- introduce `owasp-docker` (#1245)
- replace hve-core-specific references with portable discovery-based
language (#1335)
- introduce `owasp-cicd` (#1246)
- add secure-by-design knowledge skill (#1223)
- introduce `owasp-infrastructure` (#1244)
- introduce `owasp-mcp` (#1207)
- add OutputPath parameter to Invoke-LinkLanguageCheck.ps1 (#1229)
- add -OutputPath parameter to Validate-SkillStructure.ps1 (#1225)
- add maintainer-only skip-review label guard (#1293)
- add extension collections overview and integrate into getting started
flow (#950)
- add agentic workflows for automated issue triage, implementation, PR
review, dependency review, and doc-staleness detection (#1219)
- consolidate package-lock.json version sync into
Update-VersionFiles.ps1 (#1240)
- add standards code review agent and full review orchestrator (#1174)
- standardize pytest-mock as Python mocking framework (#1170)
- add Jira backlog workflows and Jira/GitLab skills (#978)
- add centralized version bump script and supply-chain attestation
(#1183)

### 🐛 Bug Fixes

- pin PowerShell-Yaml to 0.4.7 across all install sites (#1378)
- close fork-PR/workflow-file-PR secret-strip gap and normalize
upload-artifact version (#1421)
- replace stream-based lookahead with array indexing in
list-changed-files.sh (#1376)
- centralize ISO 8601 timestamp regex in CIHelpers (#1343)
- update stale documentation date in release-process.md (#1363)
- pin basic-ftp to 5.3.0 to resolve GHSA-rp42-5vxx-qpwr (#1374)
- add bot filter to dependency PR review workflow (#1362)
- resolve pip-audit findings in powerpoint, gitlab, and jira skill lock
files (#1360)
- standardize Timestamp JSON key casing across all lint result files
(#1314)
- add synchronize trigger to PR Review workflow (#1323)
- standardize timestamp in Validate-SkillStructure.ps1 to use
Get-StandardTimestamp (#1280)
- add parallel subagent dispatch and structured JSON contracts to
code-review-full (#1304)
- standardize timestamp in SecurityHelpers.psm1 to use
Get-StandardTimestamp (#1284)
- standardize timestamps in Test-DependencyPinning.ps1 and
SecurityClasses.psm1 (#1282)
- derive collection artifact counts from YAML at build time (#1275)
- standardize timestamp in FrontmatterValidation.psm1 to use
Get-StandardTimestamp (#1285)
- standardize timestamp in Markdown-Link-Check.ps1 to use
Get-StandardTimestamp (#1283)
- escape hyphens in Mermaid diagram on Collections page (#1262)
- add summary timestamp to PSScriptAnalyzer output (#1211)
- fix plugin compatibility and robustness for coding-standards code
review agents (#1289)
- standardize timestamp in Test-CopyrightHeaders.ps1 to use
Get-StandardTimestamp (#1278)
- standardize timestamp in Invoke-YamlLint.ps1 to use
Get-StandardTimestamp (#1270)
- standardize timestamp in Invoke-LinkLanguageCheck.ps1 to use
Get-StandardTimestamp (#1264)
- fix dependency-review path filters and sparse-checkout cone mode
(#1259)
- replace invalid bare tool names with official tool identifiers (#1198)
- fix broken links and remove orphaned reference in code review docs
(#1257)
- exclude Python env dirs from skill validation warnings (#1255)
- pin happy-dom and serialize-javascript to resolve Dependabot
vulnerabilities (#1253)
- remove Mermaid diagram and add missing collection cards (#1247)
- disable MCP servers by default to prevent token limit errors (#1144)
- sync package-lock.json after pre-release version bump (#1236)
- separate mermaid node declarations and add dynamic diagram generation
with tests (#1215)
- replace anchor links in meeting-analyst with bold text references
(#1201)
- remove recursive symlinks in jira and gitlab skill directories (#1233)
- validate-installation scripts now check .github/skills directory
(#1010) (#1206)
- resolve npm audit vulnerabilities via dependency overrides (#1200)
- add post-release triggers to scorecard workflow (#1186)
- add missing .md extensions to relative links in agent documentation
(#1180)

### 📚 Documentation

- broaden Security Review description beyond OWASP (#1385)
- document maintainer advisory mode and skip-review label guard (#1386)
- document ExcludePaths/OutputPath for Invoke-LinkLanguageCheck (#1383)
- CLI getting-started: clarify plugin install commands as alternatives
(-all vs base) (#1251)

### ♻️ Refactoring

- align agent and prompt folder names to collection identifier (#1210)

### 🔧 Maintenance

- pin PSScriptAnalyzer to 1.25.0 and sync stale workflow version
comments (#1389)
- bump lxml from 6.0.2 to 6.1.0 in
/.github/skills/experimental/powerpoint (#1424)
- bump @vscode/vsce from 3.7.1 to 3.9.1 in the npm-dependencies group
(#1390)
- bump the github-actions group across 1 directory with 7 updates
(#1391)
- bump follow-redirects from 1.15.11 to 1.16.0 in /docs/docusaurus
(#1356)
- upgrade Node.js from 20 to 24 and bump cspell to v10 (#1353)
- bump basic-ftp from 5.2.0 to 5.2.1 (#1324)
- update github/gh-aw-actions requirement to
536ea1bad8c6715d098a9dc1afea8d403733acfe in the github-actions group
across 1 directory (#1298)
- update security instruction attributions and compliance (#1294)
- bump the npm-dependencies group with 2 updates (#1297)
- pre-release 3.3.41 (#1252)
- streamline RAI Planner phase structure and documentation (#1273)
- bump happy-dom from 20.8.8 to 20.8.9 in /docs/docusaurus (#1237)
- pre-release 3.3.27 (#1191)
- bump pygments from 2.19.2 to 2.20.0 in /.github/skills/gitlab/gitlab
(#1234)
- bump path-to-regexp from 0.1.12 to 0.1.13 in /docs/docusaurus (#1226)
- bump the github-actions group with 4 updates (#1231)
- add missing folders and alphabetize location lists (#1193)
- bump brace-expansion (#1224)
- bump handlebars from 4.7.8 to 4.7.9 in /docs/docusaurus (#1217)
- bump brace-expansion from 5.0.3 to 5.0.5 in /docs/docusaurus (#1213)
- pre-release 3.3.10 (#1187)
- bump markdownlint-cli2 from 0.21.0 to 0.22.0 in the npm-dependencies
group (#1175)
- bump the github-actions group with 3 updates (#1176)
- pre-release 3.3.1 (#1165)

---
*Managed automatically by pre-release workflow.*

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

fix(agents,instructions): make distributed artifacts portable by replacing hve-core-specific references with discoverable patterns

4 participants