I previously let an AI agent build an entire social media site in one day. It worked, but then it introduced a bug that neither I nor the agent could fix because I had no idea what the code did.

Now I want to rebuild it. I want to use AI again, but this time as an assistant – I’ll review every change, write tests together, and keep a clear plan.

Which AI tool would you recommend for this hybrid approach? How do you structure prompts to force the agent to explain before coding?

Also, do you think a couple of weeks is realistic to rebuild the site that has feature parity with Lemmy and a few extra features that the AI managed to build in a single day? Should I switch to a more manual approach with the agent only for boilerplate?

Any advice is appreciated. Thanks!

  • MagicShel@lemmy.zip
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    4 hours ago

    If you have the knowledge and understanding to build such a system from the ground up, and you can translate that knowledge into a set of very detailed instructions, you might be successful in this. If you can’t, you will not.

    The fact that you couldn’t fix a bug it introduced by just rolling back to an earlier commit and trying something different tells me a lot. You likely don’t have the domain knowledge to build a social media site (no worries, me either). Have you moderated / admined social media before?

    What’s your database going to be? What’s the schema? Why? What endpoints will you need? What is the API contract? What is your versioning scheme for your API contract? What admin tools do you intend to create? How are they secured? How do you store passwords? How does a user reset their own password? How do you prevent hacking attempts?& How do you handle media? How do you handle gdpr requests? How will you handle blocking? How will you prevent CSAM? How will you handle DDOS attacks?

    If you haven’t thought about every single one of those questions and more, you’re not ready to build this. Good luck, mate.

  • thingsiplay@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    3 hours ago

    I took your post title and body text, and asked a local Ai (on my 8gb vram lol, most of it runs on cpu and is slow) what it “thinks” of. Just for the lols. I think using an Ai to answer this question is appropriate. I did not read the answer, but I think this is only fair.

    Input

    I there is a user in forum asking a question.

    Title: “Rebuilding a social platform – how to use an AI agent as a pair programmer, not a black box?”

    Body: “”" I previously let an AI agent build an entire social media site in one day. It worked, but then it introduced a bug that neither I nor the agent could fix because I had no idea what the code did. Now I want to rebuild it. I want to use AI again, but this time as an assistant – I’ll review every change, write tests together, and keep a clear plan. Which AI tool would you recommend for this hybrid approach? How do you structure prompts to force the agent to explain before coding? Also, do you think a couple of weeks is realistic to rebuild the site that has feature parity with Lemmy and a few extra features that the AI managed to build in a single day? Should I switch to a more manual approach with the agent only for boilerplate? Any advice is appreciated. Thanks! “”"

    What do you think about this?

    Output

    This is a classic “AI Honeymoon” story. The user experienced the initial rush of seeing a functional app appear instantly, only to hit the “Complexity Wall”—the moment where the AI-generated technical debt becomes so high that the human can no longer maintain the system.

    If you are responding to this user, here is a breakdown of how to analyze their situation and the advice you should give them.

    1. The Reality Check: The “Lemmy” Problem

    The most concerning part of the post is the timeline: “a couple of weeks… feature parity with Lemmy.”

    The verdict: This is wildly unrealistic. Lemmy is not just a “social site.” It is a federated platform using the ActivityPub protocol. It involves complex distributed systems, asynchronous messaging, complex database schemas for nesting comments, and rigorous security for federation.

    • The Trap: The user thinks that because the AI “built a site in one day,” it can build a complex site in two weeks.
    • The Truth: AI is great at building “Happy Path” prototypes (things that work when everything goes right). It is terrible at building “Edge Case” architecture (things that don’t break when 1,000 people use it or when a malicious actor tries to crash the server).

    2. Tool Recommendations

    To move away from the “Black Box,” the user needs tools that have context of the entire codebase, not just a single chat window.

    • Cursor: Currently the gold standard. It’s a fork of VS Code that indexes the entire project. This allows the AI to “see” how a change in UserAuth.ts affects PostController.ts, reducing the chance of those “unfixable bugs.”
    • Claude 3.5 Sonnet: Widely considered the best model for coding logic and refactoring right now. It tends to be more concise and less “lazy” than GPT-4o.
    • GitHub Copilot (with Workspace): Good for boilerplate, but less “architectural” than Cursor.

    3. The “Anti-Black Box” Prompting Strategy

    The user wants to know how to force the AI to explain first. They need to implement a “Design-First” workflow.

    Suggested Prompting Framework: Instead of saying “Build a comment section,” they should use a multi-step prompt:

    1. The Blueprint Phase: “I want to build a comment section. Before writing any code, provide a technical design document. Include: 1) The database schema changes, 2) The API endpoints required, and 3) How you will handle nested replies. Do not write the implementation yet.”
    2. The Critique Phase: The user reviews the plan. “I don’t like how you’re handling the nesting; let’s use a path-enumeration strategy instead of recursive joins. Update the plan.”
    3. The Test-Driven Phase: “Now, write the Vitest/Jest tests for the logic we just agreed upon. The tests should fail initially.”
    4. The Implementation Phase: “Now, write the minimal amount of code necessary to make those tests pass.”

    4. Manual vs. AI Balance

    The user asked if they should switch to a more manual approach. Yes, but specifically for the “Glue Logic.”

    • AI for: Boilerplate, writing repetitive CSS, generating unit tests, and explaining unfamiliar library documentation.
    • Human for: Database schema design, authentication flow, security permissions, and the overall project structure.

    Summary of Advice for the User

    If I were replying to them, I would say:

    "You’ve just learned the hardest lesson in AI coding: Code you didn’t write is code you can’t fix.

    First, be honest with yourself: you cannot achieve Lemmy-level parity in two weeks. Lemmy is a complex federated system; if you rush it with AI, you will end up with the same ‘black box’ bug that killed your first version.

    Use Cursor with Claude 3.5 Sonnet. Stop asking the AI to ‘build features’ and start asking it to ‘propose architectures.’ Force it to write the tests before the code. If you can’t explain how a function works to a human, don’t let the AI commit it to your repo."

    - google/gemma-4-31b-qat

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    4 hours ago

    I want to use AI again, but this time as an assistant – I’ll review every change, write tests together, and keep a clear plan.

    Let’s overlook the en-dash here and assume good faith. You should review every change from the start. You cannot assume the AI will work correctly or even has a concept of correct vs incorrect (or, despite the marketing, the ability to actually reason, sans a definition of the word that explicitly includes language models).

    Which AI tool would you recommend for this hybrid approach? How do you structure prompts to force the agent to explain before coding?

    Any tool should work. Just ask it questions, and forbid it from modifying or generating code itself.

    Note that all LLMs are prone to hallucinate. While I haven’t tried Fable yet, even Opus with maximum reasoning can produce utter bullshit if something isn’t in its training data. This means you need to validate everything it says.

    Use the model as a tool to point you in the right direction and help you form good questions or digest things beyond where you currently are. Verify the answers. Read documentation yourself. Go to the source, and learn from there. The LLMs are not omniscient, nor are they going to tell you when they cannot answer a question, so don’t rely too heavily on them.

    Also, do you think a couple of weeks is realistic to rebuild the site that has feature parity with Lemmy and a few extra features that the AI managed to build in a single day?

    Let me ask you this: are you familiar with ActivityPub? ActivityStreams? JSON-LD? Do you know how to compact a JSON-LD document using a Lemmy-compatible context? Do you know how to dereference IRIs pointing to other servers?

    Going even higher level, do you know what backend framework you want to use? Frontend framework, if any? Do you know how to use them? How will you store user-generated content, including text, images, and other kinds of media? How will you handle access controls for those users? How will you perform authentication and user sign-ups?

    If you don’t know, can you even fill the gaps in your knowledge in under two weeks?

    Two weeks is enough time to build a very basic proof of concept backend. It’s enough time to mock out a couple pages on the frontend. You can’t build a service in two weeks if you expect to actually understand how it works. You won’t learn anything asking a LLM to do it for you.

    Learning takes time. If you skip that step, you will plateau at whatever level the LLM is at. Only by taking the time to learn will you ever actually grow as a developer.

  • Mereo@lemmy.ca
    link
    fedilink
    arrow-up
    9
    ·
    5 hours ago

    I recommend changing your perception of AI as merely a tool that requires human verification.

    If you cannot verify its work, then you need to learn how to. Allowing AI to code a complex service like Lemmy will introduce significant bugs that you won’t realize are there.

  • kibblebits@quokk.au
    link
    fedilink
    English
    arrow-up
    13
    ·
    6 hours ago

    So, can YOU build a social media site without AI? If you cannot, I’d suggest learning and doing it yourself first.

  • TheMightyCat@ani.social
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    6 hours ago

    It depends, do you want to learn or do you want to get something fast and don’t care how?

    If you want to learn don’t let AI write anything. Ask it questions if you don’t understand, ask it to explain, but wrte everything yourself.

    If you want to get something that works and don’t care how, make extensive tests. Use a minimum test coverage. Automaric AI reviewing the PR of the AI, And keep the agent going until it passes the CI.

    To awnser your question specifically read the plans very carefully. Most of the time the agents execute the plan fairly faithfully, you don’t need to correct the code much if you make sure to read the initial plan very carefully and make changes on where it made a mistake.

    This does build on the fact that you can actually understand what its writing, if you can’t, go with the first approach and don’t use AI at all for writing code.

  • Skullgrid@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    6 hours ago

    Actually think through the design of your program. Have an architectural plan in place. Have the behaviours and interactions planned out in advance. Write the code patterns as examples yourself.

    Consult the AI as a pair programmer after you feed the hard work you did to cover the gaps in your knowledge. VERIFY THE FUCKING SHIT IT SAYS IN THE ACTUAL FUCKING DOCUMENTATION OF THE CODE YOU ARE RUNNING. You should not put random code you find online into your terminal, because that’s how you get rm -r /ed in the face. Same thing here. The AI is no different. It’s not magic, if you don’t know what the fuck you are doing, the AI snippets aren’t going to make you know how to do it, UNLESS you corroborate the information.

    Also, why clone wholesale instead of just forking or joining the actual project? If you hate the communists of lemmy.ml, piefed also exists, and if you’re a nazi, there’s a similar right wing project that spun off back when people were mad at the asian woman in charge of reddit.