Repository navigation
docs: move agent doc narrative to on-demand docs - #253
Merged
Merged
Conversation
The nested CLAUDE.md files load each time an agent reads a file in their folder. A web and core task loaded about 68 KB before work started. Long explanation filled most of it, and some rules were in a file that does not load for the code that they are about. Move the authorization matrix, the targets, the notifications, the REST pipeline, the CLI release, the display preferences and the stale-chunk reload to docs/domains, and keep a short rule list in each CLAUDE.md. Move the REST pipeline rules from apps/cli to apps/web, where server/api-route.ts lives. Fix the claim that apps/web has no tests. Add apps/mobile/CLAUDE.md with the platform design rule and the API compatibility rule.
The mobile compatibility rule was only in apps/mobile, but the response shapes live in packages/core/src/api and packages/api-client. Add the rule to core and those paths to the mobile.md row. Name the workspace of the paths that two workspaces could own, add the instance settings to the deployment.md row, and fix a paragraph that rendered inside a list item.
The new text said that every api/v1 route runs the api-route pipeline. Fourteen route files do not use apiRoute or userApiRoute, for example meta, openapi.json and me/devices, so an agent could assume a guard that is not there. Say which routes use the pipeline, and write the full path of github-client.ts and theme.ts, which another workspace also has.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A nested
CLAUDE.mdloads each time that an agent reads a file in its folder. A task inapps/webandpackages/coreloaded about 68 KB of instructions before work started. Long explanation filled most of that text. Some rules were in a file that does not load for the code that they are about. One fact was out of date.Changes
Stale facts:
packages/core/CLAUDE.mdandapps/cli/CLAUDE.mdsaid thatapps/webhas no tests. It has abun testsuite, andserver/*.test.tsdrive the real REST route handlers.docs/plans/, and three of the nestedCLAUDE.mdfiles.Misplaced rules:
apps/cli/CLAUDE.md. They are aboutapps/web/src/server/api-route.ts, so they did not load for an edit there. They are now inapps/web/CLAUDE.md, with the full text indocs/domains/rest-api.md.listMembersandlistRangegotchas moved from the root topackages/core/CLAUDE.md. The root keeps one line for each.bearerplugin stays off" rule now also has a line inpackages/core/CLAUDE.md, besideauth/index.ts.Narrative moved to on-demand docs (verbatim). Each
CLAUDE.mdkeeps a short list of rules and a pointer:docs/domains/authorization.mddocs/domains/compliance.mddocs/domains/notifications.mddocs/domains/rest-api.mddocs/domains/cli-distribution.mddocs/domains/display.mddocs/domains/deployment.md, new last sectiontools/oxlint/README.mdEach new doc has a row in the root table, with the files that should make an agent read it.
Removed:
organization_id, the services with noCtx, andPersonCtx.New file:
apps/mobile/CLAUDE.md(and itsAGENTS.mdsymlink). It holds the platform design rule (Android M3 Expressive, iOS HIG), the API compatibility rule for the published app, the three timezone test runs, and pointers to the README anddocs/domains/mobile.md.Size
CLAUDE.mdpackages/core/CLAUDE.mdapps/web/CLAUDE.mdapps/cli/CLAUDE.mdapps/mobile/CLAUDE.mdA task in
apps/webandpackages/corenow loads 52.1 KB, not 68.4 KB.Review fixes
packages/core/CLAUDE.md, besidesrc/api/. Themobile.mdrow namespackages/api-clientandpackages/core/src/api/.deployment.mdrow names the instance settings again.day-marks.ts,targets.tsx,github-public.ts,github-client.ts,theme.ts).api/v1route runsapi-route.ts. Fourteen route files do not use it, for examplemeta,openapi[.]jsonandme/devices.notifications.mdrendered inside a list item. It now has a blank line before it.Checks
bun run checkpasses. No code changed.