# How to Install AI Berkshire for Codex AI: A Complete Setup Guide

> Install AI Berkshire for Codex AI easily. Follow our complete setup guide to clone the repository, generate skills, and deploy them to empower your Codex client.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: getting-started
- Published: 2026-07-10

---

**To install AI Berkshire for Codex AI, clone the xbtlin/ai-berkshire repository, execute [`./scripts/install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-codex-skills.sh) to generate skills and deploy them to `~/.codex/skills`, then restart your Codex client.**

The AI Berkshire framework provides a reproducible investment research workflow that works across Claude Code and Codex AI. When you install AI Berkshire for Codex AI, you gain access to 19 specialized skills for financial analysis, from earnings review to bottleneck detection. This guide walks through the canonical installation process derived directly from the source code in the `xbtlin/ai-berkshire` repository.

## Prerequisites

Before beginning the installation, ensure you have the Codex CLI installed and accessible on your system PATH. You will need Git to clone the repository and a Unix-like shell (Linux, macOS, or WSL) to execute the provided scripts.

## Installation Steps

### 1. Clone the Repository

First, download the complete codebase including canonical skill definitions and shared utilities.

```bash
git clone https://github.com/xbtlin/ai-berkshire.git
cd ai-berkshire

```

The repository contains the `skills/` directory with canonical Markdown definitions, the `tools/` directory with Python utilities like [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py), and the `scripts/` directory containing the installation automation.

### 2. Generate and Install Codex Skills

AI Berkshire uses a **canonical workflow** where skill definitions in `skills/*.md` are shared between Claude Code and Codex. The installation script handles two operations: generating Codex-compatible skill packages and installing them to the correct directory.

Run the installation script:

```bash
./scripts/install-codex-skills.sh

```

This shell script performs two critical functions:

1. **Generation**: It executes [`scripts/sync-codex-skills.py`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/sync-codex-skills.py), which reads each Markdown file in `skills/` (e.g., [`investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/investment-research.md)), adds minimal front-matter headers, and writes the output to `codex-skills/<skill>/SKILL.md`.
2. **Deployment**: It copies the generated skill packages from `codex-skills/` to `$HOME/.codex/skills` (or the directory specified by `$CODEX_HOME`).

According to the source code in [`scripts/sync-codex-skills.py`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/sync-codex-skills.py) (lines 1-31), the Python script ensures that Claude Code and Codex always reference the same canonical implementation. The shell script at [`scripts/install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-codex-skills.sh) (lines 4-21) handles the directory creation and copying logic.

### 3. Install Optional Slash Prompts

For enhanced usability with slash commands, install the compatible prompt layer:

```bash
./scripts/install-codex-prompts.sh

```

This optional step enables access to skills via the `/` menu (e.g., `/prompts:investment-research`) in addition to the standard natural language interface.

### 4. Verify the Installation

Confirm the Codex client recognizes the new skills:

```bash
codex --version

```

After verifying the client is on your PATH, **restart the Codex client** (or reload your session) to load the newly installed skills from `~/.codex/skills`.

## Architecture Overview

Understanding the file structure helps when customizing or debugging the installation. The repository implements a **source-to-target** pipeline:

```text
repository-root/
├── skills/                 # Canonical skill definitions (source)

│   └── *.md
├── codex-skills/           # Generated Codex packages (intermediate)

│   └── <skill>/SKILL.md
├── tools/                  # Shared Python utilities

│   └── financial_rigor.py
└── scripts/
    ├── sync-codex-skills.py    # Generator script

    └── install-codex-skills.sh # Installer script

```

The [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) module provides precision-finance utilities used across multiple skills, including market-cap verification and valuation checks. This architecture ensures that modifications to files in `skills/` propagate correctly to Codex after running the sync script.

## Using AI Berkshire Skills

Once installed, invoke skills directly in Codex using natural language commands:

```text
使用 investment-research 研究腾讯
使用 earnings-review 分析 PDD 2025年报
使用 industry-funnel 筛选 AI算力
使用 bottleneck-hunter 扫描 AI基础设施
使用 thesis-drift 对比拼多多两份投资论文
使用 wechat-article 写美团投研文章

```

If you installed the slash-command prompts, you can also use:

```text
/prompts:investment-research 腾讯

```

## Summary

- **Clone** the `xbtlin/ai-berkshire` repository to access canonical skill definitions in `skills/`.
- **Generate** Codex-compatible packages using [`scripts/sync-codex-skills.py`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/sync-codex-skills.py), which processes Markdown files and adds required front-matter.
- **Install** the generated skills to `~/.codex/skills` using [`scripts/install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-codex-skills.sh).
- **Optional**: Run [`scripts/install-codex-prompts.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-codex-prompts.sh) to enable slash-command shortcuts.
- **Restart** the Codex client to activate 19 investment research skills including financial rigor tools from [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py).

## Frequently Asked Questions

### Where does AI Berkshire install the Codex skills?

The [`scripts/install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-codex-skills.sh) script copies generated skill packages to `$HOME/.codex/skills` by default, or to the directory specified by the `$CODEX_HOME` environment variable if set. This is the standard location where the Codex CLI discovers available skills.

### Can I modify the skills after installation?

Yes. Edit the source files in the `skills/` directory, then re-run [`./scripts/install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-codex-skills.sh). The [`sync-codex-skills.py`](https://github.com/xbtlin/ai-berkshire/blob/main/sync-codex-skills.py) script regenerates the `codex-skills/` packages from the canonical Markdown sources, ensuring your changes propagate to `~/.codex/skills` while maintaining synchronization with any Claude Code installations.

### What is the difference between the skills and prompts?

The skills installed by [`install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/install-codex-skills.sh) provide the core functionality and natural language command processing (e.g., `使用 investment-research`). The optional prompts installed by [`install-codex-prompts.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/install-codex-prompts.sh) add slash-command shortcuts (e.g., `/prompts:investment-research`) that provide quick access to the same functionality through Codex's command menu.

### Do I need Python installed to run the installation?

Yes, the installation process requires Python to execute [`scripts/sync-codex-skills.py`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/sync-codex-skills.py), which handles the Markdown processing and front-matter injection. However, the script does not require external dependencies beyond the Python standard library, as evidenced by the source code implementation in the repository.