Generate Konveyor analyzer migration rules from any migration guide. Point your AI coding agent at a guide and get validated, tested rules ready for the konveyor/rulesets repo.
- Go 1.25+
- Java 21+ (required by kantra's bundled jdtls)
- kantra (for rule testing)
- An AI coding agent (Claude Code, OpenCode, Goose, Codex, or similar)
git clone https://github.com/konveyor/ai-rule-gen.gitSkills follow the Agent Skills format and are bundled in the repo. Open the repo in your agent — no registration step needed.
Two commands are available:
| Command | What it does |
|---|---|
/generate-rules |
Generate rules only (no testing) |
/generate-rules-with-test |
Full pipeline with test generation and validation |
/generate-rules https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
/generate-rules-with-test https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
/generate-rules https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
/generate-rules-with-test https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
/skills generate-rules https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
/skills generate-rules-with-test https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
$generate-rules checkpoint_behavior=stop_after_extract https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
$generate-rules checkpoint_behavior=continue https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
Read and follow agents/generate-rules/SKILL.md. Input: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
By default, the agent prompts at checkpoint whether to continue with testing. Pass checkpoint_behavior=stop_after_extract (rules only) or checkpoint_behavior=continue (full pipeline) to skip the prompt.
The input can be a URL, a file path, or pasted migration guide text.
To add tests to rules generated with /generate-rules, use the resume mechanism:
/generate-rules-with-test resume_from=scaffold migration_dir=output/<source>-to-<target>-<timestamp>
You can optionally pass explicit source and target labels (multiple of each are supported):
/generate-rules sources=["spring-boot3","spring-boot"] targets=["spring-boot4","spring-boot"] https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
Each source and target becomes its own konveyor.io/source= or konveyor.io/target= label on every generated rule, matching the konveyor/rulesets label conventions. If omitted, sources and targets are auto-detected from the guide.
The agent runs the full pipeline automatically:
- Ingest the migration guide into clean markdown
- Extract every migration pattern (API changes, dependency updates, config renames, POM structure)
- Construct Konveyor rule YAML files from the patterns
- Scaffold test directories and generate test source code
- Run kantra to validate every rule finds incidents
- Fix any failing rules (up to 3 iterations)
- Report final pass rate and output locations
output/
└── <primary-source>-to-<primary-target>-<timestamp>/
├── guide.md # Ingested migration guide
├── patterns.json # Extracted migration patterns (sources/targets arrays)
├── rules/ # Rule YAML files ready for konveyor/rulesets
│ ├── ruleset.yaml # Ruleset with all source/target labels
│ ├── web.yaml
│ └── ...
├── tests/ # Kantra test suites
└── report.yaml # Summary report
All LLM orchestration lives in agent skills. The Go CLI is purely deterministic — no LLM calls, no API keys, no prompt templates.
Migration Guide → Agent extracts patterns → CLI constructs rules → CLI scaffolds tests
→ Agent generates test code → kantra validates → Agent fixes failures → Tested rules
| Layer | What | LLM? |
|---|---|---|
Agent skills (agents/) |
Read guides, extract patterns, generate test code, fix failures | Yes |
CLI commands (cmd/) |
Ingest, construct, validate, scaffold, sanitize, test, report | No |
| Skill | Role |
|---|---|
| generate-rules | Orchestrates the full end-to-end pipeline |
| rule-writer | Reads migration guide, extracts migration patterns into patterns.json |
| test-generator | Reads manifest.json, generates compilable test source code |
| rule-validator | Runs kantra, interprets results, generates fix hints |
| eval | One-stop eval — runs deterministic checks + LLM judge, finds missed patterns and false positives |
Each skill follows the Agent Skills format with a SKILL.md and optional references/ directory.
See docs/howto/eval.md for how to measure rule quality, app coverage, and run regression comparisons.
- analyzer-rule-generator (ARG) — Python rule generation pipeline
- kantra — Rule testing and analysis CLI
- analyzer-lsp — Rule engine and analyzer
Apache-2.0