Skip to content

Commit f3edf5b

Browse files
Copilotrjmurillorjmurillo-botclaude
authored
docs: add spec reference guidance to PR template by type (#87)
* Initial plan * docs: add spec reference guidance to PR template and CONTRIBUTING.md - 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> * docs: expand conventional commit examples in spec guidance - 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> * docs: add Infrastructure guidance and conventional commit prefixes for 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> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com> Co-authored-by: rjmurillo-bot <rjmurillo-bot@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 911cfd0 commit f3edf5b

File tree

4 files changed

+53
-8
lines changed

4 files changed

+53
-8
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Specification References
88

9-
<!-- REQUIRED: Enable AI spec-to-implementation traceability -->
9+
<!-- Enable AI spec-to-implementation traceability -->
1010
<!-- The ai-spec-validation workflow checks for these references -->
1111

1212
| Type | Reference | Description |
@@ -15,13 +15,24 @@
1515
| **Spec** | `.agents/planning/...` | <!-- Planning document --> |
1616
| **Spec** | `.agents/specs/...` | <!-- Spec document (if applicable) --> |
1717

18+
### Spec Requirement Guidelines
19+
20+
| PR Type | Spec Required? | Guidance |
21+
|---------|----------------|----------|
22+
| **Feature** (`feat:`, `feat(scope):`) | ✅ Required | Link issue, REQ-*, or spec file in `.agents/planning/` |
23+
| **Bug fix** (`fix:`, `fix(scope):`) | Optional | Link issue if exists; explain root cause if complex |
24+
| **Refactor** (`refactor:`, `refactor(scope):`) | Optional | Explain rationale and scope in PR description |
25+
| **Documentation** (`docs:`) | Not required | N/A |
26+
| **Infrastructure** (`ci:`, `build:`, `chore:`) | Optional | Link ADR or design doc if architecture impacted |
27+
1828
<!--
1929
Supported reference formats:
2030
- Issues: "Closes #123", "Fixes #456", "Implements #789"
2131
- Requirements: "REQ-001", "DESIGN-002", "TASK-003"
2232
- Spec files: ".agents/specs/requirements/...", ".agents/planning/..."
2333
24-
If no specs exist, create one in .agents/planning/ before submitting.
34+
For feature PRs: Create spec in .agents/planning/ before submitting if none exists.
35+
For other PRs: Add references when traceability adds value.
2536
-->
2637

2738
## Changes

.github/workflows/ai-spec-validation.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Spec-to-Implementation Validation
22

33
# AI-powered requirements traceability using GitHub Copilot CLI
4+
45
# Verifies that PR changes implement requirements from linked specs
6+
57
# Warns if requirements are not covered by the implementation
68

79
on:
@@ -14,7 +16,7 @@ on:
1416
- 'scripts/**'
1517
- 'build/**'
1618
- '.claude/skills/**'
17-
19+
1820
permissions:
1921
contents: read
2022
pull-requests: write
@@ -224,6 +226,18 @@ jobs:
224226
| Link issues | ``Closes #123`` |
225227
| Reference spec files | ``.agents/specs/requirements/...`` |
226228
229+
**Spec Requirement by PR Type:**
230+
231+
| PR Type | Required? |
232+
|:--------|:----------|
233+
| Feature (``feat:``) | ✅ Required |
234+
| Bug fix (``fix:``) | Optional |
235+
| Refactor (``refactor:``) | Optional |
236+
| Documentation (``docs:``) | Not required |
237+
| Infrastructure (``ci:``, ``build:``, ``chore:``) | Optional |
238+
239+
See PR template for full guidance.
240+
227241
</details>
228242
229243
---

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ Agents violating these standards produce inconsistent, unprofessional output. Re
10831083
- Unresolved review threads (most common)
10841084
- Failing CI checks
10851085
- Missing required approvals
1086+
10861087
---
10871088

10881089
## Putting It All Together

CONTRIBUTING.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,30 @@ pwsh build/scripts/Invoke-PesterTests.ps1 -TestPath "./build/tests/Generate-Agen
283283

284284
## Pull Request Guidelines
285285

286-
1. **Template changes**: Always include both template and generated files
287-
2. **Validation**: Run `pwsh build/Generate-Agents.ps1 -Validate` before submitting
288-
3. **Tests**: Ensure all tests pass
289-
4. **Documentation**: Update relevant docs if adding new agents
290-
5. **Commit messages**: Use conventional commit format (e.g., `feat(agent):`, `fix(template):`)
286+
1. **Spec references**: Feature PRs (`feat:`) require spec references (issue, REQ-*, or `.agents/planning/` files)
287+
2. **Template changes**: Always include both template and generated files
288+
3. **Validation**: Run `pwsh build/Generate-Agents.ps1 -Validate` before submitting
289+
4. **Tests**: Ensure all tests pass
290+
5. **Documentation**: Update relevant docs if adding new agents
291+
6. **Commit messages**: Use conventional commit format (e.g., `feat(agent):`, `fix(template):`)
292+
293+
### Spec Reference Best Practices
294+
295+
For traceability and AI-assisted validation:
296+
297+
- **Features (`feat:`)**: Always link to an issue or create a planning document in `.agents/planning/` before submitting
298+
- **Bug fixes (`fix:`)**: Link to issue if it exists; for complex bugs, explain root cause
299+
- **Refactors (`refactor:`)**: Explain rationale and scope in PR description
300+
- **Documentation (`docs:`)**: Spec references not required
301+
- **Infrastructure (`ci:`, `build:`, `chore:`)**: Link to related infra/CI/tooling issue or spec; call out operational risk and rollback plan if applicable
302+
303+
Supported reference formats:
304+
305+
- Issue links: `Closes #123`, `Fixes #456`, `Implements #789`
306+
- Requirement IDs: `REQ-001`, `DESIGN-002`, `TASK-003`
307+
- Spec files: `.agents/specs/requirements/...`, `.agents/planning/...`
308+
309+
The AI Spec Validation workflow will check for these references on all PRs.
291310

292311
## Questions?
293312

0 commit comments

Comments
 (0)