Generate Classes
Developmentgenerate-classesGenerate Classes is an Agent Skill for development published in the apache/skywalking repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Generate bytecode classes from DSL scripts (MAL, OAL, LAL, Hierarchy). Runs the compiler and dumps .class files for inspection.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/apache/skywalking/blob/HEAD/.claude/skills/generate-classes/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/generate-classes, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Generate DSL Classes
Run the v2 compiler (ANTLR4 + Javassist) to generate bytecode classes from DSL scripts and dump .class files to disk for inspection.
Commands by argument
mal — MAL expression classes
./mvnw test -pl oap-server/analyzer/dsl-scripts-test \
-Dtest=MALExpressionExecutionTest -DfailIfNoTests=false -Dcheckstyle.skip
Output location: oap-server/analyzer/dsl-scripts-test/src/test/resources/scripts/mal/**/*.generated-classes/
oal — OAL metrics/dispatcher/builder classes
./mvnw test -pl oap-server/oal-rt \
-Dtest=RuntimeOALGenerationTest -DfailIfNoTests=false -Dcheckstyle.skip
Output location: oap-server/oal-rt/target/test-classes/metrics/, metrics/builder/, dispatcher/
lal — LAL filter/extractor classes
./mvnw test -pl oap-server/analyzer/dsl-scripts-test \
-Dtest=LALExpressionExecutionTest -DfailIfNoTests=false -Dcheckstyle.skip
Output location: oap-server/analyzer/dsl-scripts-test/src/test/resources/scripts/lal/**/*.generated-classes/
hierarchy — Hierarchy rule classes
./mvnw test -pl oap-server/analyzer/dsl-scripts-test \
-Dtest=HierarchyRuleExecutionTest -DfailIfNoTests=false -Dcheckstyle.skip
Output location: oap-server/analyzer/dsl-scripts-test/src/test/resources/scripts/hierarchy-rule/*.generated-classes/
all or no argument — generate all DSLs
Run all four commands above sequentially.
After generation
Print the output location for the requested DSL so the user knows where to find the generated .class files. Use javap to decompile:
javap -c -p <path-to-class-file>
Cleaning generated classes
./mvnw clean -pl oap-server/analyzer/dsl-scripts-test