Commit ef520df
authored
feat(agents): replace hve-core-specific references with portable discovery-based language (#1335)
## 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)
* [x] 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
* [x] Copilot instructions (`.github/instructions/*.instructions.md`)
* [x] Copilot prompt (`.github/prompts/*.prompt.md`)
* [x] 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](../docs/contributing/skills.md).
> * 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](../docs/contributing/custom-agents.md#agents-not-accepted) and
[Model Version
Requirements](../docs/contributing/ai-artifacts-common.md#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 #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
* [x] Documentation is updated (if applicable)
* [x] Files follow existing naming conventions
* [x] 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
<!-- If contributing an agent, prompt, instruction, or skill, complete
these checks -->
* [x] Used `/prompt-analyze` to review contribution
* [x] Addressed all feedback from `prompt-builder` review
* [x] Verified contribution follows common standards and type-specific
requirements
### Required Automated Checks
The following validation commands must pass before merging:
* [x] Markdown linting: `npm run lint:md`
* [x] Spell checking: `npm run spell-check`
* [x] Frontmatter validation: `npm run lint:frontmatter`
* [x] Skill structure validation: `npm run validate:skills`
* [x] Link validation: `npm run lint:md-links`
* [x] PowerShell analysis: `npm run lint:ps`
* [x] Plugin freshness: `npm run plugin:generate`
* [x] Docusaurus tests: `npm run docs:test`
## Security Considerations
<!-- 1 parent a3acef3 commit ef520df
File tree
15 files changed
+132
-93
lines changed- .github
- agents
- coding-standards
- hve-core
- project-planning
- instructions
- coding-standards
- bash
- powershell
- hve-core
- prompts/security
15 files changed
+132
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 228 | + | |
232 | 229 | | |
233 | 230 | | |
234 | 231 | | |
| |||
355 | 352 | | |
356 | 353 | | |
357 | 354 | | |
358 | | - | |
| 355 | + | |
359 | 356 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 357 | + | |
367 | 358 | | |
368 | 359 | | |
369 | 360 | | |
370 | 361 | | |
371 | 362 | | |
372 | | - | |
| 363 | + | |
373 | 364 | | |
374 | 365 | | |
375 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
74 | 86 | | |
75 | 87 | | |
76 | 88 | | |
| |||
117 | 129 | | |
118 | 130 | | |
119 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
120 | 178 | | |
121 | 179 | | |
122 | 180 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments