Skip to content

Commit 76cf928

Browse files
committed
docs: update MDX content and docs configuration
1 parent 2846ff7 commit 76cf928

26 files changed

+236
-413
lines changed

CONTRIBUTING.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to Codebuff
22

3-
Hey there! 👋 Thanks for wanting to contribute to Codebuff. Whether you're squashing bugs, building cool features, or making our docs better, we're excited to have you aboard!
3+
Hey there! 👋 Thanks for contributing to Codebuff. Bug fixes, features, and documentation improvements are welcome.
44

55
## Getting Started
66

@@ -147,15 +147,13 @@ Not sure where to start? Here are some great ways to jump in:
147147

148148
### Development Workflow
149149

150-
Here's how we like to work together:
150+
1. **Fork and branch** - Create a fork and a new branch
151+
2. **Follow style guidelines** - See below
152+
3. **Test** - Write tests for new features, run `bun test`
153+
4. **Type check** - Run `bun run typecheck`
154+
5. **Submit a PR** - Clear description of changes
151155

152-
1. **Fork and branch** - Create your own fork and a new branch for your changes
153-
2. **Code away** - Follow our style guidelines (more on that below)
154-
3. **Test it** - Write tests for new features and run `bun test` to make sure everything works
155-
4. **Type check** - Run `bun run typecheck` to catch any TypeScript issues
156-
5. **Submit a PR** - Open a pull request with a clear description of what you built and why
157-
158-
_Pro tip: Small, focused PRs are easier to review and merge quickly!_
156+
Small PRs merge faster.
159157

160158
### Code Style Guidelines
161159

@@ -218,27 +216,25 @@ test: add unit tests for file operations
218216

219217
## Areas Where We Need Help
220218

221-
There are tons of ways to make Codebuff better! Here are some areas where your skills could really shine:
222-
223219
### 🤖 **Agent Development**
224220

225-
Build specialized agents in `.agents/` for different languages, frameworks, or workflows. Think React experts, Python debuggers, or Git wizards!
221+
Build agents in `.agents/` for different languages, frameworks, or workflows.
226222

227223
### 🔧 **Tool System**
228224

229-
Add new capabilities in `common/src/tools` and the SDK helpers - file operations, API integrations, development environment helpers. The sky's the limit!
225+
Add capabilities in `common/src/tools` and SDK helpers: file operations, API integrations, dev environment helpers.
230226

231227
### 📦 **SDK Improvements**
232228

233-
Make the SDK in `sdk/` even more powerful with new methods, better TypeScript support, or killer integration examples.
229+
New methods, better TypeScript support, integration examples in `sdk/`.
234230

235-
### 💻 **CLI Magic**
231+
### 💻 **CLI**
236232

237-
Enhance the user experience in `cli/` with smoother commands, better error messages, or interactive features that make developers smile.
233+
Improve `cli/`: better commands, error messages, interactive features.
238234

239235
### 🌐 **Web Dashboard**
240236

241-
Level up the web interface in `web/` with better agent management, project templates, analytics, or any UX improvements you can dream up.
237+
Improve `web/`: agent management, project templates, analytics.
242238

243239
## Getting Help
244240

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ To get started building your own agents, run:
8383
codebuff init-agents
8484
```
8585

86-
> 💡 **Tip**: This command creates a comprehensive agent development guide at `.agents/README.md` (293 lines) with detailed documentation, complete examples, and full TypeScript type definitions. Start there for complete guidance.
86+
> 💡 **Tip**: This creates an agent development guide at `.agents/README.md` with examples and TypeScript types.
8787
8888
This creates:
8989
```
9090
.agents/
91-
├── README.md # Comprehensive 293-line agent guide
92-
├── my-custom-agent.ts # Working agent template to edit
93-
├── package.json # NPM package configuration
94-
├── LICENSE # Apache-2.0 license for publishing
95-
├── examples/ # 3 example agents (basic → advanced)
96-
└── types/ # Complete TypeScript definitions
91+
├── README.md # Agent development guide
92+
├── my-custom-agent.ts # Working agent template
93+
├── package.json # NPM package config
94+
├── LICENSE # Apache-2.0 license
95+
├── examples/ # 3 example agents
96+
└── types/ # TypeScript definitions
9797
```
9898

9999
You can write agent definition files that give you maximum control over agent behavior.
@@ -146,7 +146,7 @@ const client = new CodebuffClient({
146146
// 2. Do a coding task...
147147
const result = await client.run({
148148
agent: 'base', // Codebuff's base coding agent
149-
prompt: 'Add comprehensive error handling to all API endpoints',
149+
prompt: 'Add error handling to all API endpoints',
150150
handleEvent: (event) => {
151151
console.log('Progress', event)
152152
},
@@ -174,13 +174,13 @@ Learn more about the SDK [here](https://www.npmjs.com/package/@codebuff/sdk).
174174

175175
## Why choose Codebuff
176176

177-
**Deep customizability**: Create sophisticated agent workflows with TypeScript generators that mix AI generation with programmatic control. Define custom agents that spawn subagents, implement conditional logic, and orchestrate complex multi-step processes that adapt to your specific use cases.
177+
**Custom workflows**: TypeScript generators let you mix AI generation with programmatic control. Agents can spawn subagents, branch on conditions, and run multi-step processes.
178178

179179
**Any model on OpenRouter**: Unlike Claude Code which locks you into Anthropic's models, Codebuff supports any model available on [OpenRouter](https://openrouter.ai/models) - from Claude and GPT to specialized models like Qwen, DeepSeek, and others. Switch models for different tasks or use the latest releases without waiting for platform updates.
180180

181181
**Reuse any published agent**: Compose existing [published agents](https://www.codebuff.com/store) to get a leg up. Codebuff agents are the new MCP!
182182

183-
**Fully customizable SDK**: Build Codebuff's capabilities directly into your applications with a complete TypeScript SDK. Create custom tools, integrate with your CI/CD pipeline, build AI-powered development environments, or embed intelligent coding assistance into your products.
183+
**SDK**: Build Codebuff into your applications. Create custom tools, integrate with CI/CD, or embed coding assistance into your products.
184184

185185
## Contributing to Codebuff
186186

@@ -232,7 +232,7 @@ Some ways you can help:
232232

233233
**Documentation**: [codebuff.com/docs](https://codebuff.com/docs)
234234

235-
**Community**: [Discord](https://codebuff.com/discord) - Join our friendly community
235+
**Community**: [Discord](https://codebuff.com/discord)
236236

237237
**Issues & Ideas**: [GitHub Issues](https://github.com/CodebuffAI/codebuff/issues)
238238

web/contentlayer.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineDocumentType, makeSource } from 'contentlayer/source-files'
1+
import { defineDocumentType, makeSource } from 'contentlayer2/source-files'
22

33
import { remarkCodeToCodeDemo } from './src/lib/remark-code-to-codedemo'
44

web/src/components/docs/mdx/mdx-components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Check, Link } from 'lucide-react'
22
import Image from 'next/image'
3-
import { useMDXComponent } from 'next-contentlayer/hooks'
3+
import { useMDXComponent } from 'next-contentlayer2/hooks'
44
import React, { useState, useEffect } from 'react'
55

66
import { CodeDemo } from './code-demo'

web/src/content/advanced/claude-code-comparison.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Both tools:
1414
- Run in your terminal
1515
- Understand your entire codebase context
1616
- Can edit files and execute terminal commands
17-
- Use Claude Sonnet 4 as their primary model
17+
- Use Claude models (Codebuff uses Claude Opus 4.5 as its orchestrator)
1818

1919
## When to Choose Codebuff
2020

web/src/content/advanced/config.mdx

Lines changed: 0 additions & 75 deletions
This file was deleted.

web/src/content/advanced/how-does-it-work.mdx

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,37 @@ order: 2
77

88
# How does Codebuff actually work?
99

10-
Codebuff scans your repo with tree-sitter and builds a quick index of the code. That index makes it fast to find files when you ask for help.
10+
Codebuff runs multiple agents, each tuned for a specific task.
1111

12-
The server is stateless. It proxies requests to Anthropic, OpenAI, or Gemini over websockets and streams results back to the CLI.
12+
## The Orchestrator
1313

14-
We use a fast model to pick files, load the right snippets into context, and let Claude Sonnet propose an edit. The main agent can hand work to other agents for planning or file search when needed.
14+
The main agent ("Buffy") runs on Claude Opus 4.5. It reads your prompt, gathers context, and spawns subagents. The orchestrator is available in several variants:
15+
16+
- [`base2`](/publishers/codebuff/agents/base2) - Default mode orchestrator
17+
- [`base2-lite`](/publishers/codebuff/agents/base2-lite) - Lite mode (faster, cheaper)
18+
- [`base2-max`](/publishers/codebuff/agents/base2-max) - Max mode (best-of-N selection)
19+
- [`base2-plan`](/publishers/codebuff/agents/base2-plan) - Plan mode (no file writes)
20+
21+
## Subagents
22+
23+
- [**File Picker**](/publishers/codebuff/agents/file-picker) (Gemini 2.0 Flash) - finds relevant files
24+
- [**Code Searcher**](/publishers/codebuff/agents/code-searcher) - grep-style pattern matching
25+
- [**Researcher**](/publishers/codebuff/agents/researcher) (Grok 4 Fast) - web and docs lookup
26+
- [**Thinker**](/publishers/codebuff/agents/thinker) (GPT-5.1, Gemini 2.5 Pro) - works through hard problems
27+
- [**Editor**](/publishers/codebuff/agents/editor) (GPT-5.1, Claude Opus 4.5) - writes and modifies code
28+
- [**Reviewer**](/publishers/codebuff/agents/reviewer) (Claude Sonnet 4.5) - catches bugs and style issues
29+
- [**Commander**](/publishers/codebuff/agents/commander) (Grok 4 Fast or Claude Sonnet 4.5) - runs terminal commands
30+
31+
## Best-of-N Selection (Max Mode)
32+
33+
In Max mode, Codebuff spawns multiple editors with different strategies. A selector compares the outputs and picks the best one.
34+
35+
## The Pipeline
36+
37+
1. Tree-sitter scans your repo and builds a code map
38+
2. File pickers and searchers find relevant code
39+
3. Thinkers analyze the problem if needed
40+
4. Editors generate changes
41+
5. Reviewers check for issues; commanders run tests
42+
43+
The server is stateless. It streams requests to model providers (Anthropic, OpenAI, Google, xAI) over websockets. Your code stays local; only relevant context is sent.

web/src/content/advanced/large-projects.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ order: 4
77

88
# Working with Large Projects
99

10-
Codebuff runs fine on very large repos (we test against the VS Code codebase). If it starts to wander or burn too many credits, use the tips below.
10+
Codebuff works on large repos (we test against VS Code). If it wanders or burns credits, try these.
1111

1212
## Directory-Based Approach
1313

web/src/content/advanced/sdk.mdx

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ order: 7
77

88
# SDK & Programmatic Access
99

10-
The Codebuff SDK (`@codebuff/sdk`) lets you run Codebuff agents from your own code.
10+
Run Codebuff agents from your own code with `@codebuff/sdk`.
1111

1212
## Installation
1313

@@ -17,10 +17,12 @@ npm install @codebuff/sdk
1717

1818
## Prerequisites
1919

20-
Get your API key from [codebuff.com/api-keys](https://www.codebuff.com/api-keys).
20+
API key: [codebuff.com/api-keys](https://www.codebuff.com/api-keys)
2121

2222
## Quick Start
2323

24+
Use the [`base`](/publishers/codebuff/agents/base) agent (or any agent from the [Agent Store](/store)) to run tasks:
25+
2426
```typescript
2527
import { CodebuffClient } from '@codebuff/sdk'
2628

@@ -40,7 +42,7 @@ const result = await client.run({
4042

4143
## Continuing Conversations
4244

43-
Pass the previous run state to maintain context across multiple interactions:
45+
Pass the previous run state to keep context:
4446

4547
```typescript
4648
// First run
@@ -59,8 +61,6 @@ const run2 = await client.run({
5961

6062
## Custom Agents
6163

62-
Define your own agents with custom models, tools, and prompts:
63-
6464
```typescript
6565
import type { AgentDefinition } from '@codebuff/sdk'
6666

@@ -81,8 +81,6 @@ await client.run({
8181

8282
## Custom Tools
8383

84-
Extend agent capabilities with your own tools:
85-
8684
```typescript
8785
import { z } from 'zod/v4'
8886
import { getCustomToolDefinition } from '@codebuff/sdk'
@@ -110,8 +108,6 @@ await client.run({
110108

111109
## Loading Local Agents
112110

113-
Load agent definitions from your `.agents/` directory:
114-
115111
```typescript
116112
import { loadLocalAgents, CodebuffClient } from '@codebuff/sdk'
117113

@@ -129,8 +125,6 @@ await client.run({
129125

130126
### `CodebuffClient`
131127

132-
Main client for interacting with Codebuff.
133-
134128
```typescript
135129
const client = new CodebuffClient({
136130
apiKey: string, // Required: Your Codebuff API key
@@ -140,8 +134,6 @@ const client = new CodebuffClient({
140134

141135
### `client.run(options)`
142136

143-
Run an agent with the specified options.
144-
145137
<MarkdownTable>
146138
| Parameter | Type | Description |
147139
| --- | --- | --- |
@@ -159,26 +151,24 @@ Run an agent with the specified options.
159151

160152
### Event Types
161153

162-
The `handleEvent` callback receives events during execution:
163-
164154
- `agent_start` / `agent_finish` - Agent lifecycle
165155
- `tool_call` / `tool_result` - Tool execution
166156
- `text` - Text responses
167157
- `error` - Error events
168158

169159
### Return Value
170160

171-
Returns a `RunState` object containing:
161+
`RunState` object:
172162

173163
- `sessionState` - Internal state for continuing conversations
174164
- `output` - The agent's output (text, error, or structured data)
175165

176166
## Use Cases
177167

178-
- CI/CD pipelines (code review, test generation, refactoring)
179-
- Batch processing across multiple files
180-
- Embedding in VS Code extensions or web apps
181-
- Scripts for repetitive coding tasks
168+
- CI/CD pipelines: code review, test generation, refactoring
169+
- Batch processing
170+
- VS Code extensions, web apps
171+
- Automation scripts
182172

183173
## Examples
184174

@@ -214,6 +204,8 @@ async function generateTests(code: string) {
214204

215205
### Code Review in CI
216206

207+
Use the [`reviewer`](/publishers/codebuff/agents/reviewer) agent for automated code review:
208+
217209
```typescript
218210
import { CodebuffClient } from '@codebuff/sdk'
219211

@@ -355,6 +347,6 @@ jobs:
355347
356348
## Resources
357349
358-
- [GitHub Repository](https://github.com/CodebuffAI/codebuff) - Source code
359-
- [Agent Store](https://codebuff.com/store) - Browse available agents
360-
- [API Keys](https://codebuff.com/api-keys) - Get your API key
350+
- [GitHub](https://github.com/CodebuffAI/codebuff)
351+
- [Agent Store](https://codebuff.com/store)
352+
- [API Keys](https://codebuff.com/api-keys)

0 commit comments

Comments
 (0)