How to Install AI Berkshire for Codex AI: A Complete Setup Guide
To install AI Berkshire for Codex AI, clone the xbtlin/ai-berkshire repository, execute ./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.
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, 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:
./scripts/install-codex-skills.sh
This shell script performs two critical functions:
- Generation: It executes
scripts/sync-codex-skills.py, which reads each Markdown file inskills/(e.g.,investment-research.md), adds minimal front-matter headers, and writes the output tocodex-skills/<skill>/SKILL.md. - 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 (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 (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:
./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:
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:
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 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:
使用 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:
/prompts:investment-research 腾讯
Summary
- Clone the
xbtlin/ai-berkshirerepository to access canonical skill definitions inskills/. - Generate Codex-compatible packages using
scripts/sync-codex-skills.py, which processes Markdown files and adds required front-matter. - Install the generated skills to
~/.codex/skillsusingscripts/install-codex-skills.sh. - Optional: Run
scripts/install-codex-prompts.shto enable slash-command shortcuts. - Restart the Codex client to activate 19 investment research skills including financial rigor tools from
tools/financial_rigor.py.
Frequently Asked Questions
Where does AI Berkshire install the Codex skills?
The 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. The 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 provide the core functionality and natural language command processing (e.g., 使用 investment-research). The optional prompts installed by 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, 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.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →