Phase 12c: Domain-aware /review-pr routing + domain label hook #102
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/claude-custom!102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "101-domain-aware-review-pr-routing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replace the static
/review-prskill (which forked to a deprecated generalist QA agent) with a smart domain-aware router. The skill now reads the PR's parent issue domain label and spawns the correct specialized QA agent (frontend-qa,dev-qa, ordevops-qa). Also adds a soft-warning hook that reminds users to include domain labels when creating issues.Changes
skills/review-pr/SKILL.md-- Removedcontext: fork,agent: qa, anddisable-model-invocation: true. Replaced with model-invoked 6-step routing instructions: parse argument, get PR, extract parent issue fromCloses #N, read domain labels, map to QA agent, spawn with minimal prompt. Handles edge cases (missing Closes ref, no domain label, unrecognized label, multiple Closes refs).hooks/check-domain-label.sh(new) -- PreToolUse hook on issue creation that warns (allow, not deny) when nodomain:label is mentioned. Fail-open on all errors. Advisory only for docs/meta issues.settings.json-- Wiredcheck-domain-label.shinto the existingcreate_issue|create_issue_and_branchmatcher.Test Plan
disable-model-invocation,context,agent) are removedcheck-domain-label.shis executable, passes bash syntax checksettings.jsonis valid JSON and the hook is properly wiredReview Checklist
disable-model-invocation,context: fork,agent: qaremovedargument-hintpreservedallownotdeny(soft warning)Related
plan-pal-e-agencyCloses #101
PR #102 Review
BLOCKERS
None.
NITS
BRE alternation in
check-domain-label.shline 27 -- inconsistent with repo convention. The hook usesgrep -qi 'domain:\(frontend\|backend\|devops\)'which is BRE (Basic Regular Expression) alternation syntax. Every other hook in this repo that needs alternation uses ERE via-Eflag (e.g.,check-pr-template.shusesgrep -qiE,check-agent-spawn.shusesgrep -qE). While BRE works in a non-interactive#!/bin/bashsubshell (aliases from the Archgrep->rgmapping do not apply), it is inconsistent. Recommend changing to:grep -qiE 'domain:(frontend|backend|devops)'.list_issuespagination gap in SKILL.md Step 3. The instruction says "Callmcp__forgejo__list_issueswith the same owner and repo. Find the issue matching the number from Step 2." Thelist_issuestool defaults to 20 results. If the parent issue is older or the repo has many open issues, it may not appear in the first page. Consider adding guidance to setlimithigher (e.g., 50) or to filter by state"all"(since the issue might already be closed if the PR was submitted after work completed). Thelist_issuestool also does not support filtering by issue number directly, so this is a known limitation, but the instructions should at least setstate: "all"and a reasonablelimit.SubagentStart context injection does not differentiate specialized QA agents. In
hooks/inject-subagent-context.sh(not part of this diff, but relevant), all QA variants (qa|frontend-qa|dev-qa|devops-qa) get the same context string pointing toagent-qa. The specialized agents have their own pal-e-docs profiles (agent-dev-qa,agent-devops-qa,agent-frontend-qa) referenced in their agent.mdfiles. The SubagentStart hook should ideally inject the correct profile slug per agent type. This is a pre-existing issue not introduced by this PR, but worth noting since this PR is the feature that makes these specializations matter for the first time.SKILL.md Step 6 spawn prompt may not satisfy spawn gate. The spawn gate (
check-agent-spawn.sh) requires QA agent prompts to match both an issue pattern (#[0-9]+|Issue|Forgejo issue) and a PR pattern (PR #[0-9]+|PR [0-9]+|Pull Request|pulls/[0-9]+). The template prompt in Step 6 is"Review PR #{pr_number} on {owner}/{repo}. Parent issue: #{issue_number}..."which includesPR #Nand#{issue_number}. ThePR #Nmatches the PR pattern, and#Nmatches the issue pattern. This should pass, but only if the interpolated values are actual numbers. Consider adding a note in Step 6 that the prompt MUST include both patterns to satisfy the spawn gate.SOP COMPLIANCE
101-domain-aware-review-pr-routingreferences issue #101plan-pal-e-agencyCloses #101present in PR bodyVERDICT: APPROVED
The three-file change is clean, well-scoped, and correctly wired. The SKILL.md routing logic is thorough with good edge case handling. The hook is properly fail-open (advisory only). The settings.json wiring is correct -- the new hook is appended to the existing
create_issue|create_issue_and_branchmatcher alongside the template check. All four nits are non-blocking improvements that can be addressed in a follow-up.