Scoped Execution: How to build real systems in layers with AI

Alexandru IonAlexandru Ion
5 min read

Isolate, prompt, execute, repeat. It's the only sane way to build anything non-trivial with AI and not lose your mind.

Alright, so you’ve done the hard part. You’ve battled your own assumptions, used AI to co-plan your product, and (hopefully) translated that clarity into a set of crisp markdown files that actually describe your system’s architecture. You’ve got the blueprint of your idea with the help of the AI.

Now it’s time to build. And this, my friends, is where most people using AI go spectacularly off the rails.

They try to do too much, too fast, with one single prompt. They’ll stare at their screen, summon their AI, and utter some vague incantation like:

“Okay, build the entire user authentication feature. You know, sign-up, login, password reset, the whole shebang. Make it secure. Thanks.”

"I want a dashboard connected to my Gitlab account that extracts the data from my merge requests so I can share my stats with others."

And the AI, bless its silicon heart, tries. It churns out schemas, API endpoints, maybe even some half-baked React components. But underneath that veneer of "progress," it’s pure chaos. Inconsistent naming conventions that’ll make your eyes bleed, and wild assumptions about your database. Error handling? What error handling? Half the time, its output directly contradicts the beautiful docs you spent a day writing. That, of course, if you wrote any and you didn't directly start prompting.

Why? Because you didn’t isolate the problem. You handed your AI a multi-headed hydra of a task with zero guardrails and expected a unicorn.

The solution? Scoped prompting, the PDD golden rule

If you followed all the steps described in my previous articles, then you know how Prompt-Driven Development (PDD) breaks this madness with a simple, unshakeable rule:

One feature. One layer. One prompt.

You’re not building a monolith in one go, instead, you’re assembling it piece by piece, like a master craftsman.

Here’s how I should have initially broken down that "Cards" feature from my Jira-sync project, and how I do it now with PDD:

Phase 1: The absolute foundation: the database model

Begin development for the Cards feature.
Focus ONLY on the Database model.
Use and strictly follow the specifications in @cards-model.md.
Ensure alignment with the project structure and naming conventions outlined in @overview.md, and update the feature checklist when done with progress on a task.

Phase 2: Backend logic: the API endpoints

Continue development for the Cards feature.
Focus ONLY on the Create and Update API endpoints for Cards.
Implement according to @cards-backend.md, using the previously defined @cards-model.md for data structures.
Adhere to error handling patterns in @overview.md, and update the feature checklist when done with progress on a task.

Phase 3: Adding complexity: realtime logic (e.g., Redis pub/sub)

Now, integrate Redis pub/sub for real-time card updates.
Focus ONLY on the pub/sub mechanism as defined in @cards-realtime.md, and update the feature checklist when done with progress on a task.
This will interact with the services defined around @cards-backend.md.

Phase 4: Bringing it to Life – Frontend UI Component

Build the `CardItem` React component.
Focus ONLY on its structure and props as defined in @cards-frontend-ui.md.
Follow project styling conventions from @overview.md and use `@ui-library-components.md` for existing component references, and update the feature checklist when done with progress on a task.

This layered approach is predictable, scalable, and most importantly, maintainable. If something breaks (and it will), you know exactly which layer, which prompt, and which document to scrutinize.

And because each chunk of work is laser-guided by a single, scoped document, the AI stays on target. Fewer "creative interpretations," and less wandering logic. No more accidental feature creep that blows up your timeline.

Building methodically means you can rework a feature built by AI at any given time because you know exactly how the feature was built, how clear it is defined, and how it wasn't built on top of a vibe. No, it was built on a solid foundation, following clear guidelines and best practices. Just like any other real product out there.

The prompt template that actually keeps AI in your control

You no longer have to carefully consider each word in your prompt and the ways it might be interpreted by the AI during execution. Prompts need clarity and structure too. Here’s the exact format I lean on every single time:

Begin/Continue development for [FEATURE NAME].

Focus ONLY on [THE SPECIFIC SCOPE - e.g., "the User database schema," "the GET /products/:id endpoint," "the ProductCard React component's initial state logic"].

Strictly follow ALL specifications, constraints, and examples defined in [@your-specific-feature-layer-doc.md].
Adhere to ALL project-wide standards, naming conventions, and architectural principles outlined in [@overview.md], and update the feature checklist when done with progress on a task.
[Optional: If using a specific library/tool] Use ONLY official documentation for [library/tool name - e.g., "Express.js," "Prisma ORM"] as your primary reference for its API and best practices.

STOP and ask for clarification if ANYTHING in the provided documentation is unclear, ambiguous, or seems incomplete. DO NOT proceed with assumptions.

Best part about it? If you feel like you don't like AI's output, then you know where to make changes. You're either not clear enough in your documentation, or didn't break features well enough so the AI creates spaghetti code.

This isn't just "good practice," this should be the way forward. Because the moment your project grows beyond a toy app, those vague, hopeful prompts will absolutely destroy your velocity and bury you in technical debt.

You're telling the AI exactly what to do, exactly what constraints to obey, and exactly what your definition of "done" is for that specific piece.


0
Subscribe to my newsletter

Read articles from Alexandru Ion directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Alexandru Ion
Alexandru Ion