Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .claude/skills/codi-rs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: codi-rs
description: Codi AI coding wingman (Rust implementation). Use when working on the Rust port in codi-rs/ - the agent, TUI, providers, tools, MCP, or any Rust source.
allowed-tools: Bash(cargo *)
---

# Codi Rust Implementation

Rust port of Codi, located in `codi-rs/` within the codi repo.

## Build / Test / Bench

```bash
cd codi-rs
cargo build # Debug build
cargo build --release # Release build
cargo test # Run tests
cargo test -- --nocapture # Show output
cargo clippy # Lint
cargo fmt # Format
cargo bench # Run benchmarks
```

## Architecture

```
src/
├── main.rs # CLI entry (clap)
├── lib.rs # Library exports
├── agent/ # Core agent loop
├── cli/ # CLI command implementations
├── config/ # Configuration
├── providers/ # AI model backends
├── tools/ # Filesystem interaction tools
├── tui/ # Terminal UI (ratatui + crossterm)
├── mcp/ # Model Context Protocol (rmcp)
├── orchestrate/ # Multi-agent orchestration
├── rag/ # RAG system (embeddings)
├── symbol_index/ # SQLite code navigation (tree-sitter)
├── model_map/ # Multi-model orchestration
├── session/ # Session persistence
├── lsp/ # Language Server Protocol
├── completion/ # Shell completions
├── telemetry/ # Tracing and metrics
├── error.rs # Error types
└── types.rs # Core types
```

## Key Dependencies

- **tokio** - Async runtime
- **clap** - CLI argument parsing
- **ratatui + crossterm** - Terminal UI
- **reqwest** - HTTP client
- **serde + serde_json + serde_yaml** - Serialization
- **tree-sitter** - Code parsing for symbol index
- **rmcp** - MCP protocol
- **rusqlite** - SQLite for symbol index
- **indicatif** - Progress bars

## Coding Conventions

- **anyhow** for application errors, **thiserror** for library errors
- **async-trait** for async trait methods
- Use `colored` for terminal output
- Follow standard Rust idioms (clippy clean)
- Tests alongside modules or in `tests/`

## Feature Flags

```toml
[features]
default = ["telemetry"]
telemetry = [] # Tracing spans and metrics
release-logs = ["tracing/release_max_level_info"] # Strip debug logs in release
max-perf = ["tracing/max_level_off"] # Disable all tracing
```
91 changes: 91 additions & 0 deletions .claude/skills/codi/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
name: codi
description: Codi AI coding wingman (TypeScript CLI). Use when working on the codi TypeScript codebase - the agent loop, tools, commands, providers, or any TypeScript source.
allowed-tools: Bash(pnpm *), Bash(npx *)
---

# Codi TypeScript CLI

Codi is an AI coding wingman for the terminal - a TypeScript CLI supporting multiple AI providers (Claude, OpenAI, Ollama).

## Build / Dev / Test

```bash
pnpm install # Install dependencies
pnpm build # Compile TypeScript to JavaScript
pnpm dev # Run with ts-node (dev mode)
pnpm test # Run Vitest tests
pnpm test:watch # Watch mode
```

## Architecture

```
src/
├── index.ts # CLI entry, REPL loop
├── agent.ts # Core agent loop (model + tools orchestration)
├── config.ts # Workspace configuration (.codi.json)
├── context.ts # Project detection (Node, Python, Rust, Go)
├── session.ts # Session persistence
├── types.ts # TypeScript interfaces
├── logger.ts # Level-aware logging (NORMAL/VERBOSE/DEBUG/TRACE)
├── spinner.ts # Ora spinner manager
├── compression.ts # Entity-based context compression
├── commands/ # Slash command system (/git, /save, /config, etc.)
├── providers/ # AI model backends (Anthropic, OpenAI, Ollama)
├── tools/ # Filesystem interaction tools (read, write, edit, grep, etc.)
├── orchestrate/ # Multi-agent orchestration (parallel workers via IPC)
├── rag/ # Semantic code search (embeddings + vectra)
├── model-map/ # Multi-model orchestration (docker-compose style)
└── symbol-index/ # SQLite-based code navigation
```

## Key Patterns

- **Provider Abstraction**: `BaseProvider` + factory pattern. Add backends in `src/providers/`.
- **Tool Registry**: Self-describing tools with JSON schema definitions in `src/tools/`.
- **Slash Commands**: `src/commands/` with `registerCommand()`.
- **Streaming-First**: Provider `streamChat()` for incremental text display.
- **Context Compaction**: Auto-summarization when approaching token limits.

## Coding Conventions

- **ES Modules** with `.js` extension in imports (even for `.ts` files)
- **Async/Await** over callbacks
- **TypeScript interfaces**, avoid `any`
- **Vitest** for testing (`tests/` directory)
- Error handling: tools catch errors and return descriptive messages

## Adding a Tool

```typescript
// 1. Create src/tools/my-tool.ts
export class MyTool extends BaseTool {
getDefinition(): ToolDefinition { /* JSON schema */ }
async execute(input: Record<string, unknown>): Promise<string> { /* logic */ }
}
// 2. Register in src/tools/index.ts
registry.register(new MyTool());
```

## Adding a Command

```typescript
// In src/commands/*.ts
export const myCommand: Command = {
name: 'mycommand',
aliases: ['mc'],
description: 'Description',
usage: '/mycommand <args>',
execute: async (args, context) => `Prompt for AI: ${args}`,
};
registerCommand(myCommand);
```

## Adding a Provider

```typescript
// 1. Create src/providers/my-provider.ts extending BaseProvider
// 2. Implement: chat(), streamChat(), getName(), getModel(), supportsToolUse()
// 3. Add to createProvider() in src/providers/index.ts
```
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ npm-debug.log*
coverage/

# Local settings
.claude/
.claude/*
!.claude/skills/
*.code-review
.codi.local.json

Expand Down