Skip to content

feat(agents): add AGENTS.md file#2932

Open
tangge233 wants to merge 3 commits into
devfrom
feat/agents
Open

feat(agents): add AGENTS.md file#2932
tangge233 wants to merge 3 commits into
devfrom
feat/agents

Conversation

@tangge233
Copy link
Copy Markdown
Contributor

@tangge233 tangge233 commented May 30, 2026

先出一版不太行的,等大佬来优化下

由 Sourcery 提供的摘要

文档:

  • 新增 AGENTS.md,描述由 AI 生成贡献所需遵循的编码规范、项目结构、提交约定、测试要求、性能要求、安全要求以及代码审查要求。
Original summary in English

Summary by Sourcery

Documentation:

  • Add AGENTS.md describing coding standards, project structure, commit conventions, testing, performance, security, and review requirements for AI-generated contributions.

@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: L PR 大小评估:大型 labels May 30, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 30, 2026

审阅者指南

添加了一份完整的 AGENTS.md 指南文档,用于说明在 PCL2-CE 项目中为 AI 代理贡献代码时的编码规范、架构约定、工作流程以及审核约定。

AI 代理贡献与审阅流程图

flowchart TD
    Agent[AI_agent generates_code]
    CommitRules[Check_AI_generation_rules]
    HumanReview[Human_reviewer_audits_code]
    Tests[Run_dotnet_test]
    Checklist[Run_pre_commit_checklist]
    PR[Open_PR_with_tag]

    Agent --> CommitRules
    CommitRules -->|OK| HumanReview
    CommitRules -->|Violates_size_or_scope_limits| Agent

    HumanReview -->|Issues_found| Agent
    HumanReview -->|Looks_good| Tests

    Tests -->|Tests_fail| Agent
    Tests -->|Tests_pass| Checklist

    Checklist -->|All_checks_pass| PR
    Checklist -->|Missing_items| Agent
Loading

文件级变更

变更 详情 文件
引入 AGENTS.md 作为专门针对在 PCL2-CE 上工作的 AI 代理的集中式贡献指南。
  • 记录项目结构以及启动器与核心库之间的单向依赖规则。
  • 定义详细的 C# 命名约定、代码风格(LF、UTF-8、4 空格缩进、Allman 花括号风格),以及如 goto 之类的禁止使用结构。
  • 指定与性能相关的实践,例如正则使用 GeneratedRegex,以及原生互操作中使用 LibraryImportSpan<T> 等。
  • 说明适配本项目的生命周期服务、配置系统、测试、性能、安全性与文档编写等最佳实践。
  • 为 AI 生成代码的使用、提交信息格式、分支策略以及 PR 前检查清单(作者与审阅者)设定规则。
AGENTS.md

技巧与命令

与 Sourcery 交互

  • 触发新的审阅: 在 Pull Request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub Issue: 通过回复某条审阅评论,要求 Sourcery 根据该评论创建一个 issue。你也可以在审阅评论下回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在 Pull Request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 Pull Request 摘要: 在 Pull Request 正文的任意位置写入 @sourcery-ai summary,即可在指定位置生成 PR 摘要。你也可以在 Pull Request 中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在 Pull Request 中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 一次性解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,即可将所有 Sourcery 评论标记为已解决。适用于你已经处理完所有评论且不再希望看到它们的情况。
  • 一次性撤销所有 Sourcery 审阅: 在 Pull Request 中评论 @sourcery-ai dismiss,即可撤销所有现有的 Sourcery 审阅。特别适用于你希望从头开始一次新的审阅——别忘了再评论 @sourcery-ai review 来触发新审阅!

自定义使用体验

访问你的 控制面板 以:

  • 启用或禁用审阅特性,例如 Sourcery 自动生成的 Pull Request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅指令。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Adds a comprehensive AGENTS.md guideline document describing coding, architecture, workflow, and review conventions for AI agents contributing to the PCL2-CE project.

Flow diagram for AI agent contribution and review process

flowchart TD
    Agent[AI_agent generates_code]
    CommitRules[Check_AI_generation_rules]
    HumanReview[Human_reviewer_audits_code]
    Tests[Run_dotnet_test]
    Checklist[Run_pre_commit_checklist]
    PR[Open_PR_with_tag]

    Agent --> CommitRules
    CommitRules -->|OK| HumanReview
    CommitRules -->|Violates_size_or_scope_limits| Agent

    HumanReview -->|Issues_found| Agent
    HumanReview -->|Looks_good| Tests

    Tests -->|Tests_fail| Agent
    Tests -->|Tests_pass| Checklist

    Checklist -->|All_checks_pass| PR
    Checklist -->|Missing_items| Agent
Loading

File-Level Changes

Change Details Files
Introduce AGENTS.md as a centralized contribution guideline specifically for AI agents working on PCL2-CE.
  • Document project structure and one-way dependency rules between the launcher and core libraries.
  • Define detailed C# naming conventions, code style (LF, UTF-8, 4-space indent, Allman braces), and forbidden constructs like goto.
  • Specify performance-related practices for regex (GeneratedRegex) and native interop (LibraryImport, Span).
  • Describe lifecycle service, configuration system, testing, performance, security, and documentation best practices tailored to the project.
  • Set rules for AI-generated code usage, commit message format, branching strategy, and a pre-PR checklist for authors and reviewers.
AGENTS.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些总体反馈:

  • “工具和环境”部分中的工具和运行时版本与前面提到的 .NET 8 描述存在冲突(例如 .NET SDK 10.0、Rider 2025.3.2、VS 2026)。建议将这些版本与当前项目的实际要求保持一致,或者明确标注为示例。
  • 由于本指南的很多部分与通用项目规范(命名、提交信息、生命周期服务等)存在重复,建议显式引用或链接到权威的编码规范/wiki,并说明哪些内容是针对 AI 代理(AI agents)的特定要求,以减少今后各文档之间的偏差。
AI 代理提示词
Please address the comments from this code review:

## Overall Comments
- The tooling and runtime versions in the "工具和环境" section conflict with the earlier .NET 8 description (e.g., .NET SDK 10.0, Rider 2025.3.2, VS 2026), so it would be good to align these with the actual current project requirements or clearly mark them as examples.
- Since many parts of this guide duplicate general project rules (naming, commit messages, lifecycle services, etc.), consider explicitly referencing or linking to the canonical coding standards/wiki and clarifying which parts are AI-agent-specific to reduce future drift between documents.

Sourcery 对开源项目免费——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • The tooling and runtime versions in the "工具和环境" section conflict with the earlier .NET 8 description (e.g., .NET SDK 10.0, Rider 2025.3.2, VS 2026), so it would be good to align these with the actual current project requirements or clearly mark them as examples.
  • Since many parts of this guide duplicate general project rules (naming, commit messages, lifecycle services, etc.), consider explicitly referencing or linking to the canonical coding standards/wiki and clarifying which parts are AI-agent-specific to reduce future drift between documents.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The tooling and runtime versions in the "工具和环境" section conflict with the earlier .NET 8 description (e.g., .NET SDK 10.0, Rider 2025.3.2, VS 2026), so it would be good to align these with the actual current project requirements or clearly mark them as examples.
- Since many parts of this guide duplicate general project rules (naming, commit messages, lifecycle services, etc.), consider explicitly referencing or linking to the canonical coding standards/wiki and clarifying which parts are AI-agent-specific to reduce future drift between documents.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Pigeon0v0
Copy link
Copy Markdown
Contributor

PCL2-CE -> PCL-CE

Visual Basic 描述可以删了,现在已经全部杀光了😠

Comment thread AGENTS.md Outdated
@pcl-ce-automation pcl-ce-automation Bot added size: M PR 大小评估:中型 and removed size: L PR 大小评估:大型 labels May 30, 2026
Copy link
Copy Markdown
Member

@MoYuan-CN MoYuan-CN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

味道不对,等我晚点来 suggest

@tangge233 tangge233 requested a review from pynickle May 30, 2026 12:13
Copy link
Copy Markdown
Member

@LuLu-ling LuLu-ling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> 生命周期服务、IoC 依赖注入、配置项、编译时优化(GeneratedRegex/LibraryImport)等写法参考 wiki
Wiki 又不在代码仓库里,你这写了 AI 也读不到啊😰

@tangge233
Copy link
Copy Markdown
Contributor Author

tangge233 commented May 30, 2026

> 生命周期服务、IoC 依赖注入、配置项、编译时优化(GeneratedRegex/LibraryImport)等写法参考 wiki Wiki 又不在代码仓库里,你这写了 AI 也读不到啊😰

这个比较麻烦了,GitHub MCP 无法直接访问 Wiki,目前 API 相关的文档都在 Wiki 板块下。等之后把再把 API 文档迁移到仓库的 /docs 里吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M PR 大小评估:中型 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants