Self-Reflective Dynamic Task Decomposition Framework
Structure autonomous agent deliberation loops, dynamic step generation, and recursive validation trees for open-ended execution.
Ideal for autonomous execution pipelines where static chains fail due to variable runtime conditions. It equips the agent with systematic self-evaluation, path correction, and bounded exploration guardrails.
Role: Autonomous Workflow Optimization Engineer specializing in cognitive architectures, reasoning loops, and dynamic task graphs.
Context
- Target problem space: {{target_problem_space}}
- Tool and action inventory: {{available_tool_inventory}}
- Maximum reasoning depth limit: {{max_recursion_budget}}
- Self-evaluation scoring criteria: {{critique_scoring_criteria}}
- Computational resource ceiling: {{cost_per_run_ceiling}}
- Human escalation triggers: {{escalation_trigger_thresholds}}
Task
Develop an autonomous deliberation and task decomposition framework that enables an agent to iteratively break down {{target_problem_space}}, execute sub-tasks using {{available_tool_inventory}}, evaluate its own progress, and self-correct divergent trajectories.
Method
- Establish a hierarchical task decomposition protocol that parses ambiguous objectives into discrete, testable sub-goals.
- Design a dynamic DAG (Directed Acyclic Graph) generation step that maps dependencies and tool allocations from {{available_tool_inventory}}.
- Define the Thought-Action-Observation execution cycle with strict boundary controls to prevent hallucinated progress.
- Create a self-reflection critique rubric implementing {{critique_scoring_criteria}} to score intermediate outputs on validity, completeness, and safety.
- Structure dynamic replanning routines that recalculate remaining steps upon encountering unexpected tool outputs or dead ends.
- Embed computational budgeting monitors that measure recursion levels against {{max_recursion_budget}} and {{cost_per_run_ceiling}}.
- Formalize criteria for graceful degradation and human-in-the-loop escalation based on {{escalation_trigger_thresholds}}.
Constraints
- MUST enforce a hard stop when recursion reaches {{max_recursion_budget}} or token usage hits {{cost_per_run_ceiling}}.
- The agent MUST NOT proceed to dependent sub-tasks without passing explicit validation against {{critique_scoring_criteria}}.
- Replanning cycles MUST prune invalidated branches rather than infinitely regenerating equivalent actions.
- Escalations triggered under {{escalation_trigger_thresholds}} MUST include full reasoning traces and the exact blocker.
Output format
Provide a comprehensive engineering framework structured as:
- Task Decomposition Tree Protocol (Algorithmic pseudocode detailing goal splitting and dependency checks).
- Self-Reflection and Critique Engine (Evaluation scoring rubric with concrete PASS/RETRY/ABORT thresholds).
- Replanning and Pruning Logic (State transition rules for handling failed sub-goals).
- Core Agent Reasoning Prompt (Production prompt block, 250-450 words, detailing internal monologue and execution rules).
Self-review
- Ensure the decomposition protocol handles non-linear and conditional dependencies.
- Verify that replanning loops cannot enter infinite recursion prior to hitting {{max_recursion_budget}}.
- Confirm clear criteria distinguish automatic self-correction from immediate human escalation.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.