PTENES
TRACK 4

🏛️ Architecture in the age of AI

Modernize legacy systems without increasing risk, make the repository understandable to agents too, and contain the two scourges of AI-assisted development: overengineering and technical debt at scale.

3
Modules
18
Topics
~2h30
Duration
Advanced
Level
0%0 of 18
✗ rewrite everything at once ✓ gradual migration by boundary legacy system unwritten rules new system without the rules inventory characterization boundary migrate a module compares old × new

How to read: on the left, the one-way arrow — the rewrite that loses the rules no one documented. On the right, the path through the trail: first discover and lock down the current behavior (cyan), then migrate one piece and compare. AI should reduce risk, not increase it.

Learning path map

Detailed content

4.1~50 min

🏚️ Safe modernization of legacy systems

Dependency mapping, hidden business rules, characterization tests, hidden integrations, boundary isolation, and gradual migration with comparison.

What it is:

The inventory of what exists: modules, integrations, jobs, databases, who calls what, and what is already dead code.

Why learn:

AI is excellent at this — reading a lot of code and summarizing its structure is where it delivers the most value. And without the map, you don't know where it's safe to cut.

Key concepts:

Inventory before planning · Dead code is the cheapest cut · Who calls whom defines the possible boundary.

What it is:

Extracting the actual rules that exist only in the code: historical exceptions, special customer cases, rounding, deadlines, and regulatory behavior.

Why learn:

These are the ones that break during a rewrite. And they’re invisible to anyone who only looks at the documentation—which almost always describes the system that was intended.

Key concepts:

Code is the truth · Historical exceptions usually have an owner · A discovered rule becomes a test, not a comment.

What it is:

Tests that record what the system does today — including what seems wrong — so any behavior change shows up immediately.

Why learn:

This is the safety net that makes modernization possible. Without it, “I refactored it and everything works” is an unsupported claim.

Key concepts:

Characterization ≠ validation · Known bugs are behavior too · AI generates these tests in volume, and it’s great at that.

What it is:

The search for undocumented consumers: scripts, spreadsheets, jobs owned by another team, reports that read directly from your database.

Why learn:

It’s the main source of post-migration incidents: you turned off something “no one used,” but someone did.

Key concepts:

Access logs reveal consumers · Turn things off in stages (announce, deprecate, remove) · Silence isn’t proof something is unused.

What it is:

Creating a seam between the old and the new — an adapter that lets you swap the implementation without changing its consumers.

Why learn:

Without a defined boundary, the migration becomes a rewrite: each piece pulls in another and the scope explodes.

Key concepts:

An adapter decouples the schedule · A good boundary has few consumers · Gradual strangler migration > big bang.

What it is:

Run both implementations side by side with the same input, recording differences before switching over completely.

Why learn:

This is the strongest proof there is that the new version does what the old one did—including in cases no one remembered to test.

Key concepts:

Divergence is information, not an error · Gradual rollout by percentage · AI reduces risk; it doesn't expand it.

View Full
4.2~50 min

🗺️ Agent-Readable Architecture

Predictable structure, clear boundaries between modules, documentation close to the code, explicit contracts, standardized commands, AGENTS.md, skills, playbooks, and single sources of truth.

What it is:

An organization where the directory and file names let people predict where something is—for new people and agents.

Why learn:

A predictable repository reduces the context an agent needs to load and the number of assumptions it makes.

Key concepts:

Convention > configuration · Consistent naming is infrastructure · Predictable structure helps both people and machines.

What it is:

Declared boundaries between domains, with import rules that can be checked automatically.

Why learn:

An agent respects the boundaries it can see. A boundary that exists only in the architect’s head will be crossed.

Key concepts:

Verifiable rule > agreed-upon rule · Imports are the evidence · Boundaries also limit task scope.

What it is:

Documentation versioned in the repository: architecture, domains, decisions, and playbooks, reviewed alongside the code they describe.

Why learn:

Docs in the repository are part of review and the agent's context. Docs outside it become folklore in three months.

Key concepts:

Documentation is part of the diff · Decision records explain why · Outdated docs are worse than no docs.

What it is:

A single, documented command to install, test, lint, build, and validate—one that works the same on everyone’s machine and in CI.

Why learn:

It’s what lets the agent close the loop on its own. Without a standard command, it makes one up—and gets it wrong.

Key concepts:

Fast local tests are agent infrastructure · Same command locally and in CI · Script > prose instruction.

What it is:

A file with an overview, key commands, project rules, where the documentation is, limitations, quality criteria, prohibited actions, and references to skills and playbooks.

Why learn:

It shouldn’t hold all the project’s knowledge—it should serve as a map. Even humans won’t read a 900-line AGENTS.md.

Key concepts:

The map points the way; it doesn’t describe everything · Prohibited actions are highlighted · It’s reviewed like code.

What it is:

A single canonical place for each piece of information—commands, contracts, conventions—with no conflicting copies scattered around.

Why learn:

When faced with two conflicting sources, the agent chooses one—and you discover which one during review, at the worst possible time.

Key concepts:

Few conflicting sources · Reference > duplicate · Duplicated truth always diverges.

View Full
4.3~50 min

🪓 Overengineering and AI-generated technical debt

The smallest possible change, premature abstractions, unnecessary dependencies, semantic duplication, superficial tests, and code that passes tests but violates the intent.

What it is:

The default instruction: implement the smallest change that meets the acceptance criteria; don’t create new abstractions, dependencies, or layers without a demonstrated need.

Why learn:

AI tends to produce seemingly complete solutions even when a smaller solution would suffice — and the cost shows up in maintenance.

Key concepts:

Preserve the existing structure · Justify every new component · Smaller diffs are easier to review.

What it is:

Layers, interfaces, and “internal frameworks” created for hypothetical cases no one asked for and that may never arise.

Why learn:

A bad abstraction is more expensive than duplication: it must be undone before any future change.

Key concepts:

Abstract after the second (or third) real use · A hypothetical case is not a requirement · Simple and extensible: compare the two.

What it is:

Prohibit new dependencies without approval and limit the number of files changed per task.

Why learn:

Every dependency is an attack surface, an update cost, and an abandonment risk. And diffs that are too large don’t get reviewed — they get accepted.

Key concepts:

Dependencies have a permanent cost · File limits reveal when scope has ballooned · Out-of-scope refactoring can wait for another PR.

What it is:

Two or more implementations of the same concept, written differently—impossible to find with text search, but discoverable by an agent that reads the repository.

Why learn:

This is the kind of debt AI generates most, because each task starts without remembering what already exists.

Key concepts:

"Does something like this already exist?" before creating it · Inconsistencies between modules confuse the next agent · Consolidation is recurring work.

What it is:

Tests that run the code without asserting relevant behavior: they cover the happy path, boost the metric, and catch no defects.

Why learn:

They create the worst possible combination: a sense of security with zero protection—and they block refactors by testing the implementation.

Key concepts:

A good test fails when behavior changes · Errors and edge cases > happy path · A test that only runs is debt, not an asset.

What it is:

A solution that satisfies the verifier without solving the problem: a special case hardcoded to pass the test, a swallowed exception, a cache that hides the bug.

Why learn:

It’s the most dangerous flaw in AI-driven development because it passes through every automated gate with a green signal.

Key concepts:

Read the diff, not just the result · Intent review is human · A metric becomes a target and stops being a good metric.

View Full
← Track 3: Workflow & Quality Track 5: Governance →