From 4153ea59b858287fb2ae83be8a8d3ae9dd70a185 Mon Sep 17 00:00:00 2001 From: gewuyou <95328647+GeWuYou@users.noreply.github.com> Date: Sun, 3 May 2026 21:00:03 +0800 Subject: [PATCH] =?UTF-8?q?docs(agents):=20=E8=A1=A5=E5=85=85=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B4=E6=B2=BB=E7=90=86=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 补充 AGENTS.md 中的许可证文件头规则 - 修复新增治理文件自身缺失的文件头 --- .github/workflows/license-header-fix.yml | 3 +++ AGENTS.md | 17 +++++++++++++++++ scripts/license-header.py | 3 +++ 3 files changed, 23 insertions(+) diff --git a/.github/workflows/license-header-fix.yml b/.github/workflows/license-header-fix.yml index ac94cb4f..cc7d510a 100644 --- a/.github/workflows/license-header-fix.yml +++ b/.github/workflows/license-header-fix.yml @@ -1,3 +1,6 @@ +# Copyright (c) 2025-2026 GeWuYou +# SPDX-License-Identifier: Apache-2.0 + # 维护者手动触发的 Apache-2.0 文件头修复流程。 name: License Header Fix diff --git a/AGENTS.md b/AGENTS.md index 06610a00..630282bd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -79,6 +79,23 @@ All AI agents and contributors must follow these rules when writing, reviewing, - The branch naming rule for a new task branch is `/`, where `` should match the intended Conventional Commit category as closely as practical. +## License Header Rules + +- Repository-maintained source and configuration files that are supported by `scripts/license-header.py` MUST include an + Apache-2.0 file header before the task is considered complete. +- When creating or modifying supported files, contributors MUST preserve an existing compliant header or add the SPDX + header generated by `python3 scripts/license-header.py --fix`. +- Before committing changes that add or modify supported source/configuration files, contributors MUST run + `python3 scripts/license-header.py --check` and resolve any missing or misplaced headers. +- For files with shebang lines, keep the shebang as the first line and place the license header immediately after it. +- For XML/MSBuild files with an XML declaration, keep the XML declaration as the first node and place the license header + immediately after it. +- Do not add project license headers to excluded or third-party areas such as `.agents/**`, `ai-libs/**`, + `third-party-licenses/**`, generated snapshots, binary assets, lock files, and generated build output. Treat + `scripts/license-header.py` as the authoritative include/exclude policy for this check. +- If CI reports a license-header failure, either fix it locally with `python3 scripts/license-header.py --fix` or, for + maintainer-owned cleanup, use the manual `License Header Fix` GitHub Actions workflow to create a reviewed repair PR. + ## Repository Boot Skill - The repository-maintained Codex boot skill lives at `.codex/skills/gframework-boot/`. diff --git a/scripts/license-header.py b/scripts/license-header.py index 5b060be5..d4374859 100644 --- a/scripts/license-header.py +++ b/scripts/license-header.py @@ -1,4 +1,7 @@ #!/usr/bin/env python3 +# Copyright (c) 2025-2026 GeWuYou +# SPDX-License-Identifier: Apache-2.0 + """Command entry point for repository license header checks.""" from __future__ import annotations