Skip to content

docs(agents): trim the guides, split the two largest, and fix stale claims - #1007

Merged
Ardnived merged 1 commit into
mainfrom
claude/docs-doctor-trim
Oct 20, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/docs-doctor-trim

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

  • Cuts what a tool call can rebuild from the agent guides; splits the two over 40k chars by scope.
  • Fixes 16 stale claims, each checked against the code. Docs-only, plus two comment repoints.

Change outline

Files — where each piece of guidance now loads

The two largest files were over the size where a guide stops being read whole. What applied to one directory moved to a nested guide there, with a CLAUDE.md symlink beside it. Every ⚠ line and "never" rule stays in the parent too.

 src/collections/AGENTS.md                58,620 → 31,734   # cross-collection rules only
+├── Events/AGENTS.md                              1,746   # `title`: a field a hook fills
+├── Lessons/AGENTS.md                             1,985   # per-locale title/panels, polymorphic `meditation`
+├── Meditations/AGENTS.md                           700   # single-locale documents
 src/fields/AGENTS.md                         137 → 2,626   # + schedule field, lastDate, rrule-temporal
 src/lib/richEditor/blocks/AGENTS.md        2,617 → 2,847   # + TextBoxBlock field notes
+src/plugins/formBuilder/AGENTS.md                 3,415   # what the wrapper does, per-intake slots
+src/plugins/login/AGENTS.md                       2,334   # routes, sign-in page, createSession
+src/jobs/CleanupOrphanedMedia/AGENTS.md           1,364   # schema introspection, parseInt pitfall
 docs/rules/access.md                      33,773 → 30,938   # + admin locale filtering

api-clients.md splits by its two paths: scopes, and keeps the name every citation of the usage half uses.

 docs/rules/api-clients.md                 50,014 → 29,965
-  paths: src/plugins/usage/**/*.ts, src/collections/Clients/Clients.ts
+  paths: src/plugins/usage/**/*.ts                  # auth, gates, counting, origin, rate limit, read contracts
+docs/rules/clients.md                              18,310
+  paths: src/collections/Clients/**/*.ts            # key, canonical ownership, verification, webUrl, mailing list
+.claude/rules/clients.md → ../../docs/rules/clients.md

Files — the trims

Package.json scripts, file listings, field inventories and JSDoc restated as tables, most of which had drifted from the code.

 AGENTS.md (always loaded)                 11,873 → 9,373
 tests/AGENTS.md                           30,802 → 23,262
 docs/rules/admin-ui.md                    32,334 → 26,004
 seeds/atlas/AGENTS.md                     31,976 → 30,058
 docs/architecture.md                      30,132 → 30,092

Contract — stale claims corrected

One line per claim, in the doc where it now lives.

 AGENTS.md
-  Use `/pr-prep`                                   # no SKILL.md exists
+  Run .claude/skills/pr-prep/check.sh — `leanGate`, which /workflow:finalize-pr runs
-  (why: docs/why.md#a-conflicted-pr-…)              # no docs/why.md here
+  (why: sydevs/claude-workflow docs/why.md#a-conflicted-pr-…)
 src/collections/Lessons/AGENTS.md
-  `meditation` accepts only type: 'lesson' meditations
+  polymorphic (meditations | videos | lectures); filterOptions scopes the meditations branch
 src/collections/AGENTS.md § Programmatic file upload
-  upload collections (Media, Frames, Files, tag collections)
+  Images, Frames, Files, UserChoices, SongTags, Songs, Meditations, Videos
 tests/AGENTS.md
-  custom hooks (`src/hooks/`)                      → src/collections/<Name>/hooks/
-  tests/int/schedule-hooks.int.spec.ts             → tests/unit/schedule-hooks.spec.ts
+  Integration lane also runs seeds/**/*.test.ts
 docs/rules/api-clients.md
-  registers two scheduled tasks                    → one, resetUsageTask
-  surfaces as `highUsageAlert`                     # no such field
+  crosses HIGH_USAGE_THRESHOLD: a high-usage day at the nightly reset; Sentry at the 1st and 10th
 docs/rules/admin-ui.md
-  .next/payload-component-map.json                 → src/app/(payload)/admin/importMap.js
-  Never hand-write `admin.hidden`
+  Never hand-write project visibility; a hand-written admin.hidden is composed (globals: overwritten)
 docs/rules/access.md § Permission flow
-  3 table lookup · 4 translate · 5 implicit read · 6 document-level
+  3 resolve roles · 4a implicit read · 4b table lookup + translate · 5 deny → document-level   # = permissions.ts
-  atlas-manager: create, update, delete on events and regions
+  events: create, update, delete · regions: create, update
 seeds/atlas/AGENTS.md
-  sydevs/AtlasReact, <syatlas-map>                 → sydevs/SahajAtlasWeb, <sahaj-atlas>
-  "the two custom endpoints below"                 # only one was below
+  GET /api/events/geojson (below) and POST /api/clients/report (docs/rules/clients.md)
-  the auto-fill only has the street
+  addressPlaceName prefers address.venueName, falls back to the street's first segment

Preview

Nothing to see in a running app. Markdown, two rule symlinks, and two code comments.

Test results

  • Doc guards: ✓ doc-citations, perf-figures-pinned, conflict-markers (3 files, 16 tests)
  • eslint + prettier --check on the two edited .ts files: ✓
  • Structural check over every touched doc: fences balanced, no empty section, every paths: glob matches files
  • Build: N/A

Notes for reviewer

  • clients.md loads for all of src/collections/Clients/**, not only Clients.ts, so it reaches the report and verify endpoints and the hooks it documents — the split plan's scope.
  • The seeds/atlas "Keep it when it names the venue" rule now reads against the venue-name auto-fill. Most of the ten kept titles restate their venue's name. Whether to blank them is a curation call this PR does not make.
  • Seen, not fixed (not on the stale list): tests/AGENTS.md still names a lecture-clips collection; docs/architecture.md describes usage tracking as trackUsage off afterRead.
Detail

Stale-item tally. Of 44 listed items: 16 fixed, 27 already cut by the trims, 1 not stale (/workflow:implement-ticket exists on the plugin's main). Two fixes landed in a line other than the one listed, because the same wrong claim survived there: atlas-manager regions delete (§ Region-subtree write scoping) and the usage-monitoring alert sentence.

What stays in the parent. All three Login ⚠ bullets and the appends bullet, the Form Builder per-intake ⚠, the schema-introspection locale: 'all' ⚠, and the wisdomStyle ⚠ are in both places. The "supplying validate replaces the default" rule moved out of the Events section into Conditional validation, because UserSubmissions/fields.ts and Events.ts cite it for non-Events fields.

Repointed citations. eventQuality.ts (computeLastDate → src/fields/AGENTS.md), nonEmptySlug.ts (Events title → src/collections/Events/AGENTS.md), DEPLOYMENT.md (Routing → clients.md, and a new entry in its doc list), access.md and storage.md (mailing list, embed verification → clients.md).

🤖 Generated with Claude Code

…laims

The agent guides had grown to restate what a tool call can rebuild —
package.json scripts, file listings, field inventories copied from the
collection configs, JSDoc restated as tables — and most of those copies
had already drifted from the code. The approved trims cut them, keeping
every ⚠ line, every "never" rule and every repo convention.

Two files stayed over the size where a guide stops being read whole, so
they are split along the scope each section already had:

- `src/collections/AGENTS.md` keeps the cross-collection rules. What
  belongs to one directory moved to a nested guide there, with the
  `CLAUDE.md` symlink beside it: Events (`title`), Lessons, Meditations,
  `src/plugins/formBuilder`, `src/plugins/login`,
  `src/jobs/CleanupOrphanedMedia`, the schedule field (`src/fields/`), a
  page-block note (`src/lib/richEditor/blocks/`), and admin locale
  filtering (`docs/rules/access.md`). Each ⚠ line stays in the parent as
  well, and the "supplying `validate` replaces the default" rule that
  code comments cite was lifted out of the Events section, since it is
  not about Events.
- `docs/rules/api-clients.md` split by its two `paths:` scopes. The
  `clients` record — key, canonical ownership, embed verification,
  per-region `webUrl`, mailing list — is now `docs/rules/clients.md`,
  scoped to `src/collections/Clients/**` so it also loads for the report
  and verify endpoints and the hooks it documents. The usage-plugin half
  keeps the name every citation uses.

Stale claims, each checked against the code first:

- Root: `/pr-prep` has no SKILL.md; the gate is `check.sh`, the
  `leanGate` that `/workflow:finalize-pr` runs. The why-anchor lives in
  sydevs/claude-workflow, not here.
- Collections: Lessons `meditation` is polymorphic and `filterOptions`
  scopes only its meditations branch; the upload collections are named
  as they are (`Media` is gone).
- Tests: no `src/hooks/`; `schedule-hooks` is a unit spec; the
  integration lane also runs `seeds/**/*.test.ts`.
- api-clients: one scheduled task, not two; no `highUsageAlert` exists,
  so the high-usage signal is described as the reset task computes it.
- admin-ui: the import map is `src/app/(payload)/admin/importMap.js`;
  `accessPlugin` composes a hand-written `admin.hidden`, so the rule is
  "never hand-write project visibility".
- access: the permission flow now follows the step numbers in
  `permissions.ts`, which other comments cite as "step 4a"; atlas
  managers get no delete on regions.
- seeds/atlas: the widget is SahajAtlasWeb's `<sahaj-atlas>`; it calls
  two custom endpoints; the auto-title now prefers the venue name.

Citations of moved text are repointed: two code comments
(`eventQuality.ts`, `nonEmptySlug.ts`), DEPLOYMENT.md, and the
access/storage rules. No executable code changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app

railway-app Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1007 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Oct 20, 2026 at 11:19 pm UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1007 October 20, 2026 23:17 Destroyed
@Ardnived
Ardnived marked this pull request as ready for review October 20, 2026 23:19
@Ardnived
Ardnived merged commit f886f26 into main Oct 20, 2026
8 of 9 checks passed
@Ardnived
Ardnived deleted the claude/docs-doctor-trim branch October 20, 2026 23:19
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Oct 20, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

I could not request a reviewer here, so this is the step left for you.

  • request a reviewer — GitHub said: Review cannot be requested from pull request author. - https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request

🤖 sydevs dispatcher

sydevs-bot pushed a commit that referenced this pull request Oct 20, 2026
Both conflicts are the same shape: #1007 trimmed the guides while this
branch only counted its new spec in the tier figures. Took the trimmed
text and carried the branch's 205 / 2656 into it.

AGENTS.md keeps #1007's single test:unit bullet, not the seven-command
list it replaced. tests/AGENTS.md keeps #1007's Integration row, which
adds seeds/**/*.test.ts and names vitest.config.mts.

perf-figures-pinned.spec.ts is what holds the counts together, and it
passes: the lane is 205 files / 2656 tests, stated the same in PERF.md
and all four consumer docs.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XgogFLEgfauFDEdJD6HRRh
sydevs-bot pushed a commit that referenced this pull request Oct 20, 2026
…tion-locale-writes

#1007 split the two largest guides, moving the Meditations locale section
out of src/collections/AGENTS.md and into src/collections/Meditations/AGENTS.md.
This branch had extended that section in its old home with the write-scoping
bullet, so the two edits landed on the same lines.

Took main's split in src/collections/AGENTS.md and carried the bullet into the
new guide, keeping both: the detail lives where #1007 put it, and the #980
breadcrumb survives. The rest of the section was identical on both sides.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FvDwu8xnNo1TkZgFVBVXgi
sydevs-bot pushed a commit that referenced this pull request Oct 20, 2026
#1007 trimmed the agent guides, split the two largest, and fixed stale
claims. Seven markdown files conflicted.

Six of them this branch touches only in 3b05cad, the pure `prettier --write`
commit, so each took main's content and was re-formatted rather than merged
hunk by hunk:

- docs/rules/access.md, admin-ui.md, api-clients.md
- seeds/atlas/AGENTS.md, src/collections/AGENTS.md, tests/AGENTS.md

AGENTS.md needed a judgement call. #1007 deleted both passages this branch
had edited — the Essential Commands list and the CI job description — as
copies of what a tool call can rebuild. Those deletions stand: the formatting
gate is recorded in docs/rules/testing-reqs.md, which the same section already
points at, and that file is unconflicted here. Two facts are re-applied on top
of main's text, because neither is derivable from package.json:

- one bullet that `pnpm lint` checks no formatting and CI gates both
- the `--full` correction, since that flag misses Tier 3 until the attended
  `check.sh` edit in #1006 lands

docs/rules/clients.md is new in #1007 and auto-merged unformatted, which this
branch's `format:check` step would have failed on. It is formatted here.

Across all 28 files #1007 touched, the merged content is byte-for-byte
`prettier(main's version)` — 20 files, plus 7 symlinks unchanged from main —
with AGENTS.md the only exception, and it is that plus the two items above.

Lean gate green: 204 files, 2653 tests. `prettier --check .` clean over the
tree.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013HY7PTfTDxfB9ARZKkChG4
sydevs-bot pushed a commit that referenced this pull request Oct 20, 2026
#1007 split the Form Builder section out of src/collections/AGENTS.md into
src/plugins/formBuilder/AGENTS.md, leaving a pointer; this branch had added
a bullet to that section in place. Both are kept: the pointer stands, and
the #981 bullet moves to the section's new home.

The bullet's reference to #977's `lessons.title` rule, and the same
breadcrumb in src/collections/Forms/fields.ts, now name
src/collections/Lessons/AGENTS.md — #1007 moved the reason there.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GJv9myYNG1F1pVEGZ2Hn57
sydevs-bot pushed a commit that referenced this pull request Oct 20, 2026
#1007 moved the per-block field notes out of `src/collections/AGENTS.md`
into `src/lib/richEditor/blocks/AGENTS.md`, keeping only the `⚠` bullet
reporting #989. This branch fixes #989, so that bullet is now false in
both files it landed in: the condition reads `imagePosition`, and the
checkbox renders.

Took main's structure — the block table stays moved, not restored — and
dropped the stale warning. `blocks/AGENTS.md` keeps the field note in the
shape of its `textColor` twin, with the #989 breadcrumb and the reason
`position` is the wrong name.

#994's new `perf-figures-pinned` spec then went red on a conflict no
textual hunk shows: it pins `tests/PERF.md`'s spec count to the files on
disk, and this branch adds the 205th. PERF.md records the current tree's
counts by its own rule, so it and the four consumer docs move together,
as that spec requires.

Lean gate green: lint, typecheck, typecheck:tests, 2657 tests across 205
files. `tests/int/translations-field.int.spec.ts` 26 passed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMsfQPCwjEaRYV2sLpaeP9
sydevs-bot pushed a commit that referenced this pull request Oct 20, 2026
Main's #1007 trimmed the agent guides; this branch extends two of the files
it trimmed. Three hunks, resolved toward both sides:

- `docs/rules/access.md`: took #1007's removal of the manager-role table, a
  config copy it cut deliberately. The dropped `atlas-manager` row carried
  one thing the config does not show — that `imports: create` is also what
  keeps the collection's admin pages visible — so that moved onto the
  `imports` paragraph, which already owns the collection's access block.
- `docs/rules/admin-ui.md`: took #1007's trim of the `@payloadcms/ui` table
  and of the custom-field paragraph. `ProgressBar` is exported, so the
  warning below the table no longer had a curated list to be absent from;
  it now names what the component actually is.
- `docs/rules/admin-ui.md`: kept the `WorkflowButtons` section. It documents
  `src/components/admin/WorkflowButtons/`, which only this branch carries,
  so #1007 never saw it.

`tests/PERF.md` needed a count, not a resolution. #994 recorded 204 unit
specs and #990's spec pins that figure to the tree, so the merged tree's 215
files and 2783 tests reddened it with neither side wrong. Re-recorded the two
counts, and the three consumer docs that restate them. Timings are untouched:
PERF.md keeps each one with the session that measured it.

Lean gate green: lint, typecheck, typecheck:tests, 215 unit files / 2783
tests, in 83 s.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012KhBAi8xKwJspy75uAvmDV
Ardnived added a commit that referenced this pull request Oct 20, 2026
#1007 cut the maxLength trap that this section called "above", and kept
only the general "supplying validate replaces the default" rule. The
section is now a single warning on that rule, pointing to targetRegion.ts,
whose docblock already carries the detail. This puts src/collections/AGENTS.md
back under 32k characters (33,124 to 31,993).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot pushed a commit that referenced this pull request Oct 20, 2026
Eight files conflicted, all the same shape: this branch holds prettier's
rendering of the old text, while main (#912, #1007) rewrote the text itself.
Every hunk takes main's content and re-runs the formatter over it, so both
intents survive.

AGENTS.md is the one hunk where both sides wrote: main re-measured the unit
lane at 215 files, this branch documents `pnpm format:check`. Both lines kept.

Three specs #912 added had never been formatted, so `pnpm format:check` —
the gate this PR adds — went red on the merge. Formatted.

`pnpm generate:types` leaves src/payload-types.ts clean after the merge, so
the mechanical merge of that generated file is exactly what the generator
emits.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WqKhuaJ8J1h2442YHUbzgm

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1007 — e347733c Deployed Oct 20, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants