Skip to content

docs(agents): keep only what is necessary — metadata-application principle first, rules not narratives, no inventories; add CLAUDE.md pointer; correct the two *.workflow.ts briefs - #1830

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-1823-agents-md-necessary-only
Sep 9, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/issue-1823-agents-md-necessary-only

Conversation

@os-justin

@os-justin os-justin commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1823
Fixes #1745
Fixes #1620
Fixes #1618
Fixes #1818
Fixes #1681

Maintainer direct instruction to the skills seat, 2026-09-09, verbatim and untranslated:

「看一下 hotcrm 的agents.md 写的太乱了。只留下必要的。包括同时同时审核 hotcrm 的skills 任务,合并派发处理。」

「首先要明确 hotcrm 是元数据应用,平台功能应该在 objectstack中开发。 其次 claude.md 是不是直接让他阅读 agents.md 即可,没必要维护两套。所有仓库都有类似的问题」

One fold of six cards, landing as one rewrite of AGENTS.md, one new root CLAUDE.md, and #1818's two brief sites (its own commit, 0f446c1). Governed surface (AGENTS.md, CLAUDE.md, .github/instructions/**; .github/tasks/** treated as governed) — this PR stays a draft for the maintainer's own merge; skip-changeset applied (nothing shipped to users moves: the repo is private: true with no files[]).

Line budget (measured at 0f446c1): AGENTS.md 651 → 248 lines (a 61% cut; budget ≤ 250). CLAUDE.md 6 lines. .github/instructions/automation.md 64 → 46 lines; .github/tasks/autonomous_feature_dev.md unchanged at 23 lines, one line rewritten.

维护者速读(草稿)

改了什么

被移除的每一节的去向:

旧节 处置
🗣️ 沟通语言 规则保留于 🗣️ 沟通语言(压缩为一段双语)
🏗️ Project Architecture(目录树 + 退役 packages/ 说明) 规则保留于 🏗️ Project Architecture;目录树保留(test/docs-src-tree-paths.test.ts 解析它)
💻 Tech Stack 1 Metadata-First(含 crm_ 长段) 规则保留于 Tech Stack 1–2
💻 Tech Stack 2 ObjectQL(where/filter 度量叙事、「Superseded」段、「Measured … (17.2.0)」、flow/page 的 filter 形态) 规则保留于 Tech Stack 3 两条要点;度量记录、被取代主张的历史、「(17.2.0)」现在时 pin 声明:叙事,删除
💻 Tech Stack 3 AI-Native 规则保留于 Tech Stack 4(并入 skills-only、⛔ *.agent.ts)
🧠 Autonomous Iteration Protocol(三阶段) 叙事,删除(其清单项已由 Tech Stack 与 Schema Validation 覆盖)
📝 Coding Standards(File Suffix Protocol:Core + Extended 12 项) 手抄清单,删除(#1745);邻居文件规则与三种形态保留于 🔒 Schema Validation Requirements
🔒 Schema Validation Requirements(三形态、执行点、bogusUnknownKey 度量记录、barrel、parse()、「无实例」名册、workflow 说明) 规则保留于同名章;bogusUnknownKey 记录与「无实例」名册:叙事/清单,删除
🏷️ Field Type Guidance(两张表) 规则保留为一张表
🧩 Metadata semantics 7–11 + 逃生仓裁决(含先例引用块) 规则保留(裁决原文保留);先例名册缩为每条一个引用
🚀 Development Workflow 叙事,删除(与后缀规则重复)
⚠️ Constraint Checklist(含「Supersedes」尾注、Tone、No Engine Code、ADR-0048 命名注记) 五条规则保留;「Supersedes」尾注、Tone、命名注记历史:删除;No Engine Code 并入 Architecture;ADR-0048「advisory、勿批量改名」保留为 Tech Stack 2 的一句
Validation predicates must be TOTAL(含 rc.1/rc.2 日志块) 规则保留于同名节,两行 has() 表保留;日志记录删除
Documentation discipline 5(漂移计数 + 名册) 规则保留;计数与名册删除(#1620),保留一个引用
Documentation discipline 6 规则保留并按真实宽度改写(#1618)
⬆️ Platform Upgrades 1–4 + 「merged 不等于可用」注 规则保留 1–4 并压缩,新增第 5 步(#1681);该注并入 Scope 规则 2
🚫 Scope 1–4(先例名册)+ Out of scope 清单 + Focus Area 规则保留为开篇章;先例名册缩为每条一个引用;Out of scope 清单并入规则 1 的一句
⚖️ Ruling discipline 12 规则保留
✅ Verify before opening a PR(「Supersedes」尾注、ADR-0021 轴说明) 规则保留;尾注删除;ADR-0021 缩为一句
Every PR carries a changeset 规则保留
How a green PR lands(裁决引用块:#1742 / #1233 / #1815 与 #1798 的来龙去脉) 规则保留于同名节;裁决历史删除,留一个引用
Verifying UI in the browser(规则 + 图表类型清单 + Origin 轶事) 规则保留为三步;图表类型清单与来源轶事删除
Other browser-verify gotchas 三条保留为一段

为什么改

维护者 2026-09-09 直接指示:agents.md 太乱,只留必要的;claude.md 直接让读 agents.md,不维护两套。651 行的指令文件里,度量记录和历史叙事让真正的规则难以被 AI 读到;手抄清单已被本仓自己的卡片证明会双向漂移(#1745:12 个后缀 4 个零实例、8 个真实后缀未列)。

风险与代价(含回滚)

  • 风险:删掉的叙事里可能有某条对某个读者仍是负担性的。已对树实测:读取 AGENTS.md 的三个测试(zh-Hant 理由、目录树、角色层级词表)与 docs/MAINTENANCE.md、CONTRIBUTING.md、docs/architecture/module-split-plan.md 引用的节名全部保留并复跑绿。
  • 代价:只有一份文件;CLAUDE.md 不再有任何摘要,只读 CLAUDE.md 的会话在读到指针之前没有规则(本仓无 hooks 作底,这是 objectstack#17161 已记录的已知成本)。
  • 回滚:整个 PR 是三个文件的纯文档改动,git revert 两个提交即可,无数据、无元数据、无发布物变动。

席位意见

(留空,席位定稿成评论。)

你要做的

  1. 读一遍新的 AGENTS.md(248 行),确认「只留下必要的」的取舍符合你的意图,尤其是上表中标「删除」的项。
  2. 确认 skip-changeset 对本 PR 成立(此前同类 AGENTS.md PR 用的是空 frontmatter changeset,两者门禁等价)。
  3. 合并(治理面,人工合并)。

Per-member acceptance

Acceptance notes

Gates run locally (all at 0f446c1, docs-only diff):

  • pnpm hygiene — exit 0, ✓ source hygiene clean (its byte scan reads AGENTS.md via ROOT_TEXT_FILES).
  • pnpm validate — exit 0, ✓ Validation passed, Data: 18 Objects 331 Fields, Runtime: 0 plugins (unchanged; nothing under src/ moves).
  • Targeted vitest under the shared verify lock — the five suites that read AGENTS.md (docs-zh-hant-justification, docs-src-tree-paths, docs-role-hierarchy, docs-declared-versions, docs-object-coverage): Test Files 5 passed (5), Tests 80 passed (80), VERDICT command-exit 0. One red on the first run — my own wording "subordinate to this one" tripped the role-hierarchy vocabulary guard — fixed before commit.
  • Control-byte self-scan of the four changed files: no hits.
  • Narrowing declared: pnpm verify in full was not run (typecheck / lint / build / the whole test suite read src/ and test/, which this diff does not touch; the three suites that parse AGENTS.md plus two that cite it ran). link-check — NOT MEASURED locally: markdown-link-check is not installed in this container and the workflow's action is not runnable here; CI runs it on this PR (the diff carries .md). The only links in the new files are relative (./AGENTS.md, docs/README.md, docs/archive/) and the release-notes URL kept from the old file.

External readers of section names, kept: docs/MAINTENANCE.md cites "§⬆️ Platform Upgrades step 4" (step 4 is still the changeset step) and "Verifying UI in the browser"; CONTRIBUTING.md cites "§How a green PR lands"; docs/architecture/module-split-plan.md cites "A platform defect means you WAIT for the platform fix", "Do not build platform-level tooling", "Documentation discipline item 5", "Project Architecture", "Platform Upgrades"; src/** comments cite "house rule 9", "metadata rule 8", "scope rule 3", "Validation predicates must be TOTAL", "Constraint Checklist → Dependencies" — all headings and rule numbers unchanged. test/docs-zh-hant-justification.test.ts parses the zh-Hant bullet by its opening text — kept byte-identical; test/docs-src-tree-paths.test.ts requires the file to draw a src/ tree — kept, every drawn directory exists.

Overlap of the other .github/instructions/*.md with AGENTS.md (reported, not edited — outside this fold's surface):

Findings filed / noted: filed as #1832 — the remaining briefs (security.md, metadata.md §3, ui.md, automation.md §3) teaching forms the app authors nowhere or the spec rejects, same class as #1818; filed as #1833 (Blocked-by: #1830) — CLAUDE.md is a new root text file outside scripts/lib/source-hygiene-surface.mjs ROOT_TEXT_FILES, so the hygiene byte scan does not read it — that list's own comment says a new first-class root file must be added there; not done in this PR because it is a gate-surface edit outside the declared file surface. Noted, not filed (承接者: whoever takes #1819): src/objects/index.ts's header comment still mentions *.state.ts state machines "auto-associated by naming convention" — 0 such files exist.

Changeset: skip-changeset label (ruling C). Precedent: PR #1820 / #1798 used an empty-frontmatter changeset for the same "AGENTS.md only" case; the workflow treats the two as equivalent.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01MoTv7pn338AZ71owsp19gQ


Generated by Claude Code

Rewrite AGENTS.md top-down from the necessity test: the metadata-application
principle and the four Scope rules open the file; every kept rule is one to
three lines with its failure mode; measurement transcripts, superseded-claim
histories, origin anecdotes and precedent rosters leave; hand-copied
inventories (the 12-suffix File Suffix Protocol, rule 5's own drift tally, the
chart-type list) are replaced by the neighbour-file rule and pointers at
src/{type}/. Rule 6 now states its real width (list view names take the pack
wording; other pack-carried nouns keep English, the tile guard's ablation is
the discriminator). Platform Upgrades gains step 5 (re-scope, never renumber;
version-agnostic, cross-line, identifiers and labels; hits are candidates;
honest about what a grep cannot see). 651 lines -> 248.

CLAUDE.md is a pointer to AGENTS.md and nothing else, modelled on
.github/copilot-instructions.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MoTv7pn338AZ71owsp19gQ
…surviving sites

.github/instructions/automation.md section 1 and
.github/tasks/autonomous_feature_dev.md step 4 taught a workflow metadata
type no installed @objectstack/* package defines (WorkflowRuleSchema: 0 files
under node_modules/@objectstack; control FlowSchema: 34). Both now route the
reader to the three real destinations AGENTS.md names, mirroring its wording,
and the automation example that also dropped the crm_ prefix is gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MoTv7pn338AZ71owsp19gQ
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Sep 9, 2026 2:23pm UTC

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci/cd CI plumbing and the verification pipeline labels Sep 9, 2026
@os-justin os-justin added the skip-changeset PR ships nothing to users (pure CI/docs chore) — changeset gate waived label Sep 9, 2026 — with Claude
This was referenced Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

维护者速读 — hotcrm PR #1830(#1823 折叠 #1745 #1620 #1618 #1818 #1681,skills 席终稿,2026-09-09T14:30Z)

改了什么 — AGENTS.md 651 行重写为 248 行(削 61%):你的两句裁决原文开篇(「hotcrm 是元数据应用,平台功能应该在 objectstack中开发」+ 8/31 那句),🚫 Scope 四条成为第一章;其后每条规则只留一到三行「规则 + 失败形态」,度量记录、「本文件曾说」历史、来源轶事、Supersedes 尾注、先例名册全部移出(每条最多留一个卡号);手抄清单全删(12 后缀名册 #1745、规则 5 的漂移计数与名册 #1620、图表类型表、crm_ 名册史),改为「照邻居文件写、三种编写形态、看 src/{type}/」;规则 6 改成真实宽度(#1618:只有列表视图名取语言包措辞,其它语言包也带的名词保持英文,判据是守卫的消融);升级章加第 5 步两行(#1681);两处 *.workflow.ts 简报改正(#1818);新增 6 行 CLAUDE.md 只指向 AGENTS.md。PR 正文附「每一旧节的去向」表(规则留在哪 / 叙事删除),供你逐行核。⛔ 未动:.github/tasks/new-package.md(#1819 在你的决策箱)。

为什么改 — 你的直接指示:agents.md 太乱,只留必要的;claude.md 直接让读 agents.md,不维护两套;并同时把 hotcrm 的指令面任务合并派发。651 行里叙事与手抄清单淹没规则,而清单已被本仓自己的卡证明会双向漂移。

风险与代价(含回滚) — 删掉的叙事里若有对某个读者负担性的句子:dev 实测读 AGENTS.md 的五个测试套件 80/80 绿,docs/MAINTENANCE.md 等引用的节名都保留;pnpm validate 不变(18 对象 / 331 字段 / 0 插件)。已知代价:本仓无 hooks 托底,只读 CLAUDE.md 的会话在读到指针前没有规则(程序卡 objectstack#17161 已记录)。一处判断需你留意:hotcrm 席此前对 #1620 的分诊要求「保留并扩充规则 5 的漂移名册」,本 PR 按你后来的「只留下必要的」删掉了名册、留一个引用——维护者裁决优先于席位分诊,写在 PR 的 #1620 验收行。回滚 = revert 两个提交。

席位意见 — 接受。本席在分支头通读了新 248 行:第一原则开篇、七条裁决逐条成立、无手抄清单、目录树因 test/docs-src-tree-paths.test.ts 解析它而保留并说明;*.workflow.ts 教学点残留 0;merge-tree 干净;控制字节 0;CI 7 绿 / 1 跳过 / 0 红(全部完成)。dev 顺手立了两张卡交 hotcrm 席分诊:#1832(另外四处 .github/instructions 章节教不存在的形态)、#1833(新 CLAUDE.md 不在 hygiene 扫描根列表,一行修复,等本 PR 合并)。

你要做的 — 读一遍新 AGENTS.md(248 行)与「去向表」里标「删除」的项;认可 #1620 名册删除;skip-changeset 对本 PR 成立(同类前例用空 frontmatter changeset,门禁等价);人工合并(受管面,席位不翻 ready、不入队、不挂 auto-merge)。


Generated by Claude Code

@os-justin os-justin added the needs-user-decision Needs the maintainer's call before work proceeds label Sep 9, 2026 — with Claude
@os-zhuang
os-zhuang marked this pull request as ready for review September 9, 2026 15:32
@os-zhuang
os-zhuang added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit 06b9bb3 Sep 9, 2026
10 of 11 checks passed
os-steve pushed a commit that referenced this pull request Sep 10, 2026
`CLAUDE.md` landed at the repo root in PR #1830 and outside `ROOT_TEXT_FILES`,
the whitelist the source hygiene gate reads the root through. Measured on
`62e23f5`: a raw 0x01 planted in `CLAUDE.md` leaves `pnpm hygiene` at exit 0
with "no raw control bytes in first-party files"; with the entry added the same
tree exits 1 and names `CLAUDE.md` by path.

One entry, alphabetically between `CHANGELOG.md` and `CONTRIBUTING.md`. No test
edit: #1314 made the three sandbox suites import this list, so the fixtures, the
banner assertion (`ROOT_TEXT_FILES.length`) and the per-file `it.each` all
follow it (53 tests to 54).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DuzfS5chho38Yx1jxx9DEj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline documentation Improvements or additions to documentation needs-user-decision Needs the maintainer's call before work proceeds skip-changeset PR ships nothing to users (pure CI/docs chore) — changeset gate waived

Projects

None yet

3 participants