AI is your newest junior engineer. Onboard it like one.
AI writes code quickly and well, but left alone it works like a junior. The senior judgment and the knowledge of your organization have to be taught. Here's how lead engineers do that with layered context, and how to set it up once so every AI tool and every person on the team works from the same playbook.
Every engineer I've hired straight out of school could code. What they couldn't do yet was the rest of engineering: write the test before the code, design data that still holds up in year three, pick the right tool instead of the newest one. And none of them knew why our refund flow worked the way it did, or what broke the last time someone "simplified" settlement.
Writing code was never the hard part of the job.
AI sits in that same seat. It writes code quickly and well. Left alone, it also works like a junior: code first and tests later, whatever data shape gets today's task done, the first library that comes to mind. And like a junior who wants to impress, it won't stop and ask. It'll guess, and the guess will look confident.
What separates junior, senior and lead

A junior writes code that works. A senior engineers the whole solution: test-first development, data design, tool selection, security, what happens when it fails at 2 a.m. Those are the hard pieces, and almost none of them are typing.
A lead does all of that and one more thing. A lead teaches. They explain why, not just what, so the knowledge spreads across the team instead of living in one head.
AI is an odd kind of junior. It has read every book on test-first development and data design, and it can recite the practices on request. It just doesn't apply them, or apply them your way, unless someone directs it.
So there are two gaps to close. One is engineering judgment: how good work gets done here. The other is everything only your organization knows: the decision made three years ago for a reason nobody wrote down, the commitment to a regulator, what failed before and who approves what. Both have to be taught.
Don't hand over the whole wiki
The obvious fix is to give AI everything. It doesn't work for people and it doesn't work for models.
A model has a limited working memory, and everything you load into it competes for attention. Put fifty pages of standards in front of every task and the one rule that mattered gets buried. You also pay for those fifty pages every single time.
You wouldn't give a new hire the full wiki on Monday morning and expect good work by lunch. You'd onboard them in layers. Do the same here.
Five layers of context

The brief. Short and always loaded. What we're building, how we work (tests come before code, for one), the handful of things that are never OK, and a map of where everything else lives. If it runs past a page or two, it's doing another layer's job.
Rules by area. Standards that only matter in one part of the system should load only when AI is working there. Database rules when it touches the database. Front-end rules when it touches the front end.
Expertise on demand. This is what a senior or a specialist would bring, packaged by topic and pulled in when the task calls for it. Some of it is engineering practice: how we design data, how we choose a tool, how we test. Some of it is domain knowledge. In payments that's things like card network rules or compliance requirements. Nobody needs all of it at once. Everybody needs the right piece at the right time.
Lessons learned. A junior picks these up from war stories over lunch. AI needs them written down: what went wrong, and what we changed because of it. One caution. Have a person review a lesson before it becomes permanent, or the wrong lesson gets remembered forever.
Guardrails. Some things shouldn't be context at all. If something must never happen, don't ask nicely in a document. Put a check in the way that blocks it. Context guides. Checks enforce.
The problem with more than one tool
Most teams don't use one AI tool. There's a chat assistant for thinking and writing, an agent that works from the terminal, an assistant inside the editor and maybe a reviewer in the build process.
Each one has its own place for instructions and its own memory. So you teach one of them a rule and the others never hear about it. A few months in, you've got four slightly different versions of your standards and no idea which one is right.
It's the same as onboarding four juniors with four different handbooks.
Set it up once, for every tool

Here's what's worked for us.
Keep one source of truth, in plain text, in version control. Every AI tool can read plain text. You also get history, review and a named owner without building anything.
Give each tool a thin pointer. Every tool wants its own instruction file in its own spot. Keep those tiny. Their whole job is to say "the rules live over there." Most coding tools now read a shared convention called AGENTS.md, which makes this easier than it was a year ago.
Package expertise in open formats. Skills, which are folders of instructions for one kind of task, have become an open format that a long list of tools can read. Write the expertise once and it travels.
Connect your systems through a standard. The Model Context Protocol lets different AI tools reach the same data the same way, so "where do I find that?" has one answer.
Test your context. This is the step most teams skip. Context rots. Files move, rules change and the document still says the old thing. Stale context is worse than none, because AI will follow it with total confidence. We check ours automatically. If a document points at something that no longer exists, a test fails and someone fixes it.
This is a lead's job
The people who get the most out of AI aren't the best prompt writers. They're lead engineers.
A lead already knows what good looks like past the code. They can tell when AI skipped the failing test, chose a data model that'll hurt in a year or reached for a tool the team doesn't need. A junior directing AI gets junior work back, faster.
Leads also know how to teach, and that's what context really is: mentoring, written down. Everything a good lead says in a code review is context waiting to be captured. "Write the failing test first." "That belongs in a different table." "We don't add a dependency for that."
There's a trap here. If one person holds all the prompts and all the know-how, you've rebuilt the same single point of failure you had before AI. Central knowledge doesn't scale. Written, reviewed, shared context does. Every AI tool gets it, and so does every junior on the team, who now reads the same playbook the AI does.
So treat context like code. Changes get proposed, reviewed and approved by a person, and someone owns it by name.
It also changes the question you ask when AI gets something wrong. Most teams ask which model they should switch to. The better question is what it didn't know, and where that should have been written down.
The models will keep changing. I wrote about that in The tools will change. The process only hardens. What you've written down about how your organization builds things is the part that carries over, and it's a big part of what we help teams build at LPG.