Squashed 'docs/standards/playbook/' changes from b529012..a854534

a854534  feat(plan_progress): auto-detect env for blocked plans
0d9a8ec 🐛 fix(playbook): honor no_backup for sync
2d401fa  test(templates): update prompts validation
e23474e 📝 docs(playbook): update prompts and sync notes
60ff3cd 🐛 fix(playbook): sync templates per file
816f036  test(playbook): add sync and vendor coverage
625cabb 📝 docs(memory_bank): reformat templates
2554c87 📝 docs(prompts): refresh prompt templates
6774a9d  feat(plan_progress): track plan status in progress.md
73d5c26 🔧 chore(playbook): split sync_templates into sections
278750e  feat(playbook): add plan progress tracking and rules updates
6efd637 🐛 fix(sync): keep agents block blank lines
ea00d43 🐛 fix(playbook): support toml without tomllib
ab0dd11 📝 docs(playbook): drop docs/plans snapshots
398696c  feat(playbook): merge unified cli
d959f80 🎨 style(docs): format markdown
b4f712a 🗑️ remove(legacy): drop old scripts and tests
0c4cd0e  feat(actions): add install_skills and format_md
3d1582c  feat(sync): add templates and standards actions
49bbfa1  feat(vendor): add playbook snapshot generation
8cfcc25  feat(cli): parse toml config and dispatch actions
05903c3  feat(cli): add toml config and dispatch order
65d216e  test(cli): add basic playbook cli tests
f0bcf54 📝 docs(plans): add unified playbook cli plan
0885309 📝 docs(plans): add unified playbook cli design
3483d8a 🔧 chore(git): ignore .worktrees dir
eb75036 🔧 chore(templates): align agent templates and docs
efb93f1 📝 docs(playbook): drop todo/confirm mentions
4a85306 🗑️ remove(workflow): drop todo/confirm artifacts
9c5ee9f 🎨 style(markdown): format docs with prettier
5a2925f 🐛 fix(scripts): repair windows script parsing
26a35e0  test(ci): update required skills list
8df3883 🐛 fix(test): skip external root doc links
b067fc1 📦 deps(skills): sync superpowers
c03cda0 🔧 chore(ci): sync from origin main
55e05cb 🔧 chore(ci): use superpowers sync script
73c97f3 🔧 chore(ci): centralize superpowers sync
945704f 🔧 chore(ci): add superpowers sync workflow
e5d2c93 🗑️ remove(skills): drop duplicate workflows
3ae9708 🐛 fix(ci): update tests for flag-only scripts
c44b9aa 🔧 chore(scripts): require flag-driven args
e4e1d14 🔧 chore(scripts): unify single-dash options
b2eb475  test(templates): add template coverage
fc230b7 🎨 style(markdown): format markdown files
8dc8924 🔧 chore(markdown): add prettier config and usage
2045dd4  feat(vendor_playbook): add apply-templates option
872d8cf  feat(templates): add sync templates scaffolding
5b1ca45 📝 docs(skills): clarify todo-plan template
054967a  feat(skills): add todo-plan skill
cc340f1 🔧 chore(ci): align standards-check workflow template
e9de0aa 🔧 chore(ci): drop removed skill check
e5dd7d9 🔧 fix(sync): avoid backtick expansion
087b0b9 🔧 chore(sync): align agents block across ps1/bat
9481510 🔧 chore(sync): scope agents block to existing langs
b0ca842 🔧 fix(sync): rewrite docs path in agents
c98d65c 🔧 chore(sync): rewrite agents docs paths
c33611c 🗑️ remove(skills): drop unused skills and update references
2b37860 🎨 style(markdown): format markdown files
e3ecd26 📝 docs(tsl): align syntax annotations and examples
37546fe 🐛 fix(playbook): enforce rulesets to agents flow
f2df89d 🐛 fix(scripts): include language list in AGENTS.md
c0d0737 🐛 fix(playbook): add agents mirror for sync
3b8b99b 🎨 style(markdown): normalize md headings and lists
31f3000 ♻️ refactor(playbook): rename agents template directory to rulesets
11b2bed  feat(markdown): add ruleset and sync support
5b89580  test(scripts): quiet git init warnings
5822a87 ♻️ refactor(playbook): streamline agents and refresh tsl docs

git-subtree-dir: docs/standards/playbook
git-subtree-split: a85453439f65b0c0aa05a5bbece773a02216ce76
This commit is contained in:
csh
2026-02-02 10:51:38 +08:00
parent ac794a6a70
commit b52102b7bd
192 changed files with 109197 additions and 135276 deletions
+75 -29
View File
@@ -1,8 +1,7 @@
# SKILLS
本文件定义:如何在仓库中落地与维护 **Codex CLI
skills**(实验功能),并给出与本 Playbook`docs/` +
`.agents/`)配套的技能编写建议与内置技能清单。
本文件定义:如何在仓库中落地与维护 **Codex CLI skills**(实验功能),
并给出与本 Playbook`docs/` + `rulesets/`)配套的技能编写建议与内置技能清单。
> 提示:Codex skills 是“按用户安装”的(默认在
> `~/.codex/skills`)。本仓库将 skills 以可分发的形式放在
@@ -46,28 +45,45 @@ $CODEX_HOME/skills/<skill-name>/SKILL.md
## 3. 安装到本机(推荐)
本仓库已提供跨平台安装脚本(会把 `codex/skills/*` 复制到
`$CODEX_HOME/skills/`):
使用统一入口 `playbook.py` 安装 skills(会把 `codex/skills/*` 复制到 `$CODEX_HOME/skills/`):
- macOS/Linux`sh scripts/install_codex_skills.sh`
- PowerShell`powershell -File scripts/install_codex_skills.ps1`
- Windows bat`scripts/install_codex_skills.bat`
```toml
# playbook.toml
[playbook]
project_root = "."
用法示例:
[install_skills]
mode = "all" # list|all
codex_home = "~/.codex"
```
```bash
# 安装全部 skills
sh scripts/install_codex_skills.sh
# 只安装指定 skills
sh scripts/install_codex_skills.sh style-cleanup code-review-workflow
python scripts/playbook.py -config playbook.toml
```
仅安装指定 skills
```toml
[install_skills]
mode = "list"
skills = ["style-cleanup", "commit-message"]
```
如果希望“项目内本地安装”(不污染全局):
```toml
[install_skills]
mode = "all"
codex_home = "./.codex"
```
> 注意:Codex 只会从 `CODEX_HOME` 加载 skills;使用本地安装时,启动 Codex 需设置同样的 `CODEX_HOME`。
如果你的项目通过 `git subtree` vendoring 本 Playbook(推荐前缀
`docs/standards/playbook`),则在目标项目里执行:
```bash
sh docs/standards/playbook/scripts/install_codex_skills.sh
python docs/standards/playbook/scripts/playbook.py -config playbook.toml
```
安装后重启 `codex`,即可在运行时看到 `## Skills` 列表。
@@ -119,27 +135,53 @@ sh docs/standards/playbook/scripts/install_codex_skills.sh
---
## 8. 本 Playbook 内置 skills
## 8. 本 Playbook 原生 skills
位于 `codex/skills/`
位于 `codex/skills/`(Playbook 自维护部分),当前共 4 个。
第三方 superpowers 列表见第 9 节。
- `commit-message`:基于 staged
diff 自动建议提交信息(`:emoji: type(scope): subject`
- `create-plan`:生成简明计划(适用于用户明确要求规划编码任务)
- `code-review-workflow`:结构化代码评审(正确性/安全/性能/测试)
### 语言特定 Skills
- **`tsl-guide`**:TSL/TSF 语法与编码完整指南
- 渐进式教学体系:基础语法 → 高级特性 → 函数库 → 最佳实践
- 包含 4 个子文档:primer.md / advanced.md / functions_index.md / common_patterns.md
- 总计约 1000 行,按需加载
- 触发词:TSL 语法, 写 TSL, TSL 函数, TSL class, 矩阵操作, TS-SQL 等
### 通用工作流 Skills
- `commit-message`:基于 staged diff 自动建议提交信息(`:emoji: type(scope): subject`
- `style-cleanup`:整理代码风格(优先使用仓库既有 formatter/lint 工具链)
- `systematic-debugging`:系统化调试(先复现 → 再定位 → 再修复 → 再验证)
- `root-cause-tracing`:根因溯源 / RCA 模板
- `defense-in-depth`:关键路径分层校验/多道防线
- `bulk-refactor-workflow`:批量重构(安全做法 + 验证契约)
- `document-workflow`PDF/DOCX/PPTX/XLSX 文档工作流(带开源 fallback)
- `pdf-workflow` / `docx-workflow` / `pptx-workflow` /
`xlsx-workflow`:按格式拆分的文档子工作流
- `verification-before-completion`:先验证再宣称完成(证据链优先)
---
## 9. 运行时排障
## 9. Third-party Skills (superpowers)
来源:`codex/skills/.sources/superpowers.list`(第三方来源清单)。
本节仅列出 superpowers 体系 skills,与本 Playbook 原生 skills 分离。
<!-- superpowers:skills:start -->
- brainstorming
- dispatching-parallel-agents
- executing-plans
- finishing-a-development-branch
- receiving-code-review
- requesting-code-review
- subagent-driven-development
- systematic-debugging
- test-driven-development
- using-git-worktrees
- using-superpowers
- verification-before-completion
- writing-plans
- writing-skills
<!-- superpowers:skills:end -->
---
## 10. 运行时排障
- 不触发:
- 确认已启用 `[features] skills = true`
@@ -148,3 +190,7 @@ sh docs/standards/playbook/scripts/install_codex_skills.sh
- 触发错:减少不同 skill 的 `description`
关键词重叠;让触发词更具体(语言/工具/目录名/流程名)。
- 启动报错:通常是 YAML frontmatter 不合法或字段超长;修复后重启即可。
---
**最后更新**2026-01-26