Skip to content

docs: add spec reference guidance to PR template by type#87

Merged
rjmurillo merged 5 commits into
mainfrom
copilot/update-pr-template-guidance
Dec 20, 2025
Merged

docs: add spec reference guidance to PR template by type#87
rjmurillo merged 5 commits into
mainfrom
copilot/update-pr-template-guidance

Conversation

Copilot AI commented Dec 20, 2025

Copy link
Copy Markdown
Contributor
  • Review current PR template and spec validation workflow
  • Add spec requirement guidance table to PR template
  • Update inline comments for clarity
  • Update AI spec validation workflow warning message
  • Update CONTRIBUTING.md with spec reference best practices
  • Verify markdown linting passes
  • Review all changes for accuracy and completeness
  • Expand conventional commit examples per feedback
  • Add conventional commit prefixes to all PR types

Summary

Implemented Option 1 from issue: "Update PR Template" with spec reference guidance.

Changes:

  1. Added "Spec Requirement Guidelines" table to PR template with conventional commit prefixes
  2. Enhanced AI spec validation workflow warning with actionable guidance
  3. Added "Spec Reference Best Practices" section to CONTRIBUTING.md
  4. Expanded conventional commit examples (feat(scope):, fix(scope):, refactor:, ci:, build:, chore:)

Files Modified: 3 files

  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/workflows/ai-spec-validation.yml
  • CONTRIBUTING.md

Design Approach:

  • Low friction: No workflow enforcement changes
  • Clear expectations: Visual indicators (✅) and specific guidance per PR type
  • Consistent: Conventional commit prefixes used throughout
  • Flexible: Features require specs, others are optional with rationale

All acceptance criteria met. Feedback addressed.

Original prompt

This section details on the original issue you should resolve

<issue_title>feat: Improve PR template with spec reference guidance</issue_title>
<issue_description>## Summary

Improve PR quality by requiring or encouraging spec references in PR descriptions.

Priority: P2 (Process improvement)
Effort: 30 minutes
Source: PR #79 AI Spec Validation warning

Context

The AI Spec Validator on PR #79 showed:

⚠️ No spec references found

This PR does not reference any specifications (REQ-, DESIGN-, TASK-*, or linked issues).

While this is acceptable for trivial bug fixes, it highlights an opportunity to improve traceability for feature work.

Current State

  • AI Spec Validation workflow exists and runs on PRs
  • Warning is shown when no specs found
  • No enforcement or guidance on when specs are required

Proposal

Option 1: Update PR Template

Add guidance to .github/PULL_REQUEST_TEMPLATE.md:

## Spec References (if applicable)

<!-- For feature work, link specifications or requirements -->
<!-- Examples: Implements REQ-001, Closes rjmurillo/ai-agents#123, References .agents/specs/... -->

-

## Spec Reference Guidance

| PR Type | Spec Required? |
|---------|----------------|
| Bug fix | Optional (link issue if exists) |
| Feature | Required (REQ-*, issue, or spec file) |
| Refactor | Optional (explain rationale) |
| Docs | Not required |

Option 2: Enforce in AI Quality Gate

Update AI review agents to flag missing specs for feature PRs:

  • Detect PR type from title prefix (feat:, fix:, docs:, etc.)
  • Require spec reference for feat: PRs
  • Warn (not fail) for other types without specs

Option 3: Documentation Only

Document spec reference best practices in CONTRIBUTING.md without enforcement.

Acceptance Criteria

  • Clear guidance on when specs are required
  • PR template updated with spec reference section
  • AI Spec Validation message updated with actionable guidance
  • Documentation updated

Trade-offs

Approach Pros Cons
PR Template Low friction, visible guidance Easy to ignore
AI Enforcement Consistent, automated May block valid PRs
Documentation Non-intrusive May not be read

Recommendation

Start with PR template update (Option 1), observe adoption, then consider enforcement if needed.

Related


Source: PR #79 AI review analysis
</issue_description>

Comments on the Issue (you are @copilot in this section)

Custom agent used: implementer
Execution-focused C# expert who implements approved plans with production-quality code following SOLID, DRY, and clean architecture principles. Writes tests alongside code, commits atomically with conventional messages, and cares about performance, encapsulation, and coverage. Use when you need to ship code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Note

Introduces PR type-specific spec reference guidance in the PR template and CONTRIBUTING, and updates the AI spec validation workflow’s no-spec message to include actionable requirements.

  • Documentation & Templates:
    • PR Template (.github/PULL_REQUEST_TEMPLATE.md): Add PR type-specific spec requirement table and guidance; clarify supported reference formats; advise creating .agents/planning/ specs for features.
    • Contributing Guide (CONTRIBUTING.md): Add “Spec Reference Best Practices”; prioritize spec references in PR guidelines; document accepted reference formats.
  • CI Workflow:
    • AI Spec Validation (.github/workflows/ai-spec-validation.yml): Enhance “no specs found” report with PR type requirement table and link to PR template; no enforcement changes.

Written by Cursor Bugbot for commit 61feea1. This will update automatically on new commits. Configure here.

Copilot AI self-assigned this Dec 20, 2025
- Add "Spec Requirement Guidelines" table to PR template showing when specs are required/optional by PR type
- Update AI spec validation workflow warning message with PR type requirements
- Add "Spec Reference Best Practices" section to CONTRIBUTING.md
- Clarify that feature PRs require specs, others are optional
- Remove "REQUIRED" from spec section comment to reflect nuanced guidance

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve PR template with spec reference guidance docs: add spec reference guidance to PR template by type Dec 20, 2025
Copilot AI requested a review from rjmurillo December 20, 2025 02:22
Comment thread .github/workflows/ai-spec-validation.yml
Comment thread .github/PULL_REQUEST_TEMPLATE.md Outdated
@github-actions

Copy link
Copy Markdown
Contributor

AI Quality Gate Review

Tip

Final Verdict: PASS

Walkthrough

This PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:

  • Security Agent: Scans for vulnerabilities, secrets exposure, and security anti-patterns
  • QA Agent: Evaluates test coverage, error handling, and code quality
  • Analyst Agent: Assesses code quality, impact analysis, and maintainability
  • Architect Agent: Reviews design patterns, system boundaries, and architectural concerns
  • DevOps Agent: Evaluates CI/CD, build pipelines, and infrastructure changes
  • Roadmap Agent: Assesses strategic alignment, feature scope, and user value

Review Summary

Agent Verdict Status
Security PASS
QA PASS
Analyst PASS
Architect PASS
DevOps PASS
Roadmap PASS
Analyst Review Details

Analyst Review: PR #87 - Spec Reference Guidance

Code Quality Score

Criterion Score (1-5) Notes
Readability 5 Clear tables, consistent formatting across all files
Maintainability 5 Guidance centralized in PR template; other files reference it
Consistency 5 Same table structure used across template, workflow, and docs
Simplicity 5 Documentation-only change with no enforcement complexity

Overall: 5/5

Impact Assessment

  • Scope: Isolated (3 documentation/workflow files)
  • Risk Level: Low (no enforcement changes, guidance only)
  • Affected Components: PR template, AI spec validation workflow output, CONTRIBUTING.md

Findings

Priority Category Finding Location
Low Formatting Workflow adds blank lines between header comments (style preference, not a defect) .github/workflows/ai-spec-validation.yml:3-7
Low Trailing whitespace Trailing whitespace change on line 18 of workflow (style fix, acceptable) .github/workflows/ai-spec-validation.yml:18

Recommendations

  1. None required. Changes are clean and well-structured.

Alignment with Issue #86

The PR satisfies all acceptance criteria from the issue:

Criterion Status
Clear guidance on when specs are required [PASS] - Table added to PR template
PR template updated with spec reference section [PASS] - Guidelines table added
AI Spec Validation message updated [PASS] - Workflow warning enhanced
Documentation updated [PASS] - CONTRIBUTING.md updated

Verdict

VERDICT: PASS
MESSAGE: Documentation-only change adds clear, consistent spec reference guidance across 3 files. No enforcement changes. Directly addresses issue #86 requirements.
DevOps Review Details

DevOps Review: PR Template Spec Reference Guidance

Pipeline Impact Assessment

Area Impact Notes
Build None No build process changes
Test None No test changes
Deploy None No deployment changes
Cost None Workflow message change only

CI/CD Quality Checks

Check Status Location
YAML syntax valid .github/workflows/ai-spec-validation.yml
Actions pinned line 39: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Secrets secure lines 29, 168-169, 182-183: secrets referenced via ${{ secrets.* }}
Permissions minimal line 20-22: contents: read, pull-requests: write
Shell scripts robust PowerShell used with proper string handling

Findings

Severity Category Finding Location Fix
Low Style Comment lines use # at column 0 with blank lines between lines 3-7 Cosmetic; could consolidate but acceptable
Info Documentation PR template guidance table clear and actionable .github/PULL_REQUEST_TEMPLATE.md:18-26 None needed

Template Assessment

  • PR Template: Adequate - Clear guidance table with spec requirements by PR type
  • Issue Templates: Adequate - drift-alert template exists for automated alerts
  • Template Issues: None found

Automation Opportunities

Opportunity Type Benefit Effort
Auto-detect PR type from title prefix Workflow enhancement Could enforce spec requirements per type Medium

Recommendations

  1. Consider future enhancement to auto-classify PR type and adjust validation severity accordingly.

Verdict

VERDICT: PASS
MESSAGE: Documentation-only changes to PR template, workflow message, and CONTRIBUTING.md. Workflow YAML valid, actions pinned, permissions minimal, secrets handled securely. No enforcement changes made.
Roadmap Review Details

Strategic Alignment Assessment

Criterion Rating Notes
Aligns with project goals High Improves spec-to-implementation traceability, a core value in this agent-driven development system
Priority appropriate High P2 process improvement with 30-minute effort is proportionate; addresses real confusion from AI validation warnings
User value clear High Contributors now understand when specs are required vs optional
Investment justified High Minimal effort (3 files, guidance-only changes) for clear quality improvement

Feature Completeness

  • Scope Assessment: Right-sized. Implements Option 1 + Option 3 from the issue without enforcement changes
  • Ship Ready: Yes
  • MVP Complete: Yes. All acceptance criteria addressed: guidance table, PR template updated, workflow message enhanced, CONTRIBUTING.md documented
  • Enhancement Opportunities: Future Option 2 (enforcement in AI gate) remains available if adoption is low

Impact Analysis

Dimension Assessment Notes
User Value High Eliminates confusion about AI validation warnings; clear expectations at PR creation
Business Impact Medium Improves traceability for feature work without blocking legitimate contributions
Technical Leverage Low Documentation-only change; no infrastructure or reusable components created
Competitive Position Neutral Internal process improvement

Concerns

Priority Concern Recommendation
Low Guidance may be ignored without enforcement Monitor adoption over 30-60 days; revisit Option 2 if feature PRs consistently lack specs

Recommendations

  1. Merge as-is. The guidance-first approach matches the issue recommendation.
  2. Track adoption: If feature PRs continue without spec references after 60 days, consider enforcement in the AI quality gate.
  3. The workflow YAML spacing changes (adding blank lines between comments) are cosmetic but harmless.

Verdict

VERDICT: PASS
MESSAGE: Change aligns with roadmap goal of spec-to-implementation traceability. Right-sized documentation improvement that addresses contributor confusion without blocking legitimate work. Follows the recommended Option 1 + 3 approach from the issue.
Architect Review Details

Design Quality Assessment

Aspect Rating (1-5) Notes
Pattern Adherence 5 Documentation-only changes follow DRY by centralizing guidance in PR template
Boundary Respect 5 Changes stay within documentation scope; no code logic modifications
Coupling 5 PR template, workflow message, and CONTRIBUTING.md reference each other appropriately
Cohesion 5 Each file has single responsibility: template guides authors, workflow provides feedback, docs explain conventions
Extensibility 5 Guidance table is easily extendable for new PR types

Overall Design Score: 5/5

Architectural Concerns

Severity Concern Location Recommendation
None - - -

Breaking Change Assessment

  • Breaking Changes: No
  • Impact Scope: None
  • Migration Required: No
  • Migration Path: N/A

Technical Debt Analysis

  • Debt Added: Low (minimal new content, well-structured)
  • Debt Reduced: Medium (eliminates ambiguity about spec requirements)
  • Net Impact: Improved

ADR Assessment

  • ADR Required: No
  • Decisions Identified: Policy clarification on when specs are required by PR type
  • Existing ADR: None relevant; this is process guidance, not architectural decision
  • Recommendation: N/A. This is contributor workflow guidance, not a technology choice or architectural pattern. The decision to make specs "required" for feature PRs versus "optional" for others does not warrant an ADR.

Recommendations

  1. Consider adding chore: and ci: to the PR type guidance table for completeness, as these are common conventional commit prefixes used in this repository.

Verdict

VERDICT: PASS
MESSAGE: Documentation-only change with clear separation of concerns. PR template provides guidance at creation time, workflow reinforces it at validation time, CONTRIBUTING.md documents the rationale. No architectural patterns affected.
Security Review Details

Security Analysis

Findings

Severity Category Finding Location CWE
Low Documentation No security vulnerabilities found All changed files N/A

Analysis Summary

PR Template (.github/PULL_REQUEST_TEMPLATE.md):

  • Changes are documentation-only (guidance table, comment updates)
  • No executable code, no credential handling
  • [PASS]

AI Spec Validation Workflow (.github/workflows/ai-spec-validation.yml):

  • Lines 1-7: Only comment/formatting changes (added blank lines)
  • Lines 226-238: Added static text to heredoc report (no dynamic user input)
  • No new GitHub Actions inputs from untrusted sources
  • No new shell command execution paths
  • Existing injection mitigations remain intact (quoted heredoc on lines 49-55)
  • [PASS]

CONTRIBUTING.md:

  • Documentation changes only
  • No code execution, no secrets, no configuration changes
  • [PASS]

Recommendations

None. All changes are documentation and guidance updates without security implications.

Verdict

VERDICT: PASS
MESSAGE: Documentation-only changes with no security vulnerabilities. Workflow modifications add static text only; existing injection protections remain intact.
QA Review Details

Now I'll generate the QA review. This is a documentation-only PR that:

  1. Updates the PR template with spec guidance
  2. Enhances the AI spec validation workflow message
  3. Adds documentation to CONTRIBUTING.md

Spec-to-Implementation Validation Report

Test Coverage Assessment

Area Status Evidence Files Checked
Unit tests N/A Documentation changes only .github/PULL_REQUEST_TEMPLATE.md, .github/workflows/ai-spec-validation.yml, CONTRIBUTING.md
Edge cases N/A No code logic added N/A
Error paths N/A No code logic added N/A
Assertions N/A No code logic added N/A

Quality Concerns

Severity Issue Location Evidence Required Fix
LOW Minor whitespace formatting in workflow .github/workflows/ai-spec-validation.yml:3-7 Empty comment lines added between existing header comments None required (style preference)

Regression Risk Assessment

  • Risk Level: Low
  • Affected Components: PR template (contributor-facing), workflow output message (informational), CONTRIBUTING.md (documentation)
  • Breaking Changes: None. No enforcement changes. Guidance only.
  • Required Testing: Manual verification that the workflow still produces valid markdown output

Detailed Analysis

PR Template Changes (.github/PULL_REQUEST_TEMPLATE.md):

  • [PASS] Adds clear guidance table with 5 PR types
  • [PASS] Replaces vague "REQUIRED" with type-specific guidance
  • [PASS] Maintains all existing sections and structure
  • [PASS] Markdown syntax is correct (verified table structure)

Workflow Changes (.github/workflows/ai-spec-validation.yml):

  • [PASS] Only modifies the "no specs found" heredoc message (lines 226-238)
  • [PASS] Adds helpful table explaining requirements by PR type
  • [PASS] No changes to logic, verdict thresholds, or job steps
  • [PASS] PowerShell heredoc syntax preserved correctly

CONTRIBUTING.md Changes:

  • [PASS] Adds "Spec Reference Best Practices" subsection
  • [PASS] Promotes spec references to enhancement: Add GitHub workflow for YAML validation #1 in PR guidelines (appropriate for visibility)
  • [PASS] Documents all supported reference formats
  • [PASS] Consistent with PR template guidance

Verification Checklist

  • No executable code changes (documentation/template only)
  • Workflow YAML syntax valid (heredoc structure intact)
  • Markdown tables properly formatted
  • Guidance consistent across all three files
  • No breaking changes to existing workflow behavior

VERDICT: PASS
MESSAGE: Documentation-only changes require no additional tests; guidance is consistent across all modified files.

EVIDENCE:
- Tests found: N/A for 0 new functions (documentation changes only)
- Edge cases: N/A (no code logic)
- Error handling: N/A (no code logic)
- Blocking issues: 0

Run Details
Property Value
Run ID 20390316073
Triggered by pull_request on 87/merge
Commit a26860cabfb35b303d74e55224bbc8ad4566ad9c

Powered by AI Quality Gate - View Workflow

@rjmurillo rjmurillo marked this pull request as ready for review December 20, 2025 06:17
Copilot AI review requested due to automatic review settings December 20, 2025 06:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds clear, type-specific guidance for spec references in pull requests, addressing confusion from the AI Spec Validator's warnings. The changes provide contributors with explicit expectations at PR creation time without introducing enforcement changes.

Key Changes:

  • Added guidance tables showing when spec references are required (features), optional (bugs/refactors/infrastructure), or not needed (documentation)
  • Removed absolute "REQUIRED" label in favor of nuanced, PR-type-specific guidance
  • Enhanced workflow warning messages with inline guidance tables

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
CONTRIBUTING.md Added "Spec Reference Best Practices" section with bullet-point guidance and promoted spec references to #1 in PR guidelines; documents supported reference formats
.github/workflows/ai-spec-validation.yml Enhanced "no specs found" warning with PR-type requirements table and link to full guidance in PR template
.github/PULL_REQUEST_TEMPLATE.md Added "Spec Requirement Guidelines" table with type-specific guidance; replaced "REQUIRED" comment with contextual guidance; clarified when to create specs

Comment thread CONTRIBUTING.md Outdated
Comment thread .github/workflows/ai-spec-validation.yml Outdated
Comment thread CONTRIBUTING.md Outdated
- Add scope syntax examples (feat(scope):, fix(scope):) to PR template
- Add conventional commit prefixes to all PR types in workflow warning
- Include ci:, build:, chore: prefixes for Infrastructure row
- Ensure consistency with repo's conventional commit usage

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
…r consistency

Addresses Copilot review feedback for documentation consistency across files.

Changes:
- Add Infrastructure (`ci:`, `build:`, `chore:`) row to workflow table
- Add Infrastructure bullet to CONTRIBUTING.md spec guidance
- Add conventional commit prefixes to all bullet points in CONTRIBUTING.md

This ensures PR template, workflow message, and CONTRIBUTING.md all use
consistent terminology and cover all five PR types.

Comment-IDs: 2636845208, 2636845210, 2636845212

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjmurillo rjmurillo enabled auto-merge (squash) December 20, 2025 12:32
rjmurillo-bot added a commit that referenced this pull request Dec 20, 2025
Session log documenting:
- PR #87 review thread analysis (5 total, 3 unresolved)
- Resolved 3 Copilot threads using GraphQL API
- Protocol compliance (SESSION-PROTOCOL.md followed)
- Skill script bug discovery (same as PR #75)

All review threads now resolved.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjmurillo rjmurillo disabled auto-merge December 20, 2025 13:20
@rjmurillo rjmurillo merged commit f3edf5b into main Dec 20, 2025
21 checks passed
@rjmurillo rjmurillo deleted the copilot/update-pr-template-guidance branch December 20, 2025 13:21
rjmurillo-bot added a commit that referenced this pull request Dec 21, 2025
Addresses Copilot PR review comments on PR #194.

Changes:
1. COST-GOVERNANCE.md: Updated draft PR workflow to show two valid approaches
   - Zero-CI: Push empty branch first, then create draft PR
   - Minimal-CI: Push with work, create draft immediately after
   - Fixes issue where PR created after push triggers CI before draft status

2. Session 38 log: Fixed commit hash from 9e26526 to 0d583a1
   - Added clarifying note that SESSION-PROTOCOL changes were in PR #87/merged via PR #59
   - This session log is historical documentation being consolidated

Comment-IDs: 2638130053, 2638130056

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.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.

feat: Improve PR template with spec reference guidance

4 participants