DEV Community

sehwan Moon
sehwan Moon

Posted on

The vibe coding loop: scan paste into Cursor fixed in 5 seconds

🎯 Try it live β†’ AINAScan β€” paste your code, get a Vibe Score (0–100) with grade SπŸ¦„ to F-πŸ’£. Free, no signup.


You write code with Cursor. It looks fine. You ship it.

Three days later: "why does my app keep losing user data?"

You trace it back to this:

def save_user(user_id: str, data: dict) -> dict:
    validated = validate_schema(data)
    sanitized = sanitize_input(validated)
    log.info(f"Saving user {user_id}")
    return {"status": "saved", "user_id": user_id}
Enter fullscreen mode Exit fullscreen mode

Pylint: βœ… PASS
Mypy: βœ… PASS
Flake8: βœ… PASS

Every tool says it's fine. It's not fine. There's no INSERT anywhere. The function is named save_user and saves nothing.


Why AI generates this

Language models are trained on code where save_user functions validate input, call a DB function, and return success. When the model generates one, it produces the surrounding pattern β€” but sometimes drops the actual write. The result looks correct, behaves correctly in unit tests, and silently loses data in production.

This is the MISSING_WRITE pattern. Standard static analysis tools don't catch it because it's not a syntax error or a known CVE. It's a semantic pattern specific to LLM-generated code.


The fix loop

Step 1: Scan

curl -X POST https://pleasing-transformation-production-90c2.up.railway.app/v1/scan \
  -H "X-API-Key: vg_free_test" \
  -F "file=@your_file.py"
Enter fullscreen mode Exit fullscreen mode

Step 2: Get the report

{
  "passed": false,
  "issues": [
    {
      "kind": "MISSING_WRITE",
      "severity": "BLOCK",
      "line": 1,
      "detail": "save_user() contains no INSERT/UPDATE β€” data is never persisted"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Step 3: Paste into Cursor

Fix this issue in save_user():
MISSING_WRITE (line 1): save_user() contains no INSERT/UPDATE β€” data is never persisted
Enter fullscreen mode Exit fullscreen mode

Step 4: Cursor fixes it

def save_user(user_id: str, data: dict) -> dict:
    validated = validate_schema(data)
    sanitized = sanitize_input(validated)
    conn = get_db()
    conn.execute(
        "INSERT INTO users (id, data) VALUES (?, ?) ON CONFLICT(id) DO UPDATE SET data=excluded.data",
        (user_id, json.dumps(sanitized))
    )
    conn.commit()
    log.info(f"Saving user {user_id}")
    return {"status": "saved", "user_id": user_id}
Enter fullscreen mode Exit fullscreen mode

Step 5: Scan again β†’ CLEAN βœ…

Total time: under 30 seconds.


Other patterns in the same category

Pattern What it means
FAKE_ASYNC async def with no await β€” blocking call in async context
STUB_SKELETON Function returns True/{} for everything β€” logic was never written
INPUT_OUTPUT_DISCONNECTED Parameters don't affect the return value
DEAD_CALL_RESULT Module results ignored β€” check_inventory() returns False, order still "processes"

All of these are patterns that appear specifically in AI-generated code. Standard linters miss them because they're syntactically valid.


Add to CI so you catch it before it ships

# .github/workflows/scan.yml
- uses: Moonsehwan/aina-vibeguard-action@v1
  with:
    api-key: ${{ secrets.VIBEGUARD_KEY }}
Enter fullscreen mode Exit fullscreen mode

Free key during beta: vg_free_test

48 patterns, 9 languages (Python, JS, TS, Go, Java, Ruby, PHP, Kotlin, C/C++).

The point isn't to replace your AI coding tool. It's to close the loop β€” scan what the AI wrote, paste the report back in, let it fix itself.


What's Your Vibe Score?

πŸ‘‰ AINAScan β€” Try it free

Paste any file. Get a score 0–100, a grade (SπŸ¦„ β†’ F-πŸ’£), and a per-vulnerability roast.
Supports Python, JS, TS, Go, Ruby, Java, Kotlin, PHP, C/C++ Β· No signup Β· Instant results

Top comments (2)

Collapse
 
ainascan profile image
sehwan Moon

Thanks for sharing, vic xie! Clean text/prompts definitely make the vibe-coding loop much smoother.

Paired with TextStow for clean clipboard management and AINAScan to catch the actual structural flaws deterministically, devs can basically build bug-free apps in seconds. Best of luck with TextStow! πŸš€

Collapse
 
vic_xie_9bed0062d5fd73d12 profile image
vic xie

Nice write-up! For devs who deal with messy copied text, TextStow might help β€” it's a Mac menu bar tool combining clipboard history with prompt templates and text cleanup. Free: textstow.com