agentleFS
GitHubKnown publishergithub/copilot-sdk/java/AGENTS.md

copilot-sdk / java

AGENTS.md11k starsChanged 3 months agoMITView on GitHub

This directory is the Java SDK's Maven reactor. Paths and commands below are relative to this directory, whether it is nested at src/sdk/java or exported as java. Keep API usage examples in README.md, the SDK documentation, and public Javadoc rather than duplicating them in these contributor instructions. - sdk/src/main/java/ contains the handwritten client, session, and RPC APIs. sdk/src/test/java/ contains unit and integration tests. - sdk/src/generated/java/ contains generated protocol and event types. - copilot-native/ packages platform-specific runtime artifacts separately from the…

Trending

Steady talk.about the whole repository

Dec 2025: 0 mentionsJan 2026: 14 mentionsFeb 2026: 2 mentionsMar 2026: 2 mentionsApr 2026: 1 mentionMay 2026: 2 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 2 mentionsSep 2026: 1 mentionOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the github/copilot-sdk repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about github/copilot-sdk

The biggest 5 of 25 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 25

Talked about on GitHub, Bluesky and Hacker News (25 times).

On GitHub · 13

8 more on GitHub

On Bluesky · 11

6 more on Bluesky

On Hacker News · 1

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Use try-with-resources for CopilotClient and CopilotSession.

    line 28
  2. Very specific:

    Use typed event handlers and the existing ToolDefinition and ToolInvocation helpers rather than ad hoc wire payloads.

    line 30
  3. Very specific:

    Add Javadoc for public APIs and follow the existing four-space, Spotless/Eclipse formatting.

    line 38
  4. Very specific:

    Prefer the checked-in Maven wrapper (./mvnw, or .\mvnw.cmd on Windows).

    line 44
  5. Very specific:

    Follow SDK setup for the JDK and layout-appropriate Node.js version.

    line 45
  6. Very specific:

    Run verify without -q or piping through grep so failures remain visible.

    line 60
  7. Very specific:

    Add new Java E2E tests for Java SDK surface behavior, not shared runtime functionality.

    line 65
  8. Very specific:

    Do not edit sdk/src/generated/java/ by hand.

    line 76
  9. Distinctive:

    Use the SDK's selected schema inputs.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->

Java SDK

This directory is the Java SDK's Maven reactor. Paths and commands below are relative to this directory, whether it is nested at src/sdk/java or exported as java. Keep API usage examples in README.md, the SDK documentation, and public Javadoc rather than duplicating them in these contributor instructions.

Layout and compatibility

  • sdk/src/main/java/ contains the handwritten client, session, and RPC APIs. sdk/src/test/java/ contains unit and integration tests.
  • sdk/src/generated/java/ contains generated protocol and event types.
  • copilot-native/ packages platform-specific runtime artifacts separately from the pure-Java SDK.
  • Build with JDK 25 or later, as required by sdk/pom.xml. The base sources target Java 17; Java 25-specific implementations belong in the existing sdk/src/main/java25/ multi-release overlay. Do not raise the base target or introduce newer APIs into the Java 17 sources.

API conventions

  • Preserve the CompletableFuture-based asynchronous API and fluent setters on configuration classes. Preserve wire names and serialization behavior when changing RPC types.
  • Use try-with-resources for CopilotClient and CopilotSession. Close event and lifecycle subscriptions when no longer needed.
  • Use typed event handlers and the existing ToolDefinition and ToolInvocation helpers rather than ad hoc wire payloads. Prefer getArgumentsAs() for typed tool arguments.
  • Creating and resuming sessions requires a permission handler. PermissionHandler.APPROVE_ALL is for scenarios that do not exercise permission decisions; it cannot bypass managed-settings approval.
  • Handle exceptional future completion and SessionErrorEvent. Streaming consumers must handle both incremental delta events and final messages.
  • Add Javadoc for public APIs and follow the existing four-space, Spotless/Eclipse formatting. Checkstyle defines the Javadoc checks and exclusions in sdk/config/checkstyle/checkstyle.xml.

Build, format, and test

Prefer the checked-in Maven wrapper (./mvnw, or .\mvnw.cmd on Windows). Follow SDK setup for the JDK and layout-appropriate Node.js version. Tests use Node.js for the replay harness and runtime preparation tooling. Maven's generate-test-resources phase installs their dependencies from the SDK tree. In the runtime repository, prefer npm --prefix <SDK_ROOT> run test:java; it refreshes the selected schemas and Java projection and requests a current host CLI before running the tests. Direct Maven commands bypass those prerequisites and are appropriate after preparing the checkout, or in the standalone SDK repository.

./mvnw clean verify
./mvnw -pl sdk spotless:apply
./mvnw -pl sdk spotless:check checkstyle:check

Run verify without -q or piping through grep so failures remain visible. verify does not run Spotless: apply and check formatting separately for Java source changes. Tests must exercise public APIs, not expose internals solely for tests.

Add new Java E2E tests for Java SDK surface behavior, not shared runtime functionality; new SDK-accessible runtime E2Es belong in ../nodejs/test/e2e/. For replay-backed Java integration tests, use the on-demand sdk-java-e2e-test skill. Its snapshot workflow is not required for unrelated Java edits. For JDK 17 compatibility testing, run the JDK 25-built artifact on JDK 17 without recompiling it, following Development Setup.

Generated sources

Do not edit sdk/src/generated/java/ by hand. Update the generator in scripts/codegen/java.ts when needed. From <SDK_ROOT>, regenerate with the SDK facade so the runtime layout selects checked-out schemas and the standalone layout selects its pinned release schemas:

npm run generate:java

The protocol constant sdk/src/main/java/com/github/copilot/SdkProtocolVersion.java is also generated, despite living outside src/generated/. Change the shared <SDK_ROOT>/sdk-protocol-version.json and run npm --prefix <SDK_ROOT>/nodejs run update:protocol-version to update all six SDKs.

Use the SDK's selected schema inputs; do not update release-derived CLI pins as an incidental part of implementation work.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.