🎨 style(markdown): format markdown files

This commit is contained in:
csh
2026-01-21 10:20:53 +08:00
parent 8dc8924cbe
commit fc230b7ff9
11 changed files with 76 additions and 12 deletions
@@ -24,19 +24,23 @@ description:
## Proceduredefault
1. **Baseline**
- 确保工作区干净:`git status --porcelain`
- 跑一个基线验证(至少 build 或核心测试子集),避免“本来就坏”
2. **Enumerate**
- 先搜索再改:用 `rg`/`git grep` 列出全部命中
- 分类命中:真实调用 vs 注释/文档/样例;避免误改
3. **Apply Mechanical Change**
- 优先使用确定性的机械变换(脚本/结构化编辑)而非手工逐个改
- 每轮改动后立即做小验证(编译/单测子集)
- 复杂迁移优先“两阶段”:先兼容旧接口(deprecated),再清理旧接口
4. **Format & Lint(按项目约定)**
- 仅在确认“会破坏 diff 可读性”前提下分批格式化(避免把重构和格式揉在一起)
5. **Verify & Report**
@@ -23,22 +23,27 @@ description:
## Procedure
1. **Triage**
- Identify touched areas, public APIs, behavior changes, data/auth paths
- Classify risk (blast radius, rollback difficulty)
2. **Correctness**
- Invariants, edge cases, error handling, null/empty, concurrency
- Backward compatibility (inputs/outputs, wire formats, config)
3. **Security**
- AuthZ/AuthN boundaries, least privilege
- Input validation, injection surfaces, secrets/log redaction
4. **Maintainability**
- Naming/structure/style aligned with Playbook docs
- Complexity hotspots, duplication, clarity of intent
5. **Performance**
- Hot paths, algorithmic complexity, allocations/IO, N+1 patterns
6. **Tests & Verification**
+5
View File
@@ -25,22 +25,27 @@ diff)生成 13 条提交信息建议:`:emoji: type(scope): subject`(可
## Proceduredefault
1. **收集 staged 概览(尽量小上下文)**
- `git diff --cached --name-status`
- `git diff --cached --stat`
- 必要时只看关键文件:`git diff --cached -- <path>`
2. **读取并遵循权威规范**
- 优先读取就近的
`commit_message.md`(见上方路径),以其中的 type/emoji/格式为准。
3. **生成 1 条主建议 + 2 条备选**
- 格式固定:`:emoji: type(scope): subject`scope 可省略)。
- subject 用一句话描述“做了什么”,避免含糊词;尽量 ≤ 72 字符,不加句号。
4. **判断是否建议拆分提交**
- 当 staged 同时包含多个不相关模块/目的时:建议拆分,并给出拆分方式(按目录/功能点/风险)。
5. **可选:补充 body/footer(如需要)**
- body:说明 why/impact/verify(按规范建议换行)。
- footer:任务号或 `BREAKING CHANGE:`(若有)。
+3
View File
@@ -20,6 +20,7 @@ Throughout the entire workflow, operate in read-only mode. Do not write or
update files.
1. **Scan context quickly**
- Read `README.md` and any obvious docs (`docs/`, `CONTRIBUTING.md`,
`ARCHITECTURE.md`).
- Skim relevant files (the ones most likely touched).
@@ -27,12 +28,14 @@ update files.
shape).
2. **Ask follow-ups only if blocking**
- Ask **at most 12 questions**.
- Only ask if you cannot responsibly plan without the answer; prefer
multiple-choice.
- If unsure but not blocked, make a reasonable assumption and proceed.
3. **Create a plan using the template below**
- Start with **1 short paragraph** describing the intent and approach.
- Clearly call out what is **in scope** and what is **not in scope** in
short.
+4
View File
@@ -23,6 +23,7 @@ description:
## Proceduredefault
1. **Baseline**
- 记录当前状态:`git status --porcelain`
- 明确范围(默认只处理变更文件):
- staged`git diff --name-only --cached`
@@ -30,6 +31,7 @@ description:
- untracked`git ls-files -o --exclude-standard`
2. **Detect Toolchainprefer repo truth**
- 优先用仓库既有入口脚本 / 配置:
- JS/TS`package.json`
scripts`format`/`lint`/`lint:fix`)、prettier/biome/eslint 配置
@@ -41,6 +43,7 @@ description:
- 禁止默认“引入新 formatter/linter 配置”;缺配置时只做最小手工调整,并先确认是否允许落地配置文件。
3. **Applyformat first, then lint**
- 先 formatter(会改文件),再 lint(检查),再 lint
--fix(如有),最后再跑一次 check 确认干净。
- 默认只处理目标文件集合;避免全仓库 reformat(除非用户明确要求)。
@@ -52,6 +55,7 @@ description:
`npx prettier -w <files...>`(以项目脚本为准)
4. **Guardrails**
- 只做风格与格式:不改变行为、不改 public API、不做重构。
- 如格式化导致 diff 暴涨(文件数/行数过大):先停下,给出原因与两种方案让用户选:
1. 仅格式化本次改动文件(推荐默认)
@@ -1,8 +1,7 @@
# TSL 函数库分类索引
> **说明**:本文档是 `$tsl-guide` 的子文档,仅提供分类索引与检索策略。
> **权威入口**`docs/tsl/syntax_book/function/tsl/index.md`
> **注意**:函数库已拆分为 `docs/tsl/syntax_book/function/` 多文件,禁止整目录加载。
> **权威入口**`docs/tsl/syntax_book/function/tsl/index.md` > **注意**:函数库已拆分为 `docs/tsl/syntax_book/function/` 多文件,禁止整目录加载。
## 使用方法