# CLI Reference

CEXAI ships 154 command-line tools in `_tools/cex_*.py` plus slash commands for use inside Claude Code sessions. This document covers every tool, grouped by domain.

---

## Slash Commands (Claude Code)

These are typed directly in the Claude Code chat when CEX is loaded.

| Command | Description | Example |
|---------|-------------|---------|
| `/build` | Build one artifact via 8F pipeline | `/build knowledge card about microservices` |
| `/mission` | Full lifecycle: plan + guide + spec + grid + consolidate | `/mission onboarding flow for customers` |
| `/plan` | Decompose goal into tasks, nuclei, dependencies | `/plan customer support chatbot` |
| `/guide` | Co-pilot mode: ask subjective questions before building | `/guide landing page for my product` |
| `/spec` | Create spec blueprint from plan + decisions | `/spec onboarding_flow` |
| `/grid` | Dispatch nuclei autonomously (up to 6 parallel) | `/grid BRAND_LAUNCH` |
| `/dispatch` | Send task to a specific nucleus | `/dispatch n03 build agent card` |
| `/validate` | Check artifact quality against gates | `/validate all` |
| `/status` | System health: running nuclei, signals, artifacts | `/status` |
| `/cex-doctor` | Full diagnostics: builders, schemas, files | `/cex-doctor` |
| `/consolidate` | Post-dispatch: verify, stop, commit | `/consolidate` |
| `/evolve` | Autonomous improvement loop for low-quality artifacts | `/evolve all` |
| `/mentor` | Vocabulary navigator for CEX terminology | `/mentor what is a builder?` |
| `/crew` | Manage multi-role teams with handoffs | `/crew list` |

---

## Dispatch (Shell)

These run from your terminal via bash.

```bash
bash _spawn/dispatch.sh solo n03 "task"         # Dispatch one nucleus
bash _spawn/dispatch.sh grid MISSION             # Dispatch grid (up to 6)
bash _spawn/dispatch.sh status                   # Monitor running nuclei
bash _spawn/dispatch.sh stop                     # Stop my session's nuclei
bash _spawn/dispatch.sh stop n03                 # Stop specific nucleus
bash _spawn/dispatch.sh stop --all               # Stop ALL nuclei (dangerous)
bash _spawn/dispatch.sh stop --dry-run           # Preview what would stop
```

---

## Core Pipeline

### cex_run.py

Full pipeline: natural language intent to artifact on disk.

**Key flags:** `--execute`, `--dry-run`, `--discover QUERY`, `--plan INTENT`, `--verbose`, `--json`, `--bare`, `--quality N`, `--status`

**Example:** `python _tools/cex_run.py "create knowledge card about microservices" --execute`

**See also:** cex_8f_runner.py, cex_intent.py

---

### cex_8f_runner.py

Stateful 8F artifact pipeline. The primary build engine.

**Key flags:** `--kind KIND`, `--execute`, `--dry-run`, `--list-kinds`, `--step N`, `--output-dir DIR`, `--nucleus N0X`, `--context TEXT`, `--context-file FILE`, `--model MODEL`, `--update FILE`, `--force`, `--verbose`

**Example:** `python _tools/cex_8f_runner.py "API rate limiting best practices" --kind knowledge_card --execute`

**See also:** cex_run.py, cex_intent.py, cex_8f_motor.py

---

### cex_8f_motor.py

Intent to execution plan converter (dry planning, no LLM call).

**Key flags:** `--intent INTENT`, `--dry-run N`, `--quality N`, `--output PATH`, `--compact`, `--test`

**Example:** `python _tools/cex_8f_motor.py --intent "build agent for sales" --compact`

**See also:** cex_8f_runner.py, cex_intent_resolver.py

---

### cex_intent.py

Natural language to governed prompt. The "steering wheel" that maps free-form input to structured build parameters.

**Key flags:** `--execute`, `--dry-run`, `--kind KIND`, `--quality N`, `--list-kinds`, `--json`, `--output PATH`

**Example:** `python _tools/cex_intent.py "landing page for SaaS product" --dry-run`

**See also:** cex_intent_resolver.py, cex_run.py

---

### cex_intent_resolver.py

Python-first kind resolution with zero LLM tokens. Maps natural language to `{kind, pillar, nucleus, verb}` tuple using TF-IDF.

**Key flags:** `--json`, `--verbose`, `--batch FILE`, `--threshold N`, `--test`

**Example:** `python _tools/cex_intent_resolver.py "create a webhook for Stripe payments" --json`

**See also:** cex_intent.py, cex_query.py

---

### cex_pipeline.py

5-stage build engine: CAPTURE, DECOMPOSE, HYDRATE, COMPILE, ENVELOPE.

**Key flags:** `--type TYPE`, `--topic TOPIC`, `--pillar P0X`, `--content TEXT`, `--author NAME`, `--domain NAME`, `--output-kind {example,template,builder}`, `--interactive`, `--from-file PATH`, `--dry-run`

**Example:** `python _tools/cex_pipeline.py --type knowledge_card --topic "React patterns" --pillar P01`

**See also:** cex_8f_runner.py, cex_forge.py

---

### cex_batch.py

Batch runner. Processes multiple intents from a file.

**Key flags:** `--dry-run`, `--max N`

**Example:** `python _tools/cex_batch.py intents.txt --max 5`

**See also:** cex_run.py, cex_overnight.py

---

### cex_auto.py

Autonomous flywheel: scan for gaps, plan improvements, execute build cycles.

**Key flags:** `--max N`, `--dry-run`

**Subcommands:** `scan`, `plan`, `execute`, `cycle`

**Example:** `python _tools/cex_auto.py scan --max 10`

**See also:** cex_evolve.py, cex_auto_research.py

---

### cex_auto_run.py

Fully autonomous pipeline orchestrator. Runs missions without human intervention.

**Key flags:** `--mission NAME`, `--status`, `--health`, `--json`

**Example:** `python _tools/cex_auto_run.py "build complete onboarding flow" --mission onboarding`

**See also:** cex_mission_runner.py, cex_auto.py

---

### cex_auto_research.py

Versioned self-improving evolution loop (Karpathy AutoResearch pattern).

**Subcommands:** `scan` (find targets), `run` (execute cycles), `status`, `history`

**Example:** `python _tools/cex_auto_research.py scan`

**See also:** cex_evolve.py, cex_auto.py

---

## Compilation and Formatting

### cex_compile.py

Compile `.md` artifacts to `.yaml`/`.json` or reverse-compile to target formats.

**Key flags:** `--all`, `--lp P0X`, `--target {claude-md,cursorrules,customgpt,mcp}`, `--output PATH`

**Example:** `python _tools/cex_compile.py N03_engineering/P01_knowledge/kc_agent.md`

**See also:** cex_output_formatter.py, cex_hooks.py

---

### cex_output_formatter.py

Validate and fix artifact output formatting.

**Key flags:** `--validate PATH`, `--fix PATH`, `--schema PATH`, `--batch PATH`

**Example:** `python _tools/cex_output_formatter.py --validate N03_engineering/P05_output/`

**See also:** cex_compile.py, cex_hooks.py

---

### cex_forge.py

Universal prompt generator for CEX artifacts.

**Key flags:** `--lp P0X`, `--type TYPE`, `--seeds TEXT`, `--context TEXT`, `--context-file PATH`, `--list-types`, `--output PATH`, `--builder`, `--builder-only`

**Example:** `python _tools/cex_forge.py --type knowledge_card --lp P01 --seeds "microservices,scaling"`

**See also:** cex_pipeline.py, cex_8f_runner.py

---

### cex_compress.py

LLMLingua-2 markdown compression preserving repo layout.

**Key flags:** `--target {boot,file,all}`, `--ratio N`, `--in-place`, `--dry-run`, `--skip-frontmatter`

**Example:** `python _tools/cex_compress.py --target boot --ratio 0.5 --dry-run`

**See also:** cex_token_budget.py, cex_preflight.py

---

### cex_translate.py

PT-BR to EN translation engine for legacy content.

**Key flags:** `--check [PATH]`, `--scope PATH`, `--dry-run`, `--phase {1,2,3,4,5}`, `--verbose`

**Example:** `python _tools/cex_translate.py --check --scope N02_marketing/`

**See also:** cex_sanitize.py

---

## Diagnostics and Validation

### cex_doctor.py

Builder health check. Validates 300+ builders against 12-pillar ISO architecture.

**Key flags:** `--fix`

**Example:** `python _tools/cex_doctor.py --fix`

**See also:** cex_system_test.py, cex_release_check.py

---

### cex_system_test.py

Full system validation suite (54 tests).

**Key flags:** `--quick` (skip LLM tests)

**Example:** `python _tools/cex_system_test.py --quick`

**See also:** cex_doctor.py, cex_e2e_test.py

---

### cex_e2e_test.py

End-to-end stress test runner with named scenarios.

**Key flags:** `--scenario NAME`, `--all`, `--quick`, `--full`

**Example:** `python _tools/cex_e2e_test.py --scenario petshop`

**See also:** cex_system_test.py, cex_grid_test.py

---

### cex_grid_test.py

Multi-runtime grid dispatch test harness.

**Key flags:** `--mission MISSION`, `--runtimes LIST`, `--wave-timeout N`, `--poll-interval N`, `--dry-run`, `--skip-claude-family`

**Example:** `python _tools/cex_grid_test.py --mission SMOKE_GRID --runtimes "claude,ollama" --dry-run`

**See also:** cex_e2e_test.py, cex_showoff.py

---

### cex_setup_validator.py

Environment setup validator for new installs.

**Key flags:** `--json`, `--fix`, `--category CATEGORY`

**Example:** `python _tools/cex_setup_validator.py --fix`

**See also:** cex_doctor.py, cex_env_wizard.py

---

### cex_release_check.py

Pre-release validation. Checks everything needed for public release.

**Key flags:** `--fix`

**Example:** `python _tools/cex_release_check.py`

**See also:** cex_doctor.py, cex_stats.py

---

### cex_sanitize.py

ASCII compliance checker/fixer for executable code.

**Key flags:** `--check`, `--fix`, `--scope PATH`, `--dry-run`, `--verbose`, `--extensions LIST`

**Example:** `python _tools/cex_sanitize.py --check --scope _tools/`

**See also:** cex_hooks.py, cex_translate.py

---

### cex_hooks.py

Pre/post build validation hooks for CEX artifacts.

**Subcommands:** `pre-save FILE`, `post-save`, `validate`, `pre-commit`, `validate-all`, `install`

**Example:** `python _tools/cex_hooks.py validate-all`

**See also:** cex_hooks_native.py, cex_sanitize.py

---

### cex_hooks_native.py

Native hooks entry point for Claude Code and all runtimes. Runtime-agnostic: works identically for Claude, Codex, Gemini, and Ollama.

**Key flags:** positional `event` argument

**Example:** `python _tools/cex_hooks_native.py pre-save`

**See also:** cex_hooks.py

---

### cex_naming_validator.py

Enforce `pxx_kind_desc_nxx` naming convention across artifacts.

**Key flags:** `--check [PATH]`, `--fix PATH`, `--confirm`, `--summary`, `--quiet`

**Example:** `python _tools/cex_naming_validator.py --check --summary`

**See also:** cex_doctor.py, cex_hooks.py

---

### cex_semantic_lint.py

Semantic linter for CEX artifacts (checks cross-references, vocabulary drift, structural issues).

**Key flags:** `--sweep`, `--file FILE`, `--severity {ERROR,WARN,INFO}`, `--format {text,tsv}`

**Example:** `python _tools/cex_semantic_lint.py --sweep --severity WARN`

**See also:** cex_doctor.py, cex_wave_validator.py

---

### cex_wave_validator.py

Validate builder ISOs before commit (7 systemic checks).

**Key flags:** `--scope PATH`, `--all PATH`, `--staged`, `--fix`, `--strict`

**Example:** `python _tools/cex_wave_validator.py --all archetypes/builders/ --strict`

**See also:** cex_builder_linter.py, cex_hooks.py

---

### cex_builder_linter.py

Lint individual builder directories for structural compliance.

**Key flags:** `--builder PATH`, `--strict`, `--json`, `--show-passing`

**Example:** `python _tools/cex_builder_linter.py --builder archetypes/builders/agent-builder/ --strict`

**See also:** cex_wave_validator.py, cex_doctor.py

---

### cex_flywheel_audit.py

Doc-vs-practice flywheel bootstrap. Reads system map claims, verifies against filesystem. Produces gap report: WIRED, BROKEN, GHOST, TODO.

**Key flags:** `--max-rounds N`, positional `mode`

**Example:** `python _tools/cex_flywheel_audit.py`

**See also:** cex_doctor.py, cex_coverage.py

---

### cex_repo_align.py

Structural gap reporter. Validates nucleus subdirectory naming against canonical 12-pillar layout.

**Key flags:** `--json`, `--summary`

**Example:** `python _tools/cex_repo_align.py --summary`

**See also:** cex_fractal_align.py, cex_doctor.py

---

## Evolution and Scoring

### cex_evolve.py

Autonomous experiment loop (Karpathy AutoResearch pattern). Three modes: agent (SDK-driven), auto (heuristic), sweep (batch).

**Subcommands:** `agent`, `auto`, `single`, `sweep`, `cluster`, `report`

**Example:** `python _tools/cex_evolve.py sweep --target 9.0`

**See also:** cex_evolve_below9.py, cex_evolve_ollama.py, cex_auto_research.py

---

### cex_evolve_below9.py

Batch evolution targeting artifacts below score 9.0.

**Key flags:** `--batch N`, `--max-cycles N`, `--target N`, `--dry-run`, `--sleep N`

**Example:** `python _tools/cex_evolve_below9.py --batch 10 --target 9.0 --dry-run`

**See also:** cex_evolve.py, cex_score.py

---

### cex_evolve_ollama.py

Evolution via local Ollama models (zero API cost).

**Key flags:** `--model MODEL`, `--target N`, `--batch N`, `--max-cycles N`, `--sleep N`, `--scope PATH`, `--dry-run`

**Example:** `python _tools/cex_evolve_ollama.py --model qwen3:8b --target 9.0 --batch 5`

**See also:** cex_evolve.py, cex_ollama.py

---

### cex_score.py

Hybrid scorer: structural + LLM-based quality assessment.

**Key flags:** `--dry-run`, `--apply`, `--hybrid`, `--verbose`, `--no-cache`, `--nucleus N0X`, `--null-only`, `--apply-null-only`

**Example:** `python _tools/cex_score.py N03_engineering/P01_knowledge/*.md --apply`

**See also:** cex_score_python.py, cex_quality_monitor.py

---

### cex_score_python.py

Python-only scorer (L1+L2 structural checks, zero LLM tokens).

**Key flags:** `--apply`, `--below N`, `--verbose`, `--json`

**Example:** `python _tools/cex_score_python.py _tools/ --below 7.0 --json`

**See also:** cex_score.py, cex_quality_monitor.py

---

### cex_quality_monitor.py

Quality tracking and regression detection across all artifacts.

**Key flags:** `--scan`, `--nucleus N0X`, `--trend`, `--regressions`, `--below N`, `--report`

**Example:** `python _tools/cex_quality_monitor.py --scan --regressions`

**See also:** cex_score.py, cex_experiment_analytics.py

---

### cex_experiment_analytics.py

Analytics for autoresearch experiment loops. Tracks which improvements stick.

**Key flags:** `--kind KIND`, `--since DATE`, `--format {md,tsv}`, `--diff-log`

**Example:** `python _tools/cex_experiment_analytics.py --kind knowledge_card --format md`

**See also:** cex_evolve.py, cex_quality_monitor.py

---

### cex_feedback.py

Feedback engine: archive stale artifacts, promote high-quality ones.

**Key flags:** `--archive`, `--promote`

**Example:** `python _tools/cex_feedback.py --promote`

**See also:** cex_evolve.py, cex_quality_monitor.py

---

## Discovery and Retrieval

### cex_query.py

Builder discovery by keyword or natural language intent.

**Key flags:** `--top N`, `--json`, `--rebuild-cache`, `--suggest-crew`, `--intent`

**Example:** `python _tools/cex_query.py "monetize course on Hotmart" --top 5`

**See also:** cex_retriever.py, cex_intent_resolver.py

---

### cex_retriever.py

TF-IDF semantic search across all artifacts.

**Key flags:** `--build`, `--query TEXT`, `--kind KIND`, `--pillar P0X`, `--top-k N`, `--min-score N`, `--stats`, `--examples N`, `--intent TEXT`, `--output PATH`, `--verbose`

**Example:** `python _tools/cex_retriever.py --query "rate limiting patterns" --top-k 10`

**See also:** cex_query.py, cex_reranker.py, cex_vector_store.py

---

### cex_reranker.py

Rerank retrieved documents by relevance to a query.

**Key flags:** `--query TEXT`, `--top-k N`, `--json`, positional `paths`

**Example:** `python _tools/cex_reranker.py --query "authentication patterns" --top-k 5`

**See also:** cex_retriever.py, cex_preflight.py

---

### cex_vector_store.py

L2 semantic retriever using numpy cosine similarity.

**Subcommands:** `stats`, `index`, `search`

**Example:** `python _tools/cex_vector_store.py search --query "webhook design" --top-k 5`

**See also:** cex_retriever.py, cex_kc_index.py

---

### cex_fts5_search.py

FTS5 session search with optional LLM summarization (SQLite full-text).

**Subcommands:** `index`, `query`, `stats`

**Example:** `python _tools/cex_fts5_search.py query "8F pipeline" --top-k 5`

**See also:** cex_retriever.py, cex_index.py

---

### cex_index.py

SQLite indexer for artifact metadata.

**Key flags:** `--query FIELD=VALUE`, `--orphans`, `--stats`, `--verbose`

**Example:** `python _tools/cex_index.py --query "kind=knowledge_card" --stats`

**See also:** cex_retriever.py, cex_kc_index.py

---

### cex_kc_index.py

Knowledge card indexer for Supabase pgvector.

**Key flags:** `--dry-run`, `--force`, `--stats`, `--search TEXT`, `--top-k N`

**Example:** `python _tools/cex_kc_index.py --stats`

**See also:** cex_index.py, cex_vector_store.py

---

### cex_discovery.py

Quick stats and next-build suggestions.

**Subcommands:** `stats`, `next [N]`

**Example:** `python _tools/cex_discovery.py next 5`

**See also:** cex_query.py, cex_coverage.py

---

### cex_capability_index.py

Index of all spawnable agents. Query by keyword across capabilities.

**Key flags:** `--dry-run`, `--query TEXT`

**Example:** `python _tools/cex_capability_index.py --query "research"`

**See also:** cex_query.py, cex_discovery.py

---

## Mission and Orchestration

### cex_mission_runner.py

Autonomous grid orchestration: waves, polling, quality gates, retries.

**Key flags:** `--plan PATH`, `--mission NAME`, `--waves N`, `--timeout N`, `--poll N`, `--quality-floor N`, `--max-retries N`, `--dry-run`, `--skip-stop`, `--continuous`, `--task-queue PATH`

**Example:** `python _tools/cex_mission_runner.py --mission BRAND_LAUNCH --waves 3 --quality-floor 8.0`

**See also:** cex_mission.py, cex_orchestrate.py, cex_overnight.py

---

### cex_mission.py

Mission decomposer and executor.

**Subcommands:** `decompose`, `execute`, `status`

**Key flags:** `--nucleus N0X`, `--complexity {minimal,standard,full}`, `--dry-run`, `--from-file PATH`

**Example:** `python _tools/cex_mission.py decompose "customer support chatbot" --complexity standard`

**See also:** cex_mission_runner.py, cex_mission_dispatch.py

---

### cex_mission_dispatch.py

Mission dispatch configuration and listing.

**Key flags:** `--mission NAME`, `--runtime NAME`, `--output-tag TAG`, `--list-runtimes`, `--list-missions`, `--show`

**Example:** `python _tools/cex_mission_dispatch.py --list-missions`

**See also:** cex_mission_runner.py, cex_mission.py

---

### cex_mission_state.py

Mission state manager. Track, list, and recover mission progress.

**Key flags:** `--mission ID`, `--status`, `--history`, `--list`, `--recover`, `--json`

**Example:** `python _tools/cex_mission_state.py --list`

**See also:** cex_mission_runner.py, cex_signal_watch.py

---

### cex_orchestrate.py

Low-level wave orchestration primitive.

**Key flags:** `--mission NAME`, `--wave N`, `--dir PATH`, `--nuclei LIST`, `--signals PATH`, `--stop-mode {session,all,dry-run}`, `--json`

**Example:** `python _tools/cex_orchestrate.py --mission LAUNCH --wave 1 --dir .cex/runtime/ --nuclei n01,n02,n03`

**See also:** cex_mission_runner.py, cex_coordinator.py

---

### cex_coordinator.py

Coordinator protocol: validate specs, check lazy skills, track mission state.

**Key flags:** `--mission NAME`, `--status`, `--validate-spec TEXT`, `--check-lazy TEXT`

**Example:** `python _tools/cex_coordinator.py --mission LAUNCH --status`

**See also:** cex_orchestrate.py, cex_mission_runner.py

---

### cex_overnight.py

Infinite overnight runner with health checks and quality floors.

**Key flags:** `--hours N`, `--until HH:MM`, `--poll N`, `--timeout N`, `--quality-floor N`, `--health-interval N`, `--max-failures N`, `--queue FILE`, `--dry-run`, `--nuclei LIST`

**Example:** `python _tools/cex_overnight.py --hours 8 --quality-floor 9.0 --nuclei n01,n03,n04`

**See also:** cex_mission_runner.py, cex_continuous.py

---

### cex_continuous.py

Auto-dispatch loop: scan, dispatch, poll, repeat.

**Key flags:** `--mode {scan,loop,daemon}`, `--poll N`, `--timeout N`, `--max-cycles N`, `--quality-floor N`, `--dry-run`, `--nuclei LIST`, `--signal-poll N`

**Example:** `python _tools/cex_continuous.py --mode loop --max-cycles 10 --quality-floor 8.5`

**See also:** cex_overnight.py, cex_mission_runner.py

---

### cex_signal_watch.py

Watch for nucleus completion signals. Designed for headless/overnight runs only.

**Key flags:** `--expect N`, `--mission NAME`, `--timeout N`, `--poll N`, `--pid-file PATH`, `--since TIMESTAMP`, `--quiet`

**Example:** `python _tools/cex_signal_watch.py --expect 3 --mission LAUNCH --timeout 3600`

**See also:** cex_mission_runner.py, cex_orchestrate.py

---

### cex_handoff_composer.py

Auto-compose dispatch handoffs with builder, KC, and template context.

**Key flags:** `--task TEXT`, `--nucleus N0X`, `--kinds LIST`, `--mission NAME`, `--extra TEXT`, `--top N`, `--dry-run`, `--json`, `--discover-only`

**Example:** `python _tools/cex_handoff_composer.py --task "build agent card" --nucleus n03 --dry-run`

**See also:** cex_mission_runner.py, cex_preflight.py

---

### cex_agent_spawn.py

Agent spawn manager: fork, send, stop, status.

**Key flags:** `--spawn NUCLEUS TASK`, `--fork NUCLEUS DIRECTIVE`, `--send WORKER_ID MESSAGE`, `--stop WORKER_ID`, `--stop-all`, `--status`, `--worktree`

**Example:** `python _tools/cex_agent_spawn.py --status`

**See also:** cex_agentic_nucleus.py, cex_mission_runner.py

---

### cex_agentic_nucleus.py

Agentic nucleus runner: executes a handoff file with iterative tool use.

**Key flags:** `--nucleus N0X`, `--handof PATH`, `--output PATH`, `--model MODEL`, `--max-iters N`, `--require-reads N`, `--quiet`, `--interactive`, `--auto-commit`, `--mission NAME`

**Example:** `python _tools/cex_agentic_nucleus.py --nucleus n03 --handof .cex/runtime/handoffs/task_n03.md --output N03_engineering/`

**See also:** cex_agent_spawn.py, cex_mission_runner.py

---

## Composable Crews

### cex_crew.py

Composable crew runner: discover, instantiate, execute multi-role teams.

**Subcommands:** `list`, `show NAME`, `run NAME`

**Key flags (run):** `--charter PATH`, `--execute`

**Example:** `python _tools/cex_crew.py show product_launch`

**See also:** cex_crew_runner.py, cex_capability_index.py

---

### cex_crew_runner.py

Lightweight DAG executor for crew plans.

**Key flags:** `--plan PATH`, `--crew NAME`, `--charter PATH`, `--output-dir PATH`, `--step N`, `--dry-run`, `--execute`

**Example:** `python _tools/cex_crew_runner.py --crew product_launch --charter charter.md --dry-run`

**See also:** cex_crew.py

---

## Taxonomy and Kind Management

### cex_kind_register.py

Register new kinds in the 300-kind taxonomy.

**Key flags:** `--kind NAME`, `--pillar P0X`, `--function FUNC`, `--description TEXT`, `--max-bytes N`, `--boundary NAME`, `--dry-run`, `--list`, `--validate`

**Example:** `python _tools/cex_kind_register.py --list`

**See also:** cex_kind_classifier.py, cex_kind_deps.py

---

### cex_kind_classifier.py

Classify kinds by external context and live tool requirements.

**Key flags:** `--list {ext,live}`

**Example:** `python _tools/cex_kind_classifier.py --list ext`

**See also:** cex_kind_register.py, cex_kind_tool_map.py

---

### cex_kind_deps.py

Kind dependency graph builder. Extracts cross-kind references from KCs and patches `kinds_meta.json`.

**Key flags:** `--scan`, `--patch`, `--report`, `--critical-path`

**Example:** `python _tools/cex_kind_deps.py --report`

**See also:** cex_kind_register.py, cex_kind_classifier.py

---

### cex_kind_tool_map.py

Scan tools for kind/pillar annotations and build a kind-to-tool registry.

**Key flags:** `--output PATH`, `--tool TOOL`, `--verbose`, `--dry-run`

**Example:** `python _tools/cex_kind_tool_map.py --verbose`

**See also:** cex_kind_register.py, cex_capability_index.py

---

### cex_taxonomy_scout.py

Taxonomy discovery scout. Finds new kinds from external sources.

**Key flags:** `--source {all,github,arxiv,iet,w3c,community}`, `--since DATE`, `--dry-run`, `--report`, `--backfill`, `--deprecate KIND`, `--successor KIND`, `--recheck-all`, `--harvest-first`

**Example:** `python _tools/cex_taxonomy_scout.py --report`

**See also:** cex_kind_register.py, cex_source_harvester.py

---

### cex_coverage.py

Pillar coverage analyzer. Shows gaps in artifact distribution.

**Key flags:** `--pillar P0X`, `--json`, `--top-gaps N`

**Example:** `python _tools/cex_coverage.py --top-gaps 10`

**See also:** cex_fractal_fill.py, cex_discovery.py

---

## ISO and Builder Management

### cex_iso_hydrate.py

Hydrate thin ISOs with richer content.

**Key flags:** `--list`, `--dry-run`, `--execute`, `--threshold N`

**Example:** `python _tools/cex_iso_hydrate.py --list`

**See also:** cex_iso_migrate.py, cex_schema_hydrate.py

---

### cex_iso_migrate.py

Migrate ISOs from 13-pillar to 12-pillar layout.

**Key flags:** `--dry-run`, `--scope PATH`, `--verify`

**Example:** `python _tools/cex_iso_migrate.py --dry-run`

**See also:** cex_iso_hydrate.py, cex_fractal_align.py

---

### cex_iso_fix_merges.py

Fix merged/corrupted ISO frontmatter.

**Key flags:** `--dry-run`, `--scope PATH`

**Example:** `python _tools/cex_iso_fix_merges.py --dry-run`

**See also:** cex_iso_hydrate.py, cex_wave_autofix.py

---

### cex_iso_tldr_inject.py

Inject `tldr` field into ISO frontmatter.

**Key flags:** `--check`, `--fix`, `--dry-run`

**Example:** `python _tools/cex_iso_tldr_inject.py --check`

**See also:** cex_iso_hydrate.py, cex_8f_tagger.py

---

### cex_8f_normalizer.py

Normalize non-canonical `llm_function` values in builder ISOs.

**Key flags:** `--dry-run` (default), `--apply`, `--stats`

**Example:** `python _tools/cex_8f_normalizer.py --stats`

**See also:** cex_8f_tagger.py, cex_wave_validator.py

---

### cex_8f_tagger.py

Bulk-add `8f:` fields to artifact frontmatter.

**Key flags:** `--apply`, `--force`, `--scope PATH`, `--stats`, `--mapping PATH`

**Example:** `python _tools/cex_8f_tagger.py --stats`

**See also:** cex_8f_normalizer.py, cex_iso_tldr_inject.py

---

### cex_schema_hydrate.py

Hydrate builders with universal schema fields.

**Key flags:** `--dry-run`, `--apply`, `--builders LIST`, `--iso {manifest,memory,config,tools}`, `--stats`

**Example:** `python _tools/cex_schema_hydrate.py --dry-run --stats`

**See also:** cex_iso_hydrate.py, cex_doctor.py

---

### cex_materialize.py

Materialize Claude Code sub-agents from `kinds_meta.json`.

**Key flags:** `--dry-run`, `--kind KIND`, `--list`

**Example:** `python _tools/cex_materialize.py --list`

**See also:** cex_kind_register.py, cex_capability_index.py

---

### cex_wave_autofix.py

Mechanical autofix for `cex_wave_validator` failures (llm_function, quality, title).

**Key flags:** positional `scope` (default: `archetypes/builders`)

**Example:** `python _tools/cex_wave_autofix.py archetypes/builders/agent-builder/`

**See also:** cex_wave_validator.py, cex_wave_autofix_final.py

---

### cex_wave_autofix_final.py

Final autofix pass: wrap placeholder strings in ISOs. No --help available; runs on all builders.

**See also:** cex_wave_autofix.py, cex_wave_autofix_joinbackticks.py

---

### cex_wave_autofix_joinbackticks.py

Join split backtick segments in ISOs. No --help available; runs on all builders.

**See also:** cex_wave_autofix.py, cex_wave_autofix_final.py

---

## Memory and Knowledge

### cex_memory.py

Persistent build context manager.

**Key flags:** `--status`, `--kind KIND`, `--aggregate`, `--inject PATH`, `--scan PATH`, `--prune`, `--before DATE`, `--dry-run`

**Example:** `python _tools/cex_memory.py --status`

**See also:** cex_memory_update.py, cex_memory_select.py

---

### cex_memory_update.py

Dynamic builder memory: record feedback, patterns, evidence.

**Key flags:** `--builder NAME`, `--type {feedback,user,reference,project}`, `--observation TEXT`, `--pattern TEXT`, `--evidence TEXT`, `--confidence N`, `--outcome {SUCCESS,PARTIAL,FAILURE,UNKNOWN}`, `--session-id ID`

**Example:** `python _tools/cex_memory_update.py --builder agent --type feedback --observation "Users prefer shorter agent cards"`

**See also:** cex_memory.py, cex_memory_select.py

---

### cex_memory_select.py

LLM-powered memory retrieval for build context.

**Key flags:** `--query TEXT`, `--builder NAME`, `--all`, `--top-k N`, `--no-cache`, `--format {json,inject,text}`

**Example:** `python _tools/cex_memory_select.py --query "pricing patterns" --top-k 5`

**See also:** cex_memory.py, cex_retriever.py

---

### cex_memory_age.py

Memory age calculator and staleness detector. No --help available; runs demo output.

**See also:** cex_memory.py, cex_memory_update.py

---

### cex_memory_types.py

Memory type definitions. Library module, not a CLI tool.

**See also:** cex_memory.py

---

### cex_user_model.py

Honcho-pattern peer/session/message store.

**Subcommands:** `init`, `add-message`, `insight`, `context`, `compact`, `search`

**Example:** `python _tools/cex_user_model.py init --peer-id user123`

**See also:** cex_memory.py, cex_memory_select.py

---

### cex_memo.py

Result memoization cache.

**Subcommands:** `stats`, `get`, `clear`

**Example:** `python _tools/cex_memo.py stats`

**See also:** cex_prompt_cache.py, cex_memory.py

---

## Prompt and Context

### cex_prompt_cache.py

Pre-compiled builder ISO cache.

**Subcommands:** `build`, `get`, `stats`, `invalidate`, `clean`

**Example:** `python _tools/cex_prompt_cache.py build`

**See also:** cex_prompt_layers.py, cex_prompt_optimizer.py

---

### cex_prompt_layers.py

Prompt artifact loader. Lists and retrieves prompt layers.

**Key flags:** `--list`, `--stats`, `--get NAME`, `--kind KIND`

**Example:** `python _tools/cex_prompt_layers.py --stats`

**See also:** cex_prompt_cache.py, cex_prompt_optimizer.py

---

### cex_prompt_optimizer.py

Builder prompt analysis and improvement suggestions.

**Key flags:** `--scan`, `--analyze NAME`, `--suggest NAME`, `--top N`, `--worst`, `--records`

**Example:** `python _tools/cex_prompt_optimizer.py --scan --worst`

**See also:** cex_prompt_cache.py, cex_prompt_layers.py

---

### cex_preflight.py

Hybrid local/cloud context pre-compiler. Reduces token usage ~70%.

**Key flags:** `--nucleus N0X`, `--task TEXT`, `--kind KIND`, `--handof PATH`, `--mission NAME`, `--stats`, `--clean`, `--dry-run`, `--force`, `--phase0`, `--json`, `--compress-boot`, `--ratio N`, `--in-place`

**Example:** `python _tools/cex_preflight.py --nucleus n03 --task "build agent" --kind agent --dry-run`

**See also:** cex_preflight_mcp.py, cex_preflight_runtime.py

---

### cex_preflight_mcp.py

Phase 0 MCP external context gather. Fetches web, GitHub, and document context.

**Key flags:** `--nucleus N0X`, `--kind KIND`, `--task TEXT`, `--domain NAME`, `--check`, `--queries`, `--gather`, `--input-json PATH`, `--fetch-urls URL`, `--dry-run`, `--force`, `--verbose`, `--json`

**Example:** `python _tools/cex_preflight_mcp.py --kind landing_page --task "SaaS pricing page" --gather`

**See also:** cex_preflight.py, cex_web_fetch.py

---

### cex_preflight_runtime.py

Probe runtime availability before dispatch.

**Key flags:** `--runtimes LIST`, `--all`, `--model MODEL`, `--json`

**Example:** `python _tools/cex_preflight_runtime.py --all`

**See also:** cex_preflight.py, cex_provider_discovery.py

---

### cex_token_budget.py

Token counting and allocation.

**Key flags:** `--count [TEXT]`, `--file PATH`, `--budget`, `--analyze PATH`, `--model MODEL`, `--max-tokens N`

**Example:** `python _tools/cex_token_budget.py --file N03_engineering/P01_knowledge/kc_agent.md`

**See also:** cex_compress.py, cex_cache_audit.py

---

### cex_cache_audit.py

Audit Anthropic prompt cache usage from Claude Code transcripts.

**Key flags:** `--transcripts PATH`, `--last N`, `--breakpoints`, `--hit-rate`, `--breakdown`, `--json`

**Example:** `python _tools/cex_cache_audit.py --hit-rate --last 10`

**See also:** cex_token_budget.py, cex_prompt_cache.py

---

### cex_secretariat.py

Pre-flight intelligence tier. Probes, classifies, and ranks ISOs for task context.

**Key flags:** `--probe`, `--classify TEXT`, `--rank-isos KIND TASK`, `--select-context KIND TASK`, `--json`

**Example:** `python _tools/cex_secretariat.py --rank-isos agent "build sales agent"`

**See also:** cex_preflight.py, cex_reranker.py

---

## Routing and Providers

### cex_router.py

Smart router. Resolves nucleus to best available provider.

**Key flags:** `--status`, `--resolve NUCLEUS`, `--ping`, `--ollama`

**Example:** `python _tools/cex_router.py --status`

**See also:** cex_router_v2.py, cex_provider_discovery.py

---

### cex_router_v2.py

Kind-based and signature-based backend routing.

**Key flags:** `--task TEXT`, `--kind KIND`, `--signature SIG`, `--grid-size N`, `--require-accuracy`, `--json`, `--check-kind KIND`

**Example:** `python _tools/cex_router_v2.py --kind knowledge_card --json`

**See also:** cex_router.py, cex_cli_resolver.py

---

### cex_cli_resolver.py

YAML-driven CLI selection with fallback chain. Reads `nucleus_models.yaml`.

**Key flags:** `--nucleus N0X`, `--prefer CLI`, `--pre-check`, `--json`

**Example:** `python _tools/cex_cli_resolver.py --nucleus n03 --json`

**See also:** cex_router.py, cex_model_resolver.py

---

### cex_model_resolver.py

Display nucleus-to-model configuration. No flags needed; prints a table.

**Example:** `python _tools/cex_model_resolver.py`

**See also:** cex_cli_resolver.py, cex_model_updater.py

---

### cex_model_updater.py

Self-healing model discovery. Detects stale models, discovers new ones.

**Key flags:** `--check`, `--discover`, `--apply`, `--propagate`, `--full`, `--dry-run`, `--json`

**Example:** `python _tools/cex_model_updater.py --check`

**See also:** cex_model_resolver.py, cex_provider_discovery.py

---

### cex_provider_discovery.py

Provider health and availability discovery.

**Key flags:** `--status`, `--json`, `--provider NAME`, `--no-cache`, `--best N0X`

**Example:** `python _tools/cex_provider_discovery.py --status`

**See also:** cex_router.py, cex_quota_check.py

---

### cex_quota_check.py

Pre-flight probe for CLI availability (auth, quota, network).

**Key flags:** `--cli CLI`, `--all`, `--json`, `--timeout N`, `--cache`, `--use-cache PATH`

**Example:** `python _tools/cex_quota_check.py --all --json`

**See also:** cex_provider_discovery.py, cex_cli_resolver.py

---

### cex_ollama.py

Local Ollama model interface.

**Key flags:** `--list`, `--health`, `--model MODEL`, `--prompt TEXT`, `--prompt-file PATH`, `--system TEXT`, `--structured`, `--kind KIND`, `--temperature N`, `--max-tokens N`, `--timeout N`

**Example:** `python _tools/cex_ollama.py --health`

**See also:** cex_evolve_ollama.py, cex_benchmark_ollama.py

---

### cex_benchmark_ollama.py

Benchmark local Ollama models against CEX tasks.

**Key flags:** `--models LIST`, `--tasks LIST`, `--no-claude`, `--report`, `--timeout N`

**Example:** `python _tools/cex_benchmark_ollama.py --models "qwen3:8b,llama3.1:8b" --report`

**See also:** cex_ollama.py, cex_evolve_ollama.py

---

### cex_litellm_test.py

LiteLLM integration test.

**Key flags:** `--local-only`, `--direct`

**Example:** `python _tools/cex_litellm_test.py --local-only`

**See also:** cex_provider_discovery.py, cex_router.py

---

## Fractal and Structure

### cex_fractal_align.py

Migrate nuclei to exact 12-pillar fractal layout.

**Key flags:** `--apply`

**Example:** `python _tools/cex_fractal_align.py --apply`

**See also:** cex_fractal_fill.py, cex_repo_align.py

---

### cex_fractal_fill.py

Gap audit for the 8x12 nucleus/pillar matrix.

**Key flags:** `--detail`, `--nucleus N0X`, `--json PATH`, `--core-only`, `--plan`, `--verbose`

**Example:** `python _tools/cex_fractal_fill.py --detail --nucleus N03`

**See also:** cex_fractal_align.py, cex_coverage.py

---

### cex_gen_fractal_handoffs.py

Generate fractal handoff files for wave-based dispatch. No --help; prints generation summary.

**See also:** cex_fractal_fill.py, cex_handoff_composer.py

---

### cex_merge_pillars.py

Merge root P01-P12 into N00_genesis.

**Key flags:** `--dry-run`, `--execute`, `--verify`

**Example:** `python _tools/cex_merge_pillars.py --dry-run`

**See also:** cex_fractal_align.py, cex_migrate_paths.py

---

### cex_migrate_paths.py

Path migrator: git mv operations plus reference updates.

**Key flags:** `--dry-run`, `--execute`, `--update-refs`, `--update-handoffs`

**Example:** `python _tools/cex_migrate_paths.py --dry-run`

**See also:** cex_merge_pillars.py, cex_fractal_align.py

---

### cex_mirror_audit.py

Fractal mirror enforcement. Detects orphan and drifted mirrors across nuclei.

**Key flags:** `--check`, `--list KIND`, `--dif KIND NUCLEUS`, `--promote KIND`, `--coverage`, `--json`

**Example:** `python _tools/cex_mirror_audit.py --check`

**See also:** cex_fractal_fill.py, cex_doctor.py

---

## Hygiene and Maintenance

### cex_hygiene.py

Artifact garbage collector.

**Subcommands:** `scan`, `clean`, `prune-reports`, `prune-compiled`, `stats`, `delete-kind`

**Example:** `python _tools/cex_hygiene.py scan`

**See also:** cex_janitor.py, cex_feedback.py

---

### cex_janitor.py

Categorized cleanup tool.

**Subcommands:** `scan`, `inspect CATEGORY`, `rm CATEGORY`

**Example:** `python _tools/cex_janitor.py scan`

**See also:** cex_hygiene.py, cex_feedback.py

---

### cex_lock.py

Resource lock manager for concurrent operations.

**Key flags:** `--acquire RESOURCE`, `--release RESOURCE`, `--check RESOURCE`, `--status`, `--clean-stale`, `--owner NAME`, `--timeout N`, `--ttl N`

**Example:** `python _tools/cex_lock.py --status`

**See also:** cex_agent_spawn.py, cex_orchestrate.py

---

### cex_ripple.py

Cross-reference propagation engine (when one artifact changes, update dependents).

**Key flags:** `--dry-run`, `--check PATH`, `--max-ripple N`, `--min-score N`, `--rebuild-index`

**Example:** `python _tools/cex_ripple.py --check N03_engineering/P01_knowledge/kc_agent.md --dry-run`

**See also:** cex_wire_cross_refs.py, cex_wikilink.py

---

### cex_wire_cross_refs.py

Wire cross-references into builder ISOs.

**Key flags:** `--apply`, `--stats`

**Example:** `python _tools/cex_wire_cross_refs.py --stats`

**See also:** cex_ripple.py, cex_wikilink.py

---

### cex_wikilink.py

Wikilink sweep for the entire repo.

**Key flags:** `--sweep`, `--file PATH`, `--dry-run`, `--apply`, `--stats`, `--force`, `--rebuild-index`, `--min-score N`, `--max-refs N`

**Example:** `python _tools/cex_wikilink.py --sweep --dry-run`

**See also:** cex_ripple.py, cex_wire_cross_refs.py

---

## Fine-Tuning and Training

### cex_ft_dataset.py

Fine-tuning dataset generator for cex-student model.

**Key flags:** `--generate GENERATORS`, `--stats [FILE]`, `--validate FILE`, `--export`, `--format FORMAT`, `--seed N`

**Example:** `python _tools/cex_ft_dataset.py --stats`

**See also:** cex_ft_train.py, cex_finetune_export.py

---

### cex_ft_train.py

QLoRA fine-tuning trainer.

**Key flags:** `--nucleus N0X`, `--all`, `--base MODEL`, `--epochs N`, `--dry-run`, `--modelfile-only`

**Example:** `python _tools/cex_ft_train.py --nucleus N03 --dry-run`

**See also:** cex_ft_dataset.py, cex_finetune_export.py

---

### cex_finetune_export.py

Export fine-tuning data as JSONL.

**Key flags:** `--output PATH`, `--stats`

**Example:** `python _tools/cex_finetune_export.py --stats`

**See also:** cex_ft_dataset.py, cex_ft_train.py

---

## Bootstrap and Setup

### cex_bootstrap.py

First-run brand setup: fill the X with your brand identity.

**Key flags:** `--check`, `--from-file PATH`, `--reset`, `--status`

**Example:** `python _tools/cex_bootstrap.py --check`

**See also:** cex_init.py, cex_env_wizard.py

---

### cex_init.py

Scaffold a new CEX project in 5 questions.

**Key flags:** `--name NAME`, `--domain {marketing,engineering,research,ops,custom}`, `--agents N`, `--llm {claude,openai,gemini,multi}`, `--quality {strict,standard,relaxed}`

**Example:** `python _tools/cex_init.py --name "MyBrand" --domain engineering`

**See also:** cex_bootstrap.py, cex_env_wizard.py

---

### cex_env_wizard.py

API key setup wizard.

**Key flags:** `--check`, `--nucleus N0X`

**Example:** `python _tools/cex_env_wizard.py --check`

**See also:** cex_bootstrap.py, cex_setup_validator.py

---

### cex_boot_gen.py

Generate boot scripts from `nucleus_models.yaml`.

**Key flags:** `--dry-run`, `--nucleus N0X`, `--show`, `--cli CLI`

**Example:** `python _tools/cex_boot_gen.py --dry-run`

**See also:** cex_model_resolver.py, cex_cli_resolver.py

---

### cex_nucleus_builder.py

Build a complete CEX nucleus via 8F runner.

**Key flags:** `--nucleus {N01..N07}`, `--name NAME`, `--domain NAME`, `--context TEXT`, `--dry-run`, `--kinds LIST`

**Example:** `python _tools/cex_nucleus_builder.py --nucleus N03 --name engineering --domain build --dry-run`

**See also:** cex_boot_gen.py, cex_fractal_align.py

---

## Stats and Reporting

### cex_stats.py

Auto-count repo stats. Source of truth for all number claims (builders, ISOs, kinds, KCs, tools, etc.).

**Key flags:** `--json`

**Example:** `python _tools/cex_stats.py --json`

**See also:** cex_stats_inject.py, cex_coverage.py

---

### cex_stats_inject.py

Fix hardcoded count references across docs.

**Key flags:** `--check`, `--fix`, `--dry-run`, `--inject`, `--verbose`

**Example:** `python _tools/cex_stats_inject.py --check`

**See also:** cex_stats.py

---

### cex_cohort_analyzer.py

Cohort analysis with synthetic or real data.

**Key flags:** `--input CSV`, `--demo`, `--horizon N`, `--json`

**Example:** `python _tools/cex_cohort_analyzer.py --demo --json`

**See also:** cex_experiment_analytics.py

---

## Media and Publishing

### cex_media_produce.py

Media production pipeline: text, audio, video, presentation.

**Key flags:** `--concept NAME`, `--format {text,audio,video,ppt,all}`, `--lens NAME`, `--lang {en,pt-br,both}`, `--output-dir PATH`, `--dry-run`, `--skip-upload`, `--config PATH`

**Example:** `python _tools/cex_media_produce.py --concept 8f_pipeline --format text --lang en`

**See also:** cex_notebooklm.py, cex_social_publisher.py

---

### cex_notebooklm.py

NotebookLM pipeline: upload KCs, trigger studio generation.

**Key flags:** `--upload KC_PATH`, `--studio ID`, `--status ID`, `--list`, `--reauth`, `--auth-check`, `--domain NAME`, `--notebook ID`, `--outputs LIST`

**Example:** `python _tools/cex_notebooklm.py --list`

**See also:** cex_media_produce.py

---

### cex_social_publisher.py

Publish draft content to social platforms.

**Key flags:** `--input PATH`, `--stdin`, `--platforms LIST`, `--json`

**Example:** `python _tools/cex_social_publisher.py --input draft.md --platforms "twitter,linkedin"`

**See also:** cex_outreach.py, cex_media_produce.py

---

### cex_outreach.py

Influencer CRM outreach queue manager.

**Subcommands:** `generate`, `today`, `send`, `followups`, `stats`, `status`

**Example:** `python _tools/cex_outreach.py today`

**See also:** cex_social_publisher.py

---

### cex_showoff.py

Multi-wave runtime showcase.

**Key flags:** `--wave N`, `--dry-run`, `--skip LIST`

**Example:** `python _tools/cex_showoff.py --wave 1 --dry-run`

**See also:** cex_grid_test.py, cex_e2e_test.py

---

## Enrichment and Seeding

### cex_seed_heuristic.py

Heuristic keyword extraction (zero LLM tokens).

**Key flags:** `--check`, `--fix`, `--dry-run`, `--scope {kind-kcs,isos,nucleus,all}`

**Example:** `python _tools/cex_seed_heuristic.py --check --scope kind-kcs`

**See also:** cex_seed_enrich.py, cex_source_harvester.py

---

### cex_seed_enrich.py

Seed-word enrichment via Ollama.

**Key flags:** `--check`, `--fix`, `--fix-8f`, `--dry-run`, `--scope {kind-kcs,isos,nucleus,all}`, `--model MODEL`, `--batch-size N`

**Example:** `python _tools/cex_seed_enrich.py --check --scope kind-kcs`

**See also:** cex_seed_heuristic.py, cex_evolve_ollama.py

---

### cex_source_harvester.py

Source harvester: discover and collect external references.

**Key flags:** `--dry-run`, `--apply`, `--stats`, `--verbose`, `--harvest-first`

**Example:** `python _tools/cex_source_harvester.py --stats`

**See also:** cex_taxonomy_scout.py, cex_seed_heuristic.py

---

## Skills and Learning

### cex_skill_loader.py

Builder ISO registry. Load and list all builder kinds.

**Key flags:** `--list`, `--load KIND`, `--stats`

**Example:** `python _tools/cex_skill_loader.py --list`

**See also:** cex_skill_autocreate.py, cex_skill_improve.py

---

### cex_skill_autocreate.py

Auto-generate skill artifacts from task traces.

**Key flags:** `--trace PATH`, `--scan-recent`, `--since DURATION`, `--force`, `--dry-run`

**Example:** `python _tools/cex_skill_autocreate.py --scan-recent --dry-run`

**See also:** cex_skill_improve.py, cex_skill_loader.py

---

### cex_skill_improve.py

Patch skill artifacts when traces reveal new behavior.

**Key flags:** `--auto`, `--skill PATH`, `--trace PATH`, `--dry-run`

**Example:** `python _tools/cex_skill_improve.py --auto --dry-run`

**See also:** cex_skill_autocreate.py, cex_skill_loader.py

---

### cex_claude_learn.py

Learn from GitHub PR comments. Ingests feedback into learning records.

**Key flags:** `--comment-body TEXT`, `--author NAME`, `--pr N`, `--target PATH`

**Example:** `python _tools/cex_claude_learn.py --comment-body "use tables not prose" --author reviewer --pr 42`

**See also:** cex_memory_update.py, cex_feedback.py

---

### cex_nudge.py

Curation nudge runtime. Checks and fires nudges for artifact curation.

**Subcommands:** `check`, `fire`, `tick`, `stats`

**Example:** `python _tools/cex_nudge.py stats`

**See also:** cex_feedback.py, cex_quality_monitor.py

---

## Utility and Browser

### cex_web_fetch.py

Fetch web pages or arXiv papers.

**Key flags:** `--arxiv ID`, `--max-bytes N`, `--raw`, positional `url`

**Example:** `python _tools/cex_web_fetch.py https://example.com --max-bytes 50000`

**See also:** cex_preflight_mcp.py, cex_research.py

---

### cex_research.py

KC-source prompt generator for research topics.

**Key flags:** `--topic TEXT`, `--sources LIST`, `--categories LIST`, `--dry-run`, `--scaffold`, `--output PATH`, `--list-sources`

**Example:** `python _tools/cex_research.py --topic "RAG evaluation" --list-sources`

**See also:** cex_web_fetch.py, cex_retriever.py

---

### cex_cdp.py

Chrome DevTools Protocol helper.

**Subcommands:** `status`, `tabs`, `navigate`, `click`, `type`, `read`, `elements`, `eval`, `new-tab`, `screenshot`

**Example:** `python _tools/cex_cdp.py status`

**See also:** cex_web_fetch.py

---

### cex_theme.py

CEX theme system: generate themed banners, colors, CSS.

**Key flags:** `--show`, `--nucleus N0X`, `--format {ps1,ansi,css,html}`, `--banner N0X`, `--all-banners`, `--no-ansi`

**Example:** `python _tools/cex_theme.py --all-banners`

**See also:** cex_fix_boot_banner.py

---

### cex_gdp.py

Guided Decision Protocol CLI. Track and resolve subjective decisions.

**Key flags:** `--status`, `--pending`, `--resolve ID CHOSEN`, `--rationale TEXT`

**Example:** `python _tools/cex_gdp.py --status`

**See also:** cex_mission_runner.py

---

## Library Modules (not standalone CLI tools)

| Module | Purpose |
|--------|---------|
| `cex_shared.py` | Shared utilities used by other tools |
| `cex_errors.py` | Error class definitions |
| `cex_memory_types.py` | Memory type definitions |

---

## Patch and Fix Scripts

These are one-shot maintenance tools for specific migrations.

| Tool | Purpose |
|------|---------|
| `cex_fix_boot_banner.py` | Fix boot script banners (`--apply`) |
| `cex_fix_boot_colors.py` | Patch boot script color codes |
| `cex_fix_boot_tui.py` | Patch boot TUI elements |
| `cex_patch_boot_timeout.py` | Add timeout watchdog to boot wrappers (`--dry-run`) |
| `cex_patch_exit_signal.py` | Add exit signal to boot wrappers |
| `cex_flywheel_worker.py` | Flywheel worker for a specific nucleus (`--nucleus N0X --cycle N --level {1,2}`) |

---

## 8F Pipeline Internals

Lower-level tools used by the 8F orchestration layer. Most users go through `cex_8f_runner.py` or the `/build` slash command instead. These are exposed for advanced use, debugging, and custom orchestrators.

| Tool | Purpose |
|------|---------|
| `cex_8f_motor.py` | Core 8F state machine -- F1 through F8 transition logic. Used internally by `cex_8f_runner.py`. |
| `cex_8f_normalizer.py` | Normalize 8F trace output across runtimes (Claude/Codex/Gemini/Ollama emit different formats). |
| `cex_8f_tagger.py` | Auto-tag artifacts with their 8F provenance metadata. |
| `cex_8f_runner.py` | **Public entry**: full 8F pipeline runner (`--execute --nucleus n0X --kind <kind>`). |

## Search & Retrieval Backends

| Tool | Purpose |
|------|---------|
| `cex_fts5_search.py` | SQLite FTS5 full-text search backend. Faster than `cex_retriever.py` for keyword queries; less semantic. Used as drop-in alternative when TF-IDF is overkill. |
| `cex_router_v2.py` | Hybrid router (CLI + model picker). v2 is the canonical version going forward; v1 is kept for backward-compat shims. |

## Test & Eval Harness

| Tool | Purpose |
|------|---------|
| `cex_e2e_test.py` | End-to-end test harness. Runs a full 8F build cycle for one kind and verifies output structure. Used by CI for smoke tests. |

## Evolution Variants

`cex_evolve.py` is the main public tool. Specialized variants exist for specific scopes:

| Tool | When to use |
|------|-------------|
| `cex_evolve.py` | Default sweep, multi-runtime, paid+free fallback chain |
| `cex_evolve_below9.py` | Targeted sweep of only artifacts with quality < 9.0 (post-launch polish run) |
| `cex_evolve_ollama.py` | Force-route all evolution calls to Ollama (fully free, slower, less precise) |

## Auto / Mission Variants

Three closely-related orchestration tools. Pick by scope:

| Tool | Scope |
|------|-------|
| `cex_auto.py` | Single artifact auto-improvement. Smallest unit. |
| `cex_auto_research.py` | Auto-improve via research pipeline (queries + cites sources). |
| `cex_auto_run.py` | Run a saved auto-config from disk. |
| `cex_mission_runner.py` | **Public entry**: top-level multi-wave mission orchestrator. Use this for `/mission`-style work. |
