diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..d0de8ec --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +codex/skills/** diff --git a/AGENTS.md b/AGENTS.md index c424ee8..9c4c30e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -89,11 +89,11 @@ Token 消耗:~8,000 tokens ## 性能指标 -| 指标 | 之前 | 现在 | 改善 | -| --------------- | -------- | -------- | ---- | -| .agents 规模 | ~500 行 | 168 行 | -66% | -| 持久化 tokens | ~12,500 | ~4,200 | -66% | -| 场景平均 tokens | ~12,500 | ~10,500 | -16% | +| 指标 | 之前 | 现在 | 改善 | +| --------------- | ------- | ------- | ---- | +| .agents 规模 | ~500 行 | 168 行 | -66% | +| 持久化 tokens | ~12,500 | ~4,200 | -66% | +| 场景平均 tokens | ~12,500 | ~10,500 | -16% | --- diff --git a/docs/plans/2026-01-23-unified-playbook-cli-design.md b/docs/plans/2026-01-23-unified-playbook-cli-design.md index 2b1d8ad..7348519 100644 --- a/docs/plans/2026-01-23-unified-playbook-cli-design.md +++ b/docs/plans/2026-01-23-unified-playbook-cli-design.md @@ -1,20 +1,24 @@ # Unified Playbook CLI Design ## 目标 + - 提供单一入口 `scripts/playbook.py`,以 TOML 配置驱动所有动作。 - 取消旧的 sh/ps1/bat 脚本与参数兼容,减少心智负担。 - 保持功能覆盖:vendoring、同步模板、同步标准、安装 skills、格式化 Markdown。 ## 非目标 + - 不保留旧脚本的参数兼容层。 - 不引入新的依赖(Markdown 格式化仅使用已有 Prettier)。 ## CLI 设计 + - 入口:`python scripts/playbook.py -config `。 - 仅支持两个参数:`-config`(必填)与 `-h/-help`。 - `project_root` 默认取配置文件所在目录。 ## TOML 结构 + - 通过 section 是否存在决定是否执行: - `[vendor]` - `[sync_templates]` @@ -25,6 +29,7 @@ `vendor → sync_templates → sync_standards → install_skills → format_md`。 ## 行为要点 + - `vendor` 仅生成快照,不再隐式触发 `sync_standards`。 - `sync_standards` 负责 `.agents/`、`AGENTS.md` 区块与 `.gitattributes`。 - `sync_templates` 负责 memory-bank、docs/prompts、AGENTS/AGENT_RULES 模板。 @@ -32,16 +37,19 @@ - `format_md` 仅调用已有 Prettier(可通过 globs 指定范围)。 ## 预期输出 + - 新增:`scripts/playbook.py`、`playbook.toml.example`。 - 删除:旧的 sh/ps1/bat 脚本与对应测试。 - 更新:README/模板说明/CI/test.yml。 ## 测试策略 + - 用 Python `unittest` 覆盖核心路径: - TOML 解析与动作触发顺序。 - vendor/sync 模拟执行与关键输出文件检查。 - 保留现有模板验证与文档链接检查。 ## 风险 + - 旧脚本移除会影响现有用户;通过 README 与示例配置降低迁移成本。 - Windows 环境权限可能影响 `npm install` 与符号链接;测试不依赖 npm。 diff --git a/docs/plans/2026-01-23-unified-playbook-cli.md b/docs/plans/2026-01-23-unified-playbook-cli.md index d67fbce..d1795ad 100644 --- a/docs/plans/2026-01-23-unified-playbook-cli.md +++ b/docs/plans/2026-01-23-unified-playbook-cli.md @@ -13,6 +13,7 @@ ### Task 1: Create CLI test harness and basic argument handling **Files:** + - Create: `tests/cli/test_playbook_cli.py` - Modify: `tests/README.md` @@ -88,6 +89,7 @@ git commit -m ":white_check_mark: test(cli): add basic playbook cli tests" ### Task 2: Parse TOML config and enforce dispatch order **Files:** + - Modify: `scripts/playbook.py` - Create: `playbook.toml.example` - Modify: `README.md` @@ -156,6 +158,7 @@ git commit -m ":sparkles: feat(cli): add toml config and dispatch order" ### Task 3: Implement `vendor` action (snapshot only) **Files:** + - Modify: `scripts/playbook.py` - Modify: `playbook.toml.example` - Modify: `README.md` @@ -209,6 +212,7 @@ git commit -m ":sparkles: feat(vendor): add playbook snapshot generation" ### Task 4: Implement `sync_templates` and `sync_standards` **Files:** + - Modify: `scripts/playbook.py` - Modify: `playbook.toml.example` - Modify: `templates/README.md` @@ -283,6 +287,7 @@ git commit -m ":sparkles: feat(sync): add templates and standards actions" ### Task 5: Implement `install_skills` and `format_md` **Files:** + - Modify: `scripts/playbook.py` - Modify: `playbook.toml.example` - Modify: `README.md` @@ -336,6 +341,7 @@ git commit -m ":sparkles: feat(actions): add install_skills and format_md" ### Task 6: Remove legacy scripts and update CI/test docs **Files:** + - Delete: `scripts/*.sh`, `scripts/*.ps1`, `scripts/*.bat` - Delete: `tests/scripts/*.bats` - Modify: `.gitea/workflows/test.yml` @@ -386,6 +392,7 @@ git commit -m ":wastebasket: remove(legacy): drop old scripts and tests" ### Task 7: Final cleanup and formatting **Files:** + - Modify: `README.md`, `templates/README.md`, `tests/README.md` **Step 1: Run Markdown format (exclude third-party skills)** diff --git a/templates/README.md b/templates/README.md index 7774315..eb6488d 100644 --- a/templates/README.md +++ b/templates/README.md @@ -104,13 +104,13 @@ project/ 项目上下文文档,用于让 AI 快速理解项目: -| 文件 | 用途 | -| --------------------------------- | -------------------- | -| `project-brief.template.md` | 项目定位、边界、约束 | -| `tech-stack.template.md` | 技术栈、工具链、环境 | -| `architecture.template.md` | 架构设计、模块职责 | -| `progress.template.md` | 开发进度追踪 | -| `decisions.template.md` | 架构决策记录(ADR) | +| 文件 | 用途 | +| --------------------------- | -------------------- | +| `project-brief.template.md` | 项目定位、边界、约束 | +| `tech-stack.template.md` | 技术栈、工具链、环境 | +| `architecture.template.md` | 架构设计、模块职责 | +| `progress.template.md` | 开发进度追踪 | +| `decisions.template.md` | 架构决策记录(ADR) | ### prompts/ @@ -162,11 +162,11 @@ project/ **playbook 标记**(用于自动更新): -| 标记 | 用途 | 管理入口 | -| --------------------------------------- | ---------------------- | -------------------------------- | -| `` | 语言规则链接 | playbook.py `[sync_standards]` | -| `` | 路由链接(默认追加) | playbook.py `[sync_templates]` | -| `` | 完整框架(full 追加) | playbook.py `[sync_templates]` | +| 标记 | 用途 | 管理入口 | +| --------------------------------------- | --------------------- | ------------------------------ | +| `` | 语言规则链接 | playbook.py `[sync_standards]` | +| `` | 路由链接(默认追加) | playbook.py `[sync_templates]` | +| `` | 完整框架(full 追加) | playbook.py `[sync_templates]` | ### ci/、cpp/、python/