Restructure agent documentation into hub-and-spoke architecture#2713
Open
Restructure agent documentation into hub-and-spoke architecture#2713
Conversation
4e1c5a3 to
7ef0260
Compare
iadjivon
previously approved these changes
Mar 27, 2026
63076c7 to
47243bf
Compare
6472421 to
dcd1836
Compare
Replace the monolithic AGENTS.md + CLAUDE.md (510 lines, significant duplication) with a lean entry-point (AGENTS.md, 79 lines) linking to 5 focused docs: - docs/ARCHITECTURE.md — module boundaries, data flow, message bus patterns (.context vs .payload), scope semantics, error handling, thread safety - docs/CONVENTIONS.md — lint rules, UIApplication.dd.managedShared pattern, required_reason_api_name banned symbols, commit/PR format - docs/DEVELOPMENT.md — step-by-step recipes for adding features, RUM commands, context providers, and instrumentations - docs/TESTING.md — mock infrastructure (DatadogCoreProxy vs PassthroughCoreMock vs FeatureScopeMock), dropApplicationLaunchView() pattern, RUMSessionMatcher - docs/KNOWN_CONCERNS.md — fragile areas requiring extra caution CLAUDE.md is trimmed to a minimal pointer to AGENTS.md + available skills.
Co-authored-by: Maxime Epain <maxime.epain@datadoghq.com>
dcd1836 to
4d8e76c
Compare
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.
Summary
Replaces the monolithic
AGENTS.md+CLAUDE.md(510 combined lines, significant duplication) with a lean entry-point (AGENTS.md, 79 lines) linking to 5 focused docs underdocs/.CLAUDE.mdis trimmed to a minimal pointer + skills table.Files changed: 7 (2 modified, 5 created) —
AGENTS.md,CLAUDE.md,docs/ARCHITECTURE.md,docs/CONVENTIONS.md,docs/DEVELOPMENT.md,docs/TESTING.md,docs/KNOWN_CONCERNS.mdWhy — Experimentally Validated
We ran 18 identical engineering tasks on both branches (this branch vs
develop), giving Claude Code the same PM-style spec and comparing the code it produced. The structured docs consistently improved output quality and efficiency:What the new docs teach that the old docs didn't
docs/ARCHITECTURE.md— Message Bus Patterns (highest-impact addition)Documents
.contextvs.payloadmessage patterns,CombinedFeatureMessageReceivershort-circuit semantics, andRUMCoreContextpropagation flow. Validated by Task B (Logs-RUM enrichment): the new-docs agent chose the architecturally correct.context(RUMCoreContext)pattern (matching Session Replay's existingRUMContextReceiver), while the develop agent chose.payload(RUMViewEvent)— a tighter coupling that doesn't match established SDK patterns. The new-docs agent also foundLogEventSanitizerreserved attributes (a data integrity issue the develop agent missed).docs/CONVENTIONS.md— Lint Rules & UIApplication Safety (catches silent failures)Explicitly documents
UIApplication.dd.managedShared(KVC workaround for app extension safety),required_reason_api_namebanned property names, andexplicit_top_level_acl. Validated by Task A (scroll instrumentation): the new-docs agent implementedObjectIdentifier-based de-duplication to prevent spamming user action events on every scroll callback; the develop agent had no de-duplication — a correctness bug that would corrupt RUM metrics.docs/TESTING.md— Mock Selection & ApplicationLaunch View (prevents false-positive tests)Documents when to use
DatadogCoreProxyvsPassthroughCoreMockvsFeatureScopeMock, with aDatadogCoreProxycode example includingdropApplicationLaunchView()andRUMSessionMatcher. Validated by Tasks B and C: mock selection was consistently correct with new docs;dropApplicationLaunchView()was reliably discovered (previously a coin flip).docs/DEVELOPMENT.md— Step-by-Step Recipes (prevents dead code)Recipes for adding RUM commands, context publishers, instrumentations, and features — including registration steps that are invisible from the code alone. Validated by Task E (thermal state publisher): the new-docs agent completed the task in 57 tool calls vs 70 for develop (-19%), because the recipe directed it to the right files immediately.
docs/KNOWN_CONCERNS.md— Fragile AreasLists areas where changes have caused production incidents: SwiftUI view name extraction (Mirror reflection), 100ms user action window, 500 concurrent operation cap, unbounded message bus queue, KSCrash report parsing format dependency.
Detailed Task Results
Round 3 (6 PM-style tasks, 12 agents)
LogEventSanitizerreserved attribute; 35% fewer tool callsdropApplicationLaunchView()reliablyEarlier Rounds (12 additional task-pairs confirming the pattern)
Cumulative: 6 wins for new-docs, 6 ties, 0 wins for develop across 18 task-pairs.
How it works
Agents read AGENTS.md first, then follow the "Where to Look First" table to the relevant doc for their task. This hub-and-spoke navigation replaces blind codebase exploration.
Review checklist
Add CHANGELOG entry for user facing changes— N/A (internal documentation)Add Objective-C interface for public APIs— N/ARun— N/Amake api-surfacewhen adding new APIs