Skip to content

Add initial CLAUDE.md for AI-assisted development#1342

Merged
BryanFauble merged 8 commits intodevelopfrom
add-claude-md
Apr 3, 2026
Merged

Add initial CLAUDE.md for AI-assisted development#1342
BryanFauble merged 8 commits intodevelopfrom
add-claude-md

Conversation

@BryanFauble
Copy link
Copy Markdown
Member

@BryanFauble BryanFauble commented Mar 23, 2026

Summary

  • Adds root 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 alone
  • Root: async-to-sync decorator system, protocol classes, dataclass models with fill_from_dict(), concrete Java type mapping, mixin composition, layered architecture, testing conventions
  • synapseclient/models/: new model checklist, standard fields, _last_persistent_instance lifecycle, EnumCoercionMixin, fill_from_dict() pattern, @otel_trace_method usage
  • synapseclient/api/: function signature conventions, REST call patterns, pagination helpers, new service file checklist
  • synapseclient/core/: async_to_sync internals, retry strategies, credentials chain, upload/download resilience, concrete types registration
  • tests/: async-only test convention, socket blocking, schedule_for_cleanup(), fixture scoping
  • All commands verified from CI configs (build.yml, pytest.ini, .pre-commit-config.yaml)

Test plan

  • Root file under 150 lines (95 lines)
  • All module files under 150 lines (54, 45, 38, 33 lines)
  • Every line passes the quality test: "If I remove this, will Claude mess up?"
  • Commands are verbatim from config files
  • No duplication with README.md content
  • No linter/formatter rules restated (those are enforced by ruff/black/isort/bandit configs)
  • Module files only contain patterns that differ from or extend the root CLAUDE.md

🤖 Generated with Claude Code

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>
@BryanFauble BryanFauble requested a review from a team as a code owner March 23, 2026 19:48
BryanFauble and others added 3 commits March 23, 2026 20:01
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>
Copy link
Copy Markdown
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md describing overall architecture, stack, and development/testing commands.
  • Adds module-level CLAUDE.md files capturing conventions for synapseclient layers (api/core/models/operations), synapseutils, tests, and docs.
  • 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.

@andrewelamb
Copy link
Copy Markdown
Contributor

I would be in favor of removing the line counts, I'm not sure it adds anything. Other than that LGTM!

Copy link
Copy Markdown
Contributor

@jaymedina jaymedina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few suggestions to help clarify things & provide more context to Claude. This is great, thanks!

linglp
linglp previously requested changes Apr 2, 2026
Copy link
Copy Markdown
Contributor

@linglp linglp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@BryanFauble BryanFauble enabled auto-merge (squash) April 3, 2026 20:46
@BryanFauble BryanFauble disabled auto-merge April 3, 2026 21:09
@BryanFauble BryanFauble dismissed linglp’s stale review April 3, 2026 21:09

Issues resolved

@BryanFauble BryanFauble merged commit e06c715 into develop Apr 3, 2026
19 of 21 checks passed
@BryanFauble BryanFauble deleted the add-claude-md branch April 3, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants