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!

  • thingsiplay@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    4 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