Analyze codebases to understand architecture, file roles, design patterns, execution flows, and system design decisions. Returns structured insights inline and saves agent_context.json for persistent codebase understanding.
Revibe turns any GitHub repository into a complete architecture map — modules, dependencies, call chains, design decisions — in about 2 minutes.
rk_live_xxxxx. Sent as X-Revibe-Key header.This skill sends your repository's GitHub URL to revibe.codes for analysis. Source code is stored securely in Google Cloud Storage to enable features like code exploration and re-analysis. Only you can access your uploaded projects. If you're working with private or sensitive repositories, review revibe.codes/privacy before proceeding.
Tip: To reduce permission prompts, you can optionally add Bash(curl revibe.codes) to your allowed tools via /allowed-tools.
Determine the GitHub URL from one of these sources (in priority order):
https://github.com/owner/repo or owner/repo```bash
# Get GitHub URL from current git repo
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
```
Convert SSH URLs to HTTPS:
```bash
# git@github.com:owner/repo.git → https://github.com/owner/repo
if [[ "$REMOTE_URL" == git@github.com:* ]]; then
REMOTE_URL="https://github.com/${REMOTE_URL#git@github.com:}"
fi
# Strip .git suffix
REMOTE_URL="${REMOTE_URL%.git}"
```
When using the current directory, confirm briefly: "Analyzing {repo_name} from your current directory..."
# Set up auth
API_KEY="${REVIBE_API_KEY:-}"
AUTH_HEADER=""
if [ -n "$API_KEY" ]; then
AUTH_HEADER="-H \"X-Revibe-Key: $API_KEY\""
fi
# Submit
RESPONSE=$(curl -s -X POST "https://app-backend.revibe.codes/api/v1/analyze" \
-H "Content-Type: application/json" \
${AUTH_HEADER} \
-d "{\"github_url\": \"${REMOTE_URL}\"}")
JOB_ID=$(echo "$RESPONSE" | jq -r '.job_id')
STATUS=$(echo "$RESPONSE" | jq -r '.status')
If status is "completed" or "already_analyzed", skip to Step 4.
Otherwise, poll every 10 seconds (max 3 minutes):
while [ "$STATUS" != "completed" ] && [ "$STATUS" != "error" ]; do
sleep 10
POLL=$(curl -s "https://app-backend.revibe.codes/api/v1/analysis/${JOB_ID}/status")
STATUS=$(echo "$POLL" | jq -r '.status')
PROGRESS=$(echo "$POLL" | jq -r '.progress // "working"')
STEPS_DONE=$(echo "$POLL" | jq -r '.steps_completed')
STEPS_TOTAL=$(echo "$POLL" | jq -r '.steps_total')
# Show progress: "Analyzing... file_roles (5/10)"
done
If status is "error", tell the user: "Analysis failed. You can try directly at https://revibe.codes"
SUMMARY=$(curl -s "https://app-backend.revibe.codes/api/v1/analysis/${JOB_ID}/summary")
Format the response as:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Revibe Analysis: {name}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Architecture: {architecture_pattern}
Language: {language}
Size: {total_files} files
Entry point: {entry_point}
Key Modules:
{module.name} — {module.description} ({module.loc} LOC)
{module.name} — {module.description} ({module.loc} LOC)
...
Patterns: {patterns joined by ", "}
Database: {database.type}, {database.tables} tables ← only if database exists
agent_context.json saved to current directory.
Explore deeper:
[1] Architecture diagram
[2] File roles & structure
[3] System design Q&A
[4] Execution flows
[5] Database schema
[6] Full interactive analysis → {project_url}
Always save the agent context file after showing the summary:
curl -s "https://app-backend.revibe.codes/api/v1/analysis/${JOB_ID}/agent-context" \
> agent_context.json
This file gives the agent (and other skills) structured codebase understanding for future tasks.
When the user picks a number (1-5), fetch that section:
# Map numbers to section names
SECTIONS=("technical_architecture" "file_roles" "system_design_qa" "story_flow" "database_schema")
SECTION_NAME="${SECTIONS[$CHOICE - 1]}"
SECTION_DATA=$(curl -s "https://app-backend.revibe.codes/api/v1/analysis/${JOB_ID}/section/${SECTION_NAME}")
Rendering sections:
data.diagram, render as HTML file with mermaid.js (see Diagram Rendering section), open in browser. Show data.summary and data.layers as a markdown table in terminal.diagram as HTML file, open in browser. Show narrative in terminal.For option [6], tell the user to open the URL in their browser.
After showing any section, offer to explore another: "Pick another section [1-6] or ask me anything about this codebase."
When another skill or the agent itself needs codebase context (not a direct user request):
agent_context.json — no formatting, no menuDetection: If the request comes from another skill or is prefixed with context like "I need to understand this codebase to..." — use agent mode.
When a section contains Mermaid diagram data (diagram_mermaid or diagram field), render it as an HTML file and open in the browser:
/tmp/revibe-diagram.html:<!DOCTYPE html>
<html><head><meta charset="utf-8">
<title>TITLE</title>
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
<style>
body { background: #1a1a2e; display: flex; justify-content: center; padding: 40px; font-family: system-ui; }
.container { max-width: 1200px; width: 100%; }
h1 { color: #e0e0e0; font-size: 1.4rem; }
.mermaid { background: #16213e; border-radius: 12px; padding: 24px; }
.mermaid svg { width: 100%; }
</style>
</head><body>
<div class="container">
<h1>TITLE</h1>
<div class="mermaid">
MERMAID_CODE_HERE
</div>
</div>
<script>mermaid.initialize({ startOnLoad: true, theme: 'dark' });</script>
</body></html>
open /tmp/revibe-diagram.html (macOS) or xdg-open (Linux)| Situation | Response |
|---|---|
| ----------- | ---------- |
| No API key configured | "You need a Revibe API key. Sign up free at https://app.revibe.codes, then go to Settings → API Keys to generate one. Run: openclaw config set REVIBE_API_KEY your_key" |
| Invalid GitHub URL | "I need a valid GitHub URL like https://github.com/owner/repo" |
| Private repo without access | "This repo appears to be private. Connect your GitHub account at app.revibe.codes to analyze private repos" |
| Analysis timeout (>3 min) | "Analysis is taking longer than expected. Check progress at {project_url}" |
| Rate limited (429) | Wait 30s and retry once |
Basic analysis:
User: analyze https://github.com/expressjs/express
→ Submit, wait, show summary card + save agent_context.json
Quick shorthand:
User: /revibe fastify/fastify
→ Resolve to https://github.com/fastify/fastify, analyze
Context for another task:
User: I need to add a feature to this repo, first help me understand it
→ Analyze, show summary, then use agent_context.json for subsequent work
Drill down:
User: show me the architecture diagram
→ Fetch architecture section, render Mermaid as ASCII
| Config Key | Required | Description |
|---|---|---|
| ----------- | ---------- | ------------- |
REVIBE_API_KEY | Yes | API key from https://app.revibe.codes/settings — grants read-only access to analyze public GitHub repos |
Get an API key:
openclaw config set REVIBE_API_KEY rk_live_xxxxxapp-backend.revibe.codes/api/v1 endpoints onlyagent_context.json to your working directory and opens /tmp/revibe-diagram.html for diagram viewing共 1 个版本