From 0a7c1454d9960148fd80f47f16bab2f28e8226c7 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Fri, 30 Jan 2026 15:59:28 +0800 Subject: [PATCH] feat: add task JSON status update instructions to agents Add jq commands for agents to update task status lifecycle: - Step 0: Mark in_progress when starting - Task Completion: Mark completed when finishing --- .claude/agents/code-developer.md | 15 +++++++++++++-- .claude/agents/test-fix-agent.md | 12 ++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.claude/agents/code-developer.md b/.claude/agents/code-developer.md index a1273789..1d4bc1a6 100644 --- a/.claude/agents/code-developer.md +++ b/.claude/agents/code-developer.md @@ -26,6 +26,11 @@ You are a code execution specialist focused on implementing high-quality, produc ## Execution Process +### 0. Task Status: Mark In Progress +```bash +jq --arg ts "$(date -Iseconds)" '.status="in_progress" | .status_history += [{"from":.status,"to":"in_progress","changed_at":$ts}]' IMPL-X.json > tmp.json && mv tmp.json IMPL-X.json +``` + ### 1. Context Assessment **Input Sources**: - User-provided task description and context @@ -363,12 +368,18 @@ function buildCliCommand(task, cliTool, cliPrompt) { **Upon completing any task:** -1. **Verify Implementation**: +1. **Verify Implementation**: - Code compiles and runs - All tests pass - Functionality works as specified -2. **Update TODO List**: +2. **Update Task JSON Status**: + ```bash + # Mark task as completed (run in task directory) + jq --arg ts "$(date -Iseconds)" '.status="completed" | .status_history += [{"from":"in_progress","to":"completed","changed_at":$ts}]' IMPL-X.json > tmp.json && mv tmp.json IMPL-X.json + ``` + +3. **Update TODO List**: - Update TODO_LIST.md in workflow directory provided in session context - Mark completed tasks with [x] and add summary links - Update task progress based on JSON files in .task/ directory diff --git a/.claude/agents/test-fix-agent.md b/.claude/agents/test-fix-agent.md index addd7a0d..0c770fdb 100644 --- a/.claude/agents/test-fix-agent.md +++ b/.claude/agents/test-fix-agent.md @@ -51,6 +51,11 @@ You will execute tests across multiple layers, analyze failures with layer-speci ## Execution Process +### 0. Task Status: Mark In Progress +```bash +jq --arg ts "$(date -Iseconds)" '.status="in_progress" | .status_history += [{"from":.status,"to":"in_progress","changed_at":$ts}]' IMPL-X.json > tmp.json && mv tmp.json IMPL-X.json +``` + ### Flow Control Execution When task JSON contains `flow_control` field, execute preparation and implementation steps systematically. @@ -329,6 +334,13 @@ When generating test results for orchestrator (saved to `.process/test-results.j - Pass rate >= 95% + any "high" or "medium" criticality failures → ⚠️ NEEDS FIX (continue iteration) - Pass rate < 95% → ❌ FAILED (continue iteration or abort) +## Task Status Update + +**Upon task completion**, update task JSON status: +```bash +jq --arg ts "$(date -Iseconds)" '.status="completed" | .status_history += [{"from":"in_progress","to":"completed","changed_at":$ts}]' IMPL-X.json > tmp.json && mv tmp.json IMPL-X.json +``` + ## Important Reminders **ALWAYS:**