We will be mastering several key skills:
🎯 Task Formulation — turning a vague desire into a well-defined task.
🧠 Decomposition — breaking a complex problem into manageable parts.
🔄 Iterative Dialogue — not trying to get the perfect answer on the first try.
🔬 Research — understanding when to search for information, which sources to use, and how to verify conclusions.
👁️ Working with Images and Files — using me not just as a text interface.
⚔️ Critical Interaction — forcing me to find my own errors, alternatives, and weak points.
🏗️ Project Architecture — building long chains of work, not isolated questions.
🤝 Role Distribution — understanding what to do yourself, what to delegate to AI, and where to use both of us together.
🧭 Metathinking — noticing not just what we are solving, but how we are solving it.
---
The right approach — especially when working with AI.
At the initial stage, architecture is needed not just as a technical blueprint, but as a **system of constraints and rules** that reduces uncertainty. In the case of AI, this is critical: the better the context, stage, criteria, and boundaries are defined, the less the AI "drifts," the fewer hallucinations it produces, and the less often you need to redo the result.
In essence, this describes **managed AI development**:
- The AI understands **which stage is currently in progress**;
- For that stage, the **appropriate behavior rules** are loaded;
- The AI works not as a universal chatty assistant, but as a **specialized agent for a specific phase of the task**.
This aligns well with the skills from the foundation:
- **Task Formulation** — turning a vague idea into a clear task.
- **Decomposition** — breaking a complex system into manageable parts.
- **Iterative Dialogue** — not expecting a perfect answer on the first try.
- **Research** — verifying hypotheses and sources.
- **Working with Files and Images** — analyzing diagrams, code, and documents.
- **Critical Interaction** — finding weak points and errors.
- **Project Architecture** — building a long chain of work.
- **Role Distribution** — understanding what the human does and what the AI does.
- **Metathinking** — tracking not just "what we are doing" but "how we are doing it."
---
## Why initial architecture is so important
Because it solves several problems at once:
1. **Reduces the cost of changes**
The earlier rules are defined, the less rework there is at later stages.
2. **Reduces entropy in the dialogue with AI**
If the AI doesn't know the context and rules, it starts to "guess" in an averaged way.
3. **Enables work decomposition**
Architecture turns a large task into a set of clear layers, modules, and contracts.
4. **Creates control points**
You can verify not just the code, but also compliance with architectural decisions.
5. **Makes refactoring safer**
If there are clear rules and tests, refactoring becomes not a chaotic rebuild but a managed process.
---
## What is especially important for working with AI
For AI to truly help rather than create the illusion of help, it needs not just prompts, but an **operational framework**.
Let's identify 5 layers.
### 1. Project Context
What the AI must always know:
- project goals;
- constraints;
- tech stack;
- code style;
- architectural principles;
- what cannot be changed without approval;
- quality criteria;
- current assumptions and risks.
This is like a "project constitution."
---
### 2. Work Stage Definition
The AI must understand exactly what is happening right now:
- research;
- task formulation;
- design;
- implementation;
- testing;
- refactoring;
- code review;
- debugging;
- documentation preparation;
- planning the next step.
Each stage has its own mode of thinking.
---
### 3. Skill Instructions per Stage
For example:
#### If the stage is "Task Formulation"
The AI must:
- clarify the goal;
- identify constraints;
- define success criteria;
- find hidden assumptions;
- formulate the task in a clear form.
#### If the stage is "Architecture"
The AI must:
- propose a structure;
- identify modules;
- define interfaces;
- assess risks;
- propose alternatives;
- indicate trade-offs.
#### If the stage is "Implementation"
The AI must:
- follow the agreed architecture;
- not change rules without an explicit request;
- write code in the required style;
- consider edge cases;
- suggest tests.
#### If the stage is "Refactoring"
The AI must:
- first describe the current behavior;
- identify invariants;
- ensure there are tests or at least a verification plan;
- change code in small steps;
- not break contracts;
- separately note where behavior may change.
#### If the stage is "Critical Review"
The AI must:
- look for errors;
- check edge cases;
- find bottlenecks;
- suggest counterexamples;
- verify compliance with original requirements.
---
### 4. Artifacts and Stage Transitions
A very useful practice: every stage should have a clear output.
For example:
- research → list of hypotheses, sources, and conclusions;
- task formulation → task statement and acceptance criteria;
- architecture → diagram, ADR, list of modules and contracts;
- implementation → code, tests, and explanations;
- refactoring → list of changes, risks, and verifications;
- review → identified issues and recommendations.
This way, work becomes not just an exchange of messages, but a **stateful process**.
---
### 5. Metathinking
This is a very important layer.
The AI should periodically ask not just "what to do?" but also:
- Are we solving the right task right now?
- Did we jump into implementation before requirements were worked out?
- Are we skipping the verification stage?
- Are we overcomplicating things?
- Is there a conflict between the architecture and the current implementation?
This is **metathinking**: tracking the way work itself is being done.
---
## Important nuance: architecture should be sufficient, not excessive
Starting with architecture is correct.
But there is one trap: **overdesign at the start**.
A good principle is:
> Architecture should be clear enough to set rules and flexible enough to withstand iterations.
That is, you don't need to design everything down to the last detail right away.
You need to establish:
- key modules;
- boundaries of responsibility;
- contracts between parts;
- extension principles;
- quality rules;
- prohibited changes.
And then proceed iteratively.
---
## Why this is especially important for refactoring
Refactoring is a complex task.
AI can handle it, but only if there is:
1. **Understanding of current behavior**
What the system does right now.
2. **Invariants**
What must not be broken.
3. **Tests or verifiable scenarios**
How to ensure behavior is preserved.
4. **Small steps**
Not "rewrite everything," but a series of safe transformations.
5. **Clear architecture**
Where we are heading and why.
Without this, refactoring often turns into a risky rebuild.
---
## Let's formulate a strong approach
For professional work with AI, the most effective approach is not a set of scattered prompts, but a **system**:
1. **Define the stage**
What are we doing right now: researching, designing, implementing, verifying, or refactoring.
2. **Load the rules for the stage**
Exactly how the AI should behave at this stage.
3. **Fix the project context**
What constraints, principles, and decisions have already been made.
4. **Create the stage artifact**
Not just an answer, but a useful intermediate product.
5. **Verify and adjust**
Through critical dialogue, tests, and comparison with requirements.
6. **Update the project state**
What we learned, what we decided, what has changed.
This is no longer just "AI assistance," but an **engineering process with AI support**.
---
## Short conclusion
**The better the architecture and rules are designed at the start, the fewer problems there are at subsequent stages.**
And in working with AI, this is even more important because the AI:
- works better within clear boundaries;
- has a harder time maintaining long-term context without explicit rules;
- requires explicit stage definition;
- should receive different instructions for different work phases;
- should not only produce results but also check its own weak points.
---
Next, we need to build a **practical "AI-project workflow" template**:
- how to define the stage;
- which skill instructions to load;
- what questions to ask at each stage;
- and how to formalize this as a unified working prompt/regulation.
---