AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-534
  5. plan
  6. context.json
context.json(6.1 KB)· Apr 16, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "534",
    "title": "Rebrand /agent directive prefix to /agentsde and extend directive support",
    "created_at": "2026-04-16T12:00:00Z"
  },
  "inputs": [
    {
      "name": "GitHub Issue #534",
      "type": "context",
      "ref": "https://github.com/AgentSDE/agent-core/issues/534",
      "notes": "Rebrand /agent → /agentsde, add discuss + fix-this directives"
    },
    {
      "name": "AGENTS.md",
      "type": "context",
      "ref": "AGENTS.md",
      "notes": "Codebase knowledge — directive system docs, testing conventions"
    },
    {
      "name": "GitHubAdapter source",
      "type": "file",
      "ref": "src/webhook/adapters/github.adapter.ts",
      "notes": "3 regex patterns, PR review comment handler, PR conversation handler"
    },
    {
      "name": "Directive DTO",
      "type": "file",
      "ref": "src/directive/dto/directive.dto.ts",
      "notes": "ALLOWED_DIRECTIVES const, DirectiveValue type"
    },
    {
      "name": "DirectiveService",
      "type": "file",
      "ref": "src/directive/directive.service.ts",
      "notes": "applyDirective() switch — needs discuss + fix-this branches"
    },
    {
      "name": "PhaseRouterService",
      "type": "file",
      "ref": "src/phase-router/phase-router.service.ts",
      "notes": "VALID_DIRECTIVES, extractDirectiveValue() regex, route()"
    }
  ],
  "outputs": [
    {
      "name": "plan.md",
      "type": "plan",
      "format": "md",
      "content": "See plan.md"
    }
  ],
  "files": [
    {
      "path": "src/webhook/adapters/github.adapter.ts",
      "action": "modify",
      "reason": "Update 3 regex patterns to match /agentsde + /agent; update PR review comment handler to accept /agentsde directives standalone"
    },
    {
      "path": "src/directive/dto/directive.dto.ts",
      "action": "modify",
      "reason": "Add discuss and fix-this to ALLOWED_DIRECTIVES"
    },
    {
      "path": "src/directive/directive.service.ts",
      "action": "modify",
      "reason": "Add discuss and fix-this handler branches in applyDirective()"
    },
    {
      "path": "src/phase-router/phase-router.service.ts",
      "action": "modify",
      "reason": "Update VALID_DIRECTIVES, extractDirectiveValue() regex, route() for new directives"
    },
    {
      "path": "src/internal-adapter/internal-adapter.service.ts",
      "action": "modify",
      "reason": "Update inline doc comments from /agent to /agentsde"
    },
    {
      "path": "src/webhook/adapters/github.adapter.spec.ts",
      "action": "modify",
      "reason": "Add tests for /agentsde regex, backward compat, new directives"
    },
    {
      "path": "src/directive/directive.service.spec.ts",
      "action": "modify",
      "reason": "Add tests for discuss and fix-this directive handlers"
    },
    {
      "path": "src/phase-router/phase-router.service.spec.ts",
      "action": "modify",
      "reason": "Add tests for /agentsde extraction and new directive routing"
    },
    {
      "path": "AGENTS.md",
      "action": "modify",
      "reason": "Update /agent references to /agentsde with legacy fallback note"
    },
    {
      "path": ".claude/skills/plan-and-propose/SKILL.md",
      "action": "modify",
      "reason": "Update /agent references to /agentsde"
    },
    {
      "path": ".claude/skills/README.md",
      "action": "modify",
      "reason": "Update /agent references to /agentsde"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Update regex patterns in GitHubAdapter and PhaseRouterService to recognize /agentsde (primary) and /agent (legacy fallback)",
      "acceptance": [
        "hasAgentDirective() matches both /agentsde and /agent at line start",
        "extractDirectiveFromBody() extracts directive value from both prefixes",
        "extractDirectiveValue() in PhaseRouterService parses both prefixes",
        "handlePullRequestReviewComment() accepts /agentsde directives without @mention",
        "Reason strings updated to reference /agentsde"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Add discuss and fix-this directives to DTO, DirectiveService, and PhaseRouterService",
      "acceptance": [
        "discuss and fix-this added to ALLOWED_DIRECTIVES in directive.dto.ts",
        "DirectiveService.applyDirective() handles discuss and fix-this with GitHub feedback comments",
        "VALID_DIRECTIVES in PhaseRouterService includes discuss and fix-this",
        "PhaseRouterService.route() dispatches discuss and fix-this correctly"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Update documentation: AGENTS.md, skill docs, and inline code comments",
      "acceptance": [
        "AGENTS.md references /agentsde as primary with /agent as noted legacy fallback",
        "Skill docs updated to /agentsde",
        "Inline comments in internal-adapter.service.ts updated"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S4",
      "summary": "Add and update unit tests for all changes",
      "acceptance": [
        "github.adapter.spec.ts covers /agentsde detection, /agent backward compat, PR review comment /agentsde directive",
        "directive.service.spec.ts covers discuss and fix-this handlers",
        "phase-router.service.spec.ts covers /agentsde extraction",
        "npm run test passes",
        "npm run lint passes with zero warnings"
      ],
      "depends_on": [
        "S1",
        "S2"
      ]
    }
  ],
  "risks": [
    {
      "risk": "Regex precedence: /agentsde must match before /agent to avoid partial capture",
      "mitigation": "Use /^\\/agent(?:sde)?(?:\\s|$)/m — greedy match handles both"
    },
    {
      "risk": "fix this is two words but extractDirectiveValue captures single token",
      "mitigation": "Use fix-this (hyphenated) as canonical name, consistent with skip-quality-gate pattern"
    }
  ],
  "assumptions": [
    "E2E test updates in agent-core-e2e will be handled in a separate PR/issue — this plan covers agent-core only",
    "fix-this (hyphenated) is acceptable vs the two-word fix this from the issue — parsing simplicity outweighs exact phrasing",
    "discuss directive posts a reply comment and dispatches the reply-to-pr-comment or reply-to-issue-comment skill",
    "fix-this directive dispatches the address-review or implement-code skill for the relevant file/line context"
  ],
  "open_questions": [
    "Should /agentsde fix this (two words) also be supported alongside /agentsde fix-this? This would require extending the directive regex to capture multi-word tokens.",
    "What skill should discuss dispatch — reply-to-pr-comment, reply-to-issue-comment, or a new discuss skill?"
  ]
}
Plan