pharaoh

Codebase knowledge graph with 23 development workflow skills. Query architecture, dependencies, blast radius, dead code, and test coverage via MCP. Requires GitHub App installation (read-only repo access) and OAuth authentication. Connects to external MCP server at mcp.pharaoh.so.

3,891 stars
Complexity: medium

About this skill

Pharaoh functions as a sophisticated codebase understanding tool, parsing your source files server-side to extract structural metadata like names, signatures, imports, and relationships. This metadata, not the actual source code bodies, is stored in a knowledge graph which AI agents can then query directly, rather than reading files individually. This skill provides AI agents with a powerful set of 23 development workflow capabilities. It allows them to analyze and provide insights on critical aspects such as codebase architecture, inter-module dependencies, the potential 'blast radius' of changes, identifying dead or unused code, and evaluating test coverage. This makes it an invaluable asset for complex software projects. Developers and AI agents can leverage Pharaoh to dramatically improve efficiency in tasks like code reviews, refactoring, understanding legacy systems, and maintaining high code quality. By abstracting the structural understanding into a queryable graph, it empowers agents to deliver more accurate and holistic insights into the codebase.

Best use case

Pharaoh is primarily used by developers and AI coding agents to gain deep, structured insights into large and complex codebases. It streamlines tasks like architectural analysis, dependency mapping, identifying dead code, and assessing test coverage, significantly improving the efficiency of code understanding, review, and refactoring processes, especially in environments utilizing AI-assisted development.

Codebase knowledge graph with 23 development workflow skills. Query architecture, dependencies, blast radius, dead code, and test coverage via MCP. Requires GitHub App installation (read-only repo access) and OAuth authentication. Connects to external MCP server at mcp.pharaoh.so.

Users can expect AI agents to provide accurate, structured insights and answers regarding their codebase's architecture, dependencies, and health, powered by a central knowledge graph.

Practical example

Example input

Agent, using Pharaoh, analyze the 'UserAuthenticationService' module. Tell me its direct dependencies, its potential blast radius if the `authenticate` method is modified, and its current test coverage.

Example output

Module 'UserAuthenticationService' dependencies: [OAuthProvider, DatabaseClient, SessionManager]. Blast radius includes: [UserProfileController, PasswordResetFlow, AccountSettingsPage]. Test coverage: 92%.

When to use this skill

  • When an AI agent needs to quickly understand complex codebase architecture or dependencies.
  • For automated code reviews focusing on identifying dead code, blast radius, or test coverage gaps.
  • During large-scale refactoring efforts to map out code relationships and impact.
  • To enable AI agents to answer in-depth questions about a project's technical structure efficiently.

When not to use this skill

  • For very small, simple projects where manual code review or basic file parsing is sufficient.
  • When strict offline-only codebase analysis is required, as it connects to an external MCP server.
  • If the project strictly prohibits any external service interaction, even for metadata.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pharaoh/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/0xuxdesign/pharaoh/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pharaoh/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pharaoh Compares

Feature / AgentpharaohStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/A

Frequently Asked Questions

What does this skill do?

Codebase knowledge graph with 23 development workflow skills. Query architecture, dependencies, blast radius, dead code, and test coverage via MCP. Requires GitHub App installation (read-only repo access) and OAuth authentication. Connects to external MCP server at mcp.pharaoh.so.

How difficult is it to install?

The installation complexity is rated as medium. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Pharaoh — Codebase Knowledge Graph + Developer Skill Library

Pharaoh parses your source files server-side to extract structural metadata (names, signatures, imports, relationships) and stores that metadata — not source code bodies — in a knowledge graph. AI agents then query the graph instead of reading files one at a time.

## What the Installer Does

Running `npx @pharaoh-so/mcp --install-skills` performs these actions:

1. **Downloads** the `@pharaoh-so/mcp` npm package ([source](https://github.com/Pharaoh-so/pharaoh-mcp), [npm](https://www.npmjs.com/package/@pharaoh-so/mcp))
2. **Copies 23 skill directories** (SKILL.md markdown files) into `~/.openclaw/skills/` — **warning: overwrites existing pharaoh skill files on reinstall** (uses `cpSync` with `force: true`; does not touch non-pharaoh skills)
3. **Adds an MCP server entry** `"pharaoh"` to `~/.openclaw/openclaw.json` under `mcpServers` (skips if already present, refuses to write if JSON is corrupted)
4. If OpenClaw is not detected (`~/.openclaw/` doesn't exist), prints manual installation instructions and exits — **does not create directories or modify config**

Authentication happens separately when the MCP server first runs (not during `--install-skills`):
- **Device flow** ([RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628)) — displays a code, you authorize on any device with a browser
- **Credentials stored** at `~/.pharaoh/credentials.json` (file permissions `0600`, owner-only)

No background processes are installed. No cron jobs. No system services.

**Architecture:** The `@pharaoh-so/mcp` package runs a local stdio proxy process — it starts when your AI client launches it and stops when the session ends. This proxy relays MCP messages to the remote Pharaoh server at `mcp.pharaoh.so`, where parsing and graph queries execute. Your repository metadata is sent to and stored on Pharaoh's servers (see Data & Privacy below). The proxy itself does not parse code or store data locally.

## Authentication & Permissions

**OAuth flow:** GitHub device authorization grant (RFC 8628). You approve access in your browser — no secrets are embedded in the package.

**GitHub App scopes** (when installed on your org):
- `contents: read` — read-only access to parse repository files via tree-sitter
- `metadata: read` — repo names, languages, default branch
- Webhooks on `push` events — triggers automatic graph refresh when code changes

**No write access.** The GitHub App cannot modify code, create branches, open PRs, or change settings.

**Credential storage:** `~/.pharaoh/credentials.json` — OAuth access token + refresh token. Tokens expire after 7 days with automatic refresh. Clear with `npx @pharaoh-so/mcp --logout`.

## Data & Privacy

**How parsing works:** Pharaoh clones your repos server-side using GitHub App installation tokens, then runs its [open-source parser](https://github.com/Pharaoh-so/pharaoh-parser) (tree-sitter based, MIT licensed) to extract structural metadata. **Source files are read during parsing** to build the AST. After parsing, cloned files are deleted from disk. The extracted metadata is:
- Function/class **names**, signatures, and export visibility
- File paths and module membership
- Import/export relationships and call chains
- Complexity scores (cyclomatic complexity)
- JSDoc/docstring text (encrypted at rest with per-tenant AES-256-GCM keys)

**What is NOT stored:** Source code bodies (function implementations, template literals, string contents, etc.). The graph contains names, paths, relationships, and scores. Source files are cloned temporarily for parsing, then deleted — they are not persisted or logged.

**Where data lives:** Neo4j knowledge graph on Neo4j Aura (cloud, GCP). Pharaoh is a remote service — your metadata is stored on Pharaoh's infrastructure, not locally. Each tenant's data is isolated via application-level repo-anchoring (every query scoped to your repos) and ownership checks. For self-hosted options, see [documentation](https://pharaoh.so/docs).

**Data retention:** Graph data persists while your account is active. Deleting a repo from Pharaoh purges all its nodes and relationships. Account deletion removes all tenant data.

**Network endpoints contacted:**
- `mcp.pharaoh.so` — MCP server (tool calls and responses)
- `github.com` — OAuth authorization and API calls (repo metadata, installation tokens)

## When to Use

After installation, the core `pharaoh` skill loads automatically in sessions where Pharaoh MCP tools are available. It teaches your agent to query architecture before reading files, check blast radius before modifying code, and search functions before creating duplicates. The 22 other skills are invoked on-demand by name.

## What You Get

**22 MCP Tools** — codebase map, module context, function search, blast radius, dependency queries, dead code detection, test coverage, regression risk, and more.

**23 Development Skills:**

| Category | Skills |
|----------|--------|
| **Core** | `pharaoh` (architectural habits, loads when MCP tools are present) |
| **Planning** | `pharaoh:plan`, `pharaoh:brainstorm`, `pharaoh:execute`, `pharaoh:sessions`, `pharaoh:parallel` |
| **Implementation** | `pharaoh:tdd`, `pharaoh:debug`, `pharaoh:refactor`, `pharaoh:investigate`, `pharaoh:explore` |
| **Verification** | `pharaoh:verify`, `pharaoh:wiring`, `pharaoh:review`, `pharaoh:review-receive`, `pharaoh:pr`, `pharaoh:review-codex` |
| **Maintenance** | `pharaoh:health`, `pharaoh:debt`, `pharaoh:audit-tests`, `pharaoh:onboard` |
| **Git** | `pharaoh:worktree`, `pharaoh:finish` |

## Setup Steps

1. **Install the GitHub App** on your org at [github.com/apps/pharaoh-so](https://github.com/apps/pharaoh-so) — grants read-only access to selected repos
2. Pharaoh auto-maps selected repos into a knowledge graph (typically < 5 minutes)
3. Run `npx @pharaoh-so/mcp --install-skills` — installs skills + connects MCP server
4. Authorize via the device code shown in terminal (opens GitHub OAuth in browser)
5. Your agent now queries architecture instead of reading files one at a time

## Uninstall

```bash
# Remove skills (installed by --install-skills)
rm -rf ~/.openclaw/skills/pharaoh*
# Remove MCP server entry from ~/.openclaw/openclaw.json (delete the "pharaoh" key under mcpServers)

# If using Claude Code directly (without OpenClaw):
claude mcp remove pharaoh

# Remove stored credentials
npx @pharaoh-so/mcp --logout
# or: rm ~/.pharaoh/credentials.json
```

## Links

- Documentation: https://pharaoh.so/docs
- GitHub (parser, open-source): https://github.com/Pharaoh-so/pharaoh-parser
- GitHub (MCP proxy): https://github.com/Pharaoh-so/pharaoh-mcp
- npm: https://www.npmjs.com/package/@pharaoh-so/mcp
- MCP Server: https://mcp.pharaoh.so
- Security contact: security@pharaoh.so

Related Skills

Go Production Engineering

3891
from openclaw/skills

You are a Go production engineering expert. Follow this system for every Go project — from architecture decisions through production deployment. Apply phases sequentially for new projects; use individual phases as needed for existing codebases.

Coding & Development

Database Engineering Mastery

3891
from openclaw/skills

> Complete database design, optimization, migration, and operations system. From schema design to production monitoring — covers PostgreSQL, MySQL, SQLite, and general SQL patterns.

Coding & Development

afrexai-code-reviewer

3891
from openclaw/skills

Enterprise-grade code review agent. Reviews PRs, diffs, or code files for security vulnerabilities, performance issues, error handling gaps, architecture smells, and test coverage. Works with any language, any repo, no dependencies required.

Coding & Development

API Documentation Generator

3891
from openclaw/skills

Generate production-ready API documentation from endpoint descriptions. Outputs OpenAPI 3.0, markdown reference docs, and SDK quickstart guides.

Coding & Development

bili-rs

3891
from openclaw/skills

Development skill for bili-rs, a Rust CLI tool for Bilibili (B站). Use when implementing features, fixing bugs, or extending the bilibili-cli-rust codebase. Provides architecture conventions, API endpoints, coding patterns, and project-specific constraints. Triggers on tasks involving adding CLI commands, calling Bilibili APIs, handling authentication, implementing output formatting, or working with the layered cli/commands/client/payloads architecture.

Coding & Development

Puppeteer

3891
from openclaw/skills

Automate Chrome and Chromium with Puppeteer for scraping, testing, screenshots, and browser workflows.

Coding & Development

git-commit-helper

3891
from openclaw/skills

Generate standardized git commit messages following Conventional Commits format. Use this skill when the user asks to commit code, write a commit message, or create a git commit. Enforces team conventions for type prefixes, scope naming, message length, and breaking change documentation.

Coding & Development

ask-claude

3891
from openclaw/skills

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Coding & Development

bnbchain-mcp

3891
from openclaw/skills

Interact with the BNB Chain Model Context Protocol (MCP) server. Blocks, contracts, tokens, NFTs, wallet, Greenfield, and ERC-8004 agent tools. Use npx @bnb-chain/mcp@latest or read the official skill page.

Coding & Development

helius-phantom

3891
from openclaw/skills

Build frontend Solana applications with Phantom Connect SDK and Helius infrastructure. Covers React, React Native, and browser SDK integration, transaction signing via Helius Sender, API key proxying, token gating, NFT minting, crypto payments, real-time updates, and secure frontend architecture.

Coding & Development

micropython-skills/sensor

3891
from openclaw/skills

MicroPython sensor reading — DHT11/22, BME280, MPU6050, ADC, ultrasonic HC-SR04, photoresistor, generic I2C sensors.

Coding & Development

micropython-skills/network

3891
from openclaw/skills

MicroPython networking — WiFi STA/AP, HTTP requests, MQTT pub/sub, BLE, NTP time sync, WebSocket.

Coding & Development