mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-08-10 01:20:59 +00:00
fix: github - keep root readme authoritative
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
- 脚本默认从仓库根目录运行,路径解析必须稳定。
|
||||
- 新增检查脚本时,同步更新 `scripts/README.md`、`Makefile`、CI 和根目录 `AGENTS.md` 的命令清单。
|
||||
- `check-directory-docs.py` 对根 `.github/` 只要求 `AGENTS.md`,不要重新补 `.github/README.md`。
|
||||
- 修改 docs 线性 README 的主章节或锚点后,优先运行 `python3 scripts/sync-doc-toc.py`,再运行 `make test`。
|
||||
- 修改 `docs/references/sources/` 后,运行 `make sync-reference-readme`,再运行 `make test`。
|
||||
- 检查失败输出应包含文件路径、行号或可定位的错误信息。
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
- `check-local-links.py`:仓库内 Markdown 相对链接与锚点检查脚本。
|
||||
- `check-markdown-details.py`:仓库内 Markdown `<details>/<summary>` 折叠块结构检查脚本。
|
||||
- `check-doc-structure.py`:`docs/` 线性 README 的主章节顺序、重复锚点与细粒度目录入口检查脚本。
|
||||
- `check-directory-docs.py`:仓库自有目录 `README.md` / `AGENTS.md` 覆盖检查脚本。
|
||||
- `check-directory-docs.py`:仓库自有目录 `README.md` / `AGENTS.md` 覆盖检查脚本;根 `.github/` 仅要求 `AGENTS.md`,避免 GitHub 首页误展示平台配置说明。
|
||||
- `check-metadata.py`:`metadata/taxonomy.yml` 与 `metadata/redirects.yml` 路径和锚点检查脚本。
|
||||
- `check-ai-citation.py`:`llms.txt`、`assets/ai-citation/llms-full.txt` 与 AI 引用语料路径和锚点检查脚本。
|
||||
- `sync-doc-toc.py`:根据 `metadata/taxonomy.yml` 和文档锚点重建 docs 线性 README 的完整细粒度目录。
|
||||
|
||||
@@ -41,6 +41,11 @@ REQUIRED_DIRS = [
|
||||
Path("tools/prompts-library/docs"),
|
||||
Path("tools/prompts-library/scripts"),
|
||||
]
|
||||
README_OPTIONAL_DIRS = {
|
||||
# GitHub repository pages can surface `.github/README.md` as an overview file.
|
||||
# Keep the root project README authoritative and use `.github/AGENTS.md` only.
|
||||
Path(".github"),
|
||||
}
|
||||
GENERATED_OR_VENDOR_DIRS = [
|
||||
Path("node_modules"),
|
||||
]
|
||||
@@ -84,7 +89,8 @@ def main() -> int:
|
||||
if not directory.is_dir():
|
||||
errors.append(f"{rel_dir}: required directory is missing")
|
||||
continue
|
||||
for filename in ("README.md", "AGENTS.md"):
|
||||
required_files = ["AGENTS.md"] if rel_dir in README_OPTIONAL_DIRS else ["README.md", "AGENTS.md"]
|
||||
for filename in required_files:
|
||||
if not (directory / filename).is_file():
|
||||
errors.append(f"{rel_dir}/{filename}: missing required directory document")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user