Skip to content

feat(instructions): add pull request instructions for PR generation workflow#706

Merged
agreaves-ms merged 12 commits intomainfrom
feat/pull-request-instructions
Feb 20, 2026
Merged

feat(instructions): add pull request instructions for PR generation workflow#706
agreaves-ms merged 12 commits intomainfrom
feat/pull-request-instructions

Conversation

@agreaves-ms
Copy link
Copy Markdown
Collaborator

This PR decomposed the pull request generation system from a single monolithic prompt into a layered architecture of instruction files and a lightweight prompt orchestrator. The pull-request.prompt.md file shrank from ~342 lines to ~25 lines, with all workflow logic, template mapping, change-type detection, security analysis, and formatting rules extracted into two new instruction files. The prompt now serves as a thin entry point that declares inputs and delegates to the shared instruction file, while a repo-specific conventions file layers hve-core-specific template mapping on top.

The restructuring introduced parallel subagent review for diff analysis, explicit opt-in PR creation via MCP tools, and a consolidated checkbox reference table as the single authoritative source for all checkbox handling rules.

Description

Pull Request Workflow Architecture

The core of this PR established a two-tier instruction architecture for PR generation.

  • Added shared pull request instructions at .github/instructions/hve-core/pull-request.instructions.md (438 lines) defining an 8-step workflow: template resolution, PR reference generation, parallel subagent review, findings merge and verification, PR description generation, PR readiness validation, optional MCP-based PR creation, and cleanup
    • Introduced canonical fallback rules referenced by name throughout the workflow to reduce duplication of error-handling logic
    • Defined the subagent review protocol with structured fan-out/fan-in for chunk-based diff analysis and output file templates
    • Codified PR writing standards including bold emphasis for key terms (overriding general writing-style restrictions for PR descriptions), italics for file names, blockquotes for motivation, and sub-heading organization for multi-area PRs
    • Added issue reference extraction patterns for commits and branch names with deduplication
  • Added repo-specific PR conventions at .github/instructions/pull-request.instructions.md (176 lines) for hve-core template integration
    • Defined manual-only sections that agents must never modify (AI artifact contribution verification, prompt-builder review attestation, free-form other type)
    • Created a checkbox reference table consolidating all checkbox handling rules with template location, purpose, handling type, step, and rule summary columns
    • Specified section fill guidance for Sample Prompts (User Request, Execution Flow, Output Artifacts, Success Indicators sub-sections) and Testing
    • Included change type detection patterns mapping file patterns, branch patterns, and commit patterns to PR template checkbox labels
    • Added GHCP maturity detection logic with output formatting for experimental, preview, and deprecated artifacts

Prompt Refactoring

The prompt file retained only the orchestration interface, with all domain logic moved to instruction files.

  • Replaced the 342-line monolithic prompt in pull-request.prompt.md with a 25-line delegating prompt that declares three inputs (branch, createPullRequest, excludeMarkdown) with defaults
    • Added createPullRequest input defaulting to false for explicit opt-in PR creation via MCP tools
    • Added argument-hint frontmatter field showing usage syntax
    • Updated description branding from edge-ai to hve-core

Agent and Documentation Updates

  • Added a Compact handoff to prompt-builder.agent.md with a /compact prompt that preserves .copilot-tracking state, tracking artifact file paths, analysis logs, follow-up items, and user requirements during summarization
  • Expanded the instructions README "Git and Workflow" table with entries for both new PR instruction files, including their applyTo patterns
  • Updated docs/contributing/skills.md portability examples to use generic placeholders (<script-name>.sh, <reference-name>.md) instead of hardcoded filenames

Collection Manifest Registration

  • Registered the shared instruction file in both hve-core.collection.yml and hve-core-all.collection.yml, maintaining alphabetical ordering within instruction blocks

Related Issue(s)

None

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:

Invoke the pull request prompt to generate a PR description from branch diffs:

/pull-request branch=origin/main createPullRequest=true

Execution Flow:

  1. Resolves the PR template from .github/PULL_REQUEST_TEMPLATE.md
  2. Generates a PR reference XML file using the pr-reference skill
  3. Launches parallel subagents (one per chunk) to analyze diff content
  4. Merges subagent findings into a unified pr-reference-log.md
  5. Generates pr.md from the analysis, mapping findings to the repository PR template
  6. Runs required automated checks and triages failures
  7. Creates a pull request via MCP tools when createPullRequest=true
  8. Cleans up temporary artifacts (XML, subagent files)

Output Artifacts:

  • .copilot-tracking/pr/pr.md — Final PR description with title and body
  • .copilot-tracking/pr/pr-reference-log.md — Verified analysis log (persists)
  • .copilot-tracking/pr/subagents/NN-pr-reference-log.md — Per-chunk review logs (temporary)

Success Indicators:

  • pr.md preserves all PR template sections and accurately reflects diff analysis
  • Change type checkboxes match detected file patterns
  • Required automated checks pass (lint, frontmatter, skills validation)
  • PR is created on GitHub when explicitly requested

Testing

Automated Validation

Command Status
npm run lint:md Passed
npm run spell-check Passed
npm run lint:frontmatter Passed
npm run validate:skills Passed
npm run lint:md-links Passed
npm run lint:ps Passed

Security Analysis

  • No sensitive data, API keys, or credentials detected in changes
  • No new dependencies introduced
  • No privilege escalation patterns identified
  • No security scripts modified

Diff-Based Assessment

  • All changes are additive or refactoring; no public API surfaces were removed
  • Changed files follow existing naming conventions
  • Documentation updates accompany the instructional changes

Note

Manual testing was not performed. The PR introduces instruction and prompt files that define workflow behavior rather than executable code.

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 — instruction and prompt files do not have associated test suites)

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

PR Generation Validation

  • PR description preserves all template sections
  • pr-reference-log.md analysis is accurately reflected in the description
  • Description uses past tense and follows writing-style conventions
  • All significant changes from the diff are included
  • Referenced files are accurate and exist in the repository
  • Follow-up tasks are actionable and tied to specific code, files, or components

GHCP Artifact Maturity

File Type Maturity Notes
.github/instructions/hve-core/pull-request.instructions.md Instructions ✅ stable All builds
.github/instructions/pull-request.instructions.md Instructions ✅ stable Repo-specific (excluded from collections)
.github/prompts/hve-core/pull-request.prompt.md Prompt ✅ stable All builds
.github/agents/hve-core/prompt-builder.agent.md Agent ✅ stable All builds

Security Considerations

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

Additional Notes

  • The repo-specific conventions file at .github/instructions/pull-request.instructions.md is positioned at the instructions root (not under hve-core/) and is correctly excluded from collection manifests per project structure rules.
  • All 10 commits follow conventional commit format with feat type, reflecting iterative refinement of the same set of files.
  • The createPullRequest input defaults to false, preserving existing behavior where the prompt generates a description without creating a PR unless explicitly requested.

…orkflow

- include detailed steps for PR description generation
- integrate template mapping and change detection guidance
- outline security analysis and maturity detection processes

📄 - Generated by Copilot
…allback rules and validation steps

- add canonical fallback rules for PR template resolution
- improve pre-requisite validation steps for check command execution
- clarify template mapping and PR description generation process

🔧 - Generated by Copilot
…ll request instructions

- clarify required checks discovery process
- update template state resolution steps
- enhance PR readiness validation and remediation guidance

🔧 - Generated by Copilot
…uidance

- add mode column to template mapping for clarity
- update GHCP maturity section guidance
- revise post-generation checklist to align with PR writing standards

🔧 - Generated by Copilot
- replace specific script and reference paths with generic placeholders
- ensure all paths are relative to skill root for validation compliance

🔧 - Generated by Copilot
…ting guidelines

- clarify markdown formatting options for mapped sections
- specify use of bold, italics, and blockquotes for emphasis
- introduce narrative transitions for improved readability

🔍 - Generated by Copilot
…hecklist and validation steps

- update checkbox handling for automated checks and manual verification
- clarify post-generation checklist requirements for pr.md
- improve guidance on security analysis and checklist updates

🔒 - Generated by Copilot
…ction fill guidance and validation steps

- add guidance for evaluating template checkboxes against diffs
- clarify handling of manual-only sections and insertion rules
- improve security analysis and post-generation checklist criteria

🔒 - Generated by Copilot
…t argument

- add createPullRequest input for explicit PR creation instructions
- refine argument-hint for clarity on input options

🔧 - Generated by Copilot
@agreaves-ms agreaves-ms requested a review from a team as a code owner February 20, 2026 21:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 20, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@agreaves-ms agreaves-ms merged commit 73d23eb into main Feb 20, 2026
19 checks passed
WilliamBerryiii pushed a commit that referenced this pull request Feb 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.0.0](hve-core-v2.3.10...hve-core-v3.0.0)
(2026-02-20)


### ⚠ BREAKING CHANGES

* **skills:** migrate PR reference generation to self-contained skill
([#669](#669))
* restructure RPI collection to HVE Core naming convention
([#668](#668))

### ✨ Features

* **agents:** add agile-coach agent
([#562](#562))
([de8d86c](de8d86c))
* **agents:** add DT coach agent with tiered instruction loading
([#656](#656))
([206d3a7](206d3a7))
* **agents:** add product manager advisor and UX/UI designer agents
([#627](#627))
([539eb8a](539eb8a))
* **agents:** add system architecture reviewer for design trade-offs and
ADR creation ([#626](#626))
([de5cfd6](de5cfd6))
* **build:** pin devcontainer image and align tool parity
([#704](#704))
([6258b1c](6258b1c))
* **design-thinking:** add manufacturing industry context template
([#682](#682))
([ce864bf](ce864bf))
* **instructions:** add DT coaching state protocol for session
persistence ([#654](#654))
([5a5be4e](5a5be4e))
* **instructions:** add dt-coaching-identity ambient instruction
([#642](#642))
([6209a0d](6209a0d))
* **instructions:** add dt-method-01-deep for advanced scope
conversation techniques
([#673](#673))
([cc92ef9](cc92ef9))
* **instructions:** add dt-method-03-deep for advanced input synthesis
techniques ([#676](#676))
([0079a4f](0079a4f))
* **instructions:** add dt-method-09-deep instructions for Method 9
advanced coaching
([#703](#703))
([150b2a6](150b2a6))
* **instructions:** add dt-method-sequencing ambient instruction
([#650](#650))
([e465b2f](e465b2f))
* **instructions:** add dt-quality-constraints and design-thinking
collection ([#645](#645))
([17002bd](17002bd))
* **instructions:** add DT-to-RPI handoff contract specification
([#679](#679))
([87f9962](87f9962))
* **instructions:** add energy industry context template
([#687](#687))
([41088d8](41088d8))
* **instructions:** add healthcare industry context template
([#686](#686))
([b2d5281](b2d5281))
* **instructions:** add Method 1 Scope Conversations coaching knowledge
([#651](#651))
([93e2d48](93e2d48))
* **instructions:** add Method 2 Design Research coaching knowledge
([#652](#652))
([30f7f3b](30f7f3b))
* **instructions:** add Method 3 Input Synthesis coaching knowledge
([#653](#653))
([1efdb7d](1efdb7d))
* **instructions:** add Method 7 High-Fidelity Prototypes coaching
instruction ([#666](#666))
([9233eab](9233eab))
* **instructions:** add pull request instructions for PR generation
workflow ([#706](#706))
([73d23eb](73d23eb))
* **instructions:** create DT curriculum content (9 modules)
([#690](#690))
([9f7378f](9f7378f)),
closes [#617](#617)
* **instructions:** create dt-method-02-deep.instructions.md
([#700](#700))
([4d4d0ca](4d4d0ca))
* **instructions:** create dt-method-06-lofi-prototypes.instructions.md
([#684](#684))
([4d5f757](4d5f757))
* **instructions:** create dt-method-07-deep.instructions.md
([#678](#678))
([d3ec70d](d3ec70d))
* **instructions:** Create dt-method-08-deep.instructions.md
([#683](#683))
([d9e1115](d9e1115))
* **instructions:** create dt-method-08-testing.instructions.md
([#681](#681))
([3008ad8](3008ad8))
* **instructions:** create dt-method-09-iteration.instructions.md
([#685](#685))
([9d7f4f5](9d7f4f5))
* **instructions:** create dt-rpi-research-context.instructions.md
([#689](#689))
([34c7b89](34c7b89))
* **instructions:** create manufacturing reference learning scenario
([#692](#692))
([1bd3994](1bd3994))
* **instructions:** Design Thinking Method 4 brainstorming instruction
file ([#664](#664))
([06f90b0](06f90b0))
* **prompts:** add DT start-project prompt for coaching initialization
([#657](#657))
([ce583d5](ce583d5))
* **prompts:** add dt-resume-coaching prompt for session recovery
([#665](#665))
([11b93cb](11b93cb))
* **prompts:** create dt-handoff-problem-space.prompt.md
([#688](#688))
([277963d](277963d))
* **scripts:** add collection-level maturity field with validation,
gating, and notices
([#697](#697))
([7b1c8e8](7b1c8e8))
* **scripts:** add per-violation CI annotations and colorized console
output ([#637](#637))
([bd7d512](bd7d512))
* **skills:** edit SKILL frontmatter schema, add CI validation, and
documentation ([#625](#625))
([0138a78](0138a78))
* **skills:** mandate unit testing and document language support
([#636](#636))
([9263617](9263617))
* **skills:** migrate PR reference generation to self-contained skill
([#669](#669))
([cf8805f](cf8805f))


### 🐛 Bug Fixes

* **collections:** migrate artifacts into collection-based
subdirectories
([#658](#658))
([dfa5261](dfa5261))
* **instructions:** optimize Phase 1 DT token budgets and close
[#564](https://github.com/microsoft/hve-core/issues/564)/[#565](https://github.com/microsoft/hve-core/issues/565)
gaps ([#675](#675))
([4f42f00](4f42f00))
* **scripts:** add CI annotations and step summary to copyright header
check ([#638](#638))
([5fa6328](5fa6328))
* **scripts:** add grouped link-lang console diagnostics and failure
summary ([#661](#661))
([4d6871f](4d6871f))
* **scripts:** add per-violation Write-Host and Write-CIAnnotation
output to Test-DependencyPinning
([#640](#640))
([9d3b71d](9d3b71d))
* **scripts:** align agent frontmatter schema with VS Code spec
([#469](#469))
([254d445](254d445))
* **scripts:** optimize PSScriptAnalyzer linting performance in WSL2
([#667](#667))
([f120b93](f120b93))
* **scripts:** stabilize YAML display key ordering in collection
manifest ([#701](#701))
([73c0d2c](73c0d2c))
* **scripts:** use text stubs for plugin links when symlinks unavailable
([#695](#695))
([d7650a3](d7650a3))
* **skills:** fix powershell test coverage in pr-reference skill
([#699](#699))
([408e6b7](408e6b7))


### 📚 Documentation

* **dt:** add Method 5 Concepts and Method 6 Lo-Fi Prototypes
instructions ([#693](#693))
([cfdcf11](cfdcf11))
* **hve-guide:** add role-based guides and project lifecycle
documentation ([#663](#663))
([17a85da](17a85da))


### ♻️ Refactoring

* restructure RPI collection to HVE Core naming convention
([#668](#668))
([120dde0](120dde0))
* **scripts:** consolidate duplicate logging into shared SecurityHelpers
module ([#655](#655))
([627a877](627a877))
* **scripts:** use shared SecurityHelpers and CIHelpers modules in
security scripts
([#705](#705))
([3a0baa7](3a0baa7))


### 🔧 Maintenance

* **deps-dev:** bump markdownlint-cli2 from 0.20.0 to 0.21.0 in the
npm-dependencies group
([#609](#609))
([1486dd7](1486dd7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: hve-core-release-please[bot] <254602402+hve-core-release-please[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.

2 participants