How yashk-arch/repoowl-extension works
Purpose and entry points
RepoOwl is a GitHub Chrome extension for AI-assisted issue triage: it detects likely duplicates and presents technical insights inside GitHub’s native issue/PR UI. The primary client runtime is Manifest V3, with React/Vite popup and settings surfaces. Backend persistence and event processing use Supabase; Groq/Llama provides inference.
Key entry points: extension/manifest.json, extension/src/background.js, extension/src/content/index.js, supabase/functions/registry/index.ts.
Browser-extension integration layer
The manifest launches a background service worker and content scripts on GitHub pages. Content scripts inspect GitHub context and inject non-destructive UI into issue lists, issue details, PR details, and sidebars.
Core paths:
• extension/src/content/index.js
• extension/src/content/issueDetailInjector.js
• extension/src/content/prDetailInjector.js
extension/src/lib/githubContext.js is the boundary for deriving repository, issue, and page identity from GitHub URLs/DOM. This keeps GitHub-specific detection separate from downstream analysis and rendering.
In-page triage and insight presentation
Injected components retrieve persisted analysis and render badges, cards, or an on-demand overlay rather than replacing GitHub UI. This is the user-facing read path: GitHub page context → issue-insight fetch → DOM/React injection.
Core paths:
• extension/src/content/fetchIssueInsights.js
• extension/src/content/badgeInjector.js
• extension/src/content/sidebarCard.js
• extension/src/overlay/InsightsOverlay.jsx
The overlay provides a richer React-based display, while content injectors bridge React/UI output to arbitrary GitHub DOM locations.
Background orchestration and GitHub installation
The extension background process centralizes extension lifecycle work and GitHub integration/installation behavior. It is the durable browser-side control boundary for actions that should not be tied to a single GitHub tab.
Core paths:
• extension/src/background.js
• extension/src/background/githubInstaller.js
• extension/src/prTriage.js
Multi-tenant mediator and Supabase access
The v0.1.1 architecture uses a central registry/mediator so contributors can discover a repository maintainer’s Supabase connection without manually entering shared configuration. The extension’s Supabase client accesses this service; the Edge Function registry is the server-side counterpart.
Core paths:
• extension/src/lib/supabase.js
• supabase/functions/registry/index.ts
• supabase/migrations/004_multi_tenant.sql
Supabase provides PostgreSQL, Edge Functions, and real-time/service APIs. Schema evolution establishes issue identity, stronger RLS, and multi-tenant ownership boundaries.
Event-driven analysis pipeline
GitHub webhooks are intended to trigger processing when issues open. The backend persists issue data and AI-generated analysis; the extension later reads those results while viewing GitHub. Inference is performed through the Groq API using Llama 3.3 Versatile.
Core paths:
• database-schema.sql
• supabase/migrations/001_initial_schema.sql
• supabase/migrations/003_tighten_rls.sql
A deployment/documentation mismatch exists: the README names a github-webhook Edge Function, but the supplied tree exposes only supabase/functions/registry/index.ts; verify the webhook processor’s location or deployment configuration.
Prompting and response contract
Shared JavaScript code centralizes prompt composition, historical-context formatting, and the expected Groq response schema. This is the contract boundary between triage data and model output, reusable by browser and backend consumers.
Core paths:
• shared/prompts/defaultPrompt.js
• shared/utils/renderPrompt.js
• shared/schemas/groqResponseSchema.js
User configuration surfaces
The popup and options pages expose operational controls such as repository tracking, model configuration, prompt settings, and maintainer registration/sync status. These screens configure or invoke the mediator-backed workflow rather than serving as the main GitHub-page experience.
Core paths:
• extension/src/popup/PopupApp.jsx
• extension/src/options/main.jsx
• extension/src/settings/TrackedRepos.jsx
Main entry points: index.js Content runtime · supabase.js Supabase client · fetchIssueInsights.js Insight reader · background.js Background worker
Components 18
Chrome extension
Manifest V3 runtime and GitHub-page experience.
- Extension manifest · Registers service worker and GitHub content scripts.
extension/manifest.json - Content runtime · Inspects GitHub pages and coordinates page-specific injection.
extension/src/content/index.js - GitHub context · Derives repository, issue, and page identity from GitHub DOM and URLs.
extension/src/lib/githubContext.js - Issue and PR injectors · Adds non-destructive triage UI to issue and PR detail pages.
extension/src/content/issueDetailInjector.js - Insight reader · Retrieves persisted issue analysis for the current GitHub context.
extension/src/content/fetchIssueInsights.js - Badges, cards, overlay · Renders results in GitHub lists, sidebars, and an on-demand overlay.
extension/src/content/badgeInjector.js - Background worker · Centralizes lifecycle and tab-independent GitHub actions.
extension/src/background.js - GitHub installer
extension/src/background/githubInstaller.js - Popup and settings · Controls tracking, model and prompt settings, and maintainer registration.
extension/src/popup/PopupApp.jsx - Supabase client · Uses the mediator-backed Supabase connection.
extension/src/lib/supabase.js
Supabase backend
Tenant mediation, persistence, and event-driven analysis.
- Tenant registry · Resolves a repository maintainer's Supabase connection.
supabase/functions/registry/index.ts - Tenant and RLS schema · Defines issue identity, ownership boundaries, and stronger RLS.
supabase/migrations/004_multi_tenant.sql - Issue analysis store · Persists GitHub issue data and generated analysis.
database-schema.sql - Webhook analysis processor · Intended issue-open processor; its deployed source location is unverified.
Shared AI contract
Reusable prompt and response boundaries.
- Prompt composition · Builds prompts and formats historical context.
shared/prompts/defaultPrompt.js - Groq response contract · Defines expected structured model output.
shared/schemas/groqResponseSchema.js
External platforms
- GitHub · Hosts pages, repositories, and issue-open webhook events.
- Groq / Llama 3.3
Connections 21
- Extension manifest → Background worker: launches
- Extension manifest → Content runtime: injects on GitHub
- GitHub → Content runtime: page DOM
- Content runtime → GitHub context: derives context
- Content runtime → Issue and PR injectors: routes by page
- GitHub context → Insight reader: issue identity
- Issue and PR injectors → Badges, cards, overlay: injection points
- Insight reader → Badges, cards, overlay: persisted insights
- Insight reader → Supabase client: reads through
- Background worker → GitHub installer: orchestrates
- Popup and settings → Background worker: invokes actions
- Popup and settings → Supabase client: configures workflow
- Supabase client → Tenant registry: resolves tenant
- Tenant registry → Tenant and RLS schema: enforces ownership
- Supabase client → Issue analysis store: reads analysis
- GitHub → Webhook analysis processor: issue-open webhook
- Webhook analysis processor → Issue analysis store: persists issue and analysis
- Webhook analysis processor → Prompt composition: builds request
- Prompt composition → Groq / Llama 3.3: inference prompt
- Groq / Llama 3.3 → Groq response contract: structured output
- Groq response contract → Webhook analysis processor: validated analysis