From 73f01c3ca4d72b712b837be0eba34a3784d5bf30 Mon Sep 17 00:00:00 2001 From: csh Date: Mon, 2 Feb 2026 17:20:55 +0800 Subject: [PATCH] :package: deps(playbook): add markdown rules and prettier config --- .agents/markdown/index.md | 31 +++++++++++++++++++++++++++++++ .prettierrc.json | 4 ++++ AGENTS.md | 2 +- playbook.toml | 4 +++- 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .agents/markdown/index.md create mode 100644 .prettierrc.json diff --git a/.agents/markdown/index.md b/.agents/markdown/index.md new file mode 100644 index 0000000..9603d60 --- /dev/null +++ b/.agents/markdown/index.md @@ -0,0 +1,31 @@ +# Markdown 代理规则集 + +本规则集定义 AI/自动化代理在处理 Markdown(`.md`)文件时必须遵守的核心约束。 + +## 代理工作原则(铁律) + +1. 只调整代码块与行内代码;不改写正文内容 +2. 不改变标题层级、列表结构、段落顺序 +3. 不引入新工具/格式化链路,除非明确要求 + +## Markdown 代码格式约定(不可违反) + +### 代码块 + +- 统一使用围栏代码块(```lang) +- 语言标识尽量准确:`tsl`/`cpp`/`python`/`bash`/`json` 等 +- 仅做必要的排版修复;不改变代码语义 + +### 工具 + +- 优先使用 Prettier(仓库已固定配置/脚本) +- 不引入新的 Markdown 格式化依赖 + +### 行内代码 + +- 用反引号包裹命令、路径、关键字或短代码 + +## 适用范围 + +- 仅适用于 `.md` 文件 +- 涉及代码内容时,遵循对应语言的 `.agents` 规则 diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..bd07196 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "proseWrap": "preserve", + "embeddedLanguageFormatting": "off" +} diff --git a/AGENTS.md b/AGENTS.md index 880a56d..2bf42f3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -44,5 +44,5 @@ Human-facing standards snapshot (vendored): 请以 `.agents/` 下的规则为准: - 入口:`.agents/index.md` -- 语言规则:`.agents/cpp/index.md`、`.agents/tsl/index.md` +- 语言规则:`.agents/cpp/index.md`、`.agents/tsl/index.md`、`.agents/markdown/index.md` diff --git a/playbook.toml b/playbook.toml index 8e91d7a..b560e69 100644 --- a/playbook.toml +++ b/playbook.toml @@ -3,6 +3,7 @@ project_root = "." [sync_rules] force = true +no_backup = true [sync_memory_bank] project_name = "tsl-devkit" @@ -10,8 +11,9 @@ force = false [sync_prompts] force = true +no_backup = true [sync_standards] -langs = ["cpp", "tsl"] +langs = ["cpp", "tsl", "markdown"] gitattr_mode = "append" no_backup = true