You're reading this. The skill predicted it. A workflow that turns every post into a calibrated experiment—score, blind-predict, retro, evolve. The future doesn't reward effort, it rewards those who see the pattern first. 1M followers in a month — not luck, system.
Python
feat: add Codex skill install support (#6)
歌贼王@songth1ef9f433d0b23b3
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e3fe90a..2e9927f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -29,6 +29,13 @@ All notable changes to cheat-on-content will be documented here.v2 系统让"拍后改稿"成为一等公民:v1 留作档案,v2 基于实际拍摄稿重判,diff(v1, v2) 本身成为 rubric 升级的强证据(用户改稿改高了 ER → 工具学到这个用户的 ER 阈值跟当前公式不一致)。盲预测原则保留:v2 仍在发布前完成,没有播放数据可"作弊"。+### Added — Codex 安装兼容(@songth1ef [#6](https://github.com/XBuilderLAB/cheat-on-content/pull/6))++- **`install.sh --codex`**:安装根路由 skill `cheat-on-content` 和 13 个子 skill 到 `~/.codex/skills/`+- **`install.sh --all`**:同时安装 Claude Code 和 Codex skill+- **`uninstall.sh --codex` / `--all`**:对称卸载 Codex 或双端安装+- **Codex 路由说明**:Codex 用自然语言触发同一套流程,不依赖 Claude Code 的 `/cheat-*` slash-command harness+### Added — Migration 系统(让长期迭代不打断老用户)- **`/cheat-migrate` skill**:把老用户 `.cheat-state.json` 从旧 `schema_version` 升级到当前 `LATEST_SCHEMA`。幂等、不跳版、失败停在断点diff --git a/README.md b/README.mdindex bcdbffb..7141eda 100644--- a/README.md+++ b/README.md@@ -67,6 +67,8 @@## 📦 安装+### Claude Code+```bashgit clone https://github.com/XBuilderLAB/cheat-on-content.gitcd cheat-on-content@@ -75,13 +77,27 @@ bash install.sh13 个子 skill 软链接到 `~/.claude/skills/`。装一次,所有内容项目都能用。-> 冻结版本:`bash install.sh --copy` / 卸载:`bash uninstall.sh`(不动你的内容数据)+### Codex++```bash+git clone https://github.com/XBuilderLAB/cheat-on-content.git+cd cheat-on-content+bash install.sh --codex+```++Codex 会安装根路由 skill `cheat-on-content` + 13 个子 skill 到 `~/.codex/skills/`。如果当前 Codex 会话看不到新 skill,重开一次会话。++> 同时安装 Claude Code + Codex:`bash install.sh --all`+>+> 冻结版本:`bash install.sh --copy` / `bash install.sh --codex --copy`+>+> 卸载:`bash uninstall.sh` / `bash uninstall.sh --codex`(不动你的内容数据)---## 🚀 第一次跑-在你的内容项目目录里开 Claude Code,说:+在你的内容项目目录里开 Claude Code 或 Codex,说:```初始化 cheat-on-content@@ -102,7 +118,7 @@ bash install.sh状态 / 抓热点 / 找选题 / 升级 rubric / 找对标```-每次开会话 hook 自动报告 buffer + 待复盘 + top 候选——你不用主动问。+Claude Code 每次开会话 hook 自动报告 buffer + 待复盘 + top 候选——你不用主动问。Codex 当前没有等价 hook 自动注入,直接说 `状态` 可获得同样看板。完整工作流 + 子 skill 细节见 [SKILL.md](SKILL.md)。diff --git a/SKILL.md b/SKILL.mdindex b2672e4..27f705a 100644--- a/SKILL.md+++ b/SKILL.md@@ -21,6 +21,17 @@ allowed-tools: Bash(*), Read, Write, Edit, Grep, Glob, Skill, mcp__llm-chat__cha本文件是**总协议 + 路由器**。具体每个阶段的工作流在 `skills/cheat-*/SKILL.md` 各子 skill 里。+## Codex compatibility++Codex 没有 Claude Code 的 slash-command harness。安装到 Codex 后,按自然语言触发同一套路由即可:++- `初始化 cheat-on-content` → 读取并执行 `skills/cheat-init/SKILL.md`+- `打分这篇 scripts/foo.md` → 读取并执行 `skills/cheat-score/SKILL.md`+- `启动预测 scripts/foo.md` → 读取并执行 `skills/cheat-predict/SKILL.md`+- `拍了 ...` / `已发布 ...` / `复盘 ...` / `升级 rubric` / `状态` → 分别读取对应 `skills/cheat-*/SKILL.md`++执行时遵循本文件的三条原则和路由表;不要依赖 `/cheat-*` 命令是否存在。Claude Code 专用 hook(`.claude/settings.json`)仍只在 Claude Code 里自动触发;Codex 中需要用户主动说 `状态` 查看 buffer、待复盘和候选池。+---## 三条不可妥协原则diff --git a/install.sh b/install.shindex 10c0e6e..8d04f52 100755--- a/install.sh+++ b/install.sh@@ -2,8 +2,8 @@## cheat-on-content / install.sh#-# Symlinks the 13 sub-skills into ~/.claude/skills/ so Claude Code can find them-# globally. Re-runnable safely (sf flags overwrite existing links).+# Symlinks the skills into Claude Code and/or Codex skill directories so agents+# can find them globally. Re-runnable safely (overwrite after confirmation).## After install, in any content project directory: open Claude Code → say "初始化"# → /cheat-init runs the onboarding.@@ -11,8 +11,11 @@# To uninstall: bash uninstall.sh## Usage:-# bash install.sh # symlink (default; dev-friendly, changes reflect immediately)-# bash install.sh --copy # copy instead of symlink (frozen version, dev changes ignored)+# bash install.sh # Claude Code install, symlink mode (default)+# bash install.sh --copy # Claude Code install, copy mode+# bash install.sh --codex # Codex install into ~/.codex/skills/+# bash install.sh --all # install for Claude Code and Codex+# bash install.sh --codex --copy # Codex install, copy mode# bash install.sh --reinstall-hooks <project-dir># # rewrite hook scripts in an existing user project's .cheat-hooks/# # (use after git pull when CHANGELOG mentions hook script changes;@@ -20,7 +23,7 @@set -euo pipefail-SKILLS=(+SUB_SKILLS=(cheat-initcheat-learn-fromcheat-seed@@ -36,10 +39,14 @@ SKILLS=(cheat-migrate)+CLAUDE_SKILLS=("${SUB_SKILLS[@]}")+CODEX_SKILLS=(cheat-on-content "${SUB_SKILLS[@]}")+# Resolve the directory containing THIS script (the source root) — needed early for both modesSCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"MODE="symlink"+TARGET_AGENT="claude"# --- --reinstall-hooks branch: rewrite a user project's hook scripts only ---if [[ "${1:-}" == "--reinstall-hooks" ]]; then@@ -91,12 +98,40 @@ if [[ "${1:-}" == "--reinstall-hooks" ]]; thenexit 0fi-if [[ "${1:-}" == "--copy" ]]; then- MODE="copy"-fi+for arg in "$@"; do+ case "$arg" in+ --copy)+ MODE="copy"+ ;;+ --claude)+ TARGET_AGENT="claude"+ ;;+ --codex)+ TARGET_AGENT="codex"+ ;;+ --all)+ TARGET_AGENT="all"+ ;;+ --help|-h)+ sed -n '1,35p' "$0"+ exit 0+ ;;+ *)+ echo "❌ Unknown argument: $arg"+ echo " Usage: bash install.sh [--copy] [--claude|--codex|--all]"+ exit 1+ ;;+ esac+done# Sanity check: confirm we're in the cheat-on-content root-for s in "${SKILLS[@]}"; do+if [[ ! -f "$SCRIPT_DIR/SKILL.md" ]]; then+ echo "❌ Missing: $SCRIPT_DIR/SKILL.md"+ echo " Are you running install.sh from the cheat-on-content root?"+ exit 1+fi++for s in "${SUB_SKILLS[@]}"; doif [[ ! -f "$SCRIPT_DIR/skills/$s/SKILL.md" ]]; thenecho "❌ Missing: $SCRIPT_DIR/skills/$s/SKILL.md"echo " Are you running install.sh from the cheat-on-content root?"@@ -104,32 +139,84 @@ for s in "${SKILLS[@]}"; dofidone-# Ensure ~/.claude/skills exists-mkdir -p "$HOME/.claude/skills"+skill_source() {+ local skill="$1"+ if [[ "$skill" == "cheat-on-content" ]]; then+ echo "$SCRIPT_DIR"+ else+ echo "$SCRIPT_DIR/skills/$skill"+ fi+}-echo ""-echo "Installing cheat-on-content (mode: $MODE)"-echo " source: $SCRIPT_DIR"-echo " target: $HOME/.claude/skills/"-echo ""+detect_conflicts() {+ local target_dir="$1"+ shift+ local warned=0-# Detect any existing installation that conflicts-WARNED=0-for s in "${SKILLS[@]}"; do- TARGET="$HOME/.claude/skills/$s"- if [[ -e "$TARGET" || -L "$TARGET" ]]; then- if [[ -L "$TARGET" ]]; then- EXISTING=$(readlink "$TARGET")- if [[ "$EXISTING" != "$SCRIPT_DIR/skills/$s" ]]; then- echo "⚠️ $TARGET already symlinked to: $EXISTING"- WARNED=1+ for s in "$@"; do+ local src+ src=$(skill_source "$s")+ local target="$target_dir/$s"+ if [[ -e "$target" || -L "$target" ]]; then+ if [[ -L "$target" ]]; then+ local existing+ existing=$(readlink "$target")+ if [[ "$existing" != "$src" ]]; then+ echo "⚠️ $target already symlinked to: $existing"+ warned=1+ fi+ else+ echo "⚠️ $target exists (not a symlink) — will be overwritten"+ warned=1fi+ fi+ done++ return "$warned"+}++install_skills() {+ local label="$1"+ local target_dir="$2"+ shift 2++ mkdir -p "$target_dir"++ echo ""+ echo "Installing cheat-on-content for $label (mode: $MODE)"+ echo " source: $SCRIPT_DIR"+ echo " target: $target_dir/"+ echo ""++ for s in "$@"; do+ local src+ src=$(skill_source "$s")+ local dst="$target_dir/$s"++ if [[ -e "$dst" || -L "$dst" ]]; then+ rm -rf "$dst"+ fi++ if [[ "$MODE" == "symlink" ]]; then+ ln -s "$src" "$dst"+ echo " ✓ symlinked: $s"else- echo "⚠️ $TARGET exists (not a symlink) — will be overwritten"- WARNED=1+ cp -R "$src" "$dst"+ if [[ "$s" == "cheat-on-content" ]]; then+ rm -rf "$dst/.git"+ fi+ echo " ✓ copied: $s"fi- fi-done+ done+}++WARNED=0+if [[ "$TARGET_AGENT" == "claude" || "$TARGET_AGENT" == "all" ]]; then+ detect_conflicts "$HOME/.claude/skills" "${CLAUDE_SKILLS[@]}" || WARNED=1+fi+if [[ "$TARGET_AGENT" == "codex" || "$TARGET_AGENT" == "all" ]]; then+ detect_conflicts "$HOME/.codex/skills" "${CODEX_SKILLS[@]}" || WARNED=1+fiif [[ $WARNED -eq 1 ]]; thenecho ""@@ -141,24 +228,13 @@ if [[ $WARNED -eq 1 ]]; thenfifi-# Install each sub-skill-for s in "${SKILLS[@]}"; do- SRC="$SCRIPT_DIR/skills/$s"- DST="$HOME/.claude/skills/$s"-- # Remove any existing entry first (to allow overwriting non-symlink dirs)- if [[ -e "$DST" || -L "$DST" ]]; then- rm -rf "$DST"- fi+if [[ "$TARGET_AGENT" == "claude" || "$TARGET_AGENT" == "all" ]]; then+ install_skills "Claude Code" "$HOME/.claude/skills" "${CLAUDE_SKILLS[@]}"+fi- if [[ "$MODE" == "symlink" ]]; then- ln -s "$SRC" "$DST"- echo " ✓ symlinked: $s"- else- cp -R "$SRC" "$DST"- echo " ✓ copied: $s"- fi-done+if [[ "$TARGET_AGENT" == "codex" || "$TARGET_AGENT" == "all" ]]; then+ install_skills "Codex" "$HOME/.codex/skills" "${CODEX_SKILLS[@]}"+fiecho ""echo "✅ Install complete!"@@ -167,17 +243,29 @@ echo "Next steps:"echo " 1. cd into your content project (or create one):"echo " mkdir ~/my-channel && cd ~/my-channel"echo ""-echo " 2. Open Claude Code in that directory"+echo " 2. Open Claude Code or Codex in that directory"echo ""echo " 3. In the chat, say:"echo " 初始化"echo " (or: 初始化 cheat-on-content)"echo ""-echo "Verify install: ls -la ~/.claude/skills/ | grep cheat"+if [[ "$TARGET_AGENT" == "claude" || "$TARGET_AGENT" == "all" ]]; then+ echo "Verify Claude install: ls -la ~/.claude/skills/ | grep cheat"+fi+if [[ "$TARGET_AGENT" == "codex" || "$TARGET_AGENT" == "all" ]]; then+ echo "Verify Codex install: ls -la ~/.codex/skills/ | grep cheat"+ echo "Note: restart Codex if the new skills do not appear in the current session."+fiecho ""if [[ "$MODE" == "symlink" ]]; thenecho "ℹ️ Mode: symlink — edits to source SKILL.md files take effect immediately."- echo " To switch to frozen copy: bash install.sh --copy"+ if [[ "$TARGET_AGENT" == "codex" ]]; then+ echo " To switch to frozen copy: bash install.sh --codex --copy"+ elif [[ "$TARGET_AGENT" == "all" ]]; then+ echo " To switch to frozen copy: bash install.sh --all --copy"+ else+ echo " To switch to frozen copy: bash install.sh --copy"+ fielseecho "ℹ️ Mode: copy — frozen at install time. Re-run install.sh to update."fidiff --git a/uninstall.sh b/uninstall.shindex 585134b..c89a36e 100755--- a/uninstall.sh+++ b/uninstall.sh@@ -2,17 +2,22 @@## cheat-on-content / uninstall.sh#-# Removes the 13 sub-skills from ~/.claude/skills/.+# Removes cheat-on-content skills from Claude Code and/or Codex skill dirs.## Does NOT touch any content project's data (.cheat-state.json, predictions/,# rubric_notes.md, candidates.md, etc.) — those live in your content directories# and uninstalling the skill leaves your work intact.#+# Usage:+# bash uninstall.sh # remove Claude Code install (default)+# bash uninstall.sh --codex # remove Codex install+# bash uninstall.sh --all # remove both+## To re-install: bash install.shset -euo pipefail-SKILLS=(+SUB_SKILLS=(cheat-initcheat-learn-fromcheat-seed@@ -28,26 +33,69 @@ SKILLS=(cheat-migrate)-echo ""-echo "Removing cheat-on-content from ~/.claude/skills/"-echo ""+CLAUDE_SKILLS=("${SUB_SKILLS[@]}")+CODEX_SKILLS=(cheat-on-content "${SUB_SKILLS[@]}")-REMOVED=0-for s in "${SKILLS[@]}"; do- TARGET="$HOME/.claude/skills/$s"- if [[ -L "$TARGET" ]]; then- rm "$TARGET"- echo " ✓ removed symlink: $s"- REMOVED=$((REMOVED + 1))- elif [[ -d "$TARGET" ]]; then- rm -rf "$TARGET"- echo " ✓ removed directory: $s"- REMOVED=$((REMOVED + 1))- else- echo " · not found: $s (skipped)"- fi+TARGET_AGENT="claude"+for arg in "$@"; do+ case "$arg" in+ --claude)+ TARGET_AGENT="claude"+ ;;+ --codex)+ TARGET_AGENT="codex"+ ;;+ --all)+ TARGET_AGENT="all"+ ;;+ --help|-h)+ sed -n '1,25p' "$0"+ exit 0+ ;;+ *)+ echo "❌ Unknown argument: $arg"+ echo " Usage: bash uninstall.sh [--claude|--codex|--all]"+ exit 1+ ;;+ esacdone+REMOVED=0++remove_skills() {+ local label="$1"+ local target_dir="$2"+ shift 2++ echo ""+ echo "Removing cheat-on-content from $label:"+ echo " target: $target_dir/"+ echo ""++ for s in "$@"; do+ local target="$target_dir/$s"+ if [[ -L "$target" ]]; then+ rm "$target"+ echo " ✓ removed symlink: $s"+ REMOVED=$((REMOVED + 1))+ elif [[ -d "$target" ]]; then+ rm -rf "$target"+ echo " ✓ removed directory: $s"+ REMOVED=$((REMOVED + 1))+ else+ echo " · not found: $s (skipped)"+ fi+ done+}++if [[ "$TARGET_AGENT" == "claude" || "$TARGET_AGENT" == "all" ]]; then+ remove_skills "Claude Code" "$HOME/.claude/skills" "${CLAUDE_SKILLS[@]}"+fi++if [[ "$TARGET_AGENT" == "codex" || "$TARGET_AGENT" == "all" ]]; then+ remove_skills "Codex" "$HOME/.codex/skills" "${CODEX_SKILLS[@]}"+fi+echo ""if [[ $REMOVED -gt 0 ]]; thenecho "✅ Uninstalled $REMOVED skill(s)."@@ -59,5 +107,5 @@ echo "Note: your content projects' data (predictions/, rubric_notes.md, .cheat-secho " .cheat-hooks/, candidates.md, etc.) are NOT touched. They live in each content"echo " project directory. To clean a specific content project, delete those files manually."echo ""-echo "To re-install: bash install.sh (from cheat-on-content source root)"+echo "To re-install: bash install.sh [--codex|--all] (from cheat-on-content source root)"echo ""