codebase-explorer
Explore and understand the Empathy Ledger codebase architecture, data flows, database schema, services, and how components connect. Use when you need to understand where things are, how data flows, or how different parts of the system relate to each other.
Best use case
codebase-explorer is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Explore and understand the Empathy Ledger codebase architecture, data flows, database schema, services, and how components connect. Use when you need to understand where things are, how data flows, or how different parts of the system relate to each other.
Explore and understand the Empathy Ledger codebase architecture, data flows, database schema, services, and how components connect. Use when you need to understand where things are, how data flows, or how different parts of the system relate to each other.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "codebase-explorer" skill to help with this workflow task. Context: Explore and understand the Empathy Ledger codebase architecture, data flows, database schema, services, and how components connect. Use when you need to understand where things are, how data flows, or how different parts of the system relate to each other.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/codebase-explorer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How codebase-explorer Compares
| Feature / Agent | codebase-explorer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Explore and understand the Empathy Ledger codebase architecture, data flows, database schema, services, and how components connect. Use when you need to understand where things are, how data flows, or how different parts of the system relate to each other.
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.
SKILL.md Source
# Codebase Explorer Skill
Explore and document the Empathy Ledger codebase architecture, data flows, and system relationships.
## Instructions
When this skill is invoked, help the user understand:
1. **Database Schema** - Tables, relationships, migrations
2. **Data Flow** - Supabase → Services → API Routes → Components
3. **Service Layer** - Business logic patterns
4. **API Routes** - Endpoints and their purposes
5. **Type Definitions** - Where to find types for each domain
6. **Multi-Tenant Architecture** - How tenant isolation works
## Quick Reference Files
### Database & Types
| Domain | Types File | Key Tables |
|--------|-----------|-----------|
| Users/Profiles | `src/types/database/user-profile.ts` | profiles, profile_settings |
| Organizations | `src/types/database/organization-tenant.ts` | organisations, organization_members, tenants |
| Projects | `src/types/database/project-management.ts` | projects, project_participants |
| Stories/Content | `src/types/database/content-media.ts` | stories, transcripts, media_assets |
| Distribution | `src/types/database/story-ownership.ts` | story_distributions, consent_proofs |
| Cultural Safety | `src/types/database/cultural-sensitivity.ts` | cultural_safety_moderation |
| Locations | `src/types/database/location-events.ts` | locations, events |
| Analysis | `src/types/database/analysis-support.ts` | transcript_analysis, themes, quotes |
### Supabase Clients
| Client | File | Usage |
|--------|------|-------|
| Browser | `src/lib/supabase/client.ts` | React components |
| Server SSR | `src/lib/supabase/client-ssr.ts` | API routes, server components |
| Service Role | `src/lib/supabase/service-role-client.ts` | Admin operations (bypasses RLS) |
### Core Services (src/lib/services/)
| Service | Purpose |
|---------|---------|
| consent.service.ts | GDPR consent proof system |
| distribution.service.ts | Story distribution with policy enforcement |
| revocation.service.ts | Revoke distributed content |
| embed.service.ts | Embedded story tokens |
| organization.service.ts | Org management and metrics |
| audit.service.ts | Compliance logging |
| gdpr.service.ts | Data privacy operations |
| webhook.service.ts | Event distribution to partners |
### API Routes (src/app/api/)
| Route | Purpose |
|-------|---------|
| /api/stories | Story CRUD |
| /api/stories/[id]/consent | Consent management |
| /api/stories/[id]/distributions | Distribution tracking |
| /api/stories/[id]/revoke | Revocation |
| /api/storytellers | Storyteller profiles |
| /api/projects | Project management |
| /api/projects/[id]/transcripts | Transcript access |
| /api/embed/stories/[id] | Embedded content |
| /api/admin/* | Admin operations |
## Data Flow Pattern
```
User Action (React Component)
↓
fetch('/api/endpoint')
↓
API Route (src/app/api/*)
↓
Service Layer (src/lib/services/*)
↓
Supabase Client (RLS enforced)
↓
PostgreSQL (supabase/migrations/*)
```
## Multi-Tenant Isolation
Every query filters by tenant:
```typescript
// In API route
const profile = await supabase.from('profiles').select('tenant_id').eq('id', user.id).single()
query = query.eq('tenant_id', profile.tenant_id)
```
## Role Hierarchy (highest → lowest)
1. elder (100) - Cultural authority
2. cultural_keeper (90) - Knowledge preservation
3. admin (70) - System management
4. project_leader (60) - Project management
5. storyteller (50) - Content creation
6. community_member (40) - Participant
7. guest (10) - Read-only
## Common Exploration Commands
```bash
# Find all services
ls src/lib/services/
# Find API routes for a feature
ls src/app/api/stories/
# Check database types
cat src/types/database/index.ts
# View latest migration
ls -la supabase/migrations/ | tail -5
# Find where a table is used
grep -r "from('stories')" src/
# Find component for a feature
ls src/components/stories/
```
## Output Format
When exploring, provide:
1. **File locations** with clickable links
2. **Key relationships** between tables/services
3. **Code snippets** showing patterns
4. **Diagrams** using ASCII or markdown tables
## When to Use This Skill
Invoke when:
- Asking "where is X located?"
- Asking "how does X connect to Y?"
- Needing to understand data relationships
- Looking for the right service or API route
- Understanding the database schema
- Finding component or type definitions
## Reference Documentation
For comprehensive documentation with full code examples, see:
- [ARCHITECTURE_REFERENCE.md](../../../docs/ARCHITECTURE_REFERENCE.md) - Complete system documentation
---
**Trigger:** User asks about codebase structure, data flow, or "how does X connect to Y"Related Skills
codebase-search
Search and navigate large codebases efficiently. Use when finding specific code patterns, tracing function calls, understanding code structure, or locating bugs. Handles semantic search, grep patterns, AST analysis.
codebase-cleanup-tech-debt
You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti
codebase-cleanup-refactor-clean
You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.
codebase-cleanup-deps-audit
You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.
lark-openapi-explorer
飞书/Lark 原生 OpenAPI 探索:从官方文档库中挖掘未经 CLI 封装的原生 OpenAPI 接口。当用户的需求无法被现有 lark-* skill 或 lark-cli 已注册命令满足,需要查找并调用原生飞书 OpenAPI 时使用。
codebase-mapping
Repository structure and dependency analysis for understanding a codebase's architecture. Use when needing to (1) generate a file tree or structure map, (2) analyze import/dependency graphs, (3) identify entry points and module boundaries, (4) understand the overall layout of an unfamiliar codebase, or (5) prepare for deeper architectural analysis.
explore-codebase
Pattern for efficiently exploring codebases using parallel subagents. Use when you need to understand code structure, find patterns, or gather context.
investigating-codebases
Automatically activated when user asks how something works, wants to understand unfamiliar code, needs to explore a new codebase, or asks questions like "where is X implemented?", "how does Y work?", or "explain the Z component"
codebase-analysis
Systematically analyze codebase structure, complexity, dependencies, and architectural patterns to understand project organization
explorer
Quickly search and navigate the codebase - Use when you need to quickly find files, search for patterns, or locate specific code without deep analysis.
azure-quotas
Check/manage Azure quotas and usage across providers. For deployment planning, capacity validation, region selection. WHEN: "check quotas", "service limits", "current usage", "request quota increase", "quota exceeded", "validate capacity", "regional availability", "provisioning limits", "vCPU limit", "how many vCPUs available in my subscription".
raindrop-io
Manage Raindrop.io bookmarks with AI assistance. Save and organize bookmarks, search your collection, manage reading lists, and organize research materials. Use when working with bookmarks, web research, reading lists, or when user mentions Raindrop.io.