AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-534
  5. plan
  6. plan.md
plan.md(4.2 KB)· Apr 16, 2026· 3 min read
  • Summary
  • Files
  • Steps
  • Verification
  • Risks

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#

FileActionDescription
src/webhook/adapters/github.adapter.tsmodifyUpdate 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.tsmodifyAdd discuss and fix-this to ALLOWED_DIRECTIVES
src/directive/directive.service.tsmodifyAdd discuss and fix-this handlers in applyDirective()
src/phase-router/phase-router.service.tsmodifyUpdate VALID_DIRECTIVES list, update extractDirectiveValue() regex to match /agentsde, add routing for discuss/fix-this event types
src/internal-adapter/internal-adapter.service.tsmodifyUpdate inline doc comments referencing /agent to /agentsde
src/webhook/adapters/github.adapter.spec.tsmodifyAdd tests for /agentsde prefix detection, backward compat, and new directive extraction
src/directive/directive.service.spec.tsmodifyAdd tests for discuss and fix-this directive handlers
src/phase-router/phase-router.service.spec.tsmodifyAdd tests for /agentsde directive extraction and new directive routing
AGENTS.mdmodifyUpdate all /agent references to /agentsde (keep /agent noted as legacy fallback)
.claude/skills/plan-and-propose/SKILL.mdmodifyUpdate /agent references to /agentsde
.claude/skills/README.mdmodifyUpdate /agent references to /agentsde

Steps#

  1. S1: Update regex patterns in GitHubAdapter — Change hasAgentDirective() regex to /^\/agentsde(?:\s|$)|^\/agent(?:\s|$)/m, update extractDirectiveFromBody() to /^\/agent(?:sde)?\s+(\S+)/m, update extractDirectiveValue() in PhaseRouterService similarly. Update handlePullRequestReviewComment() to accept /agentsde directives without requiring @mention (same as handlePRConversationComment pattern). Update reason strings from /agent to /agentsde.
  2. S2: Add new directives to DTO and service — Add discuss and fix-this to ALLOWED_DIRECTIVES in directive.dto.ts. Add handler branches in DirectiveService.applyDirective() that post a GitHub feedback comment acknowledging the directive and dispatch the appropriate skill. Add discuss and fix-this to VALID_DIRECTIVES in PhaseRouterService. Wire routing in PhaseRouterService.route() for the new directive types.
  3. S3: Update documentation and skill refs — Replace /agent with /agentsde in AGENTS.md, .claude/skills/plan-and-propose/SKILL.md, .claude/skills/README.md, and inline code comments in internal-adapter.service.ts. Note /agent as legacy fallback in AGENTS.md.
  4. S4: Add/update unit tests — Add spec cases in github.adapter.spec.ts for /agentsde detection, backward compat /agent, and new directives. Add spec cases in directive.service.spec.ts for discuss/fix-this. Update phase-router.service.spec.ts for /agentsde extraction. Run npm run test and npm run lint.

Verification#

  • npm run test passes with new and existing tests
  • npm run lint passes with zero warnings
  • /agentsde approve and /agent approve both parse correctly in unit tests

Risks#

  • Regex precedence: /agentsde must be checked before /agent in alternation to avoid partial match. Mitigation: use /^\/agent(?:sde)?(?:\s|$)/m pattern that matches both.
  • fix this is two words: The current extractDirectiveValue() only captures (\S+) (one token). Need to handle fix this as fix-this (hyphenated) or extend regex to capture multi-word directives. Recommend using fix-this as the canonical directive name for consistency with skip-quality-gate.
ContextPrd