Bootstrap a Kodex knowledge base by analyzing codebase structure and creating topic stubs
View on GitHubben-mad-jlp/claude-mermaid-collab
mermaid-collab
skills/kodex-init/SKILL.md
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/ben-mad-jlp/claude-mermaid-collab/blob/main/skills/kodex-init/SKILL.md -a claude-code --skill kodex-initInstallation paths:
.claude/skills/kodex-init/# Kodex Init Bootstrap a Kodex knowledge base by analyzing codebase structure and creating topic stubs. ## Overview This skill analyzes a codebase to identify logical topic boundaries and creates stub topics in the Kodex knowledge base. Topics are created as drafts requiring human approval before going live. **Use when:** - Setting up Kodex for a new project - Onboarding to an unfamiliar codebase - Refreshing topic coverage after major refactoring --- ## Step 1: Explore Codebase Structure Walk the directory tree to understand the project structure. ### 1.1 List Top-Level Directories ```bash ls -d */ 2>/dev/null | grep -v -E '^(node_modules|vendor|\.git|dist|build|out|coverage|__pycache__|\.)' ``` ### 1.2 Check Framework Indicators Look for these files to identify the tech stack: - `package.json` → Node.js/React/Vue - `pubspec.yaml` → Flutter/Dart - `Cargo.toml` → Rust - `go.mod` → Go - `*.csproj` → .NET - `requirements.txt` / `pyproject.toml` → Python ### 1.3 Check Infrastructure Files - `Dockerfile`, `docker-compose.yml` → deployment topic - `.github/workflows/`, `.gitlab-ci.yml` → ci-cd topic - `jest.config.*`, `vitest.config.*`, `pytest.ini` → testing topic - `.env`, `config/` → configuration topic ### Exclusion Patterns **Always exclude:** - `node_modules/`, `vendor/`, `.git/` - `dist/`, `build/`, `out/`, `coverage/` - `__pycache__/`, `.cache/` - Hidden directories (starting with `.`) - Binary and generated files --- ## Step 2: Build Topic List ### 2.1 Directory-Based Topics For each significant directory (3+ files or contains entry point): ``` topic_name = kebab-case(directory_name) title = Title Case(directory_name) source_files = [list of files in directory] ``` ### 2.2 Standard Topics Check for and add these standard topics when indicators exist: | Topic | Indicators | |-------|------------| | `deployment` | Dockerfile, docker-compose.yml, k8s/, helm/ | | `ci-cd` | .github/workflows/, .gitlab-ci.yml, .circleci/ | | `testing` | test/, _