spring-to-solon-skill

A migration guide for moving Java projects from Spring Boot or Spring Cloud to Solon, an independent Java enterprise framework. It maps annotations, dependencies, configuration, architecture, web, data, security, scheduling, validation, cloud, and testing concepts.

In plain words
What is it for?
Replacing Spring dependencies and annotations, changing the application entry point and configuration, adapting dependency injection, and migrating web, data, security, scheduling, validation, cloud, and test code to Solon.
Why use it?
Spring and Solon use different packages, annotations, startup code, configuration files, and injection rules. The guide identifies those differences so a migration does not leave incompatible Spring pieces behind.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/opensolon/soloncode/spring-to-solon-skill
Any agent
npx skills add opensolon/soloncode --skill spring-to-solon-skill
Clone the repo
git clone --depth 1 https://github.com/opensolon/soloncode

Made for: Claude Code, Codex.

Per session 153 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,272 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00153 $0.03272
Opus 5 $0.00077 $0.01636
Sonnet 5 $0.00031 $0.00654
Haiku 4.5 $0.00015 $0.00327

Measured 2d ago against content hash 2b7db5d97b04, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spring-to-solon-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

soloncode-cli/release/skills/spring-to-solon-skill/SKILL.md · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spring to Solon Migration Skill

为将 Spring Boot / Spring Cloud 项目迁移到 Solon 框架 提供专家指导。Solon 是独立的 Java 企业框架(不基于 Spring),开发体验相近,但注解、架构与生态不同。

官方对照: https://solon.noear.org/article/compare-springboot
Cloud 对照: https://solon.noear.org/article/compare-springcloud
官网: https://solon.noear.org
当前版本: 4.0.3

版本声明:本文档所有示例基于 Solon 4.0.3(最后一次确认: 2026-07)。如需迁移到其他版本,请调整对应版本号。Solon 高版本保持向后兼容,通常仅需修改 solon-parent 版本号即可。reference 内写「跟随 SKILL 目标版本」时,以本节为准。

Critical Migration Rules

  1. Solon 不是 Spring。 禁止混用 Spring 注解与 Solon 注解。替换全部 Spring import。
  2. 禁止 Spring 依赖。 移除所有 spring-boot-starter-*spring-*。Solon 使用 org.noear groupId。
  3. 配置文件app.yml(或 app.properties),不是 application.yml
  4. 入口Solon.start(App.class, args),不是 SpringApplication.run()
  5. Parent POMsolon-parentgroupId=org.noear)。
  6. 包扫描在主类用 @Import / 主类包路径,不是 @ComponentScan
  7. 无 setter 注入。 Solon 只支持字段注入与构造器注入;构造器参数必须显式 @Inject
  8. 组件用 @Component,不要用 @Service / @Repository
  9. 所有示例目标 Solon 4.0.x(默认 4.0.3),除非用户指定其它版本。
  10. 中文支持。 用户使用中文时,回复与代码注释使用中文。
  11. 不确定的 API 不要臆造。 对照本 skill reference;Solon 原生细节查 solon-development-skill
  12. 校验坐标solon-security-validation(不是 solon-validation)。类级启用 @Valid,实体参数/字段用 @Validated
  13. 调度选型:单机 → @Scheduledscheduling_migration.md);分布式防重 → @CloudJobcloud_observability_migration.md)。勿一律替换。

与 solon-development-skill 的边界

场景 使用 skill
Spring → Solon 对照、替换、迁移步骤 本 skill
纯 Solon 新功能 / AI / Flow / 最佳实践 solon-development-skill
两边都提及时 先按本 skill 完成迁移对照,再链开发 skill 补原生写法

执行流程

  1. 扫项目:父 POM、starter 列表、配置文件名、启动类、测试入口、是否有 Security / Validation / Scheduling / Cloud。
  2. 按 Checklist Step 1→12 推进;每步只 read 1~2 个 reference,避免一次加载全部。
  3. 生成代码前核对 Critical Migration Rules(尤其:app.yml、无 Spring 混用、@Component/@Inject、校验坐标)。
  4. 数据层优先 datasource_orm_migration.md(含 solon.dataSources、SqlUtils、@Db)。
  5. 安全优先 security_migration.md(不要复刻完整 Spring Security 过滤器链)。
  6. 校验优先 validation_migration.md(与 web_advanced 摘要冲突时以 validation 文为准)。
  7. 迁移完成后的 Solon 深化(AI/Flow/进阶 API)交给 solon-development-skill

Read the full file on GitHub · 190 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 190 lines · 153 tokens per session scan A 2b7db5d97b04

Subscribe to this mod's changes

spring-to-solon-skill is a skill published in the GitHub repository opensolon/soloncode (190 stars, last pushed 2d ago), licensed MIT. It adds 153 tokens to every session and 3,272 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.