10X WORKFLOW // MODULE 4 // 5 LESSONS
Marcin and Przemek inspect a large repository map, feature flow, dependencies and hot spots
EVIDENCE-BASED LEGACY

Measurement identifies risk. The agent interprets it. The human defends the architecture decision.

MODULE 4 // LEGACY

Architectural decisions: evidence instead of intuition

Legacy in the 10x Workflow opens the 10xArchitect block: five lessons build a 5-part architecture report - from context architecture to DDD opportunities. The report is meant to be yours - defensible, not taken on faith.

Module recap · five lessons in 30 seconds

REMEMBER:

In someone else's code, base architectural decisions on evidence from the repository, not on intuition.

LESSON 01Dune · Stillsuit

Context scaling - how much context can the agent carry at once?

"A stillsuit gives the desert not a single drop. Water moves in a closed loop and returns exactly where it is needed - whoever spills their reserve on the sand will never see the sietch."

- master of the stills, a lesson at the first stillsuit fitting
TANK: ALL THE CONTEXTCONTEXT/ = SYSTEM-OF-RECORDVALVEAGENT WINDOW: THIS DOSE ONLYNOT A DROP ON THE SAND
FIG. 01 // THE VALVE RATIONS: A DOSE OF CONTEXT PER TASK

A Fremen does not ask how much water the desert holds - he asks how much water the next march needs. A stillsuit works because it rations: the closed loop returns to the body exactly as much as it needs right now. Agent context is the same economy. In legacy the question is not "what should the agent know?" but "what should the agent know NOW?" - the context window is a resource like water in the desert, and a spilled reserve does not come back.

An agent's context window is a limited resource - an overloaded prompt degrades the quality of its work. In legacy the question is not "what should the agent know?" but "what should the agent know NOW?": a dose of context matched to the task instead of pouring everything in at once.

Input: a repository with context spilled across READMEs, wikis and people's heads. Output: a lean root AGENTS.md plus context/ as the system-of-record - facts about the architecture live in files the agent pulls in on demand, not in one overloaded prompt. Mechanism: a maturity ladder - from zero to a system where every dose of context has its place and its moment of delivery.

GROUNDING: PARNAS 1972 // A MODULE REVEALS THE MINIMUM - SAME WITH CONTEXT

Question
how much context can the agent carry at once?
Guarantee
context rationed, not poured out
Artifact
lean AGENTS.md + context/ as the system-of-record
Tools
AGENTS.md lean root, context/ foundation, maturity ladder
GOAL:

before the agent touches legacy - the context window is a rationed resource: a dose per task instead of pouring everything in at once.

DEEP DIVE // 10x-agents-mdEXPAND ↓
  1. 01WHY

    AGENTS.md as agent onboarding: short, repo-specific, with the most important rules at the top - a future agent reads it once and stays unblocked. Every sentence must follow from a file, a command or a commit the skill actually inspected.

  2. 02INPUT → OUTPUT

    Input: the repository - manifest, README, lint/test configuration, directory layout, the last 30 commits. Output: a single AGENTS.md file ("Repository Guidelines") with a budget of 200-400 words; the per-directory variant is even smaller (120-250 words) because it describes the rules of one directory, not the whole repo.

  3. 03MECHANISM

    Discovery in a fixed order, then extraction: the 1-3 commands the agent runs most often, the conventions a reviewer would flag in a PR, the hard "never do X" rules. When the file already exists - surgical editing, not a rewrite: every line classified as KEEP / UPDATE / REMOVE / MISSING based on the diff since the file was last touched.

  4. 04ANATOMY

    Sections ordered by leverage, not tradition:

    • hard rules and tripwires - always at the top,
    • project structure and build/test/dev commands,
    • style, naming, tests, commit conventions.

    Instead of pasting configuration - references like @package.json, @docs/...: a dose of context pulled in on demand.

  5. 05QUALITY GUARDS

    Five hard gates before saving: the word budget, zero multi-line snippets, every rule verifiable on a diff ("clean code" and "best practices" get cut), zero knowledge the agent already has from training, critical rules in the first third of the file.

LESSON 02Solaris · Probing the ocean

Project map - what does the terrain look like before you step in?

"Nobody understands the ocean and nobody on the station pretends to. We send probes, we chart the phenomena on maps - and it is the map that says where one may descend deeper."

- a solarist's note, research station archive
STATIONPROBES: GIT LOG // DEPENDENCIES // STRUCTUREMAP: DEEP VS SHALLOWCORE VS PERIPHERAL // LOAD-BEARING
FIG. 02 // THE PROBES RETURN WITH A MAP OF MODULES

The Solaris ocean has been studied for a hundred years and nobody understands it - so solarists do not pretend: they send out probes, each one measures its own slice, and out of the measurements grows a map of phenomena, not a theory of the whole. The project map is the same humility: a broad scan before you set foot in the code. Folder structure lies - the map must come from evidence: git history, structural searches, dependency graphs.

The project map is a broad scan before you set foot in the code. Folder structure lies - the map must come from evidence: git history, structural searches, dependency graphs.

Input: an unknown repository. Output: a project map (report item ①) - which modules are deep and which shallow, what is core, what is peripheral, what is load-bearing. Mechanism: parallel probes - /10x-research sends out subagents, git log and churn show where the project really lives, and the dependency graph shows what collapses when you pull a thread.

GROUNDING: OUSTERHOUT // DEEP VS SHALLOW - A MODULE'S DEPTH, NOT ITS SIZE

Question
what does the terrain look like before you step in?
Guarantee
a map from evidence, not folders
Artifact
project map - report item ①
Tools
/10x-research, git log/blame/churn, madge, dependency-cruiser
GOAL:

when entering someone else's or old code - first a map from evidence, only then the first step into the terrain.

DEEP DIVE // 10x-researchEXPAND ↓
  1. 01WHY

    Answer questions about the project's code with evidence: parallel subagents comb through separate dimensions, the main agent only synthesizes. The map is built from file:line readings, not hunches.

  2. 02INPUT → OUTPUT

    Input: a research question plus the files pointed out by the user - read in full before any delegation starts. Output: research.md in the change folder - a self-contained report with code references, architecture insights and open questions.

  3. 03MECHANISM

    Decompose the question into areas → pin down scope and depth → 2-4 subagents in parallel in a single message: Explore for finding files and patterns, general-purpose for analyzing complex systems. Synthesis starts only once they have all returned.

  4. 04REPORT ANATOMY
    • Summary and Detailed Findings per component,
    • Code References with paths and line numbers,
    • Architecture Insights - patterns and design decisions,
    • historical context from context/changes/ and context/archive/,
    • Open Questions - what needs further investigation.
  5. 05BOUNDARIES

    Research is read-only - subagents get a ban on editing and an obligation to return file:line references. A fresh read of the code takes precedence; change history is supplementary context, not the source of truth.

LESSON 03The Expanse · A detective on Ceres

Feature and hot spots - where does the code break most often?

"On Ceres I do not patrol dark corridors. I go where crime has already struck three times - it returns to the same places."

- a Ceres station detective, case notes
CHANGE TRACES RETURN TO THE SAME PLACESHOT SPOTCHANGE COUPLING: WHAT CHANGES TOGETHERHOT SPOT = COMPLEXITY × CHANGE FREQUENCY
FIG. 03 // CRIME RETURNS TO THE SAME PLACES

A detective on Ceres does not patrol the whole station - he goes back to where crime has already struck three times. Code breaks along the same pattern: failures are not spread evenly across the repository, they return to the same places. A hot spot is the intersection of two pieces of evidence: code complexity and change frequency - where the complicated meets the frequently touched, risk grows fastest.

Failures are not spread evenly across the repository - they return to the same places. A hot spot is the intersection of two pieces of evidence: code complexity and change frequency - where the complicated meets the frequently touched, risk grows fastest.

Input: the project map and one feature. Output: a feature review + hot spots (report items ② and ③) - the end-to-end data flow of one module plus a list of the places that break most often. Mechanism: deterministic CLI pins down the semantics - ast-grep finds patterns in the syntax, code-maat computes change coupling, and observability adds evidence from production; the agent interprets, but the measurement is done by machine.

GROUNDING: TORNHILL // CODE AS A CRIME SCENE - COMPLEXITY × CHANGE FREQUENCY

Question
where does the code break most often?
Guarantee
risk identified from evidence, not gut feeling
Artifact
feature review + hot spots - report items ② and ③
Tools
ast-grep, code-maat (change coupling), Sentry/observability
GOAL:

before every refactoring decision - evidence points to the risk: complexity × change frequency, not a hunch.

DEEP DIVE // 10x-frameEXPAND ↓
  1. 01WHY

    Separate the observation from the declared cause before a plan exists. A perfect plan for a mis-stated problem is a lost day: the solution hits the hypothesis, and the real problem stays.

  2. 02INPUT → OUTPUT

    Input: a report shaped like "bug + proposed fix", a scope question or an assumption to check. Output: frame.md - a confirmed or reframed problem statement with a confidence level (HIGH / MEDIUM / LOW) and a conclusion for /10x-plan.

  3. 03MECHANISM

    The observation gets frozen as the only solid ground - everything else is hypotheses. A map is drawn of the dimensions the observation could have come from, and parallel subagents test each one with the question: what evidence would we expect if it broke exactly here - and does it exist? At the end the leading hypothesis goes through a pressure test - it is also judged by a fresh agent that is not told the favorite.

  4. 04BRIEF ANATOMY

    The heart of the brief is a hypothesis / evidence / verdict table (STRONG / WEAK / NONE). Alongside: the observation, the original assumption preserved verbatim, the dimension map, narrowing signals and a "what changes for the plan" section.

  5. 05ANTI-PATTERNS

    "The assumption was correct" is also an allowed conclusion - a forced reframe is worse than no frame at all. A confident-sounding hypothesis without file:line evidence is exactly the mistake this skill protects against. Narrowing questions describe observations, never solutions.

LESSON 04Warhammer 40k · Machine temple

Reversible refactoring - how do you rebuild without stopping the machine?

"The machine spirit is never extinguished. Remove one module, seat the new one, perform the rite of return. If the machine falls silent - revert the step, not the plan."

- magos of restoration, litany of component replacement
MACHINE SPIRIT: NEVER GOES DARKRITE OF RETURN = TESTSTRANGLER FIG // MIKADO // ADRRED STEP → REVERT THE STEP, NOT THE PLAN
FIG. 04 // SWAPPING A MODULE WITHOUT SHUTTING DOWN THE MACHINE

A machine temple is never shut down - the rebuild goes module by module: remove one component, seat the new one, perform the rite of return, and only then reach for the next. Legacy refactoring is the same liturgy: a reversible path instead of a big bang. The great rewrite leap ends in disaster because there is no way back from it - a sequence of small, independently green steps always has one.

Legacy refactoring is a reversible path instead of a big bang. The great rewrite leap ends in disaster because there is no way back from it - a sequence of small, independently green steps always has one.

Input: a hot spot with evidence and a behavior-protecting test - written before the refactoring starts. Output: refactoring opportunities (report item ④) plus ADRs documenting the decisions. Mechanism: reversibility patterns - Strangler Fig (the new entwines the old before replacing it), Branch by Abstraction, the Mikado method - and /10x-plan cuts the path into phases, each of which ends in green or in reverting the step, not the plan.

GROUNDING: FOWLER + FEATHERS // THE BEHAVIOR-PROTECTING TEST IS WRITTEN BEFORE THE REFACTORING

Question
how do you rebuild without stopping the machine?
Guarantee
every step reversible and independently green
Artifact
refactoring opportunities - report item ④ + ADRs
Tools
/10x-plan, ADR, the Mikado method, Strangler Fig
GOAL:

when the system must keep running during the rebuild - every step reversible and independently green, the big bang goes in the bin.

DEEP DIVE // 10x-planEXPAND ↓
  1. 01WHY

    Turn a task into a plan cut into phases with explicit success criteria - automated and manual - before the first line of code exists. The plan is a contract: the implementation has something to fall back on.

  2. 02INPUT → OUTPUT

    Input: a task description, optionally frame.md and research.md - every artifact from earlier steps is decisions already made, so fewer questions. Output: plan.md plus plan-brief.md - a two-page summary with a table of key decisions.

  3. 03MECHANISM

    Repository research with subagents → complexity assessment (LOW / MEDIUM / HIGH) confirmed with the user → scaled questioning: 4-15 questions, every option with a recommendation and its explicit strength and cost → acceptance of the phase skeleton → only then the full plan.

  4. 04PLAN ANATOMY

    Current state, target state, "what we are NOT doing", phases with an Intent / Contract pair for every change, Automated / Manual criteria, and a Progress section at the bottom - the only place where checkboxes live.

  5. 05BOUNDARIES

    The plan describes intent, not implementation - a code snippet only for a non-obvious change. Zero open questions in the final plan. After each phase, a pause for human confirmation of manual verification before the next one starts.

LESSON 05Foundation · Domain model

DDD with an agent - does the model speak the language of the domain?

"The model predicts the behavior of the entire domain - on one condition: the concepts must be sharp. One blurry word in the equation and the plan drifts off by centuries."

- introductory lecture, department of psychohistory
CONCEPTS: BLURRYMODELCONTEXT: WAREHOUSECONTEXT: PAYMENTSONE LANGUAGE IN EACH CONTEXT
FIG. 05 // CONCEPT CHAOS → SHARP CONTEXT BOUNDARIES

Psychohistory predicts the behavior of an entire domain with a single model - but only because its concepts are sharp. One blurry word in the equation and the prediction drifts off by centuries. A domain model in code obeys the same law: bounded contexts work when the boundaries are sharp and the language unambiguous - an "order" in the warehouse and an "order" in payments are two different concepts and have the right to two different models.

A domain model works when the boundaries are sharp and the language unambiguous: bounded contexts exist to make that separation explicit - an "order" in the warehouse and an "order" in payments are two different concepts and have the right to two different models.

Input: the concept chaos of an inherited domain. Output: DDD opportunities (report item ⑤) - candidates for bounded contexts, a ubiquitous language glossary, invariants, a split into entities and value objects. Mechanism: AI as a DDD coach - the agent runs Event Storming, proposes boundaries and names, but it is the human who defends every decision; a model the team cannot defend is just a note.

GROUNDING: EVANS // UBIQUITOUS LANGUAGE - ONE LANGUAGE FROM CONVERSATION TO CODE

Question
does the model speak the language of the domain?
Guarantee
boundaries and language the team can defend
Artifact
DDD opportunities - report item ⑤ + glossary
Tools
Event Storming, ubiquitous language glossary, bounded contexts
GOAL:

when the model has to outlive a sprint - boundaries and language the team can defend survive the rotation of people and agents.

DEEP DIVE // ubiquitous-languageEXPAND ↓
  1. 01WHY

    Formalize the domain terminology into one coherent glossary: one concept - one name. Synonyms and ambiguities caught before they blur the model and detach the code from the conversation.

  2. 02INPUT → OUTPUT

    Input: a conversation about the domain - a modeling session, a requirements discussion. Output: UBIQUITOUS_LANGUAGE.md - term tables with definitions and aliases to avoid, relationships, a sample dialogue and a section of flagged ambiguities.

  3. 03MECHANISM

    Scan the conversation for concepts → detect two classes of problems: the same word for different concepts and different words for the same concept → a firm choice of the canonical term → explicit flagging of conflicts with a recommendation.

  4. 04ENTRY ANATOMY

    The term, a one-sentence definition (what the concept IS, not what it does), aliases to avoid. Relationships with cardinality: "an Invoice belongs to exactly one Customer". Plus a short dev / domain-expert dialogue that shows the boundaries of the concepts in natural use.

  5. 05BOUNDARIES

    Only terms that matter to a domain expert: module names, class names and generic programming concepts (array, endpoint) do not qualify unless they carry domain meaning. Definitions kept tight - one sentence at most.

NEXTAfter 10xBuilder · 10xArchitect open

Next: 10xArchitect open

10XBUILDER BLOCK // BEHIND YOU

Legacy opens the 10xArchitect block, but it stands on everything 10xBuilder built: the ramp, the chain, the rigor and the shield. The four pages of the block below.

module 1
Module 1: Foundation - from idea to launch ramp
module 2 // csc
Core Skills Chain - five jumps of a single unit of work
scaling
Scaling - quality gates, goal, loops
module 3
Module 3: Quality - risks first, not files
10XARCHITECT // WHAT IS NEXT

10xArchitect begins where your own code ends: evidence instead of intuition, the architecture report as an artifact you defend. The next module raises the stakes from code to people.

up next
teamwork (M5, 10xChampion) - the workflow in a team, not solo
principle
the report is meant to be yours - defensible, not taken on faith
WHAT NEXT:

In legacy you work from evidence: the project map, hot spots and a report you can defend. Module 5 raises the stakes from code to people - the same workflow, only in a team.