Add initial CLAUDE.md for AI-assisted development#1342
Conversation
Captures non-obvious conventions (async-to-sync decorator, protocol classes, dataclass models with fill_from_dict, concrete Java types), architecture overview, verified commands, constraints, and testing patterns that Claude cannot infer from code alone. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each file documents non-obvious patterns specific to that module: - models/: new model checklist, fill_from_dict pattern, _last_persistent_instance lifecycle, EnumCoercionMixin usage, standard field requirements - api/: function signature conventions, REST call patterns, pagination helpers, new service file checklist - core/: async_to_sync internals, retry strategies, credentials chain, upload/download resilience, concrete types registration - tests/: async-only test convention, unit test socket blocking, integration test cleanup with schedule_for_cleanup(), fixture scoping Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rewrote 5 existing files with enhanced behavioral conventions (reusable utilities, conditional behavior, concurrency patterns). Added 11 new module-level files for full directory coverage: operations, models/mixins, models/services, models/protocols, core/upload, core/download, core/constants, core/credentials, extensions/curator, synapseutils, and docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove flake8 from linting list (not a pre-commit hook, only test dep) - Add Docker info to Stack section - Add auth env vars and CI matrix details to Testing section - Fix docs deployment info: Read the Docs, not gh-deploy to GitHub Pages - Add docs build output dir and autorefs cross-linking syntax - Expand Windows socket isolation note in tests - Add conftest.py location guide for tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasyu888
left a comment
There was a problem hiding this comment.
🔥 I will continue taking a look at this, and I think this would be a great PR to review in a DPE code spaces so that @Sage-Bionetworks/dpe has the opportunity to learn and review the structure.
There was a problem hiding this comment.
Pull request overview
Adds a set of CLAUDE.md guidance files (root + module-level) intended to document non-obvious repository conventions and patterns for AI-assisted development.
Changes:
- Introduces a root
CLAUDE.mddescribing overall architecture, stack, and development/testing commands. - Adds module-level
CLAUDE.mdfiles capturing conventions forsynapseclientlayers (api/core/models/operations),synapseutils,tests, anddocs. - Documents patterns such as async-first + sync-wrapper generation, concrete type registration, services/mixins usage, and test suite conventions.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
CLAUDE.md |
Root-level AI/dev conventions, commands, architecture overview |
docs/CLAUDE.md |
Documentation build/contribution conventions (MkDocs/mkdocstrings/Diataxis) |
tests/CLAUDE.md |
Test suite conventions (unit vs integration, fixtures, networking, cleanup) |
synapseutils/CLAUDE.md |
Legacy synapseutils constraints and key module notes |
synapseclient/api/CLAUDE.md |
REST service-layer signature and pagination conventions |
synapseclient/core/CLAUDE.md |
Core infrastructure patterns (async_to_sync, retry, creds, transfers) |
synapseclient/core/constants/CLAUDE.md |
Concrete type + constants registration guidance |
synapseclient/core/credentials/CLAUDE.md |
Credential-provider chain and logging constraints |
synapseclient/core/download/CLAUDE.md |
Download flow conventions (MD5, collisions, progress) |
synapseclient/core/upload/CLAUDE.md |
Multipart upload conventions (sync/async parity, retries, memory) |
synapseclient/models/CLAUDE.md |
Dataclass model conventions (fill_from_dict, annotations, lifecycle) |
synapseclient/models/mixins/CLAUDE.md |
Mixin-specific patterns and constraints |
synapseclient/models/protocols/CLAUDE.md |
Protocol/type-hint conventions for generated sync methods |
synapseclient/models/services/CLAUDE.md |
Internal service-layer conventions for models |
synapseclient/operations/CLAUDE.md |
Operations-layer sync wrapper + dispatch conventions |
synapseclient/extensions/curator/CLAUDE.md |
Curator extension conventions and constraints |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I would be in favor of removing the line counts, I'm not sure it adds anything. Other than that LGTM! |
jaymedina
left a comment
There was a problem hiding this comment.
I added a few suggestions to help clarify things & provide more context to Claude. This is great, thanks!
linglp
left a comment
There was a problem hiding this comment.
I did my first round of review. I think this is definitely a good start, but I think some of the description in the CLAUDE.md details include unnecessary details, such as what exists in a given data class. I think we should focus more on "what Claude would get wrong without guidance" rather than describing what exists.
- Fix decorator ordering guidance (@DataClass above @async_to_sync) - Remove all line counts from CLAUDE.md files - Add docstring conventions to api/ and models/ CLAUDE.md - Narrow "async only" test guidance to new code only - Add pagination, query params, and response variable patterns - Trim obvious descriptions in mixins/ and curator/ CLAUDE.md - Fix inaccurate statements (protocol bodies, curator get() API) - Add news.md, maintenance, download part size, and shared fixture guidance
Incorporates linglp's testing feedback: explicit fixture requests, careful fixture scoping, cleanup in fixtures not tests, avoiding unnecessary autouse on resource-creating fixtures.
Incorporates linglp's testing feedback: explicit fixture requests, careful fixture scoping, cleanup in fixtures not tests, avoiding unnecessary autouse on resource-creating fixtures.
Summary
CLAUDE.md(95 lines) and 4 module-level CLAUDE.md files (170 lines total) capturing non-obvious conventions and patterns that AI assistants cannot infer from the code alonefill_from_dict(), concrete Java type mapping, mixin composition, layered architecture, testing conventionssynapseclient/models/: new model checklist, standard fields,_last_persistent_instancelifecycle,EnumCoercionMixin,fill_from_dict()pattern,@otel_trace_methodusagesynapseclient/api/: function signature conventions, REST call patterns, pagination helpers, new service file checklistsynapseclient/core/:async_to_syncinternals, retry strategies, credentials chain, upload/download resilience, concrete types registrationtests/: async-only test convention, socket blocking,schedule_for_cleanup(), fixture scopingbuild.yml,pytest.ini,.pre-commit-config.yaml)Test plan
🤖 Generated with Claude Code