-
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
agent-criticPlan validation agentPlan validation agentagent-orchestratorTask coordination agentTask coordination agentagent-qaTesting and verification agentTesting and verification agentagent-retrospectiveLearning extraction agentLearning extraction agentarea-infrastructureBuild, CI/CD, configurationBuild, CI/CD, configurationarea-promptsAgent prompts and templatesAgent prompts and templatesarea-skillsSkills documentation and patternsSkills documentation and patternsarea-workflowsGitHub Actions workflowsGitHub Actions workflowsdocumentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestgateRouting-level enforcement gate (ADR-033)Routing-level enforcement gate (ADR-033)priority:P1Important: Affects user experience significantly, high business valueImportant: Affects user experience significantly, high business valueskill-conversionAgent to skill conversion workAgent to skill conversion worktaskTask-level work item under a storyTask-level work item under a story
Milestone
Description
Summary
Add a routing-level enforcement gate (per ADR-033) that forces invocation of the retrospective agent at session end, milestones, and significant events.
Parent Story
#615 (Phase 2: SHOULD Skills)
Why Gate, Not Skill
| Aspect | Skill Approach | Gate + Agent Approach |
|---|---|---|
| Problem addressed | Format inconsistency | Retrospective gets skipped entirely |
| Root cause | Format drift | Protocol bypass under pressure |
| Evidence | Some retros missing phases | PR #226: No retro despite major failure |
| ADR-033 alignment | Wrong layer (skill-internal) | Correct layer (routing-level) |
The retrospective agent already works well when invoked. The failure mode is:
Retrospective doesn't happen at all - not that it happens poorly.
This is exactly the ADR-033 "Do Router" pattern:
"Over-routing is cheap. Under-routing compounds."
Gate Specification
Trigger Conditions
| Trigger | Detection | Gate Action |
|---|---|---|
| Session end | git push after session work |
Block until retrospective section exists |
| Milestone completion | PR merge to main | Block until retrospective for milestone |
| Significant event | Major failure detected | Force retrospective routing |
Implementation
Add to Invoke-RoutingGates.ps1:
# Gate: Session End Retrospective
$SessionEndTriggers = @("git push")
$RequiresRetrospective = $SessionEndTriggers | Where-Object { $Command -like "*$_*" }
if ($RequiresRetrospective) {
$SessionLog = Get-TodaySessionLog
if ($SessionLog) {
$Content = Get-Content $SessionLog.FullName -Raw
# Check for retrospective section OR retrospective file reference
$HasRetrospective = $Content -match "## Retrospective" -or
$Content -match "\.agents/retrospective/"
if (-not $HasRetrospective) {
$Output = @{
decision = "deny"
reason = @"
RETROSPECTIVE GATE: Session retrospective required before push.
Run: Task(subagent_type='retrospective', prompt='Analyze this session for learnings')
Or document retrospective in session log with ## Retrospective section.
"@
}
$Output | ConvertTo-Json -Compress
exit 0
}
}
}Gate Bypass Conditions
Allow bypass when:
- Session is documentation-only (no code changes)
- Session is trivial (<10 minutes, single file change)
- Retrospective file already exists for today
# Check for existing retrospective file
$RetroDir = ".agents/retrospective"
$Today = Get-Date -Format "yyyy-MM-dd"
$ExistingRetro = Get-ChildItem -Path $RetroDir -Filter "$Today*.md" -ErrorAction SilentlyContinue
if ($ExistingRetro) {
# Retrospective already done today, allow push
exit 0
}Integration with ADR-033
This gate fits into the ADR-033 gate architecture:
flowchart TB
subgraph Gates["PreToolUse Hook Layer"]
G1["Gate: Session Protocol"]
G2["Gate: QA Validation"]
G3["Gate: Critic Review"]
G4["Gate: ADR Existence"]
G5["Gate: Retrospective"]
end
G5 -->|"git push"| Check{Retrospective exists?}
Check -->|Yes| Allow[Allow push]
Check -->|No| Block["Block + suggest retrospective agent"]
Acceptance Criteria
- Gate added to
Invoke-RoutingGates.ps1 - Triggers on
git pushcommands - Checks for retrospective section in session log OR retrospective file
- Provides clear guidance message when blocked
- Bypass logic for trivial sessions
- Integration tested with deliberate violation
Definition of Done
- Gate implemented in PowerShell (per ADR-005)
- Hook configuration updated in
.claude/settings.local.json - Gate documented in ADR-033 Implementation Notes
- Test: Attempt
git pushwithout retrospective → blocked - Test: Attempt
git pushwith retrospective → allowed
Relationship to Retrospective Agent
The retrospective AGENT remains unchanged:
- 6-phase workflow (Data Gathering → Insights → Diagnosis → Decide → Extract → Close)
- Five Whys, Fishbone, Force Field analysis
- Atomicity scoring, SMART validation
- Structured handoff output
This gate ENFORCES that the agent gets invoked, not changes what it does.
References
- ADR-033: Routing-Level Enforcement Gates
- Retrospective agent:
src/claude/retrospective.md - Real retrospectives:
.agents/retrospective/ - PR feat(workflows): add static PR and issue labeling workflows #226 failure: Retrospective skipped despite major process failure
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agent-criticPlan validation agentPlan validation agentagent-orchestratorTask coordination agentTask coordination agentagent-qaTesting and verification agentTesting and verification agentagent-retrospectiveLearning extraction agentLearning extraction agentarea-infrastructureBuild, CI/CD, configurationBuild, CI/CD, configurationarea-promptsAgent prompts and templatesAgent prompts and templatesarea-skillsSkills documentation and patternsSkills documentation and patternsarea-workflowsGitHub Actions workflowsGitHub Actions workflowsdocumentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestgateRouting-level enforcement gate (ADR-033)Routing-level enforcement gate (ADR-033)priority:P1Important: Affects user experience significantly, high business valueImportant: Affects user experience significantly, high business valueskill-conversionAgent to skill conversion workAgent to skill conversion worktaskTask-level work item under a storyTask-level work item under a story