diff --git a/plugins/dev-team/.claude-plugin/plugin.json b/plugins/dev-team/.claude-plugin/plugin.json index 34817c6..2b086ea 100644 --- a/plugins/dev-team/.claude-plugin/plugin.json +++ b/plugins/dev-team/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "dev-team", - "version": "1.2.2", + "version": "1.2.3", "description": "Dev-team agent pipeline: researcher, developer, reviewer, and debugger agents for implementing Jira tasks and fixing GitHub issues.", "commands": "./commands" } diff --git a/plugins/dev-team/agents/task-runner.md b/plugins/dev-team/agents/task-runner.md index 65fbf5f..faa3cea 100644 --- a/plugins/dev-team/agents/task-runner.md +++ b/plugins/dev-team/agents/task-runner.md @@ -27,7 +27,8 @@ Parse the following fields from your prompt: - `agent` — sub-agent type to spawn via the `Agent` tool (used for display/logging in the context header only; does not affect routing or tool selection) -- `skill` — name of the skill the sub-agent should invoke +- `skill` — name of the skill the sub-agent should execute +- `plugin_root` — absolute path to the dev-team plugin directory (used to load skill files) - `context_file` — absolute path to the pipeline context file - `args` — (optional) positional arguments to present to the skill - `read_sections` — comma-separated list of section names to read from the context file @@ -40,30 +41,32 @@ Use the `Read` tool to read `context_file`. Extract the content of each section `read_sections`. A section begins at `` and ends at the next `", "", self.workspace_setup.strip()] + if self.debug_report: lines += ["", "", "", self.debug_report.strip()] @@ -308,6 +312,7 @@ def load(cls, path: Path) -> "PipelineContext": pass sections = _parse_sections(body) + ctx.workspace_setup = sections.get("Workspace Setup", "") ctx.debug_report = sections.get("Debug Report", "") ctx.brief = sections.get("Researcher Brief", "") @@ -502,6 +507,43 @@ def handle_results(self) -> str: ... +class SetupWorkspaceStep(Step): + handles = "setting-up" + _PENDING_KEY = "setup" + + def __init__(self, ctx: "PipelineContext", context_path: Path) -> None: + self._ctx = ctx + self._context_path = context_path + + def get_actions(self) -> list[dict]: + ctx = self._ctx + if ctx.workspace_setup: + return [] + return [{ + "action": "spawn_agent", + "message": f"Setting up workspace branch for {ctx.work_item_id}.", + "agent": "workspace-setup", + "skill": "workspace-setup", + "args": f"{ctx.work_item_id} {ctx.spec_path}", + "context_file": str(self._context_path), + "read_sections": [], + "write_section": "Workspace Setup", + "result_format": "setup_done | failed", + }] + + def handle_results(self) -> str: + ctx = self._ctx + if ctx.workspace_setup: + _handle_agent_success(ctx) + return "setup_done" + _handle_agent_failure(ctx) + _check_and_trigger_troubleshooter( + "consecutive_failures", CONSECUTIVE_FAILURES_THRESHOLD, + ctx.consecutive_failures, ctx, self._context_path, + ) + return "failed" + + class FindSpecStep(Step): handles = "spec-finding" @@ -1125,6 +1167,7 @@ def __init__( self.machine = StateMachine(workflow.transitions, initial=ctx.state) self.step_handlers: dict[str, Step] = { "spec-finding": FindSpecStep(ctx), + "setting-up": SetupWorkspaceStep(ctx, context_path), "debugging": DebugStep(ctx, context_path), "researching": ResearchStep(research_skill, ctx, context_path), "implementing": ImplementStep(ctx, context_path), diff --git a/plugins/dev-team/scripts/implement-task-plan.md b/plugins/dev-team/scripts/implement-task-plan.md index 5af8961..33774ea 100644 --- a/plugins/dev-team/scripts/implement-task-plan.md +++ b/plugins/dev-team/scripts/implement-task-plan.md @@ -2,7 +2,8 @@ stateDiagram-v2 [*] --> init init --> spec-finding : start - spec-finding --> researching : spec_found + spec-finding --> setting-up : spec_found + setting-up --> researching : setup_done researching --> implementing : research_done implementing --> validating : impl_done validating --> fixing : build_failed