AI Practice

As a freelancer I'm increasingly finding that clients arrive with something they've already made with coding agents. It might be a prototype of something they want to build or even something that's up and running in their own business which they now want to expand.

They may also use it as a way to communicate. A working prototype shows the design, layout and features they want far better than a written description can.

The main sections below each take one part of the picture: the front end, the back end, more than one user, other businesses, corporate customers, security and the structure of the code. Each starts with what your agents can deal with easily, what you'll learn along the way, where you need a technical expert and what will catch you out, followed by a short piece on each.

What clients bring

There are three kinds of thing that turn up:

  • A prototype of something they want built.
  • A demonstration of the design, the layout and how the features should work.
  • Something running in their own business, where they've either hit a wall or want to turn it into a product to sell to similar businesses.

The third has the most in it. On the plus side a lot of business and operational logic is already baked into it, and it's tried and tested in their own business.

However, selling it to other businesses brings a lot of considerations above and beyond what you need for your own business. There are also traps that will need dealing with even if it only ever runs in-house.

The front end

The front end is everything people see and use: the pages, the forms and the buttons. It's usually where a client has spent the most time, and as the visible part of the application it's the easiest to judge just by looking at it.

What your agents can deal with easily:

What you'll learn along the way:

Where you need a technical expert:

What will catch you out:

Building interactive interfaces

This is where coding agents are at their strongest. Describe a page, a form or an interaction and you'll usually get something that works, which you can then refine by looking at it and asking for changes. It's the reason so many clients now arrive with something working.

Tell the agent who each page is for and what they're trying to get done, not just what should be on it. You'll get pages that fit together better, and the descriptions are worth keeping for whoever works on it next.

Layout, styling and wording

Moving things around, changing colours and fonts or renaming a button are quick for an agent, and you can see straight away whether they're right.

Keep the colours, fonts and spacing in one place, such as a stylesheet or a theme, and ask the agent to use it rather than styling each page separately. Then a change of style is one change rather than a hunt through every page.

Manual testing

You know what the application should do better than anyone, so clicking through it yourself is the most useful testing there is at this stage. Keep a written list of the things you check, the main journeys through the application, and go through it after every round of changes. A change in one place can break something that seems unrelated, and the list catches it before your users do.

The same list is what a developer will later turn into automated tests.

Organising an interface as it grows

Something you've made for your own use can be very different from something other people will use. You've grown the user interface piece by piece and you understand what everything does because you made it. The danger is that it grows quite complex and not that logical for anyone else, while you know it fully. User interface design has a long history of established best practices which you are now having to learn to build something that people will find easy to use.

As the visible part of the application, this is the easiest part for a client to work through themselves. They may realise the interface is becoming a sprawling mess and work on consolidating it. They may also realise that what they're building is becoming too complex to manage, and that planning some of it in advance would have been better than piling features on top of features. It's clearest in the user interface but the same thing is happening in the code.

Consistent terminology and messages

Agents name things as they go, so the same thing can turn up as a client on one page, a customer on another and an account on a third. Messages vary in the same way: one page says "Saved", another says "Changes stored" and a third says nothing at all.

Keep a short list of what things are called and the standard messages, and give it to the agent whenever you ask for a change to the interface.

Reusable components

Consolidation applies to the user interface as well as to the code: making it consistent and not having many variants of the same component or several different ways of doing the same thing.

An expert will pull those variants together into a set of components, such as a table, a form field, a dialog or a date picker, that every page is built from. A fix or an improvement to one of them then shows up everywhere, and a new page starts from parts that already work.

Loading and errors

On top of this you have error handling and progress indicators where necessary. Every page that waits for the server needs to show that it's waiting, and every page that can fail needs to say so in a way people understand. Left to themselves agents deal with these page by page, so some pages show a spinner while others freeze, and some errors are shown while others quietly vanish.

An expert will build loading and errors into the one function every page uses to talk to the server, so every page gets them without anyone having to remember. I've written about one way of doing that in Automatic loading spinners in Angular.

Keeping pages in step with the back end

With a web-based application you can update the front end at the same time as the API endpoints, but you still have to consider what happens if an endpoint changes underneath a page that's been open for a long time.

That has to be handled consistently everywhere: checking the version and handling a back end that has moved on when the front end hasn't. The answer can be as simple as asking the user to reload the page. But they won't want to lose anything they've entered, especially in a large form or anywhere they can build up complex data before pressing submit:

const API_VERSION = 7;

async function api(path, body) {
    const response = await fetch(`/api/${path}`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'X-Api-Version': API_VERSION },
        body: JSON.stringify(body),
    });
    if (response.status === 409) {
        //  The back end has moved on: keep what's been entered, then ask for a reload
        saveDraft();
        showReloadMessage();
        throw new Error('API version has changed');
    }
    return response.json();
}
Every call goes through one function, which sends its version and handles the back end having moved on

Here saveDraft keeps whatever is on the page in the browser's local storage, so it can be put back after the reload. The important part is that every call goes through the same function, so the check can't be forgotten anywhere.

The data needs keeping in step too. When two people have the same record open, or one person has it open in two tabs, a page can save over a change it never saw. An expert will have each save say which version of the record it started from, so a save based on an older version is turned away and the page shows the newer one instead of quietly overwriting it.

Securing the user interface

Hiding a button isn't the same as preventing what it does. Anything the interface can do, someone can do directly by calling the API, so the real checks have to be on the server (see Checks in one place under Security).

The front end has its own part to play, though. It shouldn't be sent data the person isn't allowed to see, even if it doesn't display it. Sign-in tokens should be kept where other scripts on the page can't read them. And anything people type should never be put straight into the page as HTML, which is how cross-site scripting gets in. An expert will check all of these across the whole interface rather than page by page.

An interface only you understand

Because you built it piece by piece, everything makes sense to you. The first time someone else sits down with it they won't know which of three ways of doing something is the right one, what the abbreviations mean or why a button is on one page but not another.

Watch someone use it without helping them. It's the quickest way to find out, and it's worth doing before other people depend on it, while it's still cheap to change.

Losing what someone has typed

A long form that's lost when the session runs out, the page reloads or the connection drops is one of the quickest ways to lose people's goodwill. It happens more as the forms get bigger and people leave pages open for longer. Keeping a draft in the browser as they type, like the saveDraft above, means nothing is lost whatever happens to the page.

Mock-ups taken as finished features

AI is very good for mocking up designs and new features, and a client may use it to show what they want next. The expectation can be that a feature made this way is ready to go straight into the application once it's handed to the developers.

But the developers are usually dealing with how all of the issues on this page meet: the permissions, the audit log, the API versions, the data that has to stay compatible, the customers who need notice. It's going to be very difficult to set up a pipeline where what you make goes straight into the application.

At best it's a mock-up showing how the design might look or how a feature might work in a basic way. That's still very useful and much clearer than a written description, but don't expect a finished feature.

The back end

The back end is everything behind the pages: the server code, the API the pages talk to and the database. An application has a front end, a back end and a database, and the back end has a data access layer between its logic and the database:

The layers of an application, with a boundary at the API and another at the data access layer
The layers of an application, with a boundary at the API and another at the data access layer

Agents are good at the parts of this you can see working straight away. The parts that only matter once there's real data, and a lot of it, are where experience counts.

What your agents can deal with easily:

What you'll learn along the way:

Where you need a technical expert:

What will catch you out:

Creating the first database

Ask an agent for a feature and it will create the tables it needs, and on most hosting platforms it can set up the database itself. For a first version that's fine.

Ask it to explain the tables it has made in plain language, and keep the explanation. It's the start of the documentation a developer will want later.

Adding to the database

Adding a table or a column for a new feature is just as easy, and while there's no real data nothing can go wrong.

Get into the habit of having the agent make each change as a migration: a small script kept with the code that makes the change, rather than an edit made directly to the database. Then every copy of the database, whether it's yours, a test copy or later a customer's, can be brought up to date the same way.

New API endpoints

AI agents are happy to create API endpoints when you're working with a server and a front end, and each new feature tends to come with a few of its own. They work, and the agent can add them as fast as you can ask.

Ask the agent to keep a list of them, with what each one does and who should be allowed to call it. You'll need that list when it comes to security.

Backwards compatibility

Once there's real data in the database, every change has to take the existing records with it. A new column that every record must have needs a value for the records already there, and a column that's renamed or split has to be filled in from the old one.

As the application grows, its data storage has to stay backwards compatible or have an upgrade path, so nothing already in the system is invalidated. That includes any files people have downloaded, if the application lets them export and import.

That means designing the database to grow in both the amount of data and the number of features it supports, and migrating the existing data each time it changes.

Keeping history instead of overwriting

Generally the system should be immutable as far as possible: existing records don't get changed. Instead the database is laid out so information builds up, tagged with who changed it, when and what the change was.

The status of an order is a good example. The obvious way is a status field on the order, which gets overwritten each time it changes:

CREATE TABLE orders (
    id       BIGINT NOT NULL AUTO_INCREMENT,
    customer BIGINT NOT NULL,
    total    INT NOT NULL,
    status   VARCHAR(20) NOT NULL,
    PRIMARY KEY (id)
);

UPDATE orders SET status = 'shipped' WHERE id = 1042;
A status that gets overwritten

Once it says shipped there's no record of when it was packed or who packed it, and if someone sets the wrong status by mistake the old one is gone. Instead the order can have a separate list of statuses, each with its own date, where the very last one wins:

An order with its own list of statuses, where the latest one wins
An order with its own list of statuses, where the latest one wins

Changing the status is now an insert, never an update. The history is the audit log, and putting a mistake right is just adding the right status again.

The same goes for deleting. Soft deletes mark things as deleted rather than actually deleting them, so nothing is lost when someone presses the wrong button.

Backups

Most hosting includes automatic backups, but check how often they're taken, how long they're kept and whether they're stored somewhere other than the server they came from. A backup you've never restored is a hope rather than a backup, so restore one to a test copy every so often.

Backups hold everything the database does, personal data included, so they need the same protection as the database itself.

Hosting

AI agents generally choose simple hosting designed for hobbyists, so you may find yourself on Supabase, Vercel or similar providers. These work for small applications but they're basically toys designed to get something off the ground quickly, not solutions for professional development.

At some point you'll be choosing between the real options:

  • Running servers directly with Linode, Hetzner or Amazon, for example. This is simpler to set up and run but more complex when it comes to security and scaling.
  • Cloud solutions such as Amazon Web Services or Microsoft Azure. These are often the right solution for medium to large projects that need to cover a range of scales automatically, but they're much more complicated to set up and get right.

There's no magic wand here. Whichever you choose, be prepared to learn a lot about databases and hosting and potentially never really know whether your product is truly secure.

Consistent database design

Each feature an agent adds tends to bring its own tables, named in its own way and sometimes storing the same information as another table. Over time there are two places a customer's address is kept, and they don't always agree.

An expert will design the tables as a whole: one place for each piece of information, consistent names and types, and relationships between tables that the database itself enforces. That's what lets the database grow in both the amount of data and the number of features without needing to be redesigned.

Efficient queries

Agents write queries that work, and on a small database everything is fast. As the data grows, a list that runs a query for every row, or a search that has to read the whole table, gets slower and slower. Often it happens suddenly, when a table passes a certain size.

An expert will look at which queries run most and how long they take, add the indexes they need, and test with realistic amounts of data rather than a handful of test records.

One place for data access

All of the data access has to be kept in specific places where it can be audited, not spread all over the code. If any part of the code can query the database, there's no single place to enforce the permissions.

An expert will put every read and write behind a data access layer, the bottom layer in the diagram above, so the rest of the code asks for what it needs and never queries the database itself. That layer is also where the security checks under Checks in one place are made a second time.

API versions

Once other businesses are using the application, the API is harder to change too. At this point you need versioning on your APIs.

That's another thing that needs skill. You need to keep a certain amount of backwards compatibility, so pages that are already open, and any other systems that call your API, keep working while they catch up. How the pages handle a back end that has moved on is under Keeping pages in step with the back end.

Scaling and replication

One server and one database will go a long way. When they stop being enough, the database can be replicated, with copies that answer reads and one that takes the writes, and more servers can be added behind a load balancer.

Whether that's possible depends on how the application was written. Anything kept in a server's memory or on its own disk, such as sessions or uploaded files, stops working once there's more than one server. An expert won't build for scale before it's needed, but will avoid the choices that rule it out.

Data security

Agents often have the API send whole records and let the page pick out what to show. Everything the page leaves out is still sent to the browser, where anyone can read it. The same goes for a list that's filtered on the page rather than in the query.

Check what each endpoint actually sends, not just what the page shows. Your browser's developer tools will show you.

Data integrity

Without constraints a database will accept anything: an order for a customer who's been deleted, two records for the same person, or a total that doesn't match its lines. A bug that writes bad data leaves it behind after the bug is fixed, and later features trip over it.

Have the database enforce what must always be true, using foreign keys, unique constraints and transactions that save related changes together or not at all, so bad data can't be written in the first place.

Encryption

Encryption in transit, between the browser and the server, comes with HTTPS and is usually there by default. Encryption at rest, of the database and its backups, often isn't. Backups and copies made for testing are a common way for data to leak, because they get less care than the real thing.

The keys need to be kept apart from the data, or the encryption doesn't protect anything. Personal data in particular should be encrypted at rest, as the next part explains.

Data protection rules

If you hold personal data about your staff or customers, there are rules about how you look after it. Taking the UK as an example, the UK GDPR applies to anyone who holds personal data, and the Information Commissioner's Office (ICO) enforces it. In short:

  • You must keep personal data secure. Encryption isn't strictly required by law, but the ICO recommends it, and personal data should be encrypted at rest using industry-standard methods.
  • People can ask for a copy of all the information you hold about them, and you have one month to provide it (the right of access).
  • People can ask for their information to be removed (the right to erasure), which you also have one month to answer.
  • Most organisations that hold personal data need to pay the ICO a data protection fee.

For the application that means personal data encrypted at rest, a way to gather up everything you hold about one person, and a way to anonymise it on request without breaking the records around it.

Depending on the size of your organisation you'll also need an audit log of everyone who has read or written that information.

More than one user

Even within a single organisation, something one person uses - for example the business owner - is potentially a very different proposition from something several people in the organisation use. That's true even as a purely internal tool.

What your agents can deal with easily:

What you'll learn along the way:

Where you need a technical expert:

What will catch you out:

Signing in

An agent will add sign-in pages quickly. Have it use a well-known sign-in library or service rather than writing its own, and ask for password resets and two-factor sign-in from the start. Both are much harder to add once people are using the application.

Adding and removing users

You'll need to be able to add and remove users, and a page for that is simple to build. Have removing a user disable them rather than delete them, so everything they did stays attached to their name.

Permissions

You don't always want everyone in the organisation to have access to all of the information. So you need a system where every piece of information records not only who created it but who is allowed to access it. There may also be information that some people are allowed to see but not to change.

This takes some thought and some experience of how it can be organised. You may end up rediscovering a lot of it yourself, but you'll start needing to put users into groups and give each group its own set of permissions.

Auditing

If a piece of information changes, do you have a log of who changed it? Can you trace it back? And can you revert anything that was a mistake?

These questions usually come up for the first time just after something has gone wrong, which is the worst time to find that the answer is no.

Reassigning work

When a team member is replaced you need to reassign everything they owned to other users, so the work carries on and no data gets orphaned.

That means being able to find everything a user owns. It's easy if every record says who owns it, and hard if ownership is worked out differently in different parts of the application.

Permissions checked in one place

Every API endpoint has to check those permissions, and this is where it comes back to the architecture. If who can access what is checked all over the code it's very difficult to keep track of, and even an AI agent won't be able to follow it through to show that only the right people can see the data. You need a layered approach, and the best places to secure it are the API and the low-level database access functions.

An audit log you can undo from

The answer to the auditing questions is to keep records rather than overwrite them, as in Keeping history instead of overwriting. An expert will lay the database out so that every change is stored with who made it and when. The history is then the audit log, and undoing a mistake means adding the right record again.

The second person logging in

Until now everything has belonged to one person, so nothing checked who was asking for it. The moment a second person logs in they can see everything the first one could, and a page that shows "my" orders may turn out to show everyone's.

Decide what each person should be able to see and change before you add them, not after.

Someone pressing the wrong button

Think about what happens when somebody presses the wrong button and deletes or changes something in a way that can't be undone.

With one user it's your own mistake to live with. With a team it's someone else's work, and without a history there's no way of knowing what it was before. Soft deletes and a history of changes, both under Keeping history instead of overwriting, turn it from a disaster into a quick fix.

Other businesses

When other businesses start using your application, managing users becomes particularly important, and the application has to work for businesses that aren't yours.

What your agents can deal with easily:

What you'll learn along the way:

Where you need a technical expert:

What will catch you out:

Features for one customer

Other businesses will start having requirements of their own, and you'll have to build some of them. Building each feature is as easy as any other. Where it goes is the harder question, which is under One copy per customer.

Each business's own settings

Each business will want its own name and logo on the application, and its own choices for things like time zones, currencies and the email addresses messages come from. A settings page for each business is easy for an agent to build. Ask for it early, before those things are written into the code.

Each business managing its own users

Each business needs to be able to set up its own users and groups, so what each group can access can't be hard coded. You'll soon find you don't want to be the one adding and removing every customer's staff.

Requests from each customer

You'll find that clients want similar features, but each asks for them in its own way. Part of running a product is deciding which requests belong in the product for everyone, which are settings, and which really are one customer's own.

Training and notice

You're much more restricted in what you can change in the user interface because people have learnt it and rely on it. You'll need to provide training and potentially publish update schedules in advance so your customers can prepare.

Permissions each business sets up

You'll need something on top of the system that's effectively metadata about every page in the interface and every feature on each page. There must be an easy way for a business to set up its users, see all of the permissions at a glance and audit everything anyone has done. Managing users and groups needs permissions of its own, and so does the auditing.

If you're selling to small businesses, or everyone in a business can see the same information, you can get away without some of this. But as you approach corporates as customers you'll definitely need it.

Keeping each business's data apart

With several businesses in one application, every record belongs to one of them, and every query has to be limited to the business that's asking. An expert will enforce that in the data access layer, so it can't be forgotten in any one query, and test it by signing in as one business and trying to reach another's records.

A common core with hooks

Rather than a copy of the application for each customer, the answer is a common core with the right hooks for adding features for specific clients, and modules added to the core that a set of clients share. I've written about how my own framework does this in Modular monoliths in PHP and Maintaining a PHP framework for 25 years.

One copy per customer

It's very tempting to make a copy of the application for each customer, and this will work for a while. But as you get more customers you'll have many copies to manage, with the same problem as repeated code: you fix a bug for one client and then have to fix it for all the others.

At some point the surface area your coding agent deals with becomes a surface area of features and bugs that you have to keep track of.

Harder to change

Once other businesses are using it, some things end up set in stone or at least a lot harder to change, including the user interface, the internal data formats and the API. A change that was a quick fix when you were the only user now needs notice, training and a way for older data and older pages to keep working.

One business seeing another's data

One query that forgets to filter by business, and one customer sees another's orders, prices or staff. It only has to happen once to lose both customers. If personal data is involved it may also be a breach you have to report, which in the UK means telling the ICO within 72 hours.

Corporate customers

Corporates go further still, and everything under Harder to change applies even more strongly: changes to the interface come with training and notice.

What your agents can deal with easily:

What you'll learn along the way:

Where you need a technical expert:

What will catch you out:

Policies and questionnaires

Corporate customers send long security questionnaires and ask for written policies on things like passwords, backups and how you handle an incident. Agents are good at drafting these and at working through the questions. Everything they write has to be true of how you actually work, though, so treat the drafts as a list of things to check.

Exports and reports

Corporates will want their data in their own formats, for their own reporting systems. Exports and scheduled reports are straightforward for an agent to build, as long as they go through the same permission checks as the pages do.

Service level agreements

You'll probably have to provide a service level agreement for uptime. That's a promise of how much of the time the application will be available, how quickly problems will be answered and what happens if you fall short.

Teams managing themselves

If their management isn't centralised, the permissions and auditing need subdividing so team leaders can manage and audit their own teams.

Single sign-on

User management is usually centralised, so you'll have to support single sign-on with whichever system they use: Microsoft Entra ID (formerly Azure Active Directory), Google Workspace, Okta, OneLogin or Ping Identity, among others. Most speak SAML or OpenID Connect for signing in and SCIM for adding and removing users automatically, but each has its own requirements and its own mapping from their groups and roles onto what your system supports.

Supplier standards

You may also have to fit in with their processes and show that you meet the standards they hold their suppliers to. For information security that's usually ISO/IEC 27001, sometimes with Cyber Essentials in the UK or SOC 2 for American companies. Some also ask for ISO 9001, which is about quality management.

Promises you can't measure

An uptime of 99.9% allows about 43 minutes of downtime a month. Without monitoring you won't know how much of that you've used, and the first you hear of an outage may be from the customer. Set up monitoring that checks the application from outside every minute or so and keeps a record, before you sign anything.

Their own IT rules

Corporate networks block things. Their firewalls may stop services your pages load from other sites, their computers may run older browsers, and their policies may require the data to stay in the UK or the EU. Find out before the contract is signed, not when their staff can't log in.

Security

Security runs through every part of the application. It needs an understanding of the security issues that can actually arise, from vulnerabilities in the underlying language and its libraries to structural vulnerabilities in your own code. The consequences are data leaks (or worse, deliberate vandalism or deletion) or corrupted data.

What your agents can deal with easily:

What you'll learn along the way:

Where you need a technical expert:

What will catch you out:

Keeping keys out of the code

Passwords and API keys written into the code end up in every copy of it, in its history and with everyone who works on it. Ask the agent to read them from settings kept outside the code, such as environment variables, and to look through the code for any that are already there. If one has ever been in the code, change it.

Keeping libraries up to date

Most of an application's code is libraries written by other people, and vulnerabilities are found in them all the time. Agents can check for known vulnerabilities and update the libraries, and it's worth having them do it regularly rather than waiting until something forces it. Go through your test list after each update.

Who has access

Over time a lot of people can end up with access to the hosting, the database, the code and the accounts for every service the application uses. Keep a list, give each person their own login rather than sharing one, use two-factor sign-in everywhere, and remove people's access when they stop working on it.

Your hosting platform's security

Hobbyist platforms have their own ongoing security issues that I hope you're on top of. Whatever you're hosted on, its security settings are your responsibility rather than the platform's: who can reach the database, which storage is public and what gets logged. Learn what each setting does rather than relying on the defaults.

A security audit

Have someone experienced audit the system before it holds anyone else's data. They'll go through the endpoints, the sign-in, the permissions and the hosting the way an attacker would, and tell you what to fix before someone else finds it.

Checks in one place

Make sure every endpoint goes through the same checks in one place. The API is one place where you need a security layer: every request is checked for who's making it and whether they're allowed to. If you're being really strict you need a separate but equal security layer on the database access as well, so a mistake in one is caught by the other. That second layer depends on One place for data access.

Checking what arrives

There's a type safety boundary too. Data arriving at the API should be checked for shape and type before anything uses it, and potentially at other layers too. I've written about that in Type safety at the boundaries.

Endpoints nobody checked

AI agents create endpoints as features need them, but again there may be repetition, and security and authentication across the whole API surface need constant watching in any application. An endpoint added for one page and then forgotten is still there for anyone who finds it.

Automated attacks

The big risk isn't necessarily a hacker or a competitor targeting you. It's the constant large-scale automated targeting of everything online. Within minutes of a server going online it's being probed for known weaknesses, default passwords and forgotten files, by programs that don't care who you are.

Infected code

Then there are viruses and other compromises. Especially if you work with freelancers, you may not even realise your code is infected: many freelancers have viruses without knowing it, and these spread through the code of the projects they work on.

Payment details

The risks here are financial. If your code is compromised, personal details including payment details may be being sent to third parties. The first you'll hear of it is the day lots of your customers email to say unauthorised payments have been taken from their accounts. That will not be a good day.

Code structure

Coding agents are now very reliable when it comes to building features that are fairly bug free. But there may still be a lot of repetition in the code and an overall lack of organisation. This doesn't tend to bite early on, and you can get a long way without even considering it. But at some point the code will need rationalising and consolidating.

These are invisible issues that eventually become visible through their consequences.

What your agents can deal with easily:

What you'll learn along the way:

Where you need a technical expert:

What will catch you out:

Consolidating when asked

Ask an agent to find repeated code and pull it into one place and it will usually do it well. The hard part is knowing when to ask.

When a fixed bug comes back, look for other copies of that code and have the agent consolidate them into one. Every so often stop adding features and ask what's been repeated. I've written more about keeping code to a shape you can check in Too much code to read.

Explaining the code

Agents are good at describing code: what each part does, how a request finds its way through it and where a feature lives. Every so often ask for a plain description of how the application is put together, and compare it with the last one. If it's getting harder to describe, it's getting harder to work on.

Build out, consolidate

What works is a cycle: build out for a while, then consolidate, then build out again.

Build out, then consolidate, then build out again
Build out, then consolidate, then build out again

Consolidating might mean simplifying the user interface, and it applies equally to the code and potentially the database. Otherwise the surface area eventually becomes too much for you and your AI agents to deal with. Bugs you thought you had dealt with keep reappearing, and adding to one area of the application can break seemingly unrelated areas that happen to share some code.

The order you build things in

Agents can build features in almost any order, but the order still matters. You want to build the architectural pieces first and consider carefully how they'll be used, so that features are built on top of them rather than each bringing its own copy.

An architecture that grows

Most of the points in the sections above come back to the architecture. An expert decides which modules the application is made of, what each one is responsible for and how they talk to each other. A new feature then has an obvious place to go, and its complexity stays inside it rather than spreading through the rest of the code. I've written about one way of doing that in Modular monoliths in PHP.

Automated tests

The list you check by hand under Manual testing can become tests that run on every change. An expert will write tests for the parts that matter most, such as permissions, payments and anything that changes existing data, so a change that breaks them is caught before it's released rather than after.

Bugs that come back

Repeated code and a lack of high-level organisation eventually mean you fix a bug in one place and think it's fixed, but it still appears elsewhere because it needed fixing in several places. Bugs you thought you'd fixed keep popping up.

Rising agent costs

Without some architectural consolidation along the way, a growing code base has a larger and larger surface area. Every new feature has more places it needs hooking into. Either your costs go up as the agents find all of those places, or some get missed and a feature works in one context but not another.

The interfaces between parts of the code also grow more complex as you go.

What you can get away with

A lot of this comes down to the fact that without the experience you're going to set yourself traps. Some aren't too bad and are easily put right later, but some will come back and bite you.

TrapFine whileBites when
Repeated codeit's small and changing fastfixed bugs keep coming back, and agent costs climb
A sprawling interfaceonly you use itsomeone else has to learn it
No permissionsone person uses ita second person logs in
Overwriting recordsmistakes are cheapsomeone deletes something that matters
No upgrade path for the datathere's no data worth keepinga change breaks what's already there
No API versionspages are reloaded oftena page left open talks to a newer back end
One copy per customerthere are one or two customersevery fix has to be made over and over
No single sign-onthe customers are small businessesthe first corporate customer
Hobbyist hostingthe application is smallit has to scale, or the platform's security issues become yours
Unchecked API endpointsnever, once it's on the internetsomeone finds one
Unprotected personal datanever, once you hold anythere's a breach, or a request you can't answer

Where experience still counts

Amongst all of this there are things that need human judgement, and not always technical experience. Some need judgement in a product manager role. Some need experience of having dealt with this before, even as a product manager: knowing for instance that users, groups and auditing will be needed.

Some need technical experience:

  • How to make the product secure.
  • How to design databases that allow for growth in both data and features without breaking existing data, and how to migrate that data as it grows.
  • How to architect a product so there's no code repetition and its complexity grows in a controlled way, only where new features are added, rather than without limit.
  • How to scale from a single user to many users to many businesses on one application, keeping a common core with the right hooks for each client's features.

And some need experience of having done it the wrong way. Taking an application down this road you'll discover a lot of these things, but probably as the issues hit you rather than by preparing for them in advance.

Building it yourself

If you're going to build it yourself you may make a lot of progress at first. But eventually you'll run into many of the things that people with development experience will (hopefully) know how to avoid by structuring the code and the user interface appropriately from the start.

Be prepared to learn a lot along the way. And be mindful that there may be a lot of things you don't know that you don't know. In the worst case they'll come back and bite you; otherwise they can slow progress to a crawl as you get stuck in a loop of fixing things.

See also