ByteNoteByteNote

字节笔记本

2026年6月16日

FableCodex — 为 Codex 引入 Fable 风格工作流的开源插件

API中转
¥120

本文介绍 FableCodex,一个为 Codex 平台设计的开源插件,它将 Fable 风格的工作流程引入 Codex 开发环境,帮助开发者养成「先检查、再行动、留证据、关发现、验完成」的严谨习惯。

项目简介

FableCodex 是一个开源的 Codex 插件项目,由 baskduf 开发维护。截至目前,该项目在 GitHub 上已获得 156 stars,主要使用 Python 编写。最新版本为 v0.4.1(2026 年 6 月 15 日发布),采用 AGPL-3.0 开源协议。

FableCodex 的核心定位是流程改进工具。它不替代任何模型能力,只提供 Codex 原生的工作流指导、本地账本、示例代码、覆盖度统计和可选的路由文档,帮开发者在复杂任务中减少遗漏。

核心特性

  • 目标账本(Goal Ledger):为多步骤工作创建结构化目标计划,每个目标完成后需附上证据,最终目标还需验证命令和输出
  • 发现门禁(Findings Gate):记录审查中发现的问题,要求修复后提供验证证据,门禁未通过前阻止最终完成
  • 七步工作流:任务分类 → 环境检查 → 工具优先 → 目标追踪 → 发现追踪 → 验证 → 报告
  • 覆盖度统计:对照源文档检查每个章节的 Codex 原生决策覆盖情况
  • 灵活控制:通过提示词控制严格程度,支持严格模式、分析模式、调试模式等

技术栈

  • Python - 核心脚本语言(占 97.7%)
  • Shell - 辅助脚本(占 2.3%)
  • Codex 插件系统 - 运行平台

安装指南

前置要求

  • Codex 开发环境
  • 有效的 Anthropic 访问权限(可选 Provider Bridge 功能)

安装步骤

bash
# 安装稳定版
codex plugin marketplace add baskduf/FableCodex --ref v0.4.1
codex plugin add codex-fable5@fablecodex

# 安装开发版
codex plugin marketplace add baskduf/FableCodex --ref main
codex plugin add codex-fable5@fablecodex

# 本地开发
codex plugin marketplace add ~/Desktop/FableCodex
codex plugin add codex-fable5@fablecodex

安装完成后重启 Codex,即可在提示词中使用 @codex-fable5 调用该技能。

快速开始

安装后,在 Codex 中发起如下提示词即可使用:

text
@codex-fable5 Use this skill to implement the change.
Create a goal ledger if the work has multiple steps.
Track findings before final completion.
Run the project tests before saying it is done.

轻量模式则跳过目标账本,只做关键证据检查:

text
@codex-fable5 Review this quickly.
Do not create a goal ledger. Check the key evidence and report only actionable findings.

使用示例

场景 1:创建目标账本

bash
codex-fable5 goals create --brief "Migration" \
  --goal "inspect::Find current behavior and tests" \
  --goal "change::Implement the migration" \
  --goal "verify::Run tests and inspect output"

codex-fable5 goals next

场景 2:记录完成证据

bash
codex-fable5 goals checkpoint \
  --id G001 \
  --status complete \
  --evidence "Read importer.ts and import.test.ts; current parser rejects quoted commas."

场景 3:记录并解决审查发现

bash
# 添加发现
codex-fable5 findings add \
  --title "Missing final verification" \
  --severity high \
  --source review \
  --location "plugins/codex-fable5/skills/codex-fable5/scripts/codex_goals.py:180" \
  --evidence "Final checkpoint can complete without proof that tests ran."

# 解决发现
codex-fable5 findings resolve \
  --id F001 \
  --evidence "Final checkpoints now require verification evidence." \
  --verify-cmd "python3 -m unittest discover -s tests -v" \
  --verify-evidence "Regression test passed."

# 运行门禁检查
codex-fable5 findings gate

命令参考

命令用途
codex-fable5 status显示发现和目标的进度
codex-fable5 goals create创建多步骤目标账本
codex-fable5 goals next开始或继续下一个目标
codex-fable5 goals checkpoint标记目标完成/失败/阻塞并附证据
codex-fable5 findings add记录有证据支持的审查发现
codex-fable5 findings next显示最高优先级的未解决发现
codex-fable5 findings resolve关闭发现并附上解决和验证证据
codex-fable5 findings gate若有未解决或阻塞的发现则失败

适用场景

推荐使用:多步骤实现或重构、根因不明显的调试、CI 失败排查、发布工作、迁移、安全敏感变更、将 Claude/Fable 风格提示转换为 Codex 原生指导。

跳过使用:简短回答、单文件小修改、无需验证的头脑风暴、账本流程比工作本身还重的简单任务。

项目链接

分享: