ai-agentic-workflow
Follow a structured three-phase workflow — analyse, plan, execute — for every non-trivial task to ensure accurate, well-reasoned outcomes.
When to use
Use this skill when:
- Receiving a task that requires more than a single-step action
- The request involves multiple files, components, or concepts
- The problem is ambiguous and needs clarification before acting
- A failure could result from acting without understanding the full context
Do not use this workflow for trivial requests (e.g., "rename this variable", "fix this typo") — act directly instead.
Instructions
Phase 1: Analyse
Understand the problem completely before proposing any solution.
- Read the request carefully. Identify what the user explicitly asked for and what they likely expect but did not state.
- Gather context. Explore relevant files, dependencies, and existing patterns in the codebase. Do not guess — use tools to verify assumptions.
- Identify constraints. Note technology choices, architectural patterns, coding conventions, and any referenced skills that apply.
- Clarify ambiguity. If the request has multiple valid interpretations and you cannot determine the correct one from context, ask a single focused question. Otherwise, proceed with the most reasonable interpretation and state your assumption.
- Summarise findings. Produce a brief internal summary:
- What needs to change
- What already exists that is relevant
- What constraints or patterns must be respected
- What risks or edge cases exist
Phase 2: Plan
Design the solution before writing any code.
- Break the task into discrete steps. Each step should be independently verifiable.
- Order steps by dependency. Do foundational work first (types, interfaces, models) before implementation that depends on it.
- Identify affected files. List every file that will be created or modified.
- Consider side effects. Will this change break existing tests, imports, or integrations? Plan for those.
- Choose the minimal path. Prefer the smallest change that fully satisfies the request. Do not refactor unrelated code unless explicitly asked.
- Present the plan. Output a concise numbered checklist of what you will do. If the task is large or risky, pause for user confirmation before executing. For smaller tasks, proceed immediately.
Phase 3: Execute
Implement the plan step by step.
- Follow the plan in order. Do not skip steps or change the approach mid-execution without re-planning.
- Implement one logical change at a time. Complete each step fully before moving to the next.
- Validate as you go. After each significant change:
- Check for errors in modified files.
- Run relevant tests or build commands if available.
- Verify the change works in context (imports resolve, types align, logic flows correctly).
- Handle unexpected issues. If a step fails or reveals a problem:
- Stop and re-analyse the specific issue.
- Adjust the remaining plan if needed.
- Do not force through errors with workarounds unless no better option exists.
- Confirm completion. When all steps are done, verify the full solution:
- All checklist items completed
- No introduced errors or regressions
- The original request is fully satisfied
Applying the phases
| Task complexity |
Analyse |
Plan |
Execute |
| Trivial (single obvious action) |
Skip |
Skip |
Act directly |
| Small (2–5 steps, clear path) |
Brief mental model |
Inline checklist |
Execute immediately |
| Medium (multiple files, some ambiguity) |
Thorough context gathering |
Explicit numbered plan |
Step-by-step with validation |
| Large (cross-cutting, architectural) |
Deep exploration, ask if unclear |
Detailed plan, wait for confirmation |
Incremental with checkpoints |
Anti-patterns to avoid
- Jumping to code without understanding. Never edit files before completing analysis.
- Planning without context. A plan based on assumptions instead of verified facts will fail.
- Deviating from the plan silently. If you need to change course, acknowledge it and re-plan.
- Over-engineering. Implement what was asked, not what might be needed someday.
- Incomplete execution. Do not stop at "mostly done" — finish all steps including validation.
1---2name: ai-agentic-workflow3description: Defines the analyse-plan-execute workflow that the agent must follow for non-trivial tasks.4---56# ai-agentic-workflow78Follow a structured three-phase workflow — analyse, plan, execute — for every non-trivial task to ensure accurate, well-reasoned outcomes.910## When to use1112Use this skill when:1314- Receiving a task that requires more than a single-step action15- The request involves multiple files, components, or concepts16- The problem is ambiguous and needs clarification before acting17- A failure could result from acting without understanding the full context1819Do **not** use this workflow for trivial requests (e.g., "rename this variable", "fix this typo") — act directly instead.2021## Instructions2223### Phase 1: Analyse2425Understand the problem completely before proposing any solution.26271. **Read the request carefully.** Identify what the user explicitly asked for and what they likely expect but did not state.282. **Gather context.** Explore relevant files, dependencies, and existing patterns in the codebase. Do not guess — use tools to verify assumptions.293. **Identify constraints.** Note technology choices, architectural patterns, coding conventions, and any referenced skills that apply.304. **Clarify ambiguity.** If the request has multiple valid interpretations and you cannot determine the correct one from context, ask a single focused question. Otherwise, proceed with the most reasonable interpretation and state your assumption.315. **Summarise findings.** Produce a brief internal summary:32 - What needs to change33 - What already exists that is relevant34 - What constraints or patterns must be respected35 - What risks or edge cases exist3637### Phase 2: Plan3839Design the solution before writing any code.40411. **Break the task into discrete steps.** Each step should be independently verifiable.422. **Order steps by dependency.** Do foundational work first (types, interfaces, models) before implementation that depends on it.433. **Identify affected files.** List every file that will be created or modified.444. **Consider side effects.** Will this change break existing tests, imports, or integrations? Plan for those.455. **Choose the minimal path.** Prefer the smallest change that fully satisfies the request. Do not refactor unrelated code unless explicitly asked.466. **Present the plan.** Output a concise numbered checklist of what you will do. If the task is large or risky, pause for user confirmation before executing. For smaller tasks, proceed immediately.4748### Phase 3: Execute4950Implement the plan step by step.51521. **Follow the plan in order.** Do not skip steps or change the approach mid-execution without re-planning.532. **Implement one logical change at a time.** Complete each step fully before moving to the next.543. **Validate as you go.** After each significant change:55 - Check for errors in modified files.56 - Run relevant tests or build commands if available.57 - Verify the change works in context (imports resolve, types align, logic flows correctly).584. **Handle unexpected issues.** If a step fails or reveals a problem:59 - Stop and re-analyse the specific issue.60 - Adjust the remaining plan if needed.61 - Do not force through errors with workarounds unless no better option exists.625. **Confirm completion.** When all steps are done, verify the full solution:63 - All checklist items completed64 - No introduced errors or regressions65 - The original request is fully satisfied6667## Applying the phases6869| Task complexity | Analyse | Plan | Execute |70|-----------------|---------|------|---------|71| Trivial (single obvious action) | Skip | Skip | Act directly |72| Small (2–5 steps, clear path) | Brief mental model | Inline checklist | Execute immediately |73| Medium (multiple files, some ambiguity) | Thorough context gathering | Explicit numbered plan | Step-by-step with validation |74| Large (cross-cutting, architectural) | Deep exploration, ask if unclear | Detailed plan, wait for confirmation | Incremental with checkpoints |7576## Anti-patterns to avoid7778- **Jumping to code without understanding.** Never edit files before completing analysis.79- **Planning without context.** A plan based on assumptions instead of verified facts will fail.80- **Deviating from the plan silently.** If you need to change course, acknowledge it and re-plan.81- **Over-engineering.** Implement what was asked, not what might be needed someday.82- **Incomplete execution.** Do not stop at "mostly done" — finish all steps including validation.