Scroll AI Now

Agent skill

Configuration properties

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

By rrezartprebreza · rrezartprebreza/spring-boot-skills · MIT License · ★ 367 · 74 lines

New to this? An agent skill is a file of instructions your AI assistant follows for one job. The text above is written for the assistant. How to use a skill

What it does

Configuration properties is an agent skill from rrezartprebreza/spring-boot-skills, a GitHub repo with 374 stars.
In short, it gives your assistant a fixed routine for one kind of job.
The file is 74 lines long and is set out in parts such as “Spring Boot 3 baseline”, “Bind and validate”, “Deployment and overrides” and “Secret rotation and exposure checks”.
It is plain instructions, with no code to run.

When to use it

Reach for it when you do this job often and want the same good result each time.
Everything it needs is in this one file.
It does not ask for special tools.

Safety check

Our checker read all 74 lines before we listed it.
It found no attack techniques, no hidden text and no steps that switch off your assistant's safety or send your data away.
It flagged nothing else to watch for.
The text links to 1 outside site.
It is shared under the MIT license.
Still read it before you use it, like any instructions you give your AI.

Open in the appOriginal on GitHub

What is inside

How to use it

Read the full guide to using an agent skill

Want your own? How to write an agent skill that works

The full skill

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

# 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](examples/ClientProperties.java) and
[its configuration](examples/good-client.yml) 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.

## Secret rotation and exposure checks

Document who owns each secret, how consumers reload it, and when the old credential is revoked.
Configuration binding at startup does not automatically refresh a connection pool, HTTP client,
signing key or cached credential. Test the real restart/reload path before a rotation rollout.
Where a provider supports overlapping keys, keep the overlap bounded and verify that consumers
accept the new key before removing the old one. A compromised key may require immediate
revocation through the incident owner rather than a normal overlap window.

Check config files, build output, container layers and CI logs for accidental credential exposure.
Use synthetic canary values in tests, never production secrets. Test that binding failures,
generated toString methods and startup logs do not echo credentials. If exposure is found,
coordinate revocation and evidence handling; deleting a file does not invalidate its credential.
Do not publish secret-bearing diagnostics or rewrite repository history without approval.

## 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

- [Boot external configuration](https://docs.spring.io/spring-boot/reference/features/external-config.html)
- [Configuration property validation](https://docs.spring.io/spring-boot/reference/features/external-config.html#features.external-config.typesafe-configuration-properties.validation)

Copyright (c) 2026 Rrezart Prebreza.
Published under the MIT License, which you can read in full there.
Shown as published on GitHub, with credit and a link to the original.
Read it before you use it.

Are you the author?

This skill passed our automated safety check.
Show it in your README with the badge below.
It links readers back to this page. How the badge works

Featured on Scroll AI Now, passed its automated safety check

Markdown
[![Featured on Scroll AI Now, passed its automated safety check](https://scrollainow.com/badge/safety-checked.svg)](https://scrollainow.com/skills/configuration-properties/)
HTML
<a href="https://scrollainow.com/skills/configuration-properties/"><img src="https://scrollainow.com/badge/safety-checked.svg" alt="Featured on Scroll AI Now, passed its automated safety check" height="28"></a>

More skills

All agent skills

Try it in your browser

Today's AI news, one card per swipe.
Free to start.

Open the web app