r/webdev • • 8h ago

Curious about people's workflow using AI

So, yeah. I'm very curious about how developers use AI in their workflow. I go first: if I need to start a project from the scratch for example using pnpm, At first I plan endpoints, etc. Then, I think about .css styles. So, I write all colours, dark/light mode, etc. Then, pages, buttons, etc. but in a very rough way. Then I make components in a way AI will understand later to make it right and finally security but very incomplete way, for example: CORS, then I add some security skills, for example from Cloudflare, etc. The point here is showing AI what you want to do later, not writing the whole code yourself. But, showing the path AI must follow. After that, I ask AI to improve the small code I made. But I don't ask: "AI finish this project". I go instead for every unfinished function, component, hooks, etc and ask:"make it better". Knowing that every path AI takes is because I instruct to it already. So, in a way I have the control, since AI already have the context of the project I make AI to work recursively. I also ask to comment changes that are relevant to the project in the changed files for future references. For me, It works great, because if you show AI some code before completion, even if it's small. AI agents will just works great. Anyone working this way too? Last but not least, I take care of commits, GitHub actions, etc. myself. I don't trust AI to push any files outside my dev projects.

0 Upvotes

21 comments sorted by

3

u/mrbmi513 8h ago

I use AI mainly for scaffolding, rapid prototyping, and minor corrections while I'm reviewing my own code.

1

u/p0sitiv3_Junki3 7h ago

It works great, even in production but you need to give very specific instructions to AI agentes to work the way you want! Of course, you need to know how to code anyway..

2

u/xzinkx 8h ago

the rough skeleton first part is underrated, it copies whatever patterns it sees so a few hand written components set the tone for the rest. i'd add a short rules file (CLAUDE.md or similar) with your conventions so you don't have to repeat them every prompt. and agreed on keeping commits to yourself

1

u/p0sitiv3_Junki3 7h ago

true, show to some AI agents some import libraries, a few raw functions in a component and some endpoints, and very important a right idea how your website should work then maybe if you're lucky you'll have a whole project almost ready in a day!

1

u/Variumcode 7h ago

similar here, but instead of leaving notes in the code i keep one AGENTS.md at the root with the project rules, decisions and "don't touch X". every session starts from that so i don't re-explain the context, and when the agent gets something wrong i add a line there so it doesn't happen again

1

u/p0sitiv3_Junki3 7h ago

AGENTS.md is fine actually! however I do comment some files (or AI do it) because is easier sometimes and while most code comes from some AI agent I do code myself, so I need to keep track some specific tasks.

1

u/Asly97 3h ago

One AGENTS.md at the root is basically my setup too, rules and decisions and the don't touch list all in one place.

The part I keep wondering about is the growth. Every time the agent gets something wrong you add a line, so does that file just keep getting longer, or do you ever go back and prune lines that stopped mattering? I used to let mine grow unchecked and half of it ended up being rules for stuff I had already changed.

Also, when you have tried a different tool on the same project, did it read that same file happily, or did you end up keeping a second version for it?

2

u/Classic-Remote-5860 8h ago

so AI writes basically every function in the codebase but the line you dont cross is git push? thats a strange place to draw the line honestly. youre already trusting it with the code, the push is not the scary part lol

and the "make it better" loop, what does better mean though. you give it a function that works and it comes back with a different approach, a try/catch you didnt ask for, your vars renamed, and now you have to read the whole diff anyway to check it didnt quietly break something. so the review work is still there, you just moved it around and called it control.

but the comments in the files, that one really gets me. "changed this to handle the edge case" written in the middle of the function like a note to future you who will have no idea what edge case and no idea if it's still true. that's what the commit message is for and you already said you do the commits yourself. so which is it. I just dont see what those comments are buying you besides a longer diff"}

2

u/elendee 5h ago

Same.. AI is "the completer". Same with game dev art for me. I sketch it myself, upload, photoshop it, describe, then at the end tell AI to render it into different styles or contexts.

The worst has been a 10 year old game I have, 100k lines of code, trying to get AI to play nicely with all the old patterns in there. I find it best to talk with AI only abstractly, I had bad luck using Opencode doing anything that made the code more cohesive. It was just random "upgrades" of conflicting styles that burned through my free plan in 10 minutes.

0

u/VariousOil3936 8h ago

First I use Claude to build custom agent configuration to evaluate the project at hand. Execute that agent. Output should be high level spec. Review that spec. Work with Claude to revise 

Then use Claude to turn that high level spec into formalized system requirements. Everything should be individually numbered

Then use Claude to turn those system requirements into GitHub issues. Reqs to issues are a many-to-one (not one to one).  Essential here: add “blocked by” relationships between issues and size them. Only S and M issues should be actionable, treat L and XL as parents that need sub-issues of size S or M. Again, use Claude to make the sub-issues.

Then make the first commit of the repo  docs/ containing your spec and system requirements

Then add a .claude/ containing allow/deny rules (depends on yr env) and custom agents, skills, hooks (all highly dependent on what your doing). 

Then add a CLAUDE.md making reference to the GH project where you added the issues and description for a phase based workflow. Add a line that says your spec and formalized requirements are frozen. Add a line explaining to author ADRs in docs/ for changes to assumptions in the spec or reqs. 

Then add a .github/ with ci/cd containing your basic initial commit stuff (compile; tests; whatever) and automated AI reviewers. Big thing here: you should have one reviewer for correctness and another reviewer for adherence to conventions 

I highly recommend unit test coverage ramping, post deploy e2e tests of live env, functional tests against the real DB, etc. since AI does everything you need a massive amount of traditional guardrails. You’re gonna want stuff like blue/green deploys if this is a serious project 

At this point you can start work. All you should need to actually prompt is “do issue #X” and if you set up all your configuration right you’ll get some pretty flawless results.

Left out a lot of details but if you wanna know any more let me know. If some of this stuff is confusing check out matthew pocock (for stuff like phase boundaries and skills to use) 

0

u/p0sitiv3_Junki3 6h ago

I don't use claude, sorry 😔

1

u/VariousOil3936 6h ago

Everything I said works with any agent, all concepts either directly portable or analogous 

1

u/onoke99 8h ago

In the first scene of collaboration with AI, it was asking 'How should we go?' to AI. It was the same with a human being. Then AI suggested the road map. I followed the way: show the requirements, tools, goal, and attention points. AI put out codes as following my requirements. I am not sure the AI was skillful or not, but it spit out ad hoc snippets sometimes. So I never got any relief from it. Maybe do not need to write codes by myself, but knowledge and experiences were to be more important to finish it.

1

u/snap-dev 8h ago

the thing that helped me trust the output more is making it write or run a test for each function before moving on, instead of reading everything by eye. small diffs per prompt too, so when something breaks you know which change caused it. and security stuff like auth checks and input validation i still review by hand, since that's where it fails quietly. do you keep a rules file in the repo so it follows your conventions?

1

u/palmersarah1 6h ago

Small diffs per prompt, agreed

1

u/Patient_Celery_2406 6h ago

You've made all the design decisions before the AI touches anything, so of course it fills in nicely. Does the same loop hold on a repo you didn't scaffold, where half the code is two years old and nobody remembers why?

1

u/prompt_scout 6h ago

biggest thing for me is keeping each prompt small, like one component or one bug at a time. whenever i let it build a whole feature in one shot i spend more time deleting weird abstractions than writing it myself.

1

u/lazyEmperer 6h ago

the piece carrying your whole setup is seeding the skeleton first so the model copies your patterns instead of inventing new ones every file, that's the real win lol, the per function make it better bit I'd watch though, it quietly drifts and gilds stuff that was fine, I give it a target like cut rerenders or handle the empty state so improve has an actual finish line

1

u/Logical_Part9021 4h ago

I build my apps solo mostly with cursor and claude, and what changed the most for me was writing the feature out in plain words first, what it should do and what it shouldn't touch, before any code. same with the skeleton, it copies whatever patterns are already in the project, good or bad, so the first few files matter a lot.