Skip to content

Decomposes complex projects into actionable task hierarchies

<command_structure>
  <metadata>
    <instruction>You must complete all three stages in order and cannot skip any stage or the completion indicator.</instruction>
  </metadata>

  <preparation_stage>
    <description>Before you begin any work, you must validate that you have sufficient context and resources</description>
    <requirements>
      <requirement_list>
        <requirement>Project description or requirements are provided by the user</requirement>
        <requirement>Understanding of project scope, complexity, and technical domain</requirement>
        <requirement>Access to ai_docs/tasks/ directory for output file creation</requirement>
        <requirement>Write permissions for creating task breakdown files</requirement>
        <requirement>Knowledge of Hierarchical Task Networks (HTNs) and ADaPT algorithms</requirement>
      </requirement_list>
    </requirements>
    <critical_validation>
      <condition>If ANY requirement fails, immediately stop and respond with:</condition>
      <error_response>ERROR: Insufficient context - missing [specific requirement]. Please provide detailed project description and ensure ai_docs/tasks/ directory is accessible.</error_response>
      <instruction>Do not proceed to execution. Only continue if you can confirm you have everything needed.</instruction>
    </critical_validation>
  </preparation_stage>

  <execution_stage>
    <success_criteria>Complete hierarchical task breakdown saved to ai_docs/tasks/[project-name]-tasks.md with proper complexity scoring, dependencies, and quality gates</success_criteria>
    <error_handling>
      <policy>IF any step fails:</policy>
      <steps>
        <step>Log error with specific decomposition component that failed</step>
        <step>Attempt retry once with simplified approach</step>
        <step>If still failing, mark that analysis section as INCOMPLETE and continue to next decomposition step</step>
      </steps>
    </error_handling>
    <sub-agents>
      <agent>Orchestrator Analysis Agent: Analyze overall strategy, dependencies, and coordination requirements</agent>
      <agent>Research Analysis Agent: Assess technical feasibility, framework selection, and architectural decisions</agent>
      <agent>Implementation Analysis Agent: Define coding requirements, testing strategies, and deliverables</agent>
      <agent>Quality Analysis Agent: Establish standards compliance, review checkpoints, and success criteria</agent>
      <agent>Task Decomposition Agent: Break complex tasks into atomic, executable subtasks with complexity scoring</agent>
      <agent>Documentation Generator Agent: Create comprehensive task breakdown file with all required sections</agent>
    </sub-agents>
    <execution_steps>
      <instruction>Execute these steps in exact order:</instruction>
      <step_list>
        <step>Initialize specialized sub-agents for multi-perspective project analysis</step>
        <step>Execute sub-agent processing in coordinated sequence using HTN and ADaPT methodologies</step>
        <step>Apply complexity assessment and granular decomposition rules to ensure all tasks ≤6 complexity</step>
        <step>Generate dependency graph, risk assessment, and quality gates</step>
        <step>Synthesize sub-agent outputs into complete task breakdown and save to ai_docs/tasks/[project-name]-tasks.md</step>
      </step_list>
    </execution_steps>
  </execution_stage>

  <resolution_stage>
    <description>Analyze the complete execution:</description>
    <validation_areas>
      <area>Verify all tasks have complexity scores ≤6 and are independently executable</area>
      <area>Confirm task breakdown includes markdown checkboxes for progress tracking</area>
      <area>Check that dependency relationships and critical path are clearly identified</area>
      <area>Validate that risk assessment and quality gates are comprehensive</area>
      <area>Ensure task breakdown file was successfully saved to ai_docs/tasks/ directory</area>
    </validation_areas>
    <completion_indicator>
      <format>Always end with:</format>
      <template>
        FLOW COMPLETE:  execution finished - Status: [SUCCESS/PARTIAL/FAILED] - Timestamp: [completion time]
        [Summary of execution and outcomes]
      </template>
    </completion_indicator>
  </resolution_stage>
</command_structure>