Skip to content

Repository files navigation

Prepost

Pre-publish question quality analyzer for Stack Overflow.

Prepost analyzes your question before you post it - checking if the answer already exists, scoring its structure and clarity, detecting duplicates, validating tags, analyzing code quality, and giving you specific tips to improve it before posting.

How it works

The pipeline runs in two phases:

Phase 1 runs two agents in parallel:

  • Search agent - searches the web for existing answers to your question
  • Classifier agent - scores your question across 5 structural dimensions

Both feed into a decision agent that produces one of four verdicts:

  • publish - question is well structured and ready to post
  • revise_first - good start but needs improvement
  • not_ready - too vague, address gaps before posting
  • do_not_post - a direct answer already exists

Phase 2 runs six agents in parallel if Phase 1 clears the question:

  • Duplicate detector - checks SO question corpus for semantic similarity
  • Tag validator - validates tags against SO API, suggests missing ones
  • Code analyzer - checks syntax, missing imports, undefined variables
  • Tone checker - flags frustration, entitlement, or excessive hedging
  • MRE checker - runs code in an E2B sandbox to verify reproducibility
  • Docs linker - surfaces relevant official documentation

All six feed into an aggregator that produces a refined final verdict with specific actionable tips.

Stack

Setup

  1. Clone the repo
git clone https://github.com/yourname/prepost.git
cd prepost
  1. Install dependencies
uv sync
  1. Copy .env.example to .env and fill in your API keys
cp .env.example .env
GROQ_API_KEY=gsk_...
TAVILY_API_KEY=tvly-...
SO_API_KEY=           # optional, increases rate limit
E2B_API_KEY=e2b_...   # required for Phase 2 MRE checker
  1. Run with Docker
docker compose up --build
  1. Or run locally
uv run uvicorn app:server --reload --port 8000
  1. Load the Firefox extension
  • Go to about:debugging in Firefox
  • Click "This Firefox"
  • Click "Load Temporary Add-on..."
  • Select extension/manifest.json
  • Go to https://stackoverflow.com/questions/ask

Project structure

prepost/
    config.py settings and env vars
    state.py LangGraph state schema
    graph.py graph definition and node wiring

    tools/
        llm_client.py Groq LLM interface
        web_search.py Tavily search wrapper
        so_api.py Stack Exchange API wrapper

    nodes/
        search.py web search agent node
        classifier.py structure classifier node
        decision.py verdict decision node
        tips.py tips generator node
        duplicate_detector.py SO duplicate detection
        tag_validator.py SO tag validation
        code_analyzer.py AST syntax + static analysis
        tone_checker.py sentiment and tone analysis
        mre_checker.py E2B sandbox execution
        docs_linker.py official docs search
        aggregator.py Phase 2 signal synthesis

extension/
    manifest.json Firefox extension config
    content.js sidebar injection and logic
    sidebar.css sidebar styles

tests/
    test_graph.py
    test_graph_phase2.py
    test_search_node.py
    test_classifier_node.py
    test_decision_node.py
    test_tips_node.py
    test_web_search.py
    test_so_api.py
    test_duplicate_detector.py
    test_tag_validator.py
    test_code_analyzer.py
    test_tone_checker.py
    test_mre_checker.py
    test_docs_linker.py
    test_aggregator.py

Roadmap

  • Phase 1 - core pipeline: search, classify, decide, tips
  • Phase 2 - duplicate detector, tag validator, code analyzer, tone check, MRE checker, docs linker
  • Firefox extension with sidebar UI
  • FastAPI wrapper + Docker
  • Phase 3 - FastAPI → browser extension polish
  • Phase 4 - feedback loop, answer quality predictor, auto rewriter

About

An NLP-powered pre-publish quality analyzer for Stack Overflow questions. Uses a multi-agent LangGraph pipeline to check for duplicates, validate structure, analyze code, detect tone issues, and verify reproducibility before a question goes live.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages