mongo-tools-js-to-go
Skill by mongodb
Converts JavaScript and resmoke integration tests in mongo-tools into Go testify tests. It covers build tags, suite methods, round-trip tests and PR conventions. It is for contributors to the mongo-tools repository.
Install mongo-tools-js-to-go
Built from the published package, never by AI.
git clone --depth 1 https://github.com/mongodb/mongo-tools /tmp/mongo-tools && mkdir -p ~/.claude/skills && cp -r /tmp/mongo-tools/.agents/skills/mongo-tools-js-to-go ~/.claude/skills/mongo-tools-js-to-goRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/mongodb/mongo-tools /tmp/mongo-tools && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/mongo-tools/.agents/skills/mongo-tools-js-to-go ~/.gemini/antigravity-cli/skills/mongo-tools-js-to-goAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install mongo-tools-js-to-go in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill guides an AI assistant through converting JavaScript and resmoke integration tests in the mongo-tools repository into Go tests that use testify. It explains which build tag to use, when to place a test in a tool package versus a suite method in integration/dumprestore or integration/exportimport, and how to write round-trip tests that drop the collection before import or restore.
It also sets code conventions and review rules, such as callers before callees, bson.D instead of bson.M, assertion messages, and keeping PRs to 200-400 lines. It asks for a local test run before commit and a final review by a separate sub-agent. It is written for contributors who port tests from JS to Go in mongo-tools.
Written from the project's SKILL.md and checked against it.
What it can do
- JS-to-Go conversion processSteps through reading a JS test, choosing a test form, writing the Go test and running it locally.
- Build tag selectionExplains the unit, integration, sharded, kerberos and awsauth tags and when to use integration || sharded.
- Testify suite methodsShows how to add e2e test methods to existing suites in integration/dumprestore and integration/exportimport.
- Round-trip test patternDescribes dropping the collection between export or dump and import or restore so the restore can be verified.
- JSON test file generationShows generating test input files from Go data with json.Marshal and bson.MarshalExtJSON.
- Code conventionsLists rules such as bson.D over bson.M, any over interface{}, and set-based membership checks.
- Naming and scope guidanceCovers constant placement, helper naming and keeping assertion messages specific to one assertion.
- Fidelity checksWarns against adding or dropping behavior from the original JS test and asks for divergences to be called out.
- PR size guidanceRecommends 200-400 lines per PR and splitting conversions by test file or theme.
What you need
- Go toolchain to run go test
- A running MongoDB instance for integration tests
- mongo-tools repository checkout
- Auth credentials via TOOLS_TESTING_AUTH env vars when testing an auth-enabled mongod
Try asking
- Convert this JS integration test in mongoimport to a Go testify test
- Turn this export and import JS test into a round-trip suite method
- Show me the build tag and boilerplate for a new mongodump integration test
Good to know
- Written for the mongo-tools repository and its conventions.
- Some JS tests may cover behavior the tools no longer support, such as restoring from a v2.6 dump, and must be flagged for a decision.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/mongo-tools-js-to-go/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to mongo-tools-js-to-go
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
mongo-tools-js-to-go: common questions
What does mongo-tools-js-to-go convert?
It converts JS and resmoke integration tests in mongo-tools into Go tests that use testify. It is meant for the mongo-tools repository.
When should a test use a suite method instead of a plain Go test?
Full pipeline tests that dump and restore or export and import belong in the integration suites as testify suite methods. Single tool tests use a plain function in the tool's own package.
Does the skill tell me to clean up databases in suite tests?
No. The source says BeforeTest in IntegrationSuite drops all non-system databases before each test method, so suite tests should not register t.Cleanup DB drops.
How do I install mongo-tools-js-to-go?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is mongo-tools-js-to-go free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is mongo-tools-js-to-go safe to use?
It scores 75 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to mongo-tools-js-to-go?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
