Skip to content
kodex-init logo

Kodex Init

kodex-init

Bootstrap a Kodex knowledge base by analyzing codebase structure and creating topic stubs

SKILL.md

Full skill instructions

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

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:

TopicIndicators
deploymentDockerfile, docker-compose.yml, k8s/, helm/
ci-cd.github/​workflows/, .gitlab-ci.yml, .circleci/
testingtest/, tests/, .test., jest.config.*, pytest.ini
configuration.env*, config/, settings.*
databasemigrations/, schema/, prisma/, drizzle/
authenticationauth/, login/, session/, jwt/
apiroutes/, controllers/, api/, endpoints/

2.3 Granularity Guidelines

  • Target: 10-30 topics depending on codebase size
  • Merge: Similar small folders into one topic
  • Split: Large complex areas (20+ files) into multiple topics
  • Don't: Create a topic for every single file

Step 3: Present for Approval

Display the proposed topic list to the user:

Proposed topics for this codebase:

1. [name]: Title (N files)
   - path/​to/​file1
   - path/​to/​file2

2. [name]: Title (N files)
   ...

Ask user:

What would you like to do?

1. Approve all - Create these topics
2. Add a topic - I want to add another
3. Remove a topic - Remove one from the list
4. Edit a topic - Modify name or files

Handle modifications and re-display until user approves.


Step 4: Create Topics

For each approved topic, call the MCP tool:

Tool: mcp__plugin_mermaid-collab_mermaid__kodex_create_topic
Args: {
  "project": "<absolute-path-to-cwd>",
  "name": "<topic-name>",
  "title": "<Topic Title>",
  "content": {
    "conceptual": "# <Topic Title>\n\nTopic pending documentation.\n\n## Source Files\n- path/​to/​file1\n- path/​to/​file2",
    "technical": "",
    "files": "",
    "related": ""
  }
}

Step 5: Flag Topics as Incomplete

After creating all topics, flag each one as incomplete so they appear in the fix queue:

Tool: mcp__plugin_mermaid-collab_mermaid__kodex_flag_topic
Args: {
  "project": "<absolute-path-to-cwd>",
  "name": "<topic-name>",
  "type": "incomplete",
  "description": "Stub topic needs detailed content based on actual codebase analysis"
}

Call this for each topic created in Step 4.

Summary

After creating and flagging all topics, display:

Created N topics as drafts:
- topic-1: Title 1
- topic-2: Title 2
...

All topics flagged as incomplete for review.
Use /​kodex-fix to fill in detailed content, or review drafts in the Kodex UI.

Error Handling

ErrorAction
Cannot read directoryLog warning, skip, continue
No significant directoriesWarn user, ask for guidance
MCP tool failsLog error, continue with remaining
User cancelsExit with no changes

MCP Tools Reference

ToolPurpose
kodex_create_topicCreate a new topic as draft
kodex_list_topicsCheck existing topics before creating
kodex_flag_topicFlag topic as incomplete for review

Integration

Standalone skill - Does not require an active collab session.

Related skills:

  • kodex-fix - Fix flagged incomplete topics
  • using-kodex - Query and flag existing topics

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View