Skip to content

feat: add structured PR description template to engineer prompt#467

Merged
buger merged 1 commit intomainfrom
improve-pr-creation-prompt
Mar 3, 2026
Merged

feat: add structured PR description template to engineer prompt#467
buger merged 1 commit intomainfrom
improve-pr-creation-prompt

Conversation

@buger
Copy link
Collaborator

@buger buger commented Mar 3, 2026

Problem / Task

The engineer prompt's GitHub Integration section had only a generic one-liner about gh pr create with no guidance on what the PR title or body should contain. This led to PRs with inconsistent, vague, or empty descriptions that made it hard for reviewers to understand what was changed and why.

Changes

  • npm/src/agent/shared/prompts.js: Added a dedicated "Pull Request Creation" section to the engineer prompt with:
    • PR title guidelines: under 72 characters, imperative mood, optional conventional commit prefixes (fix:, feat:, refactor:, etc.)
    • PR body template: mandatory 3-section structure — "Problem / Task" (what and why), "Changes" (what was done), "Testing" (what was verified)
    • Ticket references: guidance to link GitHub issues (Fixes #123) and external ticket systems like Jira/Linear (Resolves PROJ-456)
    • Quality guardrail: explicit instruction that PR bodies must never be empty or vague

Testing

  • No executable logic was changed — this is a prompt text update
  • Verified the JS file is syntactically valid (no broken template literals)
  • Existing tests unaffected since this modifies prompt content only

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@probelabs
Copy link
Contributor

probelabs bot commented Mar 3, 2026

Overview

This PR adds a structured PR description template to the engineer prompt in the shared prompts module. The change provides explicit guidance to AI agents on how to format PR titles and bodies when creating pull requests via gh pr create.

Files Changed Analysis

File Status Additions Deletions
npm/src/agent/shared/prompts.js Modified 24 2

Pattern: This is a prompt-engineering change — modifying the text instructions that guide AI agent behavior, not executable logic.

Architecture & Impact Assessment

What This PR Accomplishes

  • Standardizes PR creation workflow for AI-generated pull requests
  • Enforces a 3-section PR body structure: Problem/Task, Changes, Testing
  • Adds PR title guidelines (imperative mood, <72 chars, conventional commit prefixes)
  • Provides ticket reference guidance for GitHub issues and external systems (Jira/Linear)

Key Technical Changes

  1. New "Pull Request Creation" section added to the engineer prompt
  2. PR title guidelines: character limits, mood, and prefix conventions
  3. PR body template: mandatory structured format with code fence example
  4. Ticket linking: guidance for Fixes #123 and Resolves PROJ-456 patterns
  5. Quality guardrail: explicit instruction against empty/vague PR bodies

Affected System Components

flowchart LR
    A[User Task] --> B[Engineer Agent]
    B --> C[Code Changes]
    C --> D[PR Creation]
    D --> E{New PR Template}
    E --> F[Structured Title]
    E --> G[Problem/Task Section]
    E --> H[Changes Section]
    E --> I[Testing Section]
    F & G & H & I --> J[Reviewer Experience]
Loading

Scope Discovery & Context Expansion

Direct Impact: The engineer prompt is used by ProbeAgent.js when operating in engineer mode. Any workflow that uses this agent type will now produce structured PRs.

Related Files (not modified but contextually relevant):

  • probe/npm/src/agent/ProbeAgent.js - consumes these prompts
  • probe/npm/src/agent/index.js - agent orchestration
  • Any task/skill modules that invoke the engineer agent

Downstream Effects:

  • All future AI-generated PRs will follow consistent formatting
  • Reviewers can expect predictable PR structure
  • PR descriptions will include testing verification details
  • Issue auto-close on merge will work correctly via Fixes #N references

Tags

  • Review Effort: 1 (trivial) — Pure text/prompt change, no executable code modified
  • Label: enhancement — Improves existing PR creation functionality with better structure
Metadata
  • Review Effort: 1 / 5
  • Primary Label: enhancement

Powered by Visor from Probelabs

Last updated: 2026-03-03T11:45:46.144Z | Triggered by: pr_opened | Commit: bc3a0e7

💡 TIP: You can chat with Visor using /visor ask <your question>

@probelabs
Copy link
Contributor

probelabs bot commented Mar 3, 2026

✅ Security Check Passed

No security issues found – changes LGTM.

✅ Security Check Passed

No security issues found – changes LGTM.

\n\n

✅ Architecture Check Passed

No architecture issues found – changes LGTM.

✅ Performance Check Passed

No performance issues found – changes LGTM.


Powered by Visor from Probelabs

Last updated: 2026-03-03T11:43:29.530Z | Triggered by: pr_opened | Commit: bc3a0e7

💡 TIP: You can chat with Visor using /visor ask <your question>

@buger buger merged commit 06253bd into main Mar 3, 2026
18 checks passed
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.

1 participant