# How to Set Up the deep-company-series Skill for Long-Form Research in AI Berkshire

> Set up the deep-company-series skill for long-form AI research in Berkshire. Run the sync script and use the command with your company to get started easily.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: how-to-guide
- Published: 2026-07-11

---

**The deep-company-series skill is activated by running the repository synchronization script `python3 scripts/sync-codex-skills.py` and invoking the `/deep-company-series` slash command with your target company argument.**

The `deep-company-series` skill is a canonical workflow in the **xbtlin/ai-berkshire** repository designed to generate publication-grade, eight-chapter research series on any public company. This skill lives in the `skills/` directory and is automatically mirrored to the Codex-generated package, enabling both Claude Code and Codex agents to execute a rigorous four-stage research and writing pipeline.

## Prerequisites and Synchronization

Before invoking the workflow, you must ensure the skill artifacts are synchronized between the canonical source and the generated Codex packages.

### Running the Sync Script

Execute the repository-wide synchronization script to propagate the latest skill definitions:

```bash
python3 scripts/sync-codex-skills.py

```

This script copies the canonical source file [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md) into the generated folder [`codex-skills/deep-company-series/SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-skills/deep-company-series/SKILL.md). The [`SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/SKILL.md) adapter serves as the runtime interface that maps the placeholder `$ARGUMENTS` to the user’s request, ensuring the workflow defined in the source file is followed precisely.

## Loading and Invoking the Skill

Once synchronized, the skill becomes available through a standardized slash command interface.

### Slash Command Syntax

Invoke the skill directly from your chat interface:

```bash
/deep-company-series <company-name>

```

For example, to research Tencent:

```bash
/deep-company-series 腾讯

```

If the skill is not yet loaded in the current session, the generated prompt file [`codex-prompts/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-prompts/deep-company-series.md) instructs the executor to "use the installed AI Berkshire Codex skill `deep-company-series`".

### JSON Payload Format

When working programmatically or embedding the skill in automation scripts, pass arguments as a raw JSON payload:

```json
{
  "skill": "deep-company-series",
  "arguments": "拼多多"
}

```

The [`SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/SKILL.md) adapter processes these arguments and initializes the research workflow defined in the canonical source.

## The Four-Stage Research Workflow

The `deep-company-series` skill orchestrates a deterministic pipeline that produces eight interlinked long-form articles. Each stage enforces strict quality controls and consistency checks.

### Stage 1: Multi-Source Research

The skill initiates automated collection of:

- **5-year historical reports** and recent quarterly filings
- **At least three third-party research documents** from independent analysts

This foundation ensures the subsequent writing stage relies on verified primary sources rather than surface-level summaries.

### Stage 2: Long-Form Article Generation

Following the research phase, the skill produces eight (or a reduced set of) long-form articles in the order defined by the internal template. The canonical definition in [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md) provides a strict fact-check checklist and a comprehensive style guide covering tone, prohibited terminology, and title conventions to guarantee publication-grade output.

### Stage 3: Cross-Article Consistency Validation

An automated "Explore agent" executes a **Cross-Article Consistency Scan** that verifies numeric accuracy and terminology alignment across all generated chapters. This prevents contradictions between the financial data in early chapters and the strategic analysis in later sections.

### Stage 4: Privacy and Publication Review

Before final commit, the workflow executes a local `grep` operation to remove any personal identifiers or sensitive metadata from the generated content. This privacy check ensures the series meets publication standards before files are written to the repository.

## Output File Structure

Upon completion, the skill creates a hierarchical directory structure organized by company and publication date:

```

reports/拼多多/《看懂拼多多》-20260711/
├─ 01-开篇.md
├─ 02-护城河.md
├─ 03-商业模式.md
├─ 04-财务分析.md
├─ 05-竞争格局.md
├─ 06-风险因素.md
├─ 07-估值.md
└─ 08-决策.md

```

Each markdown file corresponds to a specific chapter in the research series, following the standardized template defined in the skill source.

## Key Implementation Files

Understanding the file architecture helps troubleshoot synchronization issues:

- **[`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md)** — Canonical definition containing the workflow logic, article templates, style guide, and execution checklist.
- **[`codex-prompts/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-prompts/deep-company-series.md)** — Thin wrapper that loads the skill in Codex environments.
- **[`codex-skills/deep-company-series/SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-skills/deep-company-series/SKILL.md)** — Generated adapter linking the canonical source to the Codex runtime.
- **[`scripts/sync-codex-skills.py`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/sync-codex-skills.py)** — The synchronization script that propagates changes from `skills/` to `codex-skills/`.

## Summary

- **Synchronize first** by running `python3 scripts/sync-codex-skills.py` to ensure the `deep-company-series` skill is available in [`codex-skills/deep-company-series/SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-skills/deep-company-series/SKILL.md).
- **Invoke via slash command** using `/deep-company-series <company>` or pass JSON arguments programmatically.
- **Expect four automated stages**: Research, Writing, Consistency Scan, and Privacy Review.
- **Receive eight chapters** following a standardized template with built-in fact-checking and style enforcement.
- **Output lands in** `reports/<company>/<series-name>-<date>/` with numbered markdown files.

## Frequently Asked Questions

### How do I update the deep-company-series skill after modifying the source files?

Edit the canonical definition in [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md), then run `python3 scripts/sync-codex-skills.py` again. This script propagates your changes to the generated `codex-skills/` directory, making the updated workflow available to both Claude Code and Codex agents without manual copying.

### Can I run the deep-company-series skill on private companies or non-standard entities?

Yes. The skill accepts free-form descriptions as arguments, not just ticker symbols. Provide descriptive text like `"early-stage AI semiconductor startup targeting data centers"` instead of a stock code, and the research stage will adapt its source collection strategy accordingly.

### What happens if the Cross-Article Consistency Scan finds discrepancies?

The Explore agent flags numeric mismatches or terminology inconsistencies between chapters and pauses the workflow. You must resolve these conflicts—typically by verifying the primary source data or adjusting the analysis—before the Final Privacy & Publication Check stage executes.

### Where does the deep-company-series skill store its style guide and fact-check rules?

These governance documents live in the canonical source file [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md) (lines 52-71), which defines prohibited words, tone requirements, title conventions, and the mandatory fact-check checklist. The synchronisation script ensures these rules propagate to the runtime environment.