oss-community

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Community and governance files

社区与治理文件

Create the files that tell a newcomer how to contribute, a security researcher how to report a bug, and a forge how to route reviews, and set the handful of forge settings that decide what a stranger sees before any of those files. The decisions below, what each file must contain, are forge-independent. The schema, path, filename, and setting each forge expects are not, so they live in references/github.md and references/gitlab.md. Read the matching reference file before writing any issue template, CODEOWNERS entry, or FUNDING key, or changing any project setting; do not write one forge's file by guessing at the other's shape.
A scaffolded file nobody maintains is worse than no file at all. A CODE_OF_CONDUCT.md with a placeholder contact, a SECURITY.md pointing at an address nobody reads, or a CONTRIBUTING.md with setup commands that do not run, each looks like progress and is actually a trap for the next person who trusts it. Gather the facts below before writing anything, and stop to ask when a file needs a fact the repository does not contain.
创建这些文件,是为了告诉新贡献者如何参与贡献、告诉安全研究人员如何报告漏洞,并告诉代码托管平台如何路由评审;同时设置少量代码托管项目设置,这些设置决定陌生人在看到上述任何文件之前会看到什么。下面的决策以及每个文件必须包含的内容与具体代码托管平台无关。各平台要求的 schema、路径、文件名和设置则有所不同,因此分别记录在 references/github.md 和 references/gitlab.md 中。在编写任何 Issue 模板、CODEOWNERS 条目或 FUNDING 键之前,或更改任何项目设置之前,请先阅读匹配的参考文件;不要凭猜测用某个平台的格式编写另一个平台的文件。
一份搭建出来却无人维护的文件,甚至比完全没有文件更糟。带占位联系人的 CODE_OF_CONDUCT.md、指向无人查看的邮箱地址的 SECURITY.md,或包含无法运行/setup命令的 CONTRIBUTING.md,看起来像是取得了进展,实际上却会给下一个信任它的人设置陷阱。在编写任何内容之前,先收集下面所需的事实;如果某个文件需要仓库中不存在的事实,请停下来询问。

Scope

范围

The COM rules belong here: R-COM-01 license file, R-COM-02 contributing guide, R-COM-03 code of conduct, R-COM-04 security policy, R-COM-05 report templates, R-COM-06 code owners, R-COM-07 project page, R-COM-08 governance statement, and R-COM-09 issue chooser.
When
oss-audit-report.md
exists at the repository root, read the group addressed to this skill and work from that. Each failing rule there carries the audit's evidence and that rule's
Check:
text verbatim, so reading
STANDARD.md
as well adds nothing. Where the file is absent, work from the request as usual.
What each of those files must contain is this skill's, and so is the forge project's own description, topics, and homepage. The DOC rules split by concern: R-DOC-01 through R-DOC-04 and R-DOC-06 through R-DOC-10, README structure including the paragraph that links to the license, the changelog, and CONTRIBUTING.md, belong to
oss-readme
; R-DOC-05, the sentences in every file this skill creates, belongs to
oss-writing
. R-SEC-12, enforcing CODEOWNERS review as part of branch protection, belongs to
oss-harden
, as does every other protection, scanning, or token setting; R-COM-07's description, topics, homepage, and feature tabs are the only forge settings this skill touches. Do not reorder or rewrite README sections, decide how a file's sentences are phrased, or configure branch protection while working from this skill; note that the project needs it and hand the work to the owning skill.
以下 COM 规则属于本 skill:R-COM-01 许可证文件、R-COM-02 贡献指南、R-COM-03 行为准则、R-COM-04 安全策略、R-COM-05 报告模板、R-COM-06 代码所有者、R-COM-07 项目页面、R-COM-08 治理声明,以及 R-COM-09 Issue 选择器。
如果仓库根目录中存在
oss-audit-report.md
,请读取本 skill 对应的分组并据此工作。该文件中的每条失败规则都附有审计证据,并逐字包含该规则的
Check:
文本,因此再阅读
STANDARD.md
也不会增加信息。如果不存在该文件,则照常根据请求开展工作。
上述各文件必须包含什么,以及代码托管项目自身的描述、主题和主页,都属于本 skill 的职责。DOC 规则按关注点划分:R-DOC-01 至 R-DOC-04,以及 R-DOC-06 至 R-DOC-10,连同 README 结构——包括链接到许可证、变更日志和 CONTRIBUTING.md 的段落——均属于
oss-readme
;R-DOC-05,即本 skill 创建的每个文件中的句子规范,属于
oss-writing
;R-SEC-12,即将 CODEOWNERS 审查作为分支保护的一部分予以强制执行,与所有其他保护、扫描或令牌设置一样,属于
oss-harden
。R-COM-07 中的描述、主题、主页和功能标签页,是本 skill 唯一会修改的代码托管平台设置。在本 skill 中工作时,不要重排或改写 README 章节,不要决定文件中句子的具体措辞,也不要配置分支保护;只需指出项目需要这些工作,并将其移交给对应的 skill。

Ask rather than invent

询问而非臆造

Three files fail this skill's job if their content is invented rather than verified:
SECURITY.md needs a channel the maintainer actually monitors, that an unaffiliated reporter can reach, and a response time the maintainer can keep. Read the existing SECURITY.md if one exists, the README's contact or maintainers section, the package manifest's author or maintainers field, and the forge settings. GitHub private vulnerability reporting works only on a public repository and only after it is enabled. GitLab Service Desk accepts email from people with no GitLab account and creates a confidential ticket. A GitLab confidential issue is suitable only when the project's permissions let the intended reporters create one. If none of that surfaces a working channel, ask which one the maintainer will use and what response window they will commit to. Never write
security@example.com
or a plausible-looking address that nobody confirmed.
CODE_OF_CONDUCT.md needs a real enforcement contact. Read the same sources: an existing CODE_OF_CONDUCT.md, the README, the package manifest, CODEOWNERS. A template CODE_OF_CONDUCT.md often ships with
[INSERT CONTACT METHOD]
or similar placeholder text still in it; carrying that text forward fails R-COM-03 outright, since the rule treats a dead channel as worse than none. If reading the repository does not surface a name and a reachable address or handle, ask for one.
CONTRIBUTING.md needs the actual local setup, test, and submission commands, not the generic ones for the ecosystem. Read the package manifest's scripts, a Makefile, a Rakefile, or whatever the project already uses to define these, and quote the commands that exist there. If no test command is defined anywhere in the repository, say so instead of inventing one, and ask whether to add one to the project or document that none exists yet.
如果以下三个文件的内容是臆造的,而不是经过核实的,本 skill 就无法完成任务:
SECURITY.md 需要一个维护者确实会查看、非项目报告者也能触达的渠道,以及维护者能够持续兑现的响应时限。请阅读现有的 SECURITY.md、README 中的联系人或维护者章节、软件包清单中的 author 或 maintainers 字段,以及代码托管平台设置。GitHub 私密漏洞报告仅适用于公开仓库,并且必须先启用该功能。GitLab Service Desk 接受没有 GitLab 账号的人员通过电子邮件提交内容,并创建机密工单。只有当项目权限允许预期报告者创建机密 Issue 时,GitLab 机密 Issue 才适合作为报告渠道。如果这些来源中没有出现可用的渠道,请询问维护者将使用哪一种渠道,以及愿意承诺在多长时间内作出响应。绝不要写入
security@example.com
或其他看似合理但无人确认过的地址。
CODE_OF_CONDUCT.md 需要一个真实有效的执行联系人。阅读以下相同来源:现有的 CODE_OF_CONDUCT.md、README、软件包清单和 CODEOWNERS。模板形式的 CODE_OF_CONDUCT.md 通常仍会附带
[INSERT CONTACT METHOD]
或类似占位文本;继续保留这类文本会直接导致 R-COM-03 失败,因为该规则认为失效的渠道甚至比完全没有渠道更糟。如果无法从仓库中找到姓名以及可访问的地址或账号,请询问维护者。
CONTRIBUTING.md 需要填写真实的本地安装、测试和提交流程命令,而不是该技术生态中的通用命令。请阅读软件包清单中的 scripts、Makefile、Rakefile 或项目已经使用的其他文件,以确定这些命令,并原样引用其中实际存在的命令。如果仓库中任何位置都没有定义测试命令,请如实说明,不要凭空编造;同时询问是要为项目添加测试命令,还是记录项目目前没有测试。

Process

流程

Step 1: Establish whether scaffolding is warranted, and gather facts

第 1 步:确定是否需要创建这些文件,并收集事实

Confirm the project accepts outside contributions at all before writing a file that invites them. Check the README for a statement either way, check whether the repository is archived, and ask directly if neither answers it; a project that does not want contributions needs a license and a security policy, not a CONTRIBUTING.md.
Identify the language and ecosystem from the package manifest and source layout, so the commands quoted in CONTRIBUTING.md match reality. Each ecosystem has a file under
references/ecosystems/
, named for the registry where there is one, that answers where its manifest declares a license and what its funding platform name is; references/ecosystems/npm.md is the shape they all take. A repository with more than one manifest has more than one of them to read. Identify the forge from the git remote or by asking; this decides which reference file governs Steps 6 through 9. Identify whether the repository sits under a personal account or an organization: a personal account has no teams, so a CODEOWNERS entry there must name a
@username
or an email address, never an
@org/team-name
. List the community files that already exist, in every location each forge recognizes, so Steps 2 through 9 extend or replace rather than duplicate them.
在编写任何邀请外部贡献的文件之前,先确认项目是否确实接受外部贡献。检查 README 中是否有相关声明,检查仓库是否已归档;如果两者都无法给出答案,请直接询问。一个不希望收到贡献的项目需要的是许可证和安全策略,而不是 CONTRIBUTING.md。
根据软件包清单和源代码目录结构识别语言与技术生态,确保 CONTRIBUTING.md 中引用的命令符合实际情况。每个技术生态在
references/ecosystems/
下都有一个文件;对于存在 registry 的生态,该文件以 registry 命名,用于说明其软件包清单在何处声明许可证,以及对应的资助平台名称;references/ecosystems/npm.md 展示了这些文件的通用形式。仓库中如果有多个软件包清单,就需要分别读取对应的多个文件。通过 git remote 或询问来识别代码托管平台;这将决定第 6 至第 9 步应遵循哪份参考文件。确认仓库位于个人账号还是组织下:个人账号没有团队,因此其中的 CODEOWNERS 条目必须指定
@username
或电子邮件地址,绝不能使用
@org/team-name
。列出已经存在的所有社区文件,并检查每个代码托管平台认可的所有可能位置,以便第 2 至第 9 步是在扩展或替换这些文件,而不是创建重复文件。

Step 2: License file (R-COM-01)

第 2 步:许可证文件(R-COM-01)

Open the matching file under
references/ecosystems/
before reading the manifest, because the field is not always called
license
and two ecosystems have no such field at all. Read every package manifest's
license
field. If a manifest names a license and no
LICENSE
or
LICENSE.md
file exists, fetch the matching text from the license steward or the SPDX License List by its current identifier, then fill only the replaceable copyright fields. Do not reconstruct license text from memory. If no manifest names a license, ask which one to use rather than defaulting to MIT or any other license silently. If a
LICENSE
file already exists and disagrees with a manifest, point out the mismatch and ask which one is correct instead of picking one.
A manifest that declares no license at all, because the package is private or the project publishes nothing, leaves this rule with no manifest to match. The license file still has to exist and still has to say which license it is, so read the file itself and confirm it is the full text of a license you can name, not a stub or a header. Check what else in the repository states a license, such as a skill's frontmatter or the forge's own detected license, and raise it if any of them disagree with the file.
在阅读软件包清单之前,先打开
references/ecosystems/
下与该生态匹配的文件,因为许可证字段并不总是命名为
license
,而且有两个生态根本没有这种字段。读取每个软件包清单的
license
字段。如果清单指定了许可证,但仓库中不存在
LICENSE
或
LICENSE.md
文件,请根据当前标识符从许可证维护方或 SPDX License List 获取对应的许可证文本,然后只填写其中可替换的版权信息。绝不要凭记忆重建许可证文本。如果没有任何清单指定许可证,请询问应使用哪一种许可证,不要默认为 MIT 或其他任何许可证。如果
LICENSE
文件已经存在,但内容与清单不一致,请指出冲突并询问哪一个正确,不要自行选择。
如果软件包清单完全没有声明许可证,原因可能是该包为私有项目或项目不发布任何内容,那么此规则就没有可用于比对的清单。许可证文件仍然必须存在,并且仍然必须明确说明使用的是哪一种许可证,因此应读取文件本身,确认它是能够明确识别的许可证完整文本,而不是存根或标题片段。检查仓库中其他声明许可证的信息,例如 skill 的 frontmatter 或代码托管平台自动检测到的许可证;如果它们与该文件不一致,应指出问题。

Step 3: CONTRIBUTING.md (R-COM-02)

第 3 步:CONTRIBUTING.md(R-COM-02)

State the setup command, the test command, and how to open a pull request or merge request, using the commands verified in Step 1's read of the manifest and any build files. Name the actual branch and fork workflow the repository uses; do not describe a generic GitHub flow for a project that requires a different one. Place the file at the repository root unless the project already keeps community files in
.github/
or
docs/
on GitHub, in which case match that convention; GitLab recognizes no alternate location for this file, so keep it at the root there.
Two more statements close the rule. State that a change adding functionality arrives with a test. Then name the document that says what an acceptable contribution must satisfy, and link it, whether that is a coding standard, a style guide, or the repository's own instructions file. Open the link before shipping the guide, because the rule checks that the document resolves. Where the project has no such document, say so and ask which one to name, rather than inventing requirements nobody agreed to.
根据第 1 步从软件包清单和构建文件中核实过的命令,说明安装命令、测试命令,以及如何发起 Pull Request 或 Merge Request。说明仓库实际使用的分支和 fork 工作流;如果项目采用不同流程,不要套用通用的 GitHub 流程。除非项目已经在 GitHub 的
.github/
或
docs/
中存放社区文件,否则应将本文件放在仓库根目录,并遵循项目已有约定;GitLab 不支持其他位置,因此应始终放在根目录。
还需要补充两项说明。第一,说明增加功能的变更必须附带测试。第二,指出说明可接受贡献必须满足哪些要求的文档,并提供链接;该文档可以是编码规范、风格指南或仓库自己的说明文件。发布贡献指南之前,应打开链接确认其可访问,因为规则会检查该文档能否正确解析。如果项目没有此类文档,请如实说明,并询问应指定哪一份文档,不要臆造无人认可的要求。

Step 4: CODE_OF_CONDUCT.md (R-COM-03)

第 4 步:CODE_OF_CONDUCT.md(R-COM-03)

Use an established code of conduct rather than drafting new standards of behavior. Fetch the version the steward publishes today, read from the steward's own index, because a version number a skill or an existing file names goes stale the moment the steward publishes the next one. For the Contributor Covenant,
https://www.contributor-covenant.org/version/
lists every version, and the newest one's Markdown is at
https://www.contributor-covenant.org/version/<major>/<minor>/code_of_conduct/code_of_conduct.md
. Preserve the attribution and license notice, and customize only the fields that version's own adoption instructions invite the project to customize, which for the Contributor Covenant is the reporting instructions and, in versions that have one, the section describing the project's own enforcement process. Fill in the verified reporting contact, and confirm no placeholder text, such as a bold
[NOTE: ...]
block, survives before finishing.
A code of conduct already in the repository at an older version of the same document still satisfies R-COM-03, provided its reporting contact works. Say that the newer version exists and let the maintainer decide; do not replace a working file to chase a version number.
使用公认的行为准则,不要自行起草新的行为标准。从维护方自己的索引中获取其当前发布的版本,因为 skill 或现有文件所注明的版本号,会在维护方发布下一版本时立即过时。对于 Contributor Covenant,
https://www.contributor-covenant.org/version/
列出了所有版本,最新版本的 Markdown 位于
https://www.contributor-covenant.org/version/<major>/<minor>/code_of_conduct/code_of_conduct.md
。保留归属声明和许可证声明,只修改该版本自身的采用说明允许项目自定义的字段;对于 Contributor Covenant,这些字段是报告说明,以及该版本包含时用于描述项目自身执行流程的章节。填入经过核实的报告联系人,并确认完成后没有残留任何占位文本,例如加粗的
[NOTE: ...]
区块。
如果仓库中的行为准则仍是同一文档的旧版本,只要报告联系人有效,仍然满足 R-COM-03。请说明存在更新的版本,并由维护者决定是否采用;不要仅为追求版本号而替换一个可正常使用的文件。

Step 5: SECURITY.md (R-COM-04)

第 5 步:SECURITY.md(R-COM-04)

State the private reporting channel gathered above and the response window the maintainer confirmed. Do not state a response window nobody committed to keeping; a generic "we aim to respond within 48 hours" that the maintainer never agreed to is exactly the kind of unmaintained promise this skill exists to avoid. The window they commit to is 14 days or less, because R-COM-04 accepts no longer one. Where the maintainer will not commit inside that ceiling, say so rather than writing a number they will miss. On GitHub, confirm the repository is public and private vulnerability reporting is enabled before naming its report form. On GitLab, prefer an enabled Service Desk address or a monitored security email. Name a confidential-issue URL only after verifying that a reporter with the documented audience's role can create the issue as confidential. A channel that requires undisclosed project membership is not a public security contact.
写明前面收集到的私密报告渠道,以及维护者确认过的响应时限。不要写维护者从未承诺会持续兑现的响应时限;诸如“我们力争在 48 小时内响应”这种泛化表述,如果维护者从未同意过,就正是本 skill 要避免的无维护承诺。维护者承诺的时限必须不超过 14 天,因为 R-COM-04 不接受更长的时限。如果维护者不愿在 14 天以内作出承诺,请如实说明,不要写入一个其无法兑现的数字。在 GitHub 上,只有确认仓库为公开状态且私密漏洞报告功能已经启用后,才能提及相应的报告表单。在 GitLab 上,优先使用已启用的 Service Desk 地址或有人查看的安全邮箱。只有在确认文档所述角色的报告者能够创建机密 Issue 后,才能列出机密 Issue URL。要求报告者具备未公开的项目成员资格,不能作为公开的安全联系渠道。

Step 6: Issue and change-request templates (R-COM-05, R-COM-09)

第 6 步:Issue 和变更请求模板(R-COM-05、R-COM-09)

Open the reference file for the forge chosen in Step 1 before writing any template; the two forges differ enough here that guessing at the other's shape produces a template the forge will not render. At minimum, ship one issue template and one change-request template.
Which facts a report has to carry is a property of this project, not of bug reports in general. Derive them from evidence in the repository using references/report-fields.md, which carries the test for whether a field belongs, the five places that evidence lives, and how many templates this project's triage needs. On GitHub, references/github.md names the schema element that carries each kind of fact.
Present the derived fields, the template categories, and the change-request template's sections before writing any file. The maintainer pays the triage cost, so the slate is theirs to cut. Name the source of each field, which is what lets them cut it, and say which fields they did not ask for.
A template made of Markdown headings cannot require any of those fields: a contributor can delete every heading and submit an empty issue. On a public GitHub repository, write issue forms instead, and mark the fields you cannot triage without as required, because that is the only shape either forge enforces and it works only in public repositories. Verify the form renders in the template chooser before treating it as finished. Fall back to a Markdown template on a private repository, on GitLab, or when a form does not render, and say which one you shipped and what it does not enforce.
Write the chooser config as well on GitHub whenever the project has somewhere to send what is not a defect (R-COM-09). Ask where that traffic already goes rather than assuming the tracker. Open the linked URL before shipping the file, because the rule checks that the destination exists. Leave the blank issue enabled unless the templates cover every kind of report the project accepts, and leave
blank_issues_enabled
alone otherwise: R-COM-09 scores the routing, not the tracker's front door.
Whether the project runs such a channel at all is the maintainer's decision and not this rule's business. Where they want one and the project is on GitHub, Discussions is the cheapest to open, and it is a repository setting rather than a file, so Step 9's rules about settings apply. A Discussions category can carry a form of its own in the same schema the issue forms use, which is worth proposing only for a category that already collects a recurring shape of report; references/github.md has the path, the naming rule, and the keys that differ from an issue form.
A change-request template collects what review needs and the pipeline cannot report. A checkbox asking whether the contributor ran the tests duplicates a required check and reads as satisfied whether or not it is, so read the project's own pipeline first and ask for nothing it already answers. Ask instead for what no job produces: which part of the declared public API the change touches, where the project declares one, and the evidence behind a change nothing automated can score. Derive the sections from what this project's review actually needs, the same way the issue fields are derived, because a section every project ships is a section that collects nothing.
A change request is read on the forge, in a rendered description a reviewer skims before opening the diff, so write the template for that reader. Use headings the forge renders, one bullet per separable part of the change, and a table where the answer is a list of things and a fact about each. A description that arrives as one flat paragraph is read by nobody, however true every sentence in it is. A repository configured to reuse the description as its squash commit message is not a reason to write one that way: the forge is where the text is read, and the commit is a copy of it. Put each section's guidance in an HTML comment under its heading, so it disappears once the description renders. Neither forge can require a field here, so keep the list short enough to be read, and say in the template that a heading with nothing under it should be deleted, since an empty section reads as an unanswered one.
编写任何模板之前,先打开第 1 步所选代码托管平台的参考文件;两个平台在这里的差异足够大,凭猜测套用另一个平台的格式会生成平台无法渲染的模板。至少应提供一个 Issue 模板和一个变更请求模板。
报告必须包含哪些事实,是具体项目的属性,而不是所有 Bug 报告的通用属性。请根据仓库中的证据,并按照 references/report-fields.md 推导这些字段;该文件说明了判断一个字段是否必要的测试、证据所在的五类位置,以及本项目的分类整理工作需要多少个模板。在 GitHub 上,references/github.md 指出了承载每类事实的 schema 元素。
编写任何文件之前,先展示推导出的字段、模板分类以及变更请求模板的章节。分类整理的投入由维护者承担,因此字段取舍应由维护者决定。说明每个字段的来源,使维护者能够删除不需要的字段,并指出维护者没有要求的字段。
仅由 Markdown 标题构成的模板无法要求任何字段,因为贡献者可以删除全部标题并提交空白 Issue。在公开 GitHub 仓库中,应改用 Issue 表单,并将缺少后无法进行分类整理的字段标为必填,因为这是两个代码托管平台中唯一能够强制字段的形式,而且仅在公开仓库中有效。将表单视为完成之前,应验证它能在模板选择器中正常渲染。如果仓库是私有仓库、平台是 GitLab,或者表单无法渲染,则回退到 Markdown 模板,并说明实际提供了哪种形式,以及它无法强制哪些内容。
如果项目有渠道可以接收非缺陷内容,在 GitHub 上还应编写 Issue 选择器配置。请询问这类内容目前会被发送到哪里,不要擅自假定它会进入问题跟踪器。发布该文件之前应打开链接,因为规则会检查目标是否存在。除非模板覆盖项目接受的所有报告类型,否则应保留空白 Issue;其余情况下不要改动
blank_issues_enabled
。R-COM-09 评估的是路由,而不是跟踪器的正门。
项目是否运营这类渠道由维护者决定,不属于本规则的职责范围。如果维护者希望设置这类渠道,且项目位于 GitHub 上,那么 Discussions 是成本最低的选择。由于它是仓库设置而不是文件,因此适用第 9 步关于设置的要求。Discussions 分类可以使用与 Issue 表单相同的 schema 承载自己的表单,但只应为已经持续收集某类结构化报告的分类提出此方案;references/github.md 给出了路径、命名规则以及与 Issue 表单不同的键。
变更请求模板应收集评审需要、但自动化流水线无法报告的信息。一个询问贡献者是否运行过测试的复选框,会重复流水线已有的必需检查,而且无论贡献者是否真的运行过测试,都会被视为已满足。因此,应先阅读项目自己的流水线,不要询问它已经能够回答的信息。应当询问流水线无法产生的信息:变更触及了已声明公共 API 的哪一部分、项目在何处声明该 API,以及自动化系统无法评分的变更背后有哪些依据。应根据本项目实际评审所需的信息推导模板章节,就像根据 Issue 字段进行推导一样;每个项目都照搬的章节只会收集不到任何信息。
变更请求是在代码托管平台上阅读的,评审者会在打开 diff 之前快速浏览渲染后的描述,因此模板应针对这类读者编写。使用代码托管平台能够渲染的标题,将变更中可分离的每个部分写成一项,并使用表格呈现“若干事项及每项事实”这类答案。如果描述以一整段平铺文字提交,即使每句话都属实,也没有人会阅读。仓库被配置为将描述复用为 squash commit message,并不意味着要按这种方式编写;文本的阅读场景是代码托管平台,commit 只是它的副本。将每个章节的填写说明放在标题下方的 HTML comment 中,使其在描述渲染后消失。两个平台都无法在这里强制字段,因此应让字段列表足够精简,确保评审者能够读完,并在模板中说明:如果某个标题下没有任何内容,应删除该标题,因为空章节看起来像是一个尚未回答的问题。

Step 7: CODEOWNERS (R-COM-06)

第 7 步:CODEOWNERS(R-COM-06)

R-COM-06 reaches a repository where two or more principals hold push, maintain, or admin access, the same condition R-SEC-12 states. Read the access list first, and where one principal holds every merge path, say the rule does not reach the repository and skip this step; a code owner who is also the only person who could merge the change assigns a reviewer to nobody. Where it does reach, open the matching reference file. GitHub reads CODEOWNERS in public repositories on GitHub Free and in public or private repositories on paid plans. GitLab's Code Owners feature, including reading this file at all, requires Premium or Ultimate. Only GitLab supports sections, exclusions, role owners, and a required approval count within a section. Enforcing CODEOWNERS approval, where the tier allows it, is a branch or merge request protection setting outside this file. Note that setting is needed and hand it to
oss-harden
rather than attempting it here. Every CODEOWNERS file this skill writes needs at least one catch-all
*
rule naming a real owner; ask who that should be if it is not already obvious from the repository's single maintainer or an existing CODEOWNERS file.
R-COM-06 适用于由两个或更多主体拥有 push、maintain 或 admin 权限的仓库,这与 R-SEC-12 中的条件相同。请先阅读访问权限列表;如果某个主体拥有所有合并路径的权限,应说明该规则不适用于此仓库并跳过本步骤,因为当代码所有者也是唯一能够合并变更的人时,他实际上是在给无人评审指定代码所有者。如果该规则适用,请打开匹配的参考文件。GitHub 会在使用 GitHub Free 的公开仓库,以及使用付费方案的公开或私有仓库中读取 CODEOWNERS。GitLab 的 Code Owners 功能——包括读取此文件本身——需要 Premium 或 Ultimate 方案。只有 GitLab 支持章节、排除项、角色所有者,以及在章节内设置必需批准数量。在套餐允许的情况下强制执行 CODEOWNERS 审批,属于分支或 Merge Request 保护设置,不在此文件范围内。请指出需要该设置,并将其移交给
oss-harden
,不要在本步骤中配置。本 skill 编写的每个 CODEOWNERS 文件都至少需要一条使用
*
的兜底规则,并指定真实的所有者;如果无法从仓库的单一维护者或现有 CODEOWNERS 文件中明确判断,应询问该所有者是谁。

Step 8: FUNDING (optional)

第 8 步:FUNDING(可选)

No rule in
STANDARD.md
requires a funding file; only add one if the maintainer wants a sponsor button or funding link, and only list a platform the project is actually registered on. Read
references/github.md
for the accepted keys before writing
.github/FUNDING.yml
; GitLab has no equivalent file.
STANDARD.md
中没有任何规则要求提供资助文件;只有在维护者希望添加赞助按钮或资助链接时才应创建,而且只能列出项目实际注册所在的平台。编写
.github/FUNDING.yml
前,请阅读
references/github.md
中支持的键;GitLab 没有等效文件。

Step 9: Forge project settings (R-COM-07)

第 9 步:代码托管项目设置(R-COM-07)

The description, homepage, and topics are what a stranger reads in a search result or a social card before deciding whether to open the README, and none of them live in a file, so nothing in a clone reveals that they are empty. Read the current values from the forge, then propose a one-sentence description saying the same thing as the README's opening line, a homepage pointing at the documentation site or package page where one exists, and topics someone searching would actually type. Read the matching reference file for the field limits, the commands, and the feature tabs, and confirm Issues is enabled at all, since Step 6's templates are unreachable without it.
A setting is not a file: it takes effect the moment it is applied, it appears in no diff, and it cannot be reviewed before it is public. Apply these only with the maintainer's agreement, and say for each one what it will look like publicly. Branch protection, required reviews, scanning, and tokens are settings too, and they belong to
oss-harden
; note that they are needed and change nothing here.
陌生人会先在搜索结果或社交卡片中看到描述、主页和主题,然后才决定是否打开 README,而这些内容都不存在于文件中,因此克隆仓库无法暴露它们为空。请从代码托管平台读取当前值,然后提出一个与 README 首句表达相同含义的单句描述;指向现有文档站点或软件包页面的主页;以及搜索者真正会输入的主题。阅读匹配的参考文件,以了解字段限制、命令和功能标签页,并确认 Issues 功能至少已启用,否则第 6 步的模板无法访问。
设置不是文件:它在应用后立即生效,不会出现在任何 diff 中,并且在公开之前无法接受评审。只有在维护者同意后才能应用这些设置,并说明每一项公开后会呈现为什么内容。分支保护、必需评审、扫描和令牌也属于设置,它们归
oss-harden
管理;请指出项目需要这些设置,但不要在此处进行任何更改。

Step 10: Governance and succession (R-COM-08)

第 10 步:治理与继任安排(R-COM-08)

Write who decides and what happens if they stop. For a project with one maintainer, that is two honest sentences in CONTRIBUTING.md or a GOVERNANCE.md: this person merges and releases, and there is no succession arranged. Do not talk a solo maintainer into inventing a steering committee, and do not name a second maintainer who has not agreed to be one; both read as governance and are neither. Where the repository already sits under an organization or foundation, say which, since that is the succession answer. Read the repository first: an existing GOVERNANCE.md, a CONTRIBUTING.md section on who reviews, or a CODEOWNERS file naming a team rather than a person all tell you what is already true. If nothing does, ask, because this is the one COM file whose content cannot be inferred from the repository at all.
说明由谁做决定,以及如果他们停止工作会发生什么。对于只有一名维护者的项目,可以在 CONTRIBUTING.md 或 GOVERNANCE.md 中用两句坦诚的话说明:由此人负责合并和发布,并且目前没有安排继任者。不要劝说单个维护者临时设立指导委员会,也不要指定一名尚未同意担任维护者的第二个人;这两种做法看起来像治理,实际上都不是。如果仓库已经位于某个组织或基金会下,请说明是哪一个,因为这本身就是继任问题的答案。请先阅读仓库:现有的 GOVERNANCE.md、CONTRIBUTING.md 中说明由谁评审的章节,或指定团队而非个人的 CODEOWNERS 文件,都能说明当前真实情况。如果没有任何线索,请询问,因为这是唯一一个内容完全无法从仓库中推断出来的 COM 文件。

Step 11: Present the result

第 11 步:展示结果

Before presenting, read each R-COM rule's
Check:
line in
STANDARD.md
, which ships in the
oss-audit
skill beside this one (
../oss-audit/STANDARD.md
from this file), against the files and settings as they now stand, and fix what fails. Where
oss-audit
is not installed, say that the rules could not be checked. One fix moves another rule, so start the list again after each one, and do not report done while any cited rule still fails.
Then list every file written or proposed, every setting changed or proposed, the rule each satisfies, and every fact that came from asking rather than reading, so the maintainer can see what they confirmed. Flag anything left unresolved, such as a CONTRIBUTING.md with no test command because the repository has no tests, rather than silently shipping a gap.
展示结果之前,请阅读
STANDARD.md
中每条 R-COM 规则的
Check:
行,并逐项对照当前的文件和设置,修复未通过项。
STANDARD.md
随附在与本 skill 相邻的
oss-audit
skill 中(从本文件看,路径为
../oss-audit/STANDARD.md
)。如果未安装
oss-audit
,请说明无法检查这些规则。一次修复可能会影响另一条规则,因此每次修复后都应重新开始检查;在任何已引用规则仍未通过时,不要报告任务已完成。
然后列出所有已编写或建议编写的文件、所有已修改或建议修改的设置、每项内容所满足的规则,以及所有通过询问而非阅读仓库获得的事实,让维护者能够确认自己批准了哪些内容。明确标记任何尚未解决的问题,例如仓库没有测试,因而 CONTRIBUTING.md 无法提供测试命令;不要在未说明的情况下默默交付这些缺口。