How skibidiskib/ai-codex works
ai-codex is a CLI that scans a project and generates compact Markdown indexes for AI coding assistants. Its main workflow parses CLI/config options, detects a framework, scans routes, pages, components, library exports and supported database schemas, then writes applicable index files. The graph preserves the documented output capabilities, including runtime detection for SvelteKit. Source excerpts show the CLI-to-orchestrator flow and generator dispatch; framework-specific generation is partly sampled, so unsupported internal handoffs are omitted.
Main entry points: core.ts Framework detection and dispatch · helpers.ts Filesystem helpers · schema.ts Schema parsing and index · sveltekit.ts SvelteKit scanning
Components 17
CLI and orchestration
- CLI and config
src/generate-codex.ts - Framework detection and dispatch
src/core.ts
Framework scanning
- Next.js scanning
src/adapters/nextjs.ts - SvelteKit scanning
src/adapters/sveltekit.ts
Index generation
- Route index
src/adapters/nextjs.ts - Page index
src/adapters/nextjs.ts - Component index
src/adapters/nextjs.ts - Library exports
src/generators/lib.ts - Schema parsing and index
src/generators/schema.ts - routes.md
- pages.md
- components.md
- lib.md
.ai-codex/lib.md - schema.md
Shared utilities
- Filesystem helpers
src/helpers.ts - Shared data types
src/types.ts
Other components
- Project operator
Connections 21
- Project operator → CLI and config: runs
README.md - CLI and config → Framework detection and dispatch: calls main
src/generate-codex.ts - Framework detection and dispatch → Next.js scanning: detects and dispatches
src/core.ts - Framework detection and dispatch → SvelteKit scanning: detects and dispatches
src/core.ts - Framework detection and dispatch → Route index: generates routes
src/core.ts - Framework detection and dispatch → Page index: generates pages
src/core.ts - Framework detection and dispatch → Component index: generates components
src/core.ts - Framework detection and dispatch → Library exports: calls generator
src/core.ts - Framework detection and dispatch → Schema parsing and index: calls generator
src/core.ts - Route index → routes.md: produces
README.md - Page index → pages.md: produces
README.md - Component index → components.md: produces
README.md - Library exports → lib.md: produces
README.md - Schema parsing and index → schema.md: produces
README.md - Next.js scanning → Filesystem helpers: uses
src/adapters/nextjs.ts - SvelteKit scanning → Filesystem helpers: uses
src/adapters/sveltekit.ts - SvelteKit scanning → Schema parsing and index: parses bindings
src/adapters/sveltekit.ts - Library exports → Filesystem helpers: uses
src/generators/lib.ts - Schema parsing and index → Filesystem helpers: uses
src/generators/schema.ts - Framework detection and dispatch → Filesystem helpers: uses
src/core.ts - Framework detection and dispatch → Shared data types: uses types
src/core.ts