Commit af97fdc
feat(prompts): add context-aware evaluation to AI Quality Gate prompts (#466)
* feat(prompts): add context-aware evaluation to QA quality gate
Apply prompt engineering patterns to reduce false positives:
- PR Type Detection: CODE/WORKFLOW/CONFIG/DOCS/MIXED categories
- Expected Patterns: normalize test files, generated files, vendor code
- Context-Aware CRITICAL_FAIL: different thresholds by PR type
- Evidence Standards: replace negative "Anti-Leniency" with affirmative
Docs-only PRs now correctly PASS without requiring test coverage.
Addresses #357
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(prompts): add context-aware evaluation to security quality gate
Apply prompt engineering patterns to reduce false positives:
- PR Type Detection: CODE/WORKFLOW/PROMPT/CONFIG/DOCS categories
- Expected Patterns: example API keys, test fixtures, env templates
- Context-Aware CRITICAL_FAIL: docs-only PRs exempt from security review
Prevents flagging placeholder credentials in documentation.
Addresses #357
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(prompts): add context-aware evaluation to devops quality gate
Apply prompt engineering patterns to reduce false positives:
- PR Scope Detection: WORKFLOW/ACTION/SCRIPT/TEMPLATE/CODE/DOCS/CONFIG
- Expected Patterns: ubuntu-latest, tag-pinned trusted actions, no caching
- Context-Aware CRITICAL_FAIL: different thresholds by file category
Templates and docs-only PRs now correctly PASS without CI/CD review.
Addresses #357
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(agents): optimize orchestrator prompts with reliability principles
Apply prompt engineering patterns across all orchestrator variants:
Triage improvements:
- Minimum agent sequences per task type (CODE requires 4 agents)
- Paths requiring security agent (.github/workflows, actions, prompts)
- Early exit conditions for simple tasks
Behavioral improvements:
- Affirmative Directives: replace FORBIDDEN with "Delegate to" tables
- Error Normalization: expected orchestration scenarios
- Contrastive Examples: CORRECT/INCORRECT demonstrations
- Reliability Principles: Delegation > Memory, Freshness First, Plan Before Execute
Files updated:
- .claude/agents/orchestrator.md
- templates/agents/orchestrator.shared.md
- src/copilot-cli/orchestrator.agent.md
- src/vs-code-agents/orchestrator.agent.md
Addresses #357
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore(lint): allow example HTML element in markdown
Add <example> to allowed inline HTML elements for prompt engineering
contrastive examples pattern (CORRECT/INCORRECT demonstrations).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test(quality-gate): add Pester regression test suite for prompt validation
Comprehensive test suite with 84 tests covering:
- File category classification (CODE, DOCS, WORKFLOW, PROMPT, etc.)
- PR type detection (single-type vs MIXED)
- DOCS-only handling exemptions across all three gates
- Expected patterns (false positive prevention)
- CRITICAL_FAIL triggers by PR type
- Cross-prompt consistency validation
Implements Issue #357 Phase 3 verification infrastructure.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(planning): add PRD, ADR, and RCA for Issue #357
- PRD-quality-gate-prompt-refinement.md: Implementation summary
- ADR-021-quality-gate-prompt-testing.md: Test suite requirements
- 003-quality-gate-comment-caching-rca.md: Root cause analysis
Captures design decisions and artifacts for Phase 3 (prompt refinement).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(adr): complete multi-agent review of ADR-021
ADR-021 revised based on 6-agent debate:
- Added Considered Options (3 alternatives)
- Added Decision Outcome with structured justification
- Added Confirmation and Reversibility sections
- Added Out of Scope section for runtime testing
- Renamed to "Structural Validation" (not "regression prevention")
- Added critical Limitations section
Multi-agent consensus: Structural tests reduce regression risk but
do NOT validate runtime AI interpretation.
Artifacts:
- ADR-021-debate-log.md: Review summary
- ADR-021-related-work-research.md: Issue/PR context
- ADR-021-quality-gate-prompt-testing-critique.md: Critic analysis
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(analysis): add adr-review auto-trigger fix analysis
Identifies why ADR-021 wasn't automatically reviewed:
- Architect handoff protocol lacks MANDATORY routing signal
- Orchestrator has no enforcement logic for ADR detection
- adr-review skill uses aspirational vs imperative language
Proposes 4 changes:
1. Architect: Add BLOCKING gate when ADR created
2. Orchestrator: Add ADR Review Enforcement section
3. AGENTS.md: Add global ADR Review Requirement
4. adr-review SKILL.md: Replace with MANDATORY enforcement
This is a follow-up improvement, not blocking for Issue #357.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(session): add Session 91 artifacts and retrospective
Session 91 completion for Issue #357 quality gate prompt refinement:
- Session log with Working Backwards format
- Retrospective with 6 extracted skills
- Serena memories for cross-session context
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(adr): rename ADR-021 to ADR-023 (resolve number collision)
ADR-021 was already used for Model Routing Policy from Session 86.
Renaming quality gate prompt testing ADR to ADR-023.
Renamed files:
- ADR-021-quality-gate-prompt-testing.md -> ADR-023-*
- ADR-021-debate-log.md -> ADR-023-*
- ADR-021-related-work-research.md -> ADR-023-*
- ADR-021-quality-gate-prompt-testing-critique.md -> ADR-023-*
Updated references in PRD and session log.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(skills): add ADR renumbering and template-first patterns to merge-resolver
Add three new conflict resolution patterns based on Session 92 learnings:
1. Numbered Documentation Conflicts (ADR, RFC)
- Detect ADR number collisions during rebase
- Renumber incoming ADR to next available
- Update all cross-references
2. Template-Generated File Conflicts
- Identify generated vs source files
- Resolve in template, regenerate outputs
- Anti-pattern warning for direct edits
3. Rebase Add/Add Conflicts
- Per-commit resolution during rebase
- REBASE_HEAD vs HEAD comparison
- Common scenario resolution table
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(retrospective): extract learnings from Session 92 and PR #466
## Session 93: Retrospective Analysis
Analyzed Session 92 (ADR review auto-trigger fix) and PR #466 (ADR renumbering)
using structured retrospective framework (5 phases).
## Learnings Extracted
### New Skills (ADD)
1. **Skill-Architecture-016: ADR Number Check**
- Statement: Check existing ADR numbers before creating to prevent parallel branch collisions
- Atomicity: 92%
- Evidence: ADR-021 collision (Session 86 in main, Session 91 in PR branch)
- Command: `ls .agents/architecture/ADR-*.md | sort -t- -k2 -n | tail -5`
2. **Skill-Documentation-008: Framework Constraints**
- Statement: Add Framework Limitations section to SKILL.md files
- Atomicity: 88%
- Evidence: adr-review skill claimed automatic trigger but required manual BLOCKING gate
- Why: Claude Code skills are pull-based (explicit invocation), not push-based (automatic)
### Memory Updates (UPDATE)
3. **architecture-template-variant-maintenance**
- Added verification step after Generate-Agents.ps1 execution
- Prevents template drift and ensures proper regeneration
4. **protocol-blocking-gates**
- Added adr-review auto-trigger validation
- Demonstrates BLOCKING gate pattern reusability (session-end → adr-review)
## Key Insights
### Five Whys: ADR Number Collision
- Root Cause: No atomic numbering mechanism + parallel branch development
- Actionable Fix: Pre-creation check command
### Pattern Analysis
- BLOCKING gates achieve 100% compliance (proven in session-end and adr-review)
- Sequential numbering fails during parallel branch work
- Framework limitations require explicit enforcement, not aspirational documentation
### Success Metrics
- 100% success rate across all Session 92 executions
- 2 novel skills added (atomicity >= 88%)
- 2 existing memories enriched with validation data
- ROTI: 3/4 (high return) - 60 min investment prevents 90+ min rework
## Files Changed
- New: skill-architecture-016-adr-number-check.md
- New: skill-documentation-008-framework-constraints.md
- Updated: skills-architecture-index.md
- Updated: skills-documentation-index.md
- Updated: architecture-template-variant-maintenance.md
- Updated: protocol-blocking-gates.md
- New: sessions/2025-12-27-session-93-retrospective-session-92-pr-466.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(agents): document source/install relationship, improve orchestrator
## Documentation Updates
- Add Source vs Installation Relationship section to src/claude/AGENTS.md
- Add Platform Generation vs Claude Installation section to templates/AGENTS.md
- Clarify that src/claude/ is hand-maintained, .claude/agents/ is installed
## Orchestrator Improvements
- Add "First Step: Triage Before Orchestrating" section
- Replace "Productive Behaviors" with "Reliability Principles" + "Execution Style"
- Modernize "Sub-Agent Delegation" with table format
- Add "Expected Orchestration Scenarios" section
- Preserve ADR Review Enforcement blocking gate
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore(claude-agents): Update Claude installation
* chore(copilot-agents): Update Copilot agent installation
* fix(tests): address Gemini review comments on QualityGatePrompts.Tests.ps1
## Changes
- Add [CmdletBinding()] to all helper functions per style guide
- Fix Get-FileCategory logic to align with prompt definitions:
- Add SCRIPT category for *.ps1 in scripts/
- Exclude .github/*.md from DOCS (now OTHER)
- Match ACTION only for action.yml files
- Update tests to handle new SCRIPT category
- Add SCRIPT-only PR detection test
Resolves: gemini-code-assist review threads
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(ci): resolve session protocol and markdown lint violations
- Add language specifiers to code blocks in prompt-builder.md (MD040)
- Update session log checklist to reflect completed validation
Addresses CI failures:
- Session Protocol CRITICAL_FAIL (markdown lint pending)
- 87 Pester tests passing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: rjmurillo[bot] <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 321cc6b commit af97fdc
File tree
63 files changed
+16669
-9001
lines changed- .agents
- analysis
- architecture
- critique
- planning
- retrospective
- sessions
- .claude
- agents
- commands
- skills/merge-resolver
- references
- .github
- agents
- prompts
- .serena/memories
- src
- claude
- copilot-cli
- vs-code-agents
- templates
- agents
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
63 files changed
+16669
-9001
lines changedLines changed: 391 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
0 commit comments