feat(agents): implement Phase 2 consistency fixes for cross-document validation#49
Merged
Merged
Conversation
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remediate CodeRabbit PR #43 findings
feat(agents): implement Phase 2 consistency fixes for cross-document validation
Dec 16, 2025
rjmurillo
requested changes
Dec 16, 2025
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
rjmurillo
reviewed
Dec 16, 2025
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements Phase 2 consistency fixes for cross-document validation across agent planning artifacts. The changes address systemic issues identified in a previous CodeRabbit review by adding validation protocols to prevent estimate divergence and orphan conditions. Notably, the PR also corrects a workflow issue where changes were initially made only to Claude agents without updating the shared templates, demonstrating the importance of following the established agent generation workflow.
Key Changes
- Added Estimate Reconciliation Protocol to task-generator agent with 10% threshold rule for detecting estimate drift between epics/PRDs and task breakdowns
- Added Escalation Prompt Completeness Requirements to critic agent ensuring verified facts are preserved with exact values during escalations
- Added Condition-to-Task Traceability to planner agent preventing orphan conditions by requiring task linkage in work breakdown tables
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
templates/agents/task-generator.shared.md |
Added estimate reconciliation protocol with 10% threshold rule and reconciliation process |
templates/agents/critic.shared.md |
Added escalation prompt requirements with verified facts table template |
templates/agents/planner.shared.md |
Added condition traceability requirements with work breakdown template |
src/vs-code-agents/task-generator.agent.md |
Generated agent file matching task-generator template changes |
src/vs-code-agents/critic.agent.md |
Generated agent file matching critic template changes |
src/vs-code-agents/planner.agent.md |
Generated agent file matching planner template changes |
src/copilot-cli/task-generator.agent.md |
Generated agent file matching task-generator template changes |
src/copilot-cli/critic.agent.md |
Generated agent file matching critic template changes |
src/copilot-cli/planner.agent.md |
Generated agent file matching planner template changes |
src/claude/task-generator.md |
Manually maintained Claude agent with estimate reconciliation protocol |
src/claude/critic.md |
Manually maintained Claude agent with escalation requirements |
src/claude/planner.md |
Manually maintained Claude agent with condition traceability |
build/scripts/Validate-PlanningArtifacts.ps1 |
New validation script for cross-document consistency (estimate divergence, orphan conditions) |
build/scripts/tests/Validate-PlanningArtifacts.Tests.ps1 |
Comprehensive Pester test suite with 17 tests covering validation scenarios |
.agents/skills/agent-generation-workflow.md |
Skill documentation capturing the agent generation workflow pattern |
.agents/retrospective/phase2-workflow-learnings.md |
Retrospective documenting workflow learnings from Phase 2 implementation |
.agents/planning/phase2-complete-handoff.md |
Handoff documentation for future agents continuing this work |
rjmurillo
approved these changes
Dec 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
✅ Phase 2 Complete: All 4 consistency fixes (P1) implemented with proper workflow
Changes
Workflow Correction
templates/agents/(the source of truth)Generate-Agents.ps1to regenerate platform-specific agentsP1-1: Critic Escalation Template
templates/agents/critic.shared.mdsrc/copilot-cli/critic.agent.md,src/vs-code-agents/critic.agent.mdP1-2: Task Generator Estimate Reconciliation
templates/agents/task-generator.shared.mdsrc/copilot-cli/task-generator.agent.md,src/vs-code-agents/task-generator.agent.mdP1-3: Planner Condition Traceability
templates/agents/planner.shared.mdsrc/copilot-cli/planner.agent.md,src/vs-code-agents/planner.agent.mdP1-4: Cross-Document Validation CI
build/scripts/Validate-PlanningArtifacts.ps1build/scripts/tests/Validate-PlanningArtifacts.Tests.ps1(17 tests passing).github/workflows/validate-planning-artifacts.ymlfor CI.githooks/pre-commitHandoff Artifacts
.agents/retrospective/phase2-workflow-learnings.md- Workflow learnings.agents/planning/phase2-complete-handoff.md- Handoff for future agents.agents/skills/agent-generation-workflow.md- Skill entry for agent workflowVerification
Checklist
Original prompt
This section details on the original issue you should resolve
<issue_title>Agent Quality: Remediate CodeRabbit PR #43 Findings (7 Issues, 15 Agent Gaps)</issue_title>
<issue_description>## Summary
CodeRabbit review of PR #43 (feat/templates) identified 7 issues stemming from 5 systemic patterns and 15 agent capability gaps across 9 agents. This issue tracks remediation across 4 workstreams with ~17.5 hours total effort.
Root Cause Analysis
Systemic Patterns Identified
Phase 1: Critical Fixes (P0) - Immediate
Effort: 5 hours
src/claude/explainer.mdwith path normalization requirements[A-Z]:\|\/Users\/|\/home\/src/claude/security.mdwith post-implementation verificationsrc/claude/implementer.mdwith security flagging protocolbuild/Validate-PathNormalization.ps1.github/workflows/validate-paths.ymlPhase 2: Consistency Fixes (P1) - Next PR
Effort: 6.5 hours
src/claude/critic.mdwith escalation templatesrc/claude/task-generator.mdwith estimate reconciliationsrc/claude/planner.mdwith condition traceabilitybuild/Validate-PlanningArtifacts.ps1Phase 3: Process Improvements (P2) - Within 2 Weeks
Effort: 4 hours
src/claude/roadmap.mdwith naming conventionsEPIC-NNN-[name].mdpatternsrc/claude/memory.mdwith freshness protocolsrc/claude/orchestrator.mdwith consistency checkpoint.agents/governance/naming-conventions.md.agents/governance/consistency-protocol.mdPhase 4: Polish (P3) - As Capacity Allows
Effort: 2 hours
CLAUDE.mdwith naming referenceSkills to Extract (After Completion)
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Note
Implements Phase 2 consistency fixes by updating shared agent templates and regenerating platform agents, adds a planning-artifact validation script with tests, and includes handoff/retrospective documentation.
templates/agents/critic.shared.md): Add Escalation Prompt Completeness Requirements with Verified Facts table and anti-pattern; propagate tosrc/copilot-cli/critic.agent.md,src/vs-code-agents/critic.agent.md.templates/agents/task-generator.shared.md): Add 10% estimate divergence rule, reconciliation process and output template; update handoff steps; propagate tosrc/copilot-cli/task-generator.agent.md,src/vs-code-agents/task-generator.agent.md.templates/agents/planner.shared.md): Add Condition-to-Task Traceability with Work Breakdown "Conditions" column, checklist, and anti-pattern; propagate tosrc/copilot-cli/planner.agent.md,src/vs-code-agents/planner.agent.md.build/scripts/Validate-PlanningArtifacts.ps1to check estimate consistency, orphan conditions, and document structure; configurable thresholds/exit behavior.build/scripts/tests/Validate-PlanningArtifacts.Tests.ps1(17 tests)..agents/planning/phase2-complete-handoff.md..agents/retrospective/phase2-workflow-learnings.md..agents/skills/agent-generation-workflow.md(workflow: templates → generate → verify).Written by Cursor Bugbot for commit a17c39c. This will update automatically on new commits. Configure here.