Commit contributor instructions for AI coding agents (AGENTS.md and skills)

未關閉
#741 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
文件
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
php

研究方向

Start by checking the repository’s release branches, milestone mapping, test and tooling commands, and existing contributor guidance; the issue names the target branch as 3.2.x and the files to add: AGENTS.md, CLAUDE.md, .agents/skills/, .gitattributes, .gitignore, and CONTRIBUTING.md. Draft the instructions from those repository facts and validate each skill with skills-ref validate. Done means the acceptance criteria pass, including confirming git archive omits the agent files.

由索引模型根據 Issue 內容生成。

描述

enhancement

Summary

Commit instructions for AI coding agents that work on this repository: an AGENTS.md with the rules every change must follow, and Agent Skills in .agents/skills/ for the multi-step workflows (ticket, pull request, merge-up, release). Today these rules exist only in maintainers' local setups, so contributors' agents (Claude Code, Codex, Copilot, Cursor, Gemini CLI) do not know them.

Why

  • Contributors increasingly work with coding agents. Without repository instructions, the agents guess the branch, the test commands, the changelog and PR format, and the release-line rules, and reviews repeat the same corrections.
  • AGENTS.md is the open format read by most agents and stewarded by the Agentic AI Foundation (Linux Foundation). Agent Skills is the open format for task-specific instructions that load only when needed.
  • Other PHP projects already do this: Symfony commits contributor skills (merge-up, pr-authoring, bug-triage, ...) in .agents/skills/ on every maintained branch; TYPO3 keeps one AGENTS.md and a CLAUDE.md that imports it; php-src and laravel/laravel commit AGENTS.md.
  • Targeting 3.2.x puts the files on the line where work happens now; the merge-up brings them to master.

Scope

  1. AGENTS.md at the repository root, written by hand, short, and limited to what changes what an agent does:
    • Commands first, with flags: tests (single file, filter, full suite with coverage), PHP-CS-Fixer, PHPStan, Rector.
    • Facts an agent cannot infer: release lines (X.Y.x per minor, master is the next minor), which milestone targets which branch, fixes go to the oldest affected line and reach the newer ones by merge-up; PHP minimum per line.
    • Architecture invariants that are easy to break (app boot and runtime pipelines, stages and their events, AppContext/Di, the factory, adapter and helper pattern, config lookup and package defaults, helper files in composer.json autoload.files), as rules, not a tour of the code.
    • Style that the tools do not enforce: use order, file docblock, declare(strict_types=1), named static constructors for exceptions with messages in Enums/ExceptionMessages.php.
    • Testing: tests mirror src/, a test for a bug fails without the fix, fixtures in tests/_root, plain setUp/tearDown.
    • Boundaries in three tiers: always (run the checks, update CHANGELOG.md, keep a fix minimal), ask first (commit, push, PR, issue or comment, a new class or public API, a breaking change, changes to long-lived branches or tags), never (commit secrets, force-push or delete a release line, add tool attribution to PRs).
    • Commit and PR format: [#n] Subject, PR body with Closes #n, What, Why, Changed paths and Testing (only what CI cannot show).
    • One line per skill saying when to use it.
  2. CLAUDE.md that imports AGENTS.md (@AGENTS.md) and lists each skill with its path, because Claude Code does not read .agents/skills/. Nothing else, so all agents get the same rules. Facts only the maintainer needs (local clone paths, the rule about the maintainer's uncommitted files) go into the uncommitted CLAUDE.local.md, not into the committed files.
  3. .agents/skills/, each skill valid against the Agent Skills specification (name equal to the folder name, a description that says when to use it, SKILL.md under 500 lines, details in references/), prefixed quantum- so they do not clash with users' own skills:
    • quantum-ticket: from issue to finished branch: pick the base branch from the milestone, branch naming, plan with checkpoints, tests first (fail without the change, pass after), the checks, changelog, code review; the plan's docs check and starter-project check, and the order core, then project, then docs (follow-up tickets in quantum-php/project and quantum-php/docs).
    • quantum-pull-request: PR title and body format, linking the issue, answering review comments, what goes into Testing.
    • quantum-merge-up (maintainers): merge each release line into the next, from the oldest to master; PR title and body format; where Closes lines go.
    • quantum-release (maintainers): changelog date, release order across framework, starter project and docs, cleanup after the release.
    • Scripts, if any, in PHP so they run on every platform.
  4. .gitattributes: export-ignore for AGENTS.md, CLAUDE.md and .agents/, so contributor files do not ship in the Composer package.
  5. .gitignore: CLAUDE.local.md and AGENTS.override.md, the personal, uncommitted instruction files of Claude Code and Codex.
  6. CONTRIBUTING.md: one paragraph pointing contributors and their agents to AGENTS.md.

Not in scope

  • Skills for people building applications with Quantum (#740).
  • Agent instructions for quantum-php/project and quantum-php/docs (separate tickets in those repositories).
  • Changes to framework code.

Notes

  • AGENTS.md and skills are instructions that agents execute. Changes to them are reviewed like code.
  • No changelog entry: nothing changes for framework users.
  • AGENTS.md is loaded into every session, so it stays short (about 100 lines); everything only some tasks need goes into a skill.
  • Maintainers who keep local, untracked AGENTS.md/CLAUDE.md (for example listed in .git/info/exclude) must move them aside before checking out the branch, or Git refuses to overwrite them.

Acceptance criteria

  • AGENTS.md, CLAUDE.md and .agents/skills/ are in the repository and absent from the Composer archive (git archive does not contain them).
  • Each skill passes the Agent Skills validator (skills-ref validate).
  • A Claude Code session and a Codex session on a fresh clone both follow the rules: asked to start an issue, they pick the right base branch from the milestone, write the test first, and propose (not make) the commit.
主要語言
PHP
星號
44
分支
22
平均合併
2 小時 49 分鐘
30 天內合併 PR
61

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

quantum-php/framework 的其他 Issue

查看 quantum-php/framework 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。