I wanted to test a simple claim: you can ship maintainable software by vibe-coding end to end. I set strict constraints:

In about a day1 I had a working Firefox add-on I could submit for review. The code meets my bar for readability and long‑term change. Even the icon came from an image model2.

Introducing Container Traffic Control.

Container Traffic Control Icon

On the vibe-coding process

It’s in vogue to share horror stories of decimated vibe-coded repos3. But I’m convinced that with the right fundamentals, you can vibe-code a codebase you’d comfortably hand to another engineer.

This was my experiment to vet my feelings on the subject. Granted, this was a small and arguably very simple repository, but I’ve also seen success with moderately larger codebases personally.

It comes down to scrupulous pruning: updating system instructions, diligent prompting, and code review. I plan to write much more about this later, but let’s talk about some of the mechanics of how it went:

I didn’t write a single line of JavaScript by hand. When I needed changes, better structure, reusable patterns, small refactors — I asked the agent. The goal throughout was simple: keep the codebase readable and maintainable. It now has a lot of the things we consider important for a decent codebase:

The best part: most of this came together over two days4. Some example pull requests from the repository with the exact prompt I used and the plan that was generated:

Here’s the very first prompt I used to generate the guts of the code:

# Role/Persona:
- you are an expert java developer who is well versed with making firefox add-ons and extensions.
- you have a strong propensity to write clearly legible code with simple to understand code comments.

# Task/Goal:
- write the functionality for the firefox add-on "Container Traffic Control" (CTC). I will provide you with the
requirements
- work on first task which is adding the rules, running the validation check, then outputting clear debug logs


# Details:
- the container takes in rules from the preferences panel; it does it similarly to how the extension (see
screenshot)
    - you can find all the relevant code for the extension "conductor" that does something similar
https://github.com/mcortt/Conductor - this is where the screenshot is from
- where CTC is different from conductor is that CTC takes in a rule with 4 possible fields (each rule will have 4
fields)
  - 1. container name (name of firefox container)
  - 2. allow/block (drop down that says this rule should either "block" or "allow"
  - 3. url pattern (regex pattern that will match the website url someone is about to navigate to)
  - 4. high prioirty (is this rule a high prioirty rule)
- CTC will build a redirectRules object similar to Conductor based on the rules that a user inputs

[Image #1]

- on attempting to save a rule, CTC will always run a "validation check" on all rules:
  - same url pattern cannot have more than one high priority container
  - same url pattern cannot have both allow and block
  - Allow Only + `*`  - invalid rule

in a future task i will provide how to process these rules. but for now, i would like to achieve the following:
- allow a user to input rules
- rule is saved if validated
- on each save, print an output log showing the table or list of rules object

the code must be extremely legible, simple and clean
- avoid overly nesting or including too many classes of fancy javascript

# Context:

- https://github.com/mcortt/Conductor/blob/6daa9ce23f2de0dc43f9e07378da03f141195fec/background.js is the main file
from conductor that you cna draw inspiration from
- i also like the addon https://github.com/kemayo/firefox-sticky-containers/blob/master/background.js which has a
clean style of code commenting and details - use this for inspiration in terms of how to write the code, add
comments, and debug logs
- container-redirect is an advanced add-on which provides almost the same set of complexity/functionality that CTC
will eventually achieve - code can be found here
https://github.com/max-dw-i/container-redirect/blob/master/src/index.js ; you may use this to figure out how
containers in firefox work, differnet functionality that can be achieved etc.

you are allowed to search the codebases of these plugins if necessary.

# Output Format:
- i want you to go through the asks
- if there are things that are unclear, raise them and ask me questions
- propose a set of tasks or plan on how you intend to go about achieving this feature first.

once i agree to the plan, i want you to write down a detailed checkpoint document in @.ai/plans/ctc-add-rule.md

I captured my prompts but wasn’t diligent about surfacing them in pull requests; here are a few I did capture:

The code is open source, so go ahead and check it out.

About the add-on itself

In my last post, How to Firefox, I covered “Privacy power-up: Containers”5. “Containers” let you log in to multiple Gmail accounts without separate browser profiles. Add Total Cookie Protection and you get strong isolation.

That’s great, but managing it automatically gets tedious fast. Examples:

Added these test cases

I realized while writing this post I should probably have these exact use cases tested, so I did just that right now… as I continued to flush out this post.

You can’t achieve this level of control with default containers unless you micromanage every case — and even then, some are impossible. I tried various add-ons but kept hitting cases that just wouldn’t work.

So I built my own. I also prefer how this add-on asks you to set up rules:

Rule setup
How the rules work

Overall, I enjoyed the experiment. I’ve been happily using my add-on, and I feel confident that if I needed to make changes, I could do it in what I consider a maintainable codebase.

Stay tuned for my tips on how you can use AI coding more constructively.


  1. The bulk took a few hours; the rest was tweaks between other work. ↩︎

  2. Google’s new 🍌 model↩︎

  3. which I don’t for a second deny exist. ↩︎

  4. Honestly, the work put together was probably a few hours. I was issuing commands mostly on the side and going about my business, coming back later when I had time to tweak and re-instruct. ↩︎

  5. I’ve since updated the post to point to my new Firefox add-on. ↩︎