fix: github - keep root readme authoritative

This commit is contained in:
tukuaiai
2026-05-04 05:07:59 +08:00
parent 4c2c4fdd45
commit 30ee6d0e20
6 changed files with 12 additions and 21 deletions
+2
View File
@@ -2,6 +2,8 @@
本目录承载 GitHub 平台自动化与协作配置。
说明:本目录不放 `README.md`,避免 GitHub 仓库首页误展示平台配置说明;目录规则只保留在 `AGENTS.md`
## 约束
- 修改 `workflows/` 前必须确认对应本地命令或验证方式。
-19
View File
@@ -1,19 +0,0 @@
# .github
GitHub 平台配置目录,集中管理 CI、Issue 模板、PR 模板、安全政策、赞助配置和 Wiki 说明。
## 目录
- `workflows/` - GitHub Actions 工作流。
- `ISSUE_TEMPLATE/` - Issue 表单和模板。
- `PULL_REQUEST_TEMPLATE.md` - PR 描述模板。
- `SECURITY.md` - 安全报告入口。
- `WIKI.md` - Wiki 使用说明。
- `labeler.yml` - PR 自动标签规则。
- `lint_config.json` - Markdown lint 配置。
## 维护规则
- CI 变更必须能用本地命令复现核心检查。
- 外链检查规则集中放在 `.lychee.toml`
- 不在此目录保存密钥、Token 或本地账号信息。
+1
View File
@@ -221,6 +221,7 @@ git push origin develop
- `assets/ai-citation/llms-full.txt` - 面向 AI 助手的完整上下文入口,用于 GEO / AI 推荐与引用
- `assets/ai-citation/` - AI 引用语料包,包含摘要、FAQ、对比、推荐回答与 GEO/SEO 检查清单
- `.gitattributes` - GitHub Linguist 语言统计规则,当前将 `tools/external/**` 标记为 vendored
- `.github/AGENTS.md` - GitHub 平台配置目录规则;根 `.github/` 不保留 `README.md`,避免 GitHub 首页误展示目录说明
- `.github/lint_config.json` - markdownlint 规则,供 `make lint` 与 CI 共用
- `.github/workflows/ci.yml` - GitHub Actionsdevelop/master 分支 markdown-lint + link-checker
- `scripts/check-local-links.py` - 仓库内 Markdown 相对链接与锚点检查脚本,供 `make check-links` 与 CI 使用
+1
View File
@@ -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
View File
@@ -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 的完整细粒度目录。
+7 -1
View File
@@ -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")