Gitdigest

By (@collinxweb) · · For Researchers

GitDigest turns any public GitHub repo into a summary where every claim links to the exact file and lines it came from. Pick a purpose (security, due diligence, onboarding, or your own focus), and anything that doesn't match the code gets flagged instead of slipping through.How I built it I started with the problem: most repo summaries are fluent but unverifiable, so I made citations the core feature. I did the planning and testing and used AI coding agents for much of the code. I ran each version on my phone and sent back the exact errors. It's a small stack built to run from Termux: Python with Flask on Vercel, a single HTML front end, GitHub and Google sign-in, and Gemini or Groq as the models. The hard parts were speed (solved with parallel reads, a Quick scan, and cached summaries), slow model responses (now retried with a clear message), and a routing bug that took several rounds to find.

Tech stack

  • Google AI Studio (3.5 Flash-Lite)
  • Vercel
  • Claude (Haiku 5.5)

Prompt steps

  1. Step 1

    Build the first working version of GitDigest, then write a deploy guide that
    I can follow on Vercel. You will do the code and the checks. I will do the
    account clicks and the git push. Mark every step clearly as "AGENT" or "YOU".
    
    GOAL OF THIS STEP: a repo that builds on Vercel and serves the app. Login and
    model keys come in Step 2, so this step must work without them. When no keys
    are set, the app must show a clear message, not a broken page.
    
    WHAT TO BUILD
    1. gitdigest.py: the core. Parse github.com/owner/repo URLs (reject anything
       else), list files through the GitHub API (public repos only), select up to
       25 files (README and manifests first, then entry points, then shallow files),
       skip lockfiles, binaries, vendor and build folders, and files over 200 KB.
       Summarize with Gemini or Groq, and write the report with citations in the
       form path:start-end. Verify each citation against the real line count and
       mark failures as [unverified: ...].
    2. api/index.py: a Flask app with these routes, each also registered without
       the /api prefix: GET /api/config, GET /api/me, POST /api/plan,
       POST /api/summarize, POST /api/report. Summaries are HMAC-signed so the
       report step rejects edited ones. Return JSON errors only, never a traceback.
    3. public/index.html: one mobile-first page, inline CSS and JS, no build step.
       Screens: Analyze (URL field, purpose cards for security, due diligence,
       onboarding, and custom, plus a Quick/Full scan toggle), a progress screen
       with Cancel, and a result screen where citations link to the exact GitHub
       lines. Store history in localStorage. Use a dark theme with a light option.
       Keep the purple "</>" logo mark.
    4. vercel.json with NO "rewrites" key, only:
       {"functions": {"api/index.py": {"maxDuration": 60, "includeFiles": "gitdigest.py"}}}
       A rewrite to /api/index makes every API route return 404. Do not add one.
    5. requirements.txt (flask, requests only), .gitignore (ignore .env and
       __pycache__), .vercelignore (ignore test files), .env.example with every
       variable named and no values.
    6. test_gitdigest.py and test_api.py with unittest. Mock every network call. No
       test may call a real API.
    
    CHECKS BEFORE YOU HAND OVER
    - python -m unittest test_gitdigest test_api passes.
    - grep confirms vercel.json has no "rewrites".
    - Run the API locally and report what GET /api/config returns.
    
    THE DEPLOY GUIDE (write it as DEPLOY.md)
    Use short numbered steps. For each step, say whether it is AGENT or YOU.
    Cover:
    - Push the repo to GitHub (YOU): the exact git commands, including git init,
      git add -A, git commit, git remote add, and git push -u origin main.
    - Import the repo on vercel.com (YOU): Add New, then Project, pick the repo,
      framework preset "Other", deploy. Explain that the first deploy will show
      errors if no variables are set yet, and that this is expected in Step 1.
    - Confirm the deployment is Ready and the home page loads (YOU).
    - Note the production URL, which will be used for the OAuth callback URLs in
      Step 2.
    - Known pitfalls, one line each: no rewrites in vercel.json, redeploy after
      any variable change, and sign-in buttons must always be visible.
    
    Show your plan first. Do not claim the deploy works. Only report what you ran.
    End with the exact list of files you created and the one thing I must do next.
  2. Step 2

    Step 1 is deployed. Now wire in login and the model keys. You will tell me
    exactly what to click, and I will report back. Mark every step "AGENT" or
    "YOU". Never ask me to paste a secret into this chat.
    
    PART A: GitHub OAuth app (YOU)
    1. Go to GitHub, Settings, Developer settings, OAuth Apps, New OAuth App.
    2. Name: GitDigest. Homepage URL: my production URL. Authorization callback URL:
       <production URL>/api/auth/github/callback
    3. Register, then copy the Client ID and generate a client secret.
    4. Save both in Vercel as GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET.
       This is an OAuth App, not a personal access token.
    
    PART B: Google OAuth client (YOU)
    1. Go to https://console.cloud.google.com/apis/credentials and select or
       create a project named GitDigest.
    2. Set up the OAuth consent screen (external) with the app name GitDigest and
       my email as the support contact. While the app is in testing, add my own
       Google account as a test user.
    3. Create credentials, then OAuth client ID, type Web application. Add the
       redirect URI <production URL>/api/auth/google/callback.
    4. Save the Client ID and Client secret in Vercel as GOOGLE_CLIENT_ID and
       GOOGLE_CLIENT_SECRET.
    
    PART C: Session secret (YOU, then AGENT)
    - AGENT: give me a one-line command to generate a random value of at least 32
      characters, using python3 with the secrets module.
    - YOU: run it in Termux, save the output in Vercel as SESSION_SECRET.
    
    PART D: Model keys (YOU)
    - GEMINI_API_KEY from Google AI Studio, and/or GROQ_API_KEY from the Groq console.
    - Optional: GEMINI_MODEL and GROQ_MODEL. AGENT: check each provider's current
      docs for a free-tier model name, and tell me which one to use. Do not guess.
      Old model names return 404 from Gemini.
    
    PART E: Apply and verify (YOU, then AGENT)
    - YOU: for every variable, set the environment to Production, then redeploy
      the latest deployment. Variables do not apply to old deployments.
    - AGENT: after I confirm the redeploy, tell me the exact URLs to open and what
      each should return:
      - <production URL>/api/config should show login.github true, login.google
        true, login_ready true, and the providers I configured.
      - <production URL>/api/me should return {"user": null}.
      - Opening the sign-in page should show both buttons with logos.
    - Tell me to tap "Continue with GitHub" and report what happens. If it fails,
      ask me for the exact text the page shows and the URL it lands on.
    
    RULES
    - Add no new features in this step.
    - Do not change any file unless a check fails. If one does, fix only that file
      and show the diff.
    - If a variable name is wrong, say so and name the correct one.
    
    Show your plan first, then guide me step by step, pausing after each part for
    my confirmation.
  3. Step 3

    Steps 1 and 2 are done. Now verify everything and close out the project. Be
    strict: report PASS only with evidence I can see, and FAIL with the exact error
    otherwise.
    
    CHECKLIST (one line each, PASS or FAIL, with evidence)
    1. Tests pass locally: python -m unittest test_gitdigest test_api.
    2. The repo has no "rewrites" in vercel.json.
    3. The latest Vercel deployment is Ready and matches the latest commit.
    4. GET /api/config returns login.github and login.google true, and login_ready true.
    5. GET /api/me returns {"user": null} when signed out.
    6. POST /api/plan without a session returns 401.
    7. The GitHub start URL redirects to github.com with a state parameter.
    8. A bad state on the callback redirects to #signin?error=github.
    9. Sign-in works end to end for GitHub, and for Google if configured.
    10. One small public repo analyzes to a result, and at least one citation
        link opens the correct lines on GitHub.
    11. Sign out clears the session and returns to sign-in.
    12. Analyzing while signed out is refused.
    
    IF ANY CHECK FAILS
    - Find the cause in the code or in the deploy settings, fix only what is
      needed, and re-run the check. Do not skip a failing check.
    - If the cause is in Vercel or a provider console, tell me exactly where to
      look and what to change.
    
    HANDOFF (write as HANDOFF.md)
    - The final file tree.
    - Every environment variable name with what it is for (no values).
    - The OAuth callback URLs.
    - The models in use, and how to change them.
    - The known limits: public repos only, up to 25 files, citations past 1,500
      lines (Gemini) or 300 lines (Groq) are marked unverified, free-tier rate
      limits, and reports stored only in the browser.
    - How to redeploy after a change, and how to rotate a secret.
    
    FINAL MESSAGE
    Give me the checklist results, the URL to share, and a three-line summary I
    can paste into a contest submission. Do not claim anything you did not verify.

Comments (2)

  1. Hadi · · 1 like

    well done<div><br></div>

  2. Jack Herzlich · · 1 like

    This is great Collin, excited to see how Gitdigest comes along. Great as always

    1. Collinxweb ·

      I appreciate the comment 🤍

3 likes · 4 comments · 5 views

Explore more on Prompted

Loading