CodeWiki
Herramienta para acceder a Google CodeWiki desde Claude Code, Letta Code y LettaBot. Permite obtener documentación estructurada de cualquier repositorio público de GitHub sin necesidad de clonarlo.
Overview
CodeWiki es una plataforma de Google que genera documentación automáticamente para repositorios públicos usando Gemini AI. Esta skill permite:
- Explorar repositorios destacados
- Obtener documentación estructurada en Markdown
- Extraer información de arquitectura y APIs
- Investigar dependencias antes de usarlas
LettaBot Integration
This skill is compatible with LettaBot. To install and enable it:
# 1. Clone the skill into your LettaBot skills directory
cd ~/.skills # or wherever your LettaBot skills are stored
git clone https://github.com/zurybr/codewiki-cli.git codewiki
cd codewiki
npm install
# 2. Make the CLI executable
chmod +x codewiki
# 3. Register the skill with LettaBot
lettabot skills
# Select "codewiki" from the list (space to toggle, enter to confirm)
# 4. Verify the skill is active
lettabot skills status
Once installed, the LettaBot agent will automatically use this skill when you ask questions about GitHub repositories. Example prompts:
- "What does the facebook/react repository do?"
- "Show me the architecture of kubernetes/kubernetes"
- "Research pydantic/pydantic before I install it"
- "List featured repos on CodeWiki"
Commands
| Comando | Descripción | Ejemplo |
|---|---|---|
featured | Lista repos destacados | ./codewiki featured |
doc owner/repo | Documentación en Markdown | ./codewiki doc facebook/react |
repo owner/repo | Datos completos en JSON | ./codewiki repo golang/go |
Output Format
All commands output to stdout. Errors go to stderr. Exit code is 0 on success, non-zero on failure — compatible with LettaBot's tool execution model.
featured→ JSON array of repositoriesrepo owner/repo→ JSON object with full documentationdoc owner/repo→ Markdown string
Architecture (Real Code Example)
// ./codewiki.js
class CodeWikiClient {
constructor() {
this.browser = null;
}
async init() {
this.browser = await puppeteer.launch({
headless: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage']
});
}
async getRepoDocumentation(owner, repo) {
const page = await this.browser.newPage();
const url = `https://codewiki.google/github.com/${owner}/${repo}`;
await page.goto(url, { waitUntil: 'networkidle2', timeout: 60000 });
await new Promise(r => setTimeout(r, 3000));
const data = await page.evaluate(() => {
const title = document.querySelector('h1')?.textContent?.trim() || '';
const toc = Array.from(document.querySelectorAll('h2, h3'))
.map(h => ({ level: h.tagName, text: h.textContent.trim() }));
const body = document.body.innerText;
return { title, toc, body };
});
await page.close();
return { owner, repo, url, ...data };
}
}
Key Patterns:
- Class-based client con lifecycle: init → operation → close
- Puppeteer para browser automation
- Wait strategy: networkidle2 + hard delay
- page.evaluate() para extracción DOM
CLI Router Pattern
// ./codewiki.js - Command dispatching
async function main() {
const args = process.argv.slice(2);
const command = args[0];
if (command === 'featured') {
const repos = await client.getFeaturedRepos();
console.log(JSON.stringify(repos, null, 2));
}
else if (command === 'doc' && args[1]) {
const [owner, repo] = args[1].split('/');
const doc = await client.getRepoDocumentation(owner, repo);
console.log(`# ${doc.title}\n`);
console.log('## Table of Contents\n');
doc.toc.forEach(h => console.log(`- ${h.text}`));
console.log('\n## Documentation\n');
console.log(doc.body.slice(0, 5000));
}
}
When to Use
Usar cuando:
- Necesitas entender un repositorio de GitHub rápidamente
- Quieres documentación estructurada de una librería
- Investigas una dependencia antes de instalarla
- Necesitas contexto sobre un proyecto open-source
- Quieres ver la arquitectura de un codebase sin clonarlo
No usar cuando:
- El repositorio es privado (CodeWiki solo funciona con repos públicos)
- Necesitas el código fuente completo (usar
git clone) - El repo no está indexado por CodeWiki
Installation (Standalone)
# Clone y setup
git clone https://github.com/zurybr/codewiki-cli.git .
npm install
# Ejecutar desde este directorio
./codewiki doc facebook/react
Python Integration
# ./codewiki.py
import subprocess
class CodeWikiClient:
def _run(self, args: list) -> str:
result = subprocess.run(
['./codewiki'] + args,
capture_output=True, text=True
)
return result.stdout
def get_repo_markdown(self, owner: str, repo: str) -> str:
return self._run(['doc', f'{owner}/{repo}'])
Common Use Cases
-
Pre-dependency research
./codewiki doc pydantic/pydantic -
Architecture analysis
./codewiki doc facebook/react -
Quick API reference
./codewiki doc anthropics/anthropic-sdk-python
Limitations
- Solo repositorios públicos de GitHub
- Requiere Puppeteer (Node.js)
- Tiempo de respuesta: 30-60 segundos por request
- Depende de la estructura HTML de CodeWiki
Requirements
- Node.js v18+
- Puppeteer (included in
node_modulesafternpm install)
Repository
- GitHub: https://github.com/zurybr/codewiki-cli
- Local:
./(este directorio)