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
+47
View File
@@ -0,0 +1,47 @@
# C++ 代理规则集
本规则集定义 AI/自动化代理在处理 C++ 代码时必须遵守的核心约束。
## 范围与优先级
- 作为仓库级基线规则集使用;更靠近代码目录的规则更具体并可覆盖基线。
- 当代理规则与 docs 冲突:安全/合规优先,其次保持仓库一致性。
## 代理工作原则(铁律)
1. 先理解目标与上下文,再动手改代码
2. 修改要小而清晰;避免无关重构
3. 发现安全问题(内存安全/鉴权漏洞)立即标注或修复
4. 不引入新依赖或工具,除非明确要求
## C++ 核心约定(不可违反)
- 语言标准:C++23;优先使用 Modules;避免裸指针、`new/delete`、C 风格字符串
- 代码风格:Google C++ Style Guide;使用项目 `.clang-format`;头文件保护用 `#pragma once`
- 命名规范:文件 `lower_with_under.cpp/.h/.cppm`;类型 `CapWords`;函数/变量 `lower_with_under`;常量 `kCapWords`;成员 `lower_with_under_`;命名空间 `lower_with_under`
- Modules 工程:模块名点分层 `lower_snake_case`;接口文件 `.cppm`;修改 `export module` 必须更新 CMake module file-set
- 构建与依赖:Conan 需提供 `conan-release`/`conan-debug``conan install` + `cmake --preset ...`Windows 通过 Linux + Clang 交叉编译验证
## 安全红线(不可触碰)
- 不得在代码/日志/注释中写入明文密钥、密码、Token、API Key
- 避免内存不安全操作:悬垂指针、双重释放、越界访问
- 禁用不安全函数(`strcpy`, `sprintf`, `gets` 等)
- 修改鉴权/权限逻辑必须说明动机与风险
## 权威来源
- 代码风格:`docs/cpp/code_style.md`
- 命名规范:`docs/cpp/naming.md`
- 工具链:`docs/cpp/toolchain.md`
- 依赖管理:`docs/cpp/dependencies_conan.md`
- clangd 配置:`docs/cpp/clangd.md`
## Skills(按需加载)
- `$commit-message`
## 与开发规范的关系
- 本仓库内:`docs/cpp/``docs/common/`
- 目标项目 subtree`docs/standards/playbook/docs/cpp/``docs/standards/playbook/docs/common/`
+29
View File
@@ -0,0 +1,29 @@
# rulesets/(规则集模板库)
> **重要**:本目录位于 **playbook 仓库**,作为**规则集模板源**。
>
> - **模板源**`playbook/rulesets/` → 通过 `scripts/playbook.py` 的 `[sync_standards]` 同步 → 目标项目的 `.agents/`
> - **AI 读取**:目标项目根目录的 `.agents/`,而非此处
> - **使用流程**
>
> ```
> playbook/rulesets/tsl/ → [sync] → your-project/.agents/tsl/ ← AI 代理读取
> (模板源) (实际使用)
> ```
本目录用于存放 **AI/自动化代理规则集模板**,用于分发到其他项目。
本仓库将规则按语言拆分为多个规则集模板:
- `rulesets/tsl/`TSL 相关规则集(适用于 `.tsl`/`.tsf`
- `rulesets/cpp/`:C++ 相关规则集(C++23,含 Modules
- `rulesets/python/`Python 相关规则集
- `rulesets/markdown/`:Markdown 相关规则集(仅代码格式化)
目标项目落地时,通过 `scripts/playbook.py``[sync_standards]`
将规则集从 `rulesets/<lang>/` 同步到目标项目根目录的 `.agents/<lang>/`
## 三层架构(分层知识库)
`rulesets/` 是三层架构中的 **Layer 1**(语言级硬规则,≤50 行/语言)。
完整分层说明见 `README.md` 的“rulesets/(规则集模板库 - 三层架构)”。
+31
View File
@@ -0,0 +1,31 @@
# Markdown 代理规则集
本规则集定义 AI/自动化代理在处理 Markdown`.md`)文件时必须遵守的核心约束。
## 代理工作原则(铁律)
1. 只调整代码块与行内代码;不改写正文内容
2. 不改变标题层级、列表结构、段落顺序
3. 不引入新工具/格式化链路,除非明确要求
## Markdown 代码格式约定(不可违反)
### 代码块
- 统一使用围栏代码块(```lang)
- 语言标识尽量准确:`tsl`/`cpp`/`python`/`bash`/`json`
- 仅做必要的排版修复;不改变代码语义
### 工具
- 优先使用 Prettier(仓库已固定配置/脚本)
- 不引入新的 Markdown 格式化依赖
### 行内代码
- 用反引号包裹命令、路径、关键字或短代码
## 适用范围
- 仅适用于 `.md` 文件
- 涉及代码内容时,遵循对应语言的 `.agents` 规则
+45
View File
@@ -0,0 +1,45 @@
# Python 代理规则集
本规则集定义 AI/自动化代理在处理 Python 代码时必须遵守的核心约束。
## 范围与优先级
- 作为仓库级基线规则集使用;更靠近代码目录的规则更具体并可覆盖基线。
- 当代理规则与 docs 冲突:安全/合规优先,其次保持仓库一致性。
## 代理工作原则(铁律)
1. 先理解目标与上下文,再动手改代码
2. 修改要小而清晰;避免无关重构
3. 发现安全问题(明文密钥/鉴权漏洞)立即标注或修复
4. 不引入新依赖或工具,除非明确要求
## Python 核心约定(不可违反)
- 代码风格:Google Python Style Guide;优先使用仓库既有配置(`pyproject.toml`, `.flake8`, `.pylintrc`
- 工具链:未经沟通不切换 formatter/linter
- Import:标准库 → 第三方 → 本地模块;分组间空行;避免 `import *`
- 命名:模块/包 `lower_with_under.py`;类 `CapWords`;函数/变量 `lower_with_under`;常量 `UPPER_WITH_UNDER`;私有 `_private`
- DocstringGoogle 风格;公共模块/类/函数/方法必须写
## 安全红线(不可触碰)
- 不得在代码/日志/注释中写入明文密钥、密码、Token、API Key
- 不得使用 `eval()` / `exec()` 处理不可信输入
- 修改鉴权/权限逻辑必须说明动机与风险
- 不确定是否敏感时按敏感信息处理
## 权威来源
- 代码风格:`docs/python/style_guide.md`
- 工具链:`docs/python/tooling.md`
- 配置清单:`docs/python/configuration.md`
## Skills(按需加载)
- `$commit-message`
## 与开发规范的关系
- 本仓库内:`docs/python/``docs/common/`
- 目标项目 subtree`docs/standards/playbook/docs/python/``docs/standards/playbook/docs/common/`
+44
View File
@@ -0,0 +1,44 @@
# TSL 代理规则集
本规则集定义 AI/自动化代理在处理 TSL 代码时必须遵守的核心约束。
## 范围与优先级
- 作为仓库级基线规则集使用;更靠近代码目录的规则更具体并可覆盖基线。
- 当代理规则与 docs 冲突:安全/合规优先,其次保持仓库一致性。
## 代理工作原则(铁律)
1. 先理解目标与上下文,再动手改代码
2. 修改要小而清晰;避免无关重构
3. 发现安全问题(明文密钥/鉴权漏洞)立即标注或修复
4. 不引入新依赖或工具,除非明确要求
## TSL 核心约定(不可违反)
- 文件结构:一文件一顶层声明;文件名 = 声明名;`.tsl``function``.tsf``function/class/unit`
- 格式:4 空格缩进;关键字小写;多语句用 `begin/end`
- 命名:类型/函数/property `PascalCase`;变量/参数 `snake_case`;私有 `snake_case_`;常量 `kPascalCase`
## 安全红线(不可触碰)
- 不得在代码/日志/注释中写入明文密钥、密码、Token、API Key
- 修改鉴权/权限逻辑必须说明动机与风险
- 不确定是否敏感时按敏感信息处理
## 权威来源
- 语法手册:`docs/tsl/syntax_book/index.md`
- 函数库:`docs/tsl/syntax_book/function/`(按需检索,禁止整份加载)
- 代码风格:`docs/tsl/code_style.md`
- 命名规范:`docs/tsl/naming.md`
## Skills(按需加载)
- `$tsl-guide`
- `$commit-message`
## 与开发规范的关系
- 本仓库内:`docs/tsl/``docs/common/`
- 目标项目 subtree`docs/standards/playbook/docs/tsl/``docs/standards/playbook/docs/common/`