Code Atlas
Overview
This skill utilizes the io.github.euledge.code-atlas Gradle plugin to automatically generate architectural diagrams from compiled Java bytecode. It supports PlantUML and Mermaid formats.
Core Mandate
- •NEVER modify
build.gradleto change diagram settings. - •ALWAYS use command-line options (e.g.,
--rootPackages,--formats) to specify or override configuration. - •ENSURE the project is built (
./gradlew classes) before generating diagrams, as the plugin analyzes bytecode.
Capabilities
1. Help & Discovery
To see all available options directly from the plugin:
powershell
./gradlew help --task generateDiagrams
2. Generate Diagrams
Use the generateDiagrams task with command-line options.
Available Options:
- •
--formats:plantuml,mermaid(comma-separated, default:plantuml). - •
--outputDir: Directory path for output files (default:docs/diagrams). - •
--rootPackages: Package prefixes to include (e.g.,com.example.domain). - •
--showDetails:trueorfalse(default:true). Set tofalsefor a simplified overview without fields/methods. - •
--stripPackagePrefix: Removes prefix from class names for cleaner diagrams (e.g.,com.example). - •
--groupByPackage:trueorfalse(default:true). Groups classes into package blocks.
Example (Simplified Mermaid Diagram):
powershell
./gradlew generateDiagrams --rootPackages=com.example.ordertable --formats=mermaid --showDetails=false --stripPackagePrefix=com.example
Workflow
- •Build Project: Run
./gradlew classesto ensure bytecode is up-to-date. - •Identify Scope: Determine the package or context to visualize.
- •Execute Task: Run
./gradlew generateDiagramswith desired options. - •Verify: Check the
outputDir(defaultdocs/diagrams) for generated.pumlor.mmdfiles.
Troubleshooting
- •No classes found: Run
./gradlew classesfirst. - •Diagram too complex: Use
--showDetails=falseand--rootPackagesto narrow the scope. - •Verbose output: Run with
--infoto see which classes are being analyzed.
Example Instructions / 指示の例
- •"Generate class diagrams for the
usercontext using Mermaid." (Mermaidを使ってuserコンテキストのクラス図を生成して。) - •"Create a simplified diagram of the
com.example.domainpackage, excluding detailed fields/methods." (com.example.domainパッケージの簡略化した図を作成して。詳細なフィールドやメソッドは除外して。) - •"Run the help task for generateDiagrams to show available options." (generateDiagramsのヘルプタスクを実行して利用可能なオプションを表示して。)