↓ Skip to main content

my methodology for vibecoding: gaur

·1866 words·9 mins· loading · loading · ·
Table of Contents

lowkey, there was no method. i just did whatever seemed best at the time.

and yet people keep asking for “the methodology”. so here it is: 455 commits of whatever seemed best at the time (that count is from the end of september; the repo has kept moving since), and the handful of rules i apparently picked up along the way without noticing.

every line of code in gaur was written by the AI. i wrote none of it.

that is not a disclaimer but the premise. what i did write was the threat model, the architecture, the commit messages, and the word “no” about four hundred times.

the result is gaur: a keyboard-driven TUI for searching, installing, updating and cleaning packages on Arch. the source, history, tests and CI are public, so the technical claims are there to be checked. none of this is a claim that the thing is bug-free.

gaur in catppuccin mocha

i just wanted paruz back
#

there was a package in the AUR called paruz: an fzf wrapper around paru. fuzzy search, hit enter, it installs. far less friction than guessing package names at a prompt. i use Arch as a daily driver, so do my friends, we all liked it.

then it broke. the developer abandoned it and took the source down. no fork, no archive, nothing.

so i thought: maybe i could vibecode a replacement. how hard could it be? a search box, a list, a details pane, and a command that runs when you hit enter.

3,645 lines later i had something that worked. and the first thing i did was nothing at all. i didn’t run git init. the whole thing existed in one untracked file before version control entered my mind.

the project started badly
#

the first real commit in the history is still there and i have never edited it:

monolith initial commit (forgot to track from beginning)

it stays as a monument. 3,645 lines of gaur.go: install, remove, update, dashboard, themes, fuzzy matching, all of it, one file, one sitting, no history.

people treat version control like bookkeeping for a team. there was no team. but the reason it matters anyway is dull and important: it makes decisions reversible. every regression had a before. without that the monolith wasn’t a design, it was a fossil: you can look at it, you can’t take it apart.

so the first real engineering decision was just being honest about what the program actually was: a state machine that draws itself. that’s Bubble Tea and the Elm Architecture: a model holds state, update handles messages, view renders. a keypress, a timer, and a subprocess that finished are all just messages. deciding that was mine. getting it right across the codebase was not.

the second decision was a wall between the app and everything it runs. every external command goes through one interface: production is a thin wrapper over the standard library, tests record what they were asked to run instead of running it. i didn’t ask for that for security. i asked because i was tired of tests shelling out to pacman -Si to assert something about a string. the security win came later, for free; the exact seam you need to mock is also the seam where command injection lives.

reality forced me to engineer
#

two things ate a month of my life, and they are the parts of this i would actually defend.

the AUR outage. i couldn’t tell whether the service was down or my code was broken. the UI rendered an empty list either way. so i sat there rerunning my own binary like a health check, purely to find out whether the app worked, debugging the internet with my program as the probe.

the fix was unglamorous: empty results and failures had to look different, and the failure had to say what it was. the network handed me the other half: a search comes back whenever it comes back, so a response arriving after you have typed something else has to be thrown away, not dropped on top of newer results.

the lesson: the network is a bug you cannot reproduce locally. you cannot unit test “the server is having a bad day”. you can only decide in advance what failure looks like and make sure it is distinguishable. build that first; you’ll need it at 2am.

the CPU spike. moving through the package list was spawning processes and opening connections constantly, most already obsolete on arrival.

local and remote work have different costs. the package list comes from pacman’s local database, so it can re-run on every keystroke and stay instant. the details pane calls the AUR helper for package details, so it got a 150ms debounce: scroll fast, fire one request, not forty. the search got three gates instead: no AUR query under two characters, no query repeated, and only one request in flight at a time.

that split is the part i’d call a real finding: debouncing is for events that fire faster than you can think; a lock is for work that must never overlap. a timer on top of the lock would only have added cancellation paths. and i’m glad this surfaced before i pointed gaur at a group chat: a small tool that forgets its gates can start hammering someone else’s infrastructure the moment other people use it. your tool is small. your traffic isn’t.

after that the thing simply grew: install, remove, selective updates, a dashboard, cache cleaning, mirrors, config, eleven themes. the pattern that held throughout is everything hard is somebody else’s job. conflict resolution, licence prompts, password prompts, dependency solving, download progress, build output. paru and pacman already do all of it and do it better than anything i would have written. gaur chooses packages, hands off, reacts when the process exits, refreshes. cache numbers come from paccache, mirror changes from reflector, and both show the exact command before it runs.

one exception, which i’d still defend. i thought selective updates were bad practice, and -Syu exists for a reason. then at a hackathon a friend told me he couldn’t update one package when he was short on time, and that was simply his workflow. so the feature exists, reluctantly, for a user who has already decided. engineering preference and actual use are different inputs, and only one is the user’s.

i had to decide what i was trusting
#

once gaur could change the system, “it looked fine” stopped being an answer. the question became: what am i trusting, and where does it touch me?

the list is short. the local pacman database, which an attacker with root already owns. the config file and the themes, which are just files on disk. and the interesting one is everything the AUR hands back: package names, descriptions, versions, repository labels, all attacker-controlled, all about to be rendered in a terminal, some about to become arguments to a program.

so the mitigations started as sentences from me: “what if the package name contained a semicolon?”, and became code, and then became tests.

  • commands are argument arrays, never strings handed to a shell. there is no bash -c, and nothing to interpolate into.
  • package names pass an allowlist: letters, digits, @ . _ + -, and never a leading - or .. anything else is rejected before it can become an argument.
  • untrusted text that reaches the screen has its terminal control sequences stripped. escape sequences can move the cursor or repaint a confirmation dialog as something else entirely, which is the least fun bug i have ever had.
  • gaur doesn’t elevate its own process to root, and it never draws a Password: box. privileged operations are handed off to sudo, with the TUI suspended so the helper owns the terminal.
  • the human stays at the point of consequence: no --noconfirm by default, so the decision happens in front of the person wearing it.

be precise about what those are worth, because this is where the bragging usually goes wrong. argument arrays stop the shell interpreting metacharacters; they do not make every argument safe to the program receiving it. an allowlist that rejects ; and $(…) is a layer, not a substitute for the array. an unprivileged process can still read your SSH keys and your browser profile, so “it can’t sudo” means a smaller blast radius, not a harmless one. and never drawing a prompt removes one place to spoof a prompt; it does not make the helper’s own output trustworthy. none of this proves gaur is secure. it is the list of risks i tried to reduce, with the limits written down.

what turned that from a feeling into engineering was the loop: threat model, then test, then CI. the important behaviours have regression tests: command construction, hostile package names, terminal escape sequences, configuration validation. the tests won’t prove the whole security model correct, but they can catch someone accidentally undoing controls we’ve already put in place. there is a dedicated security suite whose only job is to stay annoying, sitting inside a test suite that now outweighs the program it exercises. the CI workflow runs the scanners on their configured triggers (pushes and pull requests, plus a weekly scheduled vulnerability pass), and a dedicated job runs only the security tests so they cannot get lost in the noise. the honest part matters more than the checklist: i don’t want to suppress findings just to keep a badge green. the govulncheck allowlist is for advisories that have been reviewed; its format calls for an owner, a reason and a review-by date, and CI fails when a reachable advisory isn’t listed. that’s a guardrail, not proof that an allowlisted finding is harmless. a scanner you have trained to always say “pass” is decoration.

so what was the methodology?
#

there wasn’t one at the start. there is now, and it is short:

  • commit before it works, not after. history should start before the decisions.
  • draw boundaries where the program’s real responsibilities are, before growth finds them for you.
  • make failures distinguishable from empty results.
  • test what you would be embarrassed to get wrong, and read those tests.
  • threat-model anything handling untrusted input or near privilege.
  • read the diff. “the model seemed confident” is not a review.

what i would still do differently: write the threat model before the install button. i wrote it after and got lucky that the architecture happened to be injectable-friendly. and name things once. i spent real commits renaming Uninstall to Remove, because two words for one concept is how you end up with two slightly different implementations of it.

then the last one, which is the best joke in the project. gaur is an AUR package. the same ecosystem that took paruz away from me is the one gaur now ships through, and a maintainer can walk away from it just as fast. that’s the argument for keeping the source public, for the history living in commits rather than in a blog post, and for anyone who’d rather check than take my word for it. docs are at gaur.prbhtkumr.xyz, and the package is gaur-bin.

the code was never mine. the decisions were.

Prabhat Kumar
Author
Prabhat Kumar

Related

© 2026 Prabhat Kumar