Execute a single task by ID with dependency resolution, memory application, and status propagation
Executes a task by ID with dependency resolution, memory application, and status propagation.
/plugin marketplace add mwguerra/claude-code-plugins/plugin install docs-specialist@mwguerra-marketplace<task-id> [--memory "global memory"] [--task-memory "temp memory"] [--debug]You are implementing taskmanager:execute-task.
$1 (required): Task ID to execute (e.g., 1.2.3)--memory "description" or -gm "description": Add a global memory (persists to memories.json)--task-memory "description" or -tm "description": Add a task-scoped memory (temporary, reviewed at task end)--debug or -d: Enable verbose debug logging to .taskmanager/logs/debug.logsess-$(date +%Y%m%d%H%M%S) (e.g., sess-20251212103045).--debug / -d flag..taskmanager/state.json:
logging.sessionId to the generated ID.logging.debugEnabled = true if --debug flag present, else false.decisions.log:
<timestamp> [DECISION] [<session-id>] Started execute-task command for task $1
$1 must be provided (e.g., 1.2.3).taskmanager:next-task.--memory / -gm value if provided.--task-memory / -tm value if provided.--debug / -d flag if provided.Process memory arguments:
--memory is provided:
taskmanager-memory skill to create a new global memory in .taskmanager/memories.json.source.type = "user", source.via = "execute-task".importance = 3, confidence = 0.9, status = "active".--task-memory is provided:
.taskmanager/state.json → taskMemory[]:
{
"content": "<the description>",
"addedAt": "<current ISO timestamp>",
"taskId": "$1",
"source": "user"
}
Load task:
tasks.json files (> 25k tokens), use taskmanager:get-task $1 to retrieve the task without loading the full file.taskmanager skill to load .taskmanager/tasks.json and find the task with id == $1.Check dependencies:
dependencies that are not "done", "canceled", or "duplicate":
Load and apply memories (PRE-EXECUTION):
taskmanager-memory skill to query relevant memories for this task..taskmanager/memories.json:
status = "active".scope.tasks, scope.domains, scope.files, importance >= 3.state.json.taskMemory[]:
taskId == $1 or taskId == "*".state.json.appliedMemories[].useCount and update lastUsedAt for each applied memory.Start execution:
status to "in-progress" if appropriate..taskmanager/state.json:
currentStep = "execution"mode = "interactive"currentTaskId = $1currentSubtaskPath = $1lastUpdate and lastDecision.Execute the task:
Post-execution memory review (before marking done):
taskId == $1):
taskMemory[].state.json.appliedMemories[].Complete execution:
status based on outcome:
"done", "blocked", "paused", or "needs-review"."done", "canceled", or "duplicate":
.taskmanager/tasks-archive.json.tasks.json..taskmanager/state.json:
currentTaskId = nullcurrentSubtaskPath = nullcurrentStep = "idle" (or "done" if requested by the user)lastUpdate / lastDecision.decisions.log:
<timestamp> [DECISION] [<session-id>] Completed execute-task command for task $1 with status "<final-status>"
.taskmanager/state.json:
logging.debugEnabled = falselogging.sessionId = nullThroughout execution, this command MUST log:
To errors.log (ALWAYS):
To decisions.log (ALWAYS):
To debug.log (ONLY when --debug enabled):
Whenever this command changes the status of any leaf task (the specific ID the user asked to execute), it MUST also update the status of all its ancestor tasks so that parents reflect the aggregate state of their subtasks.
Conceptual algorithm (per parent, based on its direct children):
For the parent, collect the status of all its direct subtasks.
Apply these precedence rules in order:
If any child is "in-progress"
→ parent status = "in-progress".
Else if no child is "in-progress" and any child is "blocked"
→ parent status = "blocked".
Else if no child is "in-progress" or "blocked" and any child is "needs-review"
→ parent status = "needs-review".
Else if no child is "in-progress", "blocked", or "needs-review" and any child is in:
"planned", "draft", "todo", "paused"
→ parent status = "planned" (macro “not-started / planned” state).
Else if all children are in {"done", "canceled", "duplicate"}:
"done" → parent status = "done"."canceled" or "duplicate") → parent status = "canceled".After computing the parent’s new status, repeat this algorithm for its parent, and so on, up to the root.
Implementation notes:
.taskmanager/tasks.json after propagation so other commands (like /dashboard and /next-task) see a consistent, macro view of progress.taskmanager:get-task <id> [key] - Token-efficient way to retrieve task properties without loading full tasks.jsontaskmanager:update-status <status> <id1> [id2...] - Batch status updates without status propagation (use for quick updates when propagation is not needed)taskmanager:stats - Token-efficient statistics and task summariesNote: Unlike taskmanager:update-status, this command (execute-task) performs full status propagation to parent tasks. Use execute-task when you need proper status cascading; use update-status only for quick batch updates where you'll handle propagation separately.