跳到正文
cccskills
免费在 GitHub 公开

configuration-properties

Use when introducing or correcting grouped Spring Boot configuration, typed property binding, validation, profiles or secret injection. Do not rewrite unrelated single-value configuration.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(5)

  • SKILL.md3.2 KB
  • agents/openai.yaml271 B
  • examples/bad-client.java243 B
  • examples/ClientProperties.java732 B
  • examples/good-client.yml92 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Configuration Properties

Spring Boot 3 baseline

The examples use Java 17 and Jakarta APIs supported by this Boot version. Keep dependencies managed by the project's Boot BOM.

Bind and validate

Inspect existing property prefixes and external deployment configuration before renaming keys. Use a typed ConfigurationProperties record for a related group of settings. Register it with EnableConfigurationProperties or ConfigurationPropertiesScan; a record is not automatically a bean. Use Validated and Jakarta constraints, and include spring-boot-starter-validation. Validate nested objects with Valid. A single record constructor needs no ConstructorBinding annotation.

Use explicit units for durations and sizes. Provide defaults only when they are operationally safe; missing credentials or required endpoints should fail startup. Do not assume NotNull rejects zero or negative Duration values; add a duration constraint or an explicit invariant.

ClientProperties and its configuration show a validated prefix with explicit duration units. Do not turn a full API token into a record component: generated toString can expose secrets. Resolve secrets at the integration boundary or use a redacting value type.

Deployment and overrides

Document the public property keys and validate actual environment-variable binding in a test. Use environment variables or a mounted secret/config tree according to the deployment platform. Higher-precedence property sources can override packaged defaults; test the intended profile and override path. Avoid depending on YAML list merging: lists are generally replaced. Keep profile activation outside documents activated by that same profile.

Do not publish configprops/env actuator endpoints publicly or disable sanitization to debug. Binding is normally at startup; changing a file or secret does not imply live refresh. Define restart/rotation behavior when configuration changes.

Verification

Use ApplicationContextRunner with EnableConfigurationProperties to assert valid binding and startup failure on missing or invalid settings. Test nested validation, unit conversion and the override path you actually deploy. Include at least one invalid duration test.

Gotchas

  • Agent defines a properties record but never registers it - enable scanning or explicit registration.
  • Agent adds Validated without a validation provider - include the validation starter.
  • Agent uses a bare numeric timeout - use explicit units.
  • Agent adds a default credential - fail fast and inject secrets externally.
  • Agent logs the full bound configuration - redact secret-bearing values.

Official sources

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use when adding Spring AI-specific model observations, token usage, latency, externally configured cost attribution, advisor telemetry, or protected prompt and completion logging. Use production-observability for general service metrics, health, logs, and OTLP setup.

中文简介正在准备中。当前显示原文说明。

rrezartprebreza/spring-boot-skills3212026年10月22日 更新

Use when versioning Spring MVC or WebFlux APIs in Spring Boot 3 / Spring Framework 6. Covers explicit URL, header, and media-type strategies, compatibility rules, and deprecation handling.

中文简介正在准备中。当前显示原文说明。

rrezartprebreza/spring-boot-skills3212026年10月22日 更新

Use when versioning Spring MVC or WebFlux APIs in Spring Boot 4 / Spring Framework 7. Covers built-in mapping versions, request version resolution, defaults, supported versions, and deprecation headers.

中文简介正在准备中。当前显示原文说明。

rrezartprebreza/spring-boot-skills3212026年10月22日 更新

Use when packaging a Spring Boot 3 application as an OCI image or GraalVM native executable. Covers buildpacks, layered images, JVM containers, AOT hints, probes, security, and verification.

中文简介正在准备中。当前显示原文说明。

rrezartprebreza/spring-boot-skills3212026年10月22日 更新

Use when packaging Spring Boot 4 as an OCI image, JVM container, AOT application, or GraalVM native executable. Covers buildpacks, layers, runtime hints, probes, security, and verification.

中文简介正在准备中。当前显示原文说明。

rrezartprebreza/spring-boot-skills3212026年10月22日 更新

Use when evolving aggregate invariants, value objects or domain events in an existing DDD-style Spring Boot 3 application, or when DDD is explicitly requested. Preserve existing API identifiers and architecture when changing domain behavior.

中文简介正在准备中。当前显示原文说明。

rrezartprebreza/spring-boot-skills3212026年10月22日 更新

查看 rrezartprebreza 的全部技能

报告此技能的问题