Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# LLM Provider (at least one required)
OPENROUTER_API_KEY=
OPENROUTER_MODEL=google/gemini-2.5-pro
# or
GOOGLE_GENERATIVE_AI_API_KEY=
GOOGLE_AI_STUDIO_MODEL=gemini-2.5-pro

# GitHub (optional — improves rate limits)
GITHUB_TOKEN=

# OpenRouter metadata (optional)
OPENROUTER_HTTP_REFERER=
OPENROUTER_APP_TITLE=

# Supabase (optional — enables caching + library)
SUPABASE_URL=
SUPABASE_PUBLISHABLE_KEY=

# Cache TTL in hours (default: 24)
CACHE_TTL_HOURS=24

# Deep Reverse (optional — requires Supabase)
DEEP_REVERSE_ROLLOUT_PERCENT=50
DEEP_REVERSE_MAX_USES_PER_WEEK=3
DEEP_CACHE_TTL_HOURS=168
DEEPWIKI_MCP_URL=https://mcp.deepwiki.com/mcp
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!.env.example

# vercel
.vercel
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,32 @@ Paste a GitHub URL or `owner/repo` on the home page. You can also open **`/owner

Next.js (App Router), React, TypeScript, Tailwind CSS, GitHub API, OpenRouter.

## Deep Reverse

**Deep Reverse** is an optional mode that produces a detailed, comprehensive prompt (2000–4000 words) by combining [DeepWiki](https://deepwiki.com/) documentation analysis with LLM synthesis. The pipeline:

1. Fetches the repository's wiki structure from DeepWiki (MCP API)
2. An LLM selects 1–5 key documentation sections to examine
3. Fetches full wiki documentation and extracts the selected sections
4. An LLM synthesizes everything into one actionable prompt

Deep Reverse is **rate-limited** (3 uses per week per browser fingerprint) and **gradually rolled out** via `DEEP_REVERSE_ROLLOUT_PERCENT`. It requires Supabase for caching and rate tracking. Results are cached separately in `deep_prompt_cache`.

If a repository has not been indexed by DeepWiki, the request is declined and the usage attempt is refunded.

## Configuration

Copy `.env.example` to `.env.local`. You need **`OPENROUTER_API_KEY`**. Optional: `OPENROUTER_MODEL` (defaults to `google/gemini-2.5-pro`), `GITHUB_TOKEN` for better GitHub rate limits, and Supabase env vars from the example file if you want server-side caching.

### Deep Reverse env vars (optional)

| Variable | Default | Description |
|---|---|---|
| `DEEP_REVERSE_ROLLOUT_PERCENT` | `50` | Percentage of browser fingerprints that see the Deep Reverse toggle (0–100) |
| `DEEP_REVERSE_MAX_USES_PER_WEEK` | `3` | Deep reverse uses per fingerprint per week |
| `DEEP_CACHE_TTL_HOURS` | `168` | How long deep prompts are cached (default 7 days) |
| `DEEPWIKI_MCP_URL` | `https://mcp.deepwiki.com/mcp` | DeepWiki MCP endpoint override |

## Development

```bash
Expand Down
Loading