AI Task Planning and Decomposition
AI Task Planning and Decomposition
Previously, asking AI to help write a notice could usually be done with a single prompt.
But if you ask it to organize hundreds of event data points, analyze user feedback, write a review report, and then create a PPT, things are not that simple.
You might just want an event summary, but the AI starts writing conclusions before it even understands the data; it mixes up registration numbers and actual viewing numbers, and even modifies the original Excel file on the fly.
For these types of tasks, it's best not to ask the AI to complete everything at once.
A more reliable method is: first have the AI create a plan (Plan), and after we confirm it, then have it execute step by step.
This chapter uses a common real-world scenario—Organize online activity data to generate review reports and PPT outlines, learn how to have AI plan tasks, break down steps, control risks, and check results.
I. What is AI Task Planning (Plan)
AI task planning means having the AI organize the task goals, required materials, execution steps, and final deliverables before starting work.
For example, we tell the AI:
Help me organize last week's online activity data, write a review report, and then create a presentation PPT.
If we let the Agent execute directly, it might immediately read files, compile data, and generate a report.
But in reality, there are many unclear issues in the task:
- Where is the activity data stored? How many files are there?
- How should registration numbers and viewing numbers be counted?
- Should user reviews be analyzed?
- Is the report for leadership or the marketing department?
- How many slides does the PPT need? What main content should be displayed?
- Can the original files be modified or deleted?
The purpose of Plan is to clarify these questions before formal execution.
What is the difference between Plan and direct execution?
| Comparison items | Direct execution | Plan first, then execute |
|---|---|---|
| ** Workflow | Start operation immediately upon receiving the requirement | Formulate steps first, then execute after confirmation |
| ** Requirement understanding | May supplement conditions based on own understanding | Identify missing information and ambiguities in advance |
| ** File Operations | May directly modify files within the authorized scope | First clarify the scope of reading, modifying, and outputting |
| ** Result Checking | Perform unified checks after the task is completed | Acceptance can be performed at each stage |
| ** Modification Cost | Discovering a wrong direction may require a lot of rework | The direction can be adjusted during the planning stage |
You can understand Plan as looking at the design drawing before renovation. If you find the design is not suitable before walls are torn down and materials are bought, you can just modify the drawings.
If you discover the kitchen location is wrong after half the renovation is done, you can only rework it.
AI processing files and complex tasks is the same principle.
II. What tasks are suitable for using Plan
Not all tasks require a plan to be made first.
For example, asking AI to translate an English sentence, explain a concept, or polish a piece of text can usually be done directly.
However, tasks with multiple steps, file operations, or risks are worth planning first.
| Task Type | Recommended to Plan | Reason |
|---|---|---|
| ** Polish a piece of text | Usually not necessary | Simple task, easy to modify |
| ** Translate an email | Usually not necessary | The target and output format are relatively clear |
| ** Organize multiple Excel files | It is recommended to use | Fields and statistical rules need to be unified |
| ** Create activity review reports | It is recommended to use | Involves data analysis, summarization, and reporting |
| Develop a website | It is recommended to use | Involves technology selection, code, testing, and deployment |
| Batch organize files | It is recommended to use | Errors may occur during moving, renaming, or overwriting |
There is a simple judgment method:If a task requires more than three steps, and an error in any step will affect subsequent results, you can consider planning first.
III. Practical Scenarios: Creating an Online Event Review Report
Assume you work in the marketing department and have just finished an online live streaming event.
Your manager wants you to compile the event data, analyze what went well and what needs improvement, and prepare a report for next week's meeting.
You have three sets of materials:
- **
registration.xlsx: Event registration list. - **
viewers.xlsx: Live stream viewing statistics. - **
feedback.txt: Incorporate user feedback.
The AI is expected to deliver:
- An activity review report under 800 words.
- A 5-page PPT presentation outline.
- A key data statistics table.
These appear to be just three materials, but they actually involve multiple tasks such as data reading, cleaning, statistics, analysis, writing, and report organization.
This task does not require the AI to generate the complete PPT file, but rather to generate a five-page outline that can be used for subsequent PPT creation.
First, clarify the data statistics scope
Many data analysis tasks fail not because the calculation is too complex, but because the statistical scope is not clearly defined.
For example, a live stream has 500 registration records, 320 actual viewers, and the live streaming platform recorded 680 views.
These three numbers represent different meanings.
| Data Metric | Meaning | Points to note |
|---|---|---|
| Number of registration records | Number of records in the registration form | May contain duplicate registrations |
| Actual number of viewers | Number of unique users who have watched the event | Requires reliable user identification |
| Number of views | Number of times the live stream was accessed or played | The same user may watch multiple times |
| Number of user feedback | Number of valid feedback received | Cannot be directly taken as the number of participants |
The numbers above are only for conceptual illustration and are not the actual statistics of this event.
If the original data does not have user identification, viewing counts cannot be arbitrarily taken as unique viewing counts.
IV. Step 1: Let the AI first formulate a complete plan
Open DeepSeek, Qwen, or WorkBuddy, and do not upload sensitive information or directly authorize file modifications.
We first tell the AI the task objective and ask it to output only the plan, without starting execution.
Example: Activity Review Report Plan Prompt
You are an activity operations analyst,
Please help me plan the review work for an online live streaming activity.
Task Background:
The company has just completed an online live stream,
and needs to organize activity data and create review materials.
Existing Files:
registration.xlsx: Registration list
viewers.xlsx: Viewing statistics
feedback.txt: User feedback
Desired deliverables:
An activity review report under 800 words
A 5-page PPT presentation outline
A key data statistics table
We will enter the Plan stage first.
Please complete the following planning:
Analyze the task objectives and final deliverables.
List the raw data that needs to be checked.
Break down the task into independently executable steps.
Describe the input and output for each step.
List potential data issues.
Define acceptance criteria for each phase.
Mark important items that require my confirmation.
Special requirements:
Do not fabricate activity data.
Do not confuse registration numbers with viewing numbers.
Do not delete or overwrite original files.
When data is missing, it must be clearly stated.
It is not allowed to send files externally on your own.
In the current phase, only plans are formulated, tasks are not executed.
Please present the plan in a table,
Finally, list the questions that require my confirmation.
Wait for my confirmation before executing.
The most important requirement here is:Currently, only plan formulation is done, not task execution.
For ordinary conversational tools, this is just a constraint written in the prompt; for Agents that support native Plan mode, execution permissions can be further controlled through modes provided by the product.
What kind of plan should the AI provide?
A relatively reasonable execution plan might be as follows:
| Step | Operation content | Deliverables |
|---|---|---|
| 1 | Confirm activity goals, file contents, and statistical metrics | Document list, items to be confirmed |
| 2 | Check registration data for duplicate records and null values | Data quality report |
| 3 | Statistics on registration, viewing, and user feedback | Key metrics summary table |
| 4 | Analyze activity performance, issues, and areas for improvement | Core findings and recommendations |
| 5 | Write the main body of the review report within 800 words | Activity review report |
| 6 | Organize the structure of a five-page PPT report | PPT title and key points |
| 7 | Check the integrity of numbers, facts, and documents | Final acceptance record |
Note that this plan has not actually processed any activity data. It only tells us the order in which tasks should be completed next.
V. Second Step: Check and Modify the AI's Plan
The plan provided by AI does not mean it can be executed directly.
We need to check if it misses any key steps, if it will modify files that should not be modified, and if the final result can be accepted.
It is suggested to focus on checking five items:
| Check items | Key issues |
|---|---|
| ** Goal | Is the final deliverable clear? |
| ** Data | Are the input files and statistical rules clear? |
| ** Steps | Is the execution order reasonable? |
| ** Risks | Is it possible to delete, overwrite, or leak files? |
| ** Acceptance | How to determine if each step is correct after completion? |
For example, if the AI's plan states "clean up duplicate registration records," we should further ask: by what field are duplicate records judged? Is a user with the same name necessarily a duplicate registration? How are the original records preserved?
If these questions are not confirmed, directly letting the AI clean the data may cause errors.
Example: Requesting the AI to optimize the plan
Please check the activity review plan generated just now.
Key checks:
Whether the confirmation of data statistics scope has been omitted.
Whether there are operations to directly delete or overwrite files.
Whether the judgment rules for duplicate registrations are clear.
Whether there are cases where conclusions are written directly without data.
Are there clear acceptance criteria for each stage.
Please revise the plan based on the inspection results.
Additionally, divide the tasks into three stages:
Stage one: Data inspection and cleaning
Stage two: Statistical analysis and review
Stage three: Report compilation and final acceptance
Manual confirmation is required after the end of each stage.
Do not execute at this time.
Once the plan is confirmed, the actual execution phase can begin.
VI. Step 3: Phased Execution using WorkBuddy or DuMate
General conversation AIs can help us formulate plans, analyze pasted data, and write reports.
If you want the AI to automatically read Excel files, organize documents, and save results, you need to choose an Agent with the corresponding file operation capabilities, such as WorkBuddy or DuMate.
These tools can complete multi-step tasks around authorized files, but the actual supported functionality depends on the software version, permissions, and the current environment.
1. First, prepare an independent working directory
For example, create the following directory on your computer:
Activity Review Project Directory
activity-review/
├── source/
│ ├── registration.xlsx
│ ├── viewers.xlsx
│ └── feedback.txt
│
└── runoob_results/
sourceSave original practice materials,runoob_resultsSave the file after AI processing.
It is recommended to back up the original data before using the Agent and only authorize it to access the current practice directory.
2. Execute only the first phase
We first let the Agent check the activity data instead of completing all steps at once.
Example: Execute the data checking phase
The activity review plan has been confirmed.
Now execute only Phase One:
Data checking and cleaning.
Working directory:
activity-review/
Source data:
activity-review/source/
Output directory:
activity-review/runoob_results/
Specific tasks:
Read registration, viewing, and feedback files.
Check file format and fields.
Count the number of original records.
Identify null values, outliers, and suspected duplicate records.
Describe the criteria for identifying duplicate records.
Generate a data quality check report.
Operation rules:
Do not modify files in source.
Do not delete any records directly.
Do not merge users with unclear identities on your own.
Cleaning results must be saved to a new file.
Undetermined issues will be listed separately.
Do not access directories other than the current project.
Pause after execution,
and tell me what issues were found.
Do not proceed to the next stage until I confirm.
3. Check interim results
After the first stage is complete, do not just look at the Agent's response of "task completed".
We need to actually check the reports and files it generated, for example:
- How many records are in the original data?
- Which fields have null values?
- How many suspected duplicate records were found?
- What criteria were used to determine the duplicate records?
- Were all original files retained?
When an anomaly is found, directly ask it to explain the reason and correct it, do not rush to the next step.
4. Continue to the second phase: Statistics and analysis
After confirming that the cleaning results are correct, allow the Agent to continue generating statistical results and review conclusions.
Example: Continue statistics and analysis
The data check for the first phase has passed.
Now execute phase two:
Activity statistics and review analysis.
Please complete based on the confirmed data:
Summarize the activity registration status.
Analyze actual viewing performance.
Organize the main themes of user feedback.
Identify aspects that performed well in the activity.
Analyze potential issues.
Propose evidence-based improvement suggestions.
Requirements:
All figures must come from actual data.
Do not mistake view counts for the number of viewers.
Uncalculable metrics are marked as undetermined.
Distinguish between data facts and analytical inferences.
Do not fabricate user reviews.
Do not modify data confirmed in the first stage.
Save the statistical tables and analysis results to
the runoob_results directory.
Pause after completion and wait for my review.
In this way, we break down a complex task into several relatively independent stages. Even if one stage has an issue, we do not need to restart the entire task.
VII. Step Four: Generate Activity Review Report and PPT Outline
After confirming the data, then have the AI write the report to reduce the problem of fabricating conclusions.
This time, we hope to obtain two main deliverables: an activity review report suitable for reading, and a PPT outline suitable for meeting presentations.
Example: Generate final review materials
The first two stages have been accepted.
Now executing Stage Three:
Generate the activity review report and PPT outline.
Please use the confirmed statistical data and analysis results.
Task 1: Write an activity review report
Requirements:
Body text should not exceed 800 words
Language should be concise, professional, and natural
Suitable for internal company meetings
Important conclusions should be placed at the beginning
Suggested structure:
Activity overview
Core Data
Activity Performance
Main Issues
Improvement Suggestions
Task 2: Generate 5-page PPT Outline
Suggested Structure:
Page 1: Activity Background and Goals
Page 2: Key Data Performance
Page 3: User Feedback Analysis
Page 4: Issues and Causes
Page 5: Summary and Improvement Plan
Each page requires:
A clear title
3-5 content points
Suggestions for appropriate charts or illustrations
Special requirements:
All conclusions must be supported by data or feedback.
Do not fabricate activity results that were not provided.
Speculative conclusions must be marked as such.
Do not arbitrarily add non-existent metrics.
Output to a new file, do not overwrite existing materials.
List the final deliverables upon completion,
and provide an acceptance checklist.
Expected output
After execution, the project directory may contain the following files:
Example: Final delivery files
activity-review/
├── source/
│ ├── registration.xlsx
│ ├── viewers.xlsx
│ └── feedback.txt
│
└── runoob_results/
├── data-quality-report.md
├── cleaned-registration.xlsx
├── activity-statistics.xlsx
├── activity-analysis.md
├── activity-review.md
└── ppt-outline.md
These are example filenames; the actual generated content depends on the Agent used and the file processing capabilities.
Finally, check whether the key figures in the report match the statistics table and confirm that the PPT outline does not include unverified conclusions.
VIII. Codex also has Plan mode
The previous examples mainly target office tasks. If you use Codex to develop websites, modify code, or create applications, you can also plan before executing.
Codex provides a native Plan Mode. In Codex versions that support this feature, you can enter/planplanning mode.
For example, we plan to have Codex develop an online registration system.
If you directly input "Help me make a registration website," it might immediately start creating code files.
But we have not yet decided what technology to use, what features are needed, or where the registration data will be stored.
At this time, you can enter Plan mode first to let Codex formulate a development plan.
Example: Codex Plan mode
/plan
Then enter the task requirements:
Example: Plan a registration website
I plan to develop a simple online event registration system.
Requirements:
Users can fill in their name and contact information
You can view the activity introduction
Administrators can view registration data
Supports CSV export
Page adapts to mobile and computer
Please formulate a development plan first.
Notes:
Technology selection and reasons
Page and function structure
Data storage solutions
Development steps
Security and privacy risks
Testing and acceptance methods
Do not write code yet,
and do not modify project files.
First provide a plan for my confirmation.
Codex will analyze the task and form a development plan for review. After confirming the plan, switch to execution mode to start writing code and running tests.
It is necessary to distinguish: the native Plan Mode is the working mode provided by the tool, while "Please formulate a plan first" in a regular chat tool is only a prompt requirement, and the execution permission constraints of the two are not entirely the same.
IX. Common Questions and Solutions
| Problem | Cause | Solution |
|---|---|---|
| AI starts executing before planning | Used the directly executable Agent mode | Switch to native Plan Mode, or restrict the current stage to only output the plan |
| The plan is too long and incomprehensible | Task boundaries are unclear, AI over-decomposes | Require output by stage, specifying input, output, and acceptance criteria for each stage |
| Execution deviates from the original plan | Lacks stage checks and execution constraints | Pause execution, clarify deviations, and reconfirm |
| Statistical figures are inconsistent | Data sources or statistical scopes differ | First unify field definitions, then recount |
| Modified the original file | Improperly set working directory and permission scope | Immediately stop the operation, check backups, and tighten permissions |
| The final report content is incomplete | No clear deliverables or acceptance criteria | Check item by item against the plan and supplement missing content |
What to do if the plan deviates
If the Agent is halfway through execution and finds that a step does not match the initial plan, do not let it continue directly.
First, have it state the current progress, the issues encountered, and the potential impact of continuing execution.
Example: Pause and correct the execution plan
Please pause the current task and do not modify files.
Now check the difference between the actual execution and the original plan.
Please list:
Completed steps.
Uncompleted steps.
Discrepancies from the original plan.
Files that have been modified or newly created.
Whether there is a risk of data loss or overwriting.
Suggestions on how to correct the subsequent plan.
Give me a difference report first.
Do not proceed without my confirmation.
Do not delete or restore files on your own.
This allows us to first understand where the problem occurred before deciding how to handle it, avoiding the Agent introducing new problems while fixing one.
X. A General AI Plan Prompt
In addition to the case study review of this event, we can also prepare a general planning prompt.
Whether it is organizing materials, creating reports, developing webpages, or preparing for an event, you can put the task into this template first.
Example: General AI Task Planning Template
You are my AI project planning assistant.
I plan to complete the following tasks:
[Task Goal]
Fill in what you want to accomplish here.
[Existing Materials]
Fill in existing files, data, and background information here.
[Desired Deliverables]
Fill in the final required files or results here.
Please enter the planning stage first, do not execute immediately.
Step 1: Understand the Task
Clarify the final goal
Review existing information
Identify missing conditions
List issues that require my confirmation
Step 2: Decompose the task
Divide the task into multiple stages
Describe the input and output for each stage
Specify concrete execution steps
Mark preceding and succeeding dependencies
Step 3: Identify risks
Which operations may modify the original data
Which steps may generate errors
Which operations require additional authorization
How to retain original materials and intermediate results
Step four: Formulate acceptance criteria
How to determine if each step is complete
What requirements must the final deliverables meet
Which data or files require manual verification
Output requirements:
Please display in a table:
Step
|
Operation
|
Input
|
Output
|
Risks
|
Acceptance
Finally list:
Items to confirm
Major risks
Suggested execution order
Currently only outputs the plan.
After I confirm,
it will be executed step by step in phases.
When using this template, the most important thing is to supplement three parts:Task objectives, existing materials, and desired deliverables.
The clearer these three items are, the more targeted the plan generated by the AI will usually be.
Eleven, Hands-on Practice
Exercise 1: Organize 50 event photos
Assume the company held an offline event, and the photographer provided 50 photos that need to be organized, categorized, and used to create an event report.
First, have the AI create a task plan that includes at least the following steps:
- Check the number and format of the photos.
- Design classification rules based on the photo content.
- Identify duplicate and blurry photos.
- Organize the photos and standardize the naming.
- Generate the event report structure.
- Check the final output content.
Require that all original photos be retained; duplicate or blurry images cannot be deleted directly.
Exercise Two: Planning Personal Website Development
Have Codex plan a personal portfolio website that needs to include a homepage, a portfolio list, and a contact page.
First, use Plan mode to determine the technology stack, page structure, development steps, and acceptance criteria before deciding whether to start writing code.
Exercise Three: Comparing the Effects With and Without Plan
Choose a small task that does not involve real sensitive data and try two methods separately:
- A: Have the AI complete the entire task directly.
- B: First create a plan, confirm it, and then execute in stages.
Compare the completeness of the results, the number of rework cycles, and whether any omissions or unconfirmed operations occurred between the two methods.
Summary
Through the case review of this activity, we learned how to delegate a complex task to AI: first clarify the goal, then create a plan, and then execute and check the results in stages.
The entire workflow can be summarized as:
Define Goal → Create Plan → Manual Confirmation → Step-by-Step Execution → Stage Acceptance → Final Delivery
Plan does not guarantee that AI will never make mistakes, but it allows us to discover issues such as unclear requirements, inconsistent data definitions, and overly broad operational scope before actually starting the work.
For simple tasks, just let AI complete them; for complex tasks involving multiple files, multiple steps, or real data, planning first is generally more prudent.
Previously, we made our own plans and did the work ourselves; now, AI can make plans and do the work, but whether to execute it and whether the results are satisfactory is still up to us.