get_role_transitions
Identify role transitions with recommendations, scores, and requirements to streamline workflow progression in AI-powered development teams.
Instructions
Gets available role transitions with recommendations, scores, and basic requirements for workflow progression.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fromRoleName | Yes | Current role name | |
| roleId | Yes | Role ID for transition context | |
| taskId | Yes | Task ID for transition context |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"fromRoleName": {
"description": "Current role name",
"enum": [
"boomerang",
"researcher",
"architect",
"senior-developer",
"code-review"
],
"type": "string"
},
"roleId": {
"description": "Role ID for transition context",
"type": "string"
},
"taskId": {
"description": "Task ID for transition context",
"type": "number"
}
},
"required": [
"fromRoleName",
"taskId",
"roleId"
],
"type": "object"
}
Implementation Reference
- The main handler function that implements the get_role_transitions tool. It fetches available and recommended transitions, combines them with prioritization, and returns a minimal structured response or error.async getRoleTransitions(input: GetRoleTransitionsInput) { try { const context = { taskId: input.taskId.toString(), roleId: input.roleId, projectPath: process.cwd(), }; const [availableTransitions, recommendedTransitions] = await Promise.all([ this.roleTransitionService.getAvailableTransitions(input.fromRoleName), this.roleTransitionService.getRecommendedTransitions( input.fromRoleName, context, ), ]); // Combine and prioritize transitions to eliminate redundancy const recommendedIds = new Set(recommendedTransitions.map((t) => t.id)); const transitions = [ ...recommendedTransitions.map((t) => ({ transitionId: t.id, transitionName: t.transitionName, toRole: t.toRole.name, recommended: true, score: (t as any).recommendationScore || 0.95, })), ...availableTransitions .filter((t) => !recommendedIds.has(t.id)) .map((t) => ({ transitionId: t.id, transitionName: t.transitionName, toRole: t.toRole.name, recommended: false, score: 0.5, })), ]; return this.buildResponse({ transitions, }); } catch (error) { return this.buildErrorResponse( 'Failed to get role transitions', getErrorMessage(error), 'TRANSITION_QUERY_ERROR', ); } }
- Zod schema defining the input parameters for the get_role_transitions tool: fromRoleName (enum), taskId (number), roleId (string).const GetRoleTransitionsInputSchema = z.object({ fromRoleName: z .enum(['product-manager', 'architect', 'senior-developer', 'code-review']) .describe('Current role name'), taskId: z.number().describe('Task ID for transition context'), roleId: z.string().describe('Role ID for transition context'), });
- Registers the get_role_transitions tool using the @Tool decorator, providing the name, description, and input schema.@Tool({ name: 'get_role_transitions', description: `Gets available role transitions with recommendations, scores, and basic requirements for workflow progression.`, parameters: GetRoleTransitionsInputSchema as ZodSchema<GetRoleTransitionsInput>, })