# How to Use zhangxuefeng-skill with Docker: Containerization Guide

> Containerize zhangxuefeng-skill with Docker for easy deployment. Learn how to run any Agent Skills compatible runtime using Node.js and npx skills add for seamless integration.

- Repository: [花叔/zhangxuefeng-skill](https://github.com/alchaincyf/zhangxuefeng-skill)
- Tags: how-to-guide
- Published: 2026-06-27

---

**Yes, you can run zhangxuefeng-skill in Docker by containerizing any Agent Skills-compatible runtime (Claude Code, Codex, Cursor) with a Node.js base image and installing the skill via `npx skills add`.**

The `zhangxuefeng-skill` repository by `alchaincyf` provides a pure Markdown-based Agent Skill that simulates Zhang Xuefeng's perspective on academic and career decisions. Because the package contains only a [`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md) file with YAML front-matter and no compiled binaries, you can deploy it inside any Docker container that provides Node.js ≥14 and a compatible runtime CLI.

## Why zhangxuefeng-skill is Docker-Compatible

According to the repository's [`README.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/README.md), `zhangxuefeng-skill` is a pure **Agent Skills** package containing no runtime-specific code or native dependencies. The skill consists entirely of a [`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md) file located in the repository root that any Agent Skills-compatible runtime (Claude Code, Codex, Cursor, OpenClaw, Hermes Agent) can load and interpret. This architecture means Docker's filesystem isolation does not affect the skill's behavior, provided the runtime can locate the [`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md) file at the runtime-specific `skills/zhangxuefeng-skill/` path.

## Prerequisites for Containerization

To build a functional container, your image must include:

- **Node.js ≥14** (available in official `node` Docker images)
- **npm** and `npx` (included with Node.js)
- An **Agent Skills-compatible runtime** binary (Claude Code, Codex CLI, or Cursor)

## Building the Docker Image

### Step 1: Choose a Node.js Base Image

Select an official lightweight Node image such as `node:18-slim` or `node:20-alpine` to minimize container size.

### Step 2: Install the Skills CLI

While optional, installing the `@vercel/skills` package globally simplifies skill management inside the container:

```dockerfile
RUN npm i -g @vercel/skills

```

### Step 3: Add the zhangxuefeng-skill Package

Install the skill using the standard command referenced in [`README.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/README.md):

```dockerfile
RUN npx skills add alchaincyf/zhangxuefeng-skill

```

This command pulls the repository and places the [`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md) file under the runtime's skills directory at `skills/zhangxuefeng-skill/`.

### Step 4: Configure the Runtime Entrypoint

Set the container's `CMD` to launch your chosen runtime with the skill. For Claude Code:

```dockerfile
CMD ["claude-code", "run", "zhangxuefeng-skill"]

```

## Complete Dockerfile Example

The following Dockerfile creates a fully functional `zhangxuefeng-skill` container using Claude Code as the runtime:

```dockerfile
FROM node:18-slim

# Install the skills CLI globally

RUN npm i -g @vercel/skills

# Set working directory

WORKDIR /app

# Add the skill from the alchaincyf/zhangxuefeng-skill repository

RUN npx skills add alchaincyf/zhangxuefeng-skill

# Run the skill via Claude Code runtime

CMD ["claude-code", "run", "zhangxuefeng-skill"]

```

## Building and Running the Container

Execute these commands to build and run your containerized skill:

```bash

# Build the Docker image

docker build -t zhangxuefeng-skill:latest .

# Run interactively with port exposure (if the runtime requires it)

docker run -it --rm -p 8080:8080 zhangxuefeng-skill:latest

```

Once running, the container loads the skill and accepts queries such as:

```text
用张雪峰的视角帮我分析这个专业选择

```

## Alternative Runtime Configurations

For **Codex CLI**, modify the Dockerfile to install the runtime and adjust the entrypoint:

```dockerfile
FROM node:18-slim

RUN npm i -g @vercel/skills codex-cli

RUN npx skills add alchaincyf/zhangxuefeng-skill

CMD ["codex", "run", "zhangxuefeng-skill"]

```

Similarly, for **Cursor** or other runtimes, install the appropriate CLI package and reference `zhangxuefeng-skill` as the target skill.

## Key Files in the Repository Structure

When containerized, the runtime accesses these specific files from the `alchaincyf/zhangxuefeng-skill` repository:

- **[`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md)**: The core Agent Skills definition containing YAML front-matter and role-play logic that defines Zhang Xuefeng's decision-making framework
- **[`examples/demo-conversation.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/examples/demo-conversation.md)**: Sample dialogue demonstrating the skill's interaction patterns and perspective simulation
- **[`references/research/05-decisions.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/references/research/05-decisions.md)**: Source material distilled into the skill's statements regarding academic and career decisions

## Summary

- **zhangxuefeng-skill** requires no special Docker configuration because it is a pure Markdown-based Agent Skill with no compiled binaries
- Use any **Node.js ≥14** base image with `npx` support to install the package
- Install via **`npx skills add alchaincyf/zhangxuefeng-skill`** to correctly place [`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md) in the runtime's expected path
- Compatible with **Claude Code**, **Codex**, **Cursor**, and other Agent Skills runtimes in containerized environments
- The skill responds to Chinese queries using the logic defined in the repository's [`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md) and research references

## Frequently Asked Questions

### Does zhangxuefeng-skill require a specific Docker base image?

No. Any image providing Node.js ≥14 and the `npx` tool works, such as `node:18-slim` or `node:20-alpine`. The skill has no native dependencies or system libraries that require specific OS configurations.

### How do I install zhangxuefeng-skill inside a Docker container?

Run **`npx skills add alchaincyf/zhangxuefeng-skill`** during the image build process. This command downloads the repository and installs the [`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md) file to the runtime's skills directory, typically located at `~/.skills/` or the runtime-specific equivalent.

### Can I use zhangxuefeng-skill with Codex in Docker?

Yes. Install the `codex-cli` package via npm in your Dockerfile, then configure the container's `CMD` to execute `codex run zhangxuefeng-skill` after adding the skill with the standard `npx skills add` command. The skill works identically across all Agent Skills-compatible runtimes.

### Where does the runtime find the skill files in the container?

The runtime locates the skill definition at the path **`skills/zhangxuefeng-skill/`** within the container's file system, where it expects to find the [`SKILL.md`](https://github.com/alchaincyf/zhangxuefeng-skill/blob/main/SKILL.md) file. This path structure is maintained by the `npx skills add` command and is identical to the structure used on host machines.