Plan: Rebrand /agent → /agentsde + New Directives#
Summary#
Update directive detection regex in GitHubAdapter to recognize /agentsde as primary prefix while preserving /agent as backward-compatible fallback. Add two new PR-scoped directives (discuss, fix this) to ALLOWED_DIRECTIVES and wire handlers in DirectiveService and PhaseRouterService. Update all references in AGENTS.md, skill docs, and feedback comment strings.
Files#
| File | Action | Description |
|---|---|---|
src/webhook/adapters/github.adapter.ts | modify | Update 3 regex patterns to match both /agentsde and /agent; update handlePullRequestReviewComment and handlePRConversationComment to also detect /agentsde directives without requiring @mention |
src/directive/dto/directive.dto.ts | modify | Add discuss and fix-this to ALLOWED_DIRECTIVES |
src/directive/directive.service.ts | modify | Add discuss and fix-this handlers in applyDirective() |
src/phase-router/phase-router.service.ts | modify | Update VALID_DIRECTIVES list, update extractDirectiveValue() regex to match /agentsde, add routing for discuss/fix-this event types |
src/internal-adapter/internal-adapter.service.ts | modify | Update inline doc comments referencing /agent to /agentsde |
src/webhook/adapters/github.adapter.spec.ts | modify | Add tests for /agentsde prefix detection, backward compat, and new directive extraction |
src/directive/directive.service.spec.ts | modify | Add tests for discuss and fix-this directive handlers |
src/phase-router/phase-router.service.spec.ts | modify | Add tests for /agentsde directive extraction and new directive routing |
AGENTS.md | modify | Update all /agent references to /agentsde (keep /agent noted as legacy fallback) |
.claude/skills/plan-and-propose/SKILL.md | modify | Update /agent references to /agentsde |
.claude/skills/README.md | modify | Update /agent references to /agentsde |
Steps#
- S1: Update regex patterns in GitHubAdapter — Change
hasAgentDirective()regex to/^\/agentsde(?:\s|$)|^\/agent(?:\s|$)/m, updateextractDirectiveFromBody()to/^\/agent(?:sde)?\s+(\S+)/m, updateextractDirectiveValue()in PhaseRouterService similarly. UpdatehandlePullRequestReviewComment()to accept/agentsdedirectives without requiring@mention(same ashandlePRConversationCommentpattern). Update reason strings from/agentto/agentsde. - S2: Add new directives to DTO and service — Add
discussandfix-thistoALLOWED_DIRECTIVESindirective.dto.ts. Add handler branches inDirectiveService.applyDirective()that post a GitHub feedback comment acknowledging the directive and dispatch the appropriate skill. Adddiscussandfix-thistoVALID_DIRECTIVESinPhaseRouterService. Wire routing inPhaseRouterService.route()for the new directive types. - S3: Update documentation and skill refs — Replace
/agentwith/agentsdein AGENTS.md,.claude/skills/plan-and-propose/SKILL.md,.claude/skills/README.md, and inline code comments ininternal-adapter.service.ts. Note/agentas legacy fallback in AGENTS.md. - S4: Add/update unit tests — Add spec cases in
github.adapter.spec.tsfor/agentsdedetection, backward compat/agent, and new directives. Add spec cases indirective.service.spec.tsfordiscuss/fix-this. Updatephase-router.service.spec.tsfor/agentsdeextraction. Runnpm run testandnpm run lint.
Verification#
npm run testpasses with new and existing testsnpm run lintpasses with zero warnings/agentsde approveand/agent approveboth parse correctly in unit tests
Risks#
- Regex precedence:
/agentsdemust be checked before/agentin alternation to avoid partial match. Mitigation: use/^\/agent(?:sde)?(?:\s|$)/mpattern that matches both. fix thisis two words: The currentextractDirectiveValue()only captures(\S+)(one token). Need to handlefix thisasfix-this(hyphenated) or extend regex to capture multi-word directives. Recommend usingfix-thisas the canonical directive name for consistency withskip-quality-gate.