✨ feat(sync_standards): auto-detect existing languages
This commit is contained in:
@@ -230,15 +230,17 @@ sh docs/standards/playbook/scripts/sync_standards.sh tsl cpp
|
||||
- `docs/standards/playbook/scripts/sync_standards.bat`(推荐,支持多语言参数)
|
||||
- 脚本会从快照目录同步到项目根目录,并先备份旧文件(`.bak.*`)。
|
||||
|
||||
注:建议固定使用 `--prefix docs/standards/playbook`,因为同步后的 `.agents/*/`
|
||||
会引用该路径下的标准快照文档(`docs/standards/playbook/docs/...`)。注:默认同步到
|
||||
`.agents/tsl/`;如需同步 C++ 规则集,推荐直接运行:`sh docs/standards/playbook/scripts/sync_standards.sh tsl cpp`。
|
||||
建议固定使用 `--prefix docs/standards/playbook`,因为同步后的 `.agents/*/`
|
||||
会引用该路径下的标准快照文档(`docs/standards/playbook/docs/...`)。无参数时若已存在
|
||||
`.agents/<lang>/`,将按现有语言同步;否则默认 `.agents/tsl/`。如需同步 C++ 规则集,
|
||||
推荐直接运行:`sh docs/standards/playbook/scripts/sync_standards.sh tsl cpp`。
|
||||
|
||||
这样 clone 任意项目时都能直接读取规范文件,不依赖外部访问权限。
|
||||
|
||||
同步脚本行为(目标项目内的最终落地内容):
|
||||
|
||||
- 覆盖/更新:`.agents/<AGENTS_NS>/`(默认 `.agents/tsl/`)
|
||||
- 自动识别:未传语言参数且已存在 `.agents/<lang>/` 时,按现有语言同步
|
||||
- 更新 `.gitattributes`:默认追加缺失规则(可用
|
||||
`SYNC_GITATTR_MODE=append|block|overwrite|skip` 控制)
|
||||
- 缺省创建:`.agents/index.md`
|
||||
|
||||
Reference in New Issue
Block a user