Repository navigation
feat: write agent docs natively in C#, Java, Kotlin and Rust - #675
Merged
Merged
Conversation
…and Rust dotnet meta agent-docs, mvn metaobjects:agent-docs (Java and Kotlin) and a new cargo meta agent-docs now write .metaobjects/AGENTS.md, the metaobjects-* skills, the .agent-context.json manifest and the root AGENTS.md/CLAUDE.md import with no Node. They replace the "use npx meta agent-docs" stubs. Each port copies one stack out of the shipped agent-context-shipped/ tree (C# and the Maven plugin embed it at build time; the Rust crate keeps a committed copy like the Python wheel), using Python's re-run rules. Every port's tests reproduce every fixtures/agent-context-conformance/ stack and the agent-pages-pointer corpus, so the corpus is now a cross-port gate. The sync script is generalized to scripts/sync-agent-context-shipped.sh (Python and Rust copies), and the gates lane checks both copies. The C#/Java staleness nudge names the port's own command, and the shipped C#, Java and Kotlin skill references no longer send agents to npx.
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.
What Changed
agent-docscommands with no Node:dotnet meta agent-docs(C#),mvn metaobjects:agent-docs(Java and Kotlin) andcargo meta agent-docs(Rust, new). Each writes.metaobjects/AGENTS.md, themetaobjects-*skills, the.agent-context.jsonmanifest and the rootAGENTS.md/CLAUDE.mdimport, byte-for-byte matching the Node and Python output. Before this, the C# and Maven commands printed "runnpx meta agent-docs" and exited 1, and Rust had no command.agent-context-shipped/with a manifest. C# and the Maven plugin embed it at build time. The Rust crate and Python wheel keep committed copies, refreshed byscripts/sync-agent-context-shipped.sh(replacessync-python-agent-context.sh). Thegateslane (gate_agent_context_copy_drift) fails when either copy is stale.npx meta agent-docs. Thegen/verifystaleness nudge in C# and Java names the port's own command too. Every port's tests reproduce everyfixtures/agent-context-conformance/stack, so the corpus gates all ports.Changelog fragment:
changelog.d/agent-docs-native-every-port.md.Validation
Risk Assessment
Testing
Baseline
scripts/ci-local.sh --affected --strict-toolchainsalready passed at this commit and covers broad regression; no source edits were made here. Drove the built C#agent-docsCLI live with no Node on PATH for three scenarios: client-only on a fresh project (pass, csharp|react), recorded-stack refresh keeping java when only --client is given (pass), and unknown-client refusal (pass). The focused AgentDocs test filter passed 23/23. Scratch dirs were removed.agent-docs --client reactunder env -i PATH=/usr/bin:/bin; exit 0; .metaobjects/.agent-context.json servers=[csharp] clients=[react]; .claude/skills tree writte…agent-docs --server javathenagent-docs --client reactin same temp project; manifest servers=[java] clients=[react]agent-docs --client bogus; stderr 'unknown stack value: --client bogus (known: react, tanstack, angular)', exit 2, empty output dirPipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
📌 **Review** - 9 issues (2 warnings, 7 infos) left as notes at the round cap
server/csharp/MetaObjects.Cli/AgentDocsCommand.cs:489- With--clientand no--server, the native agent-docs commands fail. The default server (the recorded stack, else the port's language) only applies when BOTH lists are empty. Sodotnet meta agent-docs --client reactbuilds the stack idreact, which no manifest entry has, and exits 2 withno shipped agent files for the stack "react". This change documents exactly that invocation for C# users: server/csharp/README.md:33 (dotnet meta agent-docs [--client react] [--out <dir>]), agent-context/skills/metaobjects-audit/references/csharp.md:127 (dotnet meta agent-docs [--client <fw>] [--out <dir>]), agent-context/skills/metaobjects-codegen/references/csharp.md:332-335 ("Add--client <fw>for a web client") and the Usage text at AgentDocsCommand.cs:560 ("(default --server csharp)"). The TypeScript CLI resolves the server by detection when only clients are given (init.ts stackForAgentContext/resolveStack). Same check in other ports: server/java/maven-plugin/src/main/java/com/metaobjects/mojo/AgentDocsWriter.java:578, server/rust/metaobjects-cli/src/agent_docs.rs:630, and the Python reference server/python/src/metaobjects/agent_context/agent_docs.py:113. Fix: when servers is empty, take the prior manifest's servers, else DEFAULT_SERVER, whatever the clients are. Keep both-empty reusing the recorded clients too. Add a--client-only test per port.server/csharp/MetaObjects.Cli/MetaObjects.Cli.csproj:27- The EmbeddedResource comment had lost its command name ("so writes them"). It now reads "sodotnet meta agent-docswrites them with no Node on the path."🔧 Fix applied.
📌 Review round cap reached: 9 issues (2 warnings, 7 infos) left unresolved as notes (no further fix round):
server/csharp/MetaObjects.Cli/AgentDocsCommand.cs:489- With--clientand no--server, the native agent-docs commands fail. The default server (the recorded stack, else the port's language) only applies when BOTH lists are empty. Sodotnet meta agent-docs --client reactbuilds the stack idreact, which no manifest entry has, and exits 2 withno shipped agent files for the stack "react". This change documents exactly that invocation for C# users: server/csharp/README.md:33 (dotnet meta agent-docs [--client react] [--out <dir>]), agent-context/skills/metaobjects-audit/references/csharp.md:127 (dotnet meta agent-docs [--client <fw>] [--out <dir>]), agent-context/skills/metaobjects-codegen/references/csharp.md:332-335 ("Add--client <fw>for a web client") and the Usage text at AgentDocsCommand.cs:560 ("(default --server csharp)"). The TypeScript CLI resolves the server by detection when only clients are given (init.ts stackForAgentContext/resolveStack). Same check in other ports: server/java/maven-plugin/src/main/java/com/metaobjects/mojo/AgentDocsWriter.java:578, server/rust/metaobjects-cli/src/agent_docs.rs:630, and the Python reference server/python/src/metaobjects/agent_context/agent_docs.py:113. Fix: when servers is empty, take the prior manifest's servers, else DEFAULT_SERVER, whatever the clients are. Keep both-empty reusing the recorded clients too. Add a--client-only test per port.server/csharp/MetaObjects.Cli/MetaObjects.Cli.csproj:27- The EmbeddedResource comment had lost its command name ("so writes them"). It now reads "sodotnet meta agent-docswrites them with no Node on the path."server/java/maven-plugin/src/main/java/com/metaobjects/mojo/AgentDocsMojo.java:26- The@Mojohas noaggregator = true, andoutputDirectorydefaults to${project.basedir}. Maven runs a directly invoked non-aggregator goal once for each reactor project. So the documentedmvn metaobjects:agent-docsat the root of a multi-module build writes.metaobjects/AGENTS.md, the.claude/skillstree and the manifest into the parent and into every module. With the defaultwireRoot, it also creates or editsAGENTS.mdandCLAUDE.mdin each. The old stub only failed, so this fan-out is new. Sites that give the same invocation: server/java/README.md:158-160 (usage), agent-context/skills/metaobjects-audit/references/java.md:126 and kotlin.md:131 (shipped agent instructions), server/java/metadata/src/main/java/com/metaobjects/agentcontext/AgentContextScaffold.java:76 (stale nudge). Fix: make the goal an aggregator, or write only at the execution root unless-Dmetaobjects.outputDirectoryis set. Note that the nudge reads the manifest from the module basedir (AbstractMetaDataMojo.java:1059).server/csharp/MetaObjects.Cli/AgentDocsCommand.cs:142-CanonicalStackmaps aliases but keeps the caller's order and duplicates, and the manifest records those lists. TypeScript recordsmakeStack's output, which is deduplicated and in canonical order. For--server kotlin --server java --client tanstack --client react(the example in agent-context-shipped/README.md), a native port writesservers:[kotlin,java]andclients:[tanstack,react]. Node writes[java,kotlin]and[react,tanstack]. The same happens with-Dmetaobjects.servers=kotlin,java, and--server cs... --server dotnetrecords a duplicate. This contradicts the changelog's byte-for-byte manifest claim, and the manifest is rewritten whenever the tool changes. Sibling sites: server/java/maven-plugin/src/main/java/com/metaobjects/mojo/AgentDocsWriter.java:188-211, server/rust/metaobjects-cli/src/agent_docs.rs:186-214, server/python/src/metaobjects/agent_context/shipped.py:76 (the reference all three copy). Fix: filter SERVER_LANGS and CLIENT_FRAMEWORKS by the collected values before returning.docs/llms/llms-full.txt:45- This LLM-facing doc still says "the JVM and C# CLIs redirect to the Node CLI", and docs/llms/llms.txt:37 says the same. The change removes those redirects. An LLM reader would therefore tell a C#, Java or Kotlin adopter to install Node, which the intent rules out. Neither file mentionscargo meta agent-docs. Update both to name each port's own command.docs/RELEASING.md:301- C# and the Maven plugin now embed the repo-rootagent-context-shipped/tree, which lies outsideserver/csharpandserver/java. The publish-what-changed rule publishes a registry only when it has a changed product file. A later change to skill text alone changes files under the npm, Python and Rust directories, so a release judged by port directory can leave NuGet and Maven shipping old agent files. Add one sentence to the rule:agent-context-shipped/is a shipped product file of NuGet and Maven Central. See server/csharp/MetaObjects.Cli/MetaObjects.Cli.csproj:29 and server/java/maven-plugin/pom.xml:58.server/csharp/MetaObjects.Cli.Tests/AgentDocsCommandTests.cs:159- The "native stamp satisfies the staleness check" assertion builds aManifestby hand withReleaseand compares it withRelease. It never feeds the written stamp to the check, so it passes whatever the writer stamps. It also never covers the real default path:Run(version: null)stampsEjectCommand.ToolVersion(), whilegenandverifycompare againstAgentContextStalenessCheck.CurrentVersion(), which reads a different assembly and keeps+sha. Run with no version, readgeneratedByfrom the written manifest, and check it againstCurrentVersion(). The sibling at server/java/maven-plugin/src/test/java/com/metaobjects/mojo/AgentDocsWriterTest.java:162 also hand-builds the manifest with "1.3.0" and should parse the written one.docs/features/cli.md:963- Fixed a stale statement inline. It said onlymeta agent-docsand Python add the agent-pages section. It now says every port'sagent-docscommand does.server/java/metadata/src/main/java/com/metaobjects/agentcontext/AgentContextScaffold.java:99- Fixed a stale Javadoc inline (comment only). It said the manifest is always stamped by the Node CLI and that other ports redirect to it. It now says both Node and the Maven goal stamp an npm-line version.✅ **Test** - passed
✅ No issues found.
agent-docs --client reactunder env -i PATH=/usr/bin:/bin; exit 0; .metaobjects/.agent-context.json servers=[csharp] clients=[react]; .claude/skills tree writte…agent-docs --server javathenagent-docs --client reactin same temp project; manifest servers=[java] clients=[react]agent-docs --client bogus; stderr 'unknown stack value: --client bogus (known: react, tanstack, angular)', exit 2, empty output dirscripts/ci-local.sh --affected --strict-toolchainscd server/csharp && dotnet test MetaObjects.Cli.Tests --filter "FullyQualifiedName~AgentDocs" (23 passed, includes A_client_alone_takes_the_recorded_server_else_csharp)Live: built MetaObjects.Cli.dll, ranagent-docs --client reactin a fresh temp project under $DEV_SCRATCH with env -i PATH=/usr/bin:/bin (no Node); manifest servers=[csharp], clients=[react]Live:agent-docs --server javathenagent-docs --client reactin the same project; manifest servers=[java], clients=[react]Live adversarial:agent-docs --client bogusin a fresh project; stderr 'unknown stack value: --client bogus (known: react, tanstack, angular)', exit 2, no files writtenRemoved scratch directories; worktree git status clean✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.