
Measurement identifies risk. The agent interprets it. The human defends the architecture decision.
MODULE 4 // LEGACY
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.
UNKNOWN TERRAIN SCAN // CLICK AN AREA TO FLY TO ITS SECTION
Module recap · five lessons in 30 seconds
How much context can the agent carry at once? Context rationed, not poured out.
LESSON 02What does the terrain look like before you step in? A map from evidence, not folders.
LESSON 03Where does the code break most often? Risk identified from evidence, not gut feeling.
LESSON 04How do you rebuild without stopping the machine? Every step reversible and independently green.
LESSON 05Does the model speak the language of the domain? Boundaries and language the team can defend.
In someone else's code, base architectural decisions on evidence from the repository, not on intuition.
"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 fittingA 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
before the agent touches legacy - the context window is a rationed resource: a dose per task instead of pouring everything in at once.
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.
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.
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.
Sections ordered by leverage, not tradition:
Instead of pasting configuration - references like @package.json, @docs/...: a dose of context pulled in on demand.
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.
"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 archiveThe 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
when entering someone else's or old code - first a map from evidence, only then the first step into the terrain.
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.
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.
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.
context/changes/ and context/archive/,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.
"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 notesA 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
before every refactoring decision - evidence points to the risk: complexity × change frequency, not a hunch.
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.
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.
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.
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.
"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.
"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 replacementA 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
when the system must keep running during the rebuild - every step reversible and independently green, the big bang goes in the bin.
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.
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.
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.
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.
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.
"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 psychohistoryPsychohistory 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
when the model has to outlive a sprint - boundaries and language the team can defend survive the rotation of people and agents.
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.
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.
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.
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.
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.
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.
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.
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.
NO RESULTS // TRY ANOTHER QUERY