add-java-code-snippets-in-docs
Skill by JetBrains
Adds Java tabs to mkdocs docs that already have Kotlin examples. It follows the Knit and mkdocs-material tab structure and checks that the Java code matches the Kotlin code.
Install add-java-code-snippets-in-docs
Built from the published package, never by AI.
git clone --depth 1 https://github.com/JetBrains/koog /tmp/koog && mkdir -p ~/.claude/skills && cp -r /tmp/koog/.claude/skills/add-java-code-snippets-in-docs ~/.claude/skills/add-java-code-snippets-in-docsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install add-java-code-snippets-in-docs in Claude Code
git clone --depth 1 https://github.com/JetBrains/koog /tmp/koog && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/koog/.claude/skills/add-java-code-snippets-in-docs ~/.gemini/antigravity-cli/skills/add-java-code-snippets-in-docsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install add-java-code-snippets-in-docs in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill adds Java code tabs to mkdocs documentation pages that already contain Kotlin examples. It targets files under docs/docs/**.md that use mkdocs-material tabs and Knit INCLUDE and SUFFIX blocks. For each Kotlin block, the workflow checks for a Java tab, then adds or updates it so the visible code matches the Kotlin version in scope and structure.
The skill also covers Knit file naming, adding @JavaAPI bridge methods when a Java bridge is missing, and JVM create() factory classes. Verification runs ./gradlew :docs:knit and ./gradlew :docs:compileJava, and the generated Java file is read to check it. It is aimed at contributors who maintain these docs.
Written from the project's SKILL.md and checked against it.
What it can do
- Add Java tabsAdds a Java tab immediately after an existing Kotlin tab in a mkdocs page.
- Match structureKeeps the visible Java code equivalent in scope and structure to the Kotlin code.
- Knit naming checksExplains how capital Java in file names avoids a package line that breaks compilation.
- Bridge methodsAdds @JavaAPI bridge methods when the Java code needs one that does not exist yet.
- Factory classesSuggests JVM create() factory classes when Kotlin examples use Kotlin-only APIs.
- Verify outputRuns Knit and Java compile tasks and checks the generated Java file.
What you need
- JDK 17
- Gradle 8.x via ./gradlew
- Repository with docs/docs mkdocs files
Try asking
- Add Java examples to docs/docs/features/tracing.md
- Complete the Java side of the testing docs page
- Fix the Java block in the agent-events doc
Good to know
- Not for writing brand-new Kotlin docs with no Kotlin block to mirror.
- Not for splitting source files between JVM and non-JVM source sets.
- Kotlin-only DSL APIs without a @JavaAPI bridge get a comment-only Java class.
- Adding a bridge may require a source-code change to be flagged before proceeding.
Security check
B- Allowed to use Edit, Write, Bash without limitsIn
SKILL.md
Checked automatically: .claude/skills/add-java-code-snippets-in-docs/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: ReadEditWriteBashGrepGlob
-
SKILL.md7 KB -
reference/factory-classes.md4 KB -
reference/interop-tables.md6 KB -
reference/pitfalls.md5 KB
Alternatives to add-java-code-snippets-in-docs
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
add-java-code-snippets-in-docs: common questions
Which JDK does the Java docs workflow need?
The source says JDK 17 is required. It notes that Gradle 8.x can fail cryptically on newer JDKs, so JAVA_HOME should point to JDK 17 in that case.
Why must the Java file name use a capital Java?
The docs knit.code.include check skips the package declaration only when the name contains capital Java. Lowercase or hyphenated names emit a package line that breaks compilation.
What should I do if a Kotlin example uses a Kotlin-only API?
The source says not to leave the Java tab empty. Write a compilable Java class with a main method and comments that explain the Kotlin DSL and the recommended Java alternative.
How do I install add-java-code-snippets-in-docs?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is add-java-code-snippets-in-docs free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is add-java-code-snippets-in-docs safe to use?
It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use edit, write, bash without limits). Review the code before you install. How grades work.
What are alternatives to add-java-code-snippets-in-docs?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
