Skip to content

Getting Started

AI-First is a CLI tool that prepares any repository to be used effectively by AI coding agents. It generates instant context so AI agents understand your codebase in seconds, not minutes.

Why AI-First?

AI coding assistants often struggle with large repositories due to:

  • Limited context windows - Can't read all files
  • Lack of architectural awareness - Don't understand project structure
  • Difficulty navigating - Can't find relevant code
  • Missing relationships - Don't understand module dependencies

AI-First solves this by creating a repository intelligence layer that provides:

  • Project structure and architecture
  • Extracted symbols (functions, classes, interfaces)
  • Dependency graph
  • Coding conventions
  • Entry points

Quick Start

bash
# Install globally (recommended)
npm install -g ai-first

# Or run without install
npx ai-first init

Generate Context

bash
# Initialize AI-First in your repository
ai-first init

# This generates:
# - ai/ai_context.md      # Unified context (start here!)
# - ai/repo_map.json      # Machine-readable structure
# - ai/symbols.json       # Extracted functions/classes
# - ai/dependencies.json   # Import relationships
# - ai/architecture.md    # Architecture pattern
# - ai/tech_stack.md      # Languages & frameworks

Index for Fast Queries

bash
# Create SQLite index for fast symbol queries
ai-first index

# For large repos, enable semantic search
ai-first index --semantic

Use with AI Agents

After running ai-first init, give the AI agent the ai/ai_context.md file. It contains:

  • Project overview
  • Architecture pattern
  • Tech stack
  • Entry points
  • Key conventions

Supported AI Agents

AgentHow to Use
OpenCode~/.config/opencode/commands/ai-first.md
CursorReference ai/ai_context.md in prompts
Claude CodeInclude context in system prompt
WindsurfProject understanding
GitHub CopilotContext-aware suggestions

Next Steps

Released under the MIT License.