Explicit Configuration
Name
han-core:explicit-configuration
Description
When configuring services, APIs, or framework features, explicitly set all parameters rather than relying on defaults. Defaults vary across versions, environments, and frameworks.
Principle
What works with defaults in development may fail in production. Explicit configuration is documentation that runs.
Examples
Database connections:
- Set pool size, timeout, retry policy explicitly
- Don't rely on default connection string parsing
API calls:
- Set timeout, retry count, headers explicitly
- Don't assume default content-type
Framework config:
- Set port, environment, logging level explicitly
- Don't rely on framework auto-detection
Security settings:
- Never rely on default CORS, auth, or session config
- Always configure explicitly, even if the default is "secure"
Anti-Pattern
createServer() // relies on default port, middleware, error handling
Pattern
createServer({
port: config.PORT,
timeout: 30000,
cors: { origin: config.ALLOWED_ORIGINS }
})
When to Apply
- Any time you're initializing a service, client, or framework
- Any time you're configuring infrastructure (Docker, CI, cloud services)
- Any time the behavior difference between dev and production matters
1---
2name: explicit-configuration
3user-invocable: false
4description: Prefer explicit configuration over framework defaults to prevent environment-dependent failures
5allowed-tools: []
6---
7
8# Explicit Configuration
9
10## Name
11han-core:explicit-configuration
12
13## Description
14
15When configuring services, APIs, or framework features, explicitly set all parameters rather than relying on defaults. Defaults vary across versions, environments, and frameworks.
16
17## Principle
18
19What works with defaults in development may fail in production. Explicit configuration is documentation that runs.
20
21## Examples
22
23**Database connections:**
24- Set pool size, timeout, retry policy explicitly
25- Don't rely on default connection string parsing
26
27**API calls:**
28- Set timeout, retry count, headers explicitly
29- Don't assume default content-type
30
31**Framework config:**
32- Set port, environment, logging level explicitly
33- Don't rely on framework auto-detection
34
35**Security settings:**
36- Never rely on default CORS, auth, or session config
37- Always configure explicitly, even if the default is "secure"
38
39## Anti-Pattern
40
41```
42createServer() // relies on default port, middleware, error handling
43```
44
45## Pattern
46
47```
48createServer({
49 port: config.PORT,
50 timeout: 30000,
51 cors: { origin: config.ALLOWED_ORIGINS }
52})
53```
54
55## When to Apply
56
57- Any time you're initializing a service, client, or framework
58- Any time you're configuring infrastructure (Docker, CI, cloud services)
59- Any time the behavior difference between dev and production matters