Skip to content
neotex-init logo

Neotex Codebase Onboarding

neotex-init

Use when user runs /neotex-init to deeply scan a codebase and auto-generate organizational knowledge for neotex.

SKILL.md

Full skill instructions

Neotex Codebase Onboarding

Automatically scan a codebase and generate organizational knowledge for neotex. Uses parallel exploration and scoring to capture what matters.

Prerequisites

ls .neotex/​config.yaml 2>/​dev/​null || neotex init

PHASE 1: MEASURE & SPAWN (Immediate)

1.1 Measure Project Scale

Run these commands to understand project size:

# Total files (excluding node_modules, .git, vendor)
find . -type f -not -path '*/​node_modules/​*' -not -path '*/​.git/​*' -not -path '*/​vendor/​*' | wc -l

# Directory depth distribution
find . -type d -not -path '*/​node_modules/​*' -not -path '*/​.git/​*' | awk -F/ '{print NF-1}' | sort -n | uniq -c

# Files per directory (top 20)
find . -type f -not -path '*/​node_modules/​*' -not -path '*/​.git/​*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -20

# Detect languages
ls *.go go.mod 2>/​dev/​null && echo "GO"
ls package.json 2>/​dev/​null && echo "JS/​TS"
ls *.py pyproject.toml setup.py 2>/​dev/​null && echo "PYTHON"
ls Cargo.toml 2>/​dev/​null && echo "RUST"

1.2 Spawn Background Agents (IMMEDIATELY)

CRITICAL: Fire these agents in parallel BEFORE doing anything else. Use Task tool with run_in_background: true.

Base agents (always spawn):

Agent 1: "Explore anti-patterns: Search for 'DO NOT', 'NEVER', 'ALWAYS', 'DEPRECATED', 'TODO', 'FIXME', 'HACK' in comments. Report forbidden patterns and technical debt."

Agent 2: "Explore entry points: Find main files, CLI entrypoints, API routes, event handlers. Report non-standard organization."

Agent 3: "Explore conventions: Sample 5-10 source files. Report naming patterns, error handling style, logging approach, test organization. Focus on DEVIATIONS from language defaults."

Dynamic agents (spawn based on scale):

ConditionExtra Agents
>100 files+1 agent: "Explore directory {X}: Document purpose, key files, patterns"
>10k lines+1 agent: "Explore complexity hotspots: Find largest files, most imported modules"
Depth ≥4+1 agent: "Explore nested structure: Map deep directories, explain hierarchy"
Monorepo detected+1 per package: "Explore package {X}: Purpose, dependencies, API surface"
Multiple languages+1 per language: "Explore {LANG} code: Conventions, build, test patterns"

PHASE 2: STRUCTURE ANALYSIS (Main Session)

While agents explore, analyze structure yourself:

2.1 Read Key Files

# Identity
cat README.md 2>/​dev/​null | head -100
cat package.json go.mod Cargo.toml pyproject.toml 2>/​dev/​null | head -50

# Build/​Dev
cat Makefile docker-compose.yaml .env.example 2>/​dev/​null

# CI/​CD
cat .github/​workflows/​*.yml .gitlab-ci.yml 2>/​dev/​null | head -100

2.2 Score Directories

For each major directory, calculate a score:

FactorWeightHigh Threshold
File count3x>20 files
Subdirectory count2x>5 subdirs
Code ratio (vs config)2x>70% code
Has index/​main file2xYes
Import frequency3x>20 imports from other dirs

Decision thresholds:

  • Score >15 → Document as separate learning
  • Score 8-15 → Document if distinct domain
  • Score <8 → Skip (parent covers it)

PHASE 3: COLLECT & GENERATE

3.1 Collect Background Results

Wait for all background agents to complete. Gather their findings.

3.2 Generate Learnings

For each discovery, save to neotex immediately (no prompts):

echo '{"type":"TYPE","title":"TITLE","body_md":"BODY"}' | neotex add --output

Learning Templates

Architecture Decision:

{
  "type": "decision",
  "title": "Uses {pattern} for {purpose}",
  "body_md": "## Context\n{What problem this solves}\n\n## Decision\n{What was chosen}\n\n## Consequences\n{Trade-offs, implications}"
}

Code Guideline:

{
  "type": "guideline",
  "title": "{Action verb} {what} {how}",
  "body_md": "## Rule\n{The convention}\n\n## Rationale\n{Why this exists}\n\n## Examples\n```{lang}\n{good example}\n```\n\n## Anti-patterns\n```{lang}\n{bad example}\n```"
}

Domain Learning:

{
  "type": "learning",
  "title": "{Entity/​concept}: {key insight}",
  "body_md": "## Overview\n{What this is}\n\n## Key Files\n- `{path}`: {purpose}\n\n## Relationships\n{How it connects to other parts}"
}

Command Snippet:

{
  "type": "snippet",
  "title": "{Action}: {command}",
  "body_md": "## Command\n```bash\n{command}\n```\n\n## When to Use\n{Context}\n\n## Notes\n{Gotchas, options}"
}

Type Mapping

Discovery CategoryTypeFocus
Framework/​stack choicesdecisionWhy chosen, trade-offs
Architecture patternsdecisionLayers, boundaries
Naming conventionsguidelineDeviations from standard only
Error handlingguidelineProject-specific patterns
Testing approachguidelineFramework, style, mocking
Folder structurelearningNon-obvious organization
Core entitieslearningDomain model
Build commandssnippetDev workflow
Anti-patternsguidelineWhat NOT to do

PHASE 4: QUALITY GATES

Before saving each learning, verify:

  1. Not generic - Would this apply to ANY project? Skip it.
  2. Not obvious - Would a senior dev assume this? Skip it.
  3. Actionable - Does it help someone DO something? Keep it.
  4. Specific - Does it reference actual files/​patterns? Keep it.

Examples to SKIP:

  • "Use meaningful variable names"
  • "Write tests for your code"
  • "Handle errors appropriately"

Examples to KEEP:

  • "Error responses use api.Error(w, code, msg) - never write JSON directly"
  • "All repository methods take ctx context.Context as first param"
  • "Tests use testify/​assert not standard library"

PHASE 5: SUMMARY REPORT

After all learnings saved, output:

## Neotex Onboarding Complete

Scanned {FILE_COUNT} files across {DIR_COUNT} directories.
Spawned {AGENT_COUNT} exploration agents.
Generated {LEARNING_COUNT} learnings.

### Architecture & Decisions ({N})
| Title | Type |
|-------|------|
{list}

### Guidelines & Conventions ({N})
| Title | Type |
|-------|------|
{list}

### Domain & Structure ({N})
| Title | Type |
|-------|------|
{list}

### Commands & Snippets ({N})
| Title | Type |
|-------|------|
{list}

---

**Next steps:**
- `neotex search "<query>"` - Find specific knowledge
- `neotex pull` - Sync to local .neotex/​index.json
- Review and delete any unwanted learnings via web UI

ERROR HANDLING

  • If neotex add fails → Log error, continue with others
  • If background agent fails → Note in summary, continue
  • If file unreadable → Skip silently
  • If project too small (<10 files) → Generate minimal learnings, note in summary

GUIDELINES

  • Deviations over defaults - Only document what's different from standard practices
  • Specific over generic - Reference actual files, actual patterns
  • Actionable over descriptive - Help someone DO something
  • Parallel over sequential - Spawn agents immediately, collect later
  • Score before documenting - Don't document everything, document what matters
  • Never include secrets - Skip any file with credentials, keys, tokens

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