Skip to content

Connection: Add Claude instructions#47140

Open
sergeymitr wants to merge 3 commits intotrunkfrom
add/connection-claude
Open

Connection: Add Claude instructions#47140
sergeymitr wants to merge 3 commits intotrunkfrom
add/connection-claude

Conversation

@sergeymitr
Copy link
Contributor

Proposed changes:

Add Claude instruction files:

  • Basic Connection info in CLAUDE.md
  • Separate "rule" files for:
    • JS builder
    • IDC

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

Take a look and see if the instructional files make sense.

@sergeymitr sergeymitr self-assigned this Feb 15, 2026
Copilot AI review requested due to automatic review settings February 15, 2026 00:25
@sergeymitr sergeymitr added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. labels Feb 15, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the add/connection-claude branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/connection-claude
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/connection-claude

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@sergeymitr
Copy link
Contributor Author

Hi @bindlegirl 👋
Here's an attempt to give Claude better understanding of the connection.
I'd appreciate your opinion on this.

Copy link
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

This PR adds Claude AI assistant instruction files to the Connection package to help Claude better understand and work with this codebase. The instructions cover the package's overall structure, JavaScript build system, and Identity Crisis (IDC) subsystem.

Changes:

  • Added comprehensive CLAUDE.md file documenting the Connection package architecture, option storage, communication patterns, and key subsystems
  • Added js-build.md rule file explaining webpack configuration and build commands
  • Added identity-crisis.md rule file detailing IDC detection, resolution paths, and technical implementation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
projects/packages/connection/changelog/add-connection-claude Changelog entry for the new Claude instruction files (minor formatting issue)
projects/packages/connection/.claude/CLAUDE.md Main Claude instruction file providing comprehensive package overview with accurate technical details
projects/packages/connection/.claude/rules/js-build.md Build system documentation covering webpack entries, commands, and asset output
projects/packages/connection/.claude/rules/identity-crisis.md Detailed IDC subsystem documentation including detection mechanisms, state management, and resolution workflows

@jp-launch-control
Copy link

jp-launch-control bot commented Feb 15, 2026

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

- `migrate_for_idc` — Flags that sync actions should be accepted (URL migration path)
- `identity_crisis_url_secret` — Short-lived secret (5min) for verifying same-site IDC
- `identity_crisis_ip_requester` — IP addresses making requests (for IP-based site URLs)

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add that while in safe mode, only sync requests are blocked. Other requests will go out but without the URLs appended to the request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, added a bit more info: 26c870b

bindlegirl
bindlegirl previously approved these changes Feb 16, 2026
Copy link
Contributor

@bindlegirl bindlegirl left a comment

Choose a reason for hiding this comment

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

LGTM. This reminded me I need to update the Error Handler doc 😅

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

Instead of adding a new set of claude-specific files, it may be best to create a new AGENTS.md file, since that's where we're headed at a8c:

  • PCYsg-1bzA-p2

The main documentation seems to say that nested AGENTS.md files should work:
https://agents.md/

@jeherve
Copy link
Member

jeherve commented Feb 18, 2026

Instead of adding a new set of claude-specific files, it may be best to create a new AGENTS.md file

For reference, I'm starting work on migrating things in this repo, in #47190

@kraftbj kraftbj added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Feb 20, 2026
Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

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

Agreed with @jeherve. Per the field guide, we should be using AGENTS.md file (with a CLAUDE.md file that just points to @AGENTS.md)

We can use .ai instead of .claude for the other files and likely should reference them in the AGENTS.md (if they're not... I skimmed quickly and it didnt' scream out to me that it does).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Package] Connection [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants