OBEY Release It! by Michael T. Nygard
Purpose
This repository follows Release It! in the sense of Michael Nygard:
design and implement software that survives production reality - failures, overload, latency, partial outages, bad data, hostile traffic, and operational mistakes.
All code generation, edits, and reviews must optimize for:
- production readiness
- failure isolation
- graceful degradation
- back pressure and overload protection
- timeouts and retries with discipline
- observability
- survivability over ideal-path elegance
This file is a binding engineering policy: MUST is binding, SHOULD is a strong default, and MUST NOT is forbidden.
Primary Directive
Assume production will be messy.
When uncertain, prefer the design that:
- fails visibly instead of hanging silently
- limits blast radius instead of maximizing coupling
- sheds load instead of collapsing
- preserves core service under stress
- makes diagnosis possible
Do not design only for the happy path.
Stability Mindset Rules
- Every dependency can be slow, unavailable, or wrong.
- Every queue can fill.
- Every cache can miss or stampede.
- Every timeout can cascade.
- Every caller can retry badly.
- Every “temporary” degraded state can become normal for hours.
The code must assume these conditions, not merely tolerate them by accident.
Production Readiness and Release Risk Rules
- Do not treat QA success or feature completion as proof of production readiness.
- Design deployment, operations, security, observability, and rollback as part of the system.
- Reduce release risk through small exposure steps, compatibility discipline, and reversible changes.
- Make version, build, configuration, dependency, and runtime state visible enough to diagnose a live instance.
- Validate critical configuration at startup and make configuration changes auditable and reversible.
Dependency Protection Rules
Timeouts Are Mandatory
- Outbound calls must have explicit time limits.
- Timeouts must be chosen intentionally, not left to library defaults.
- Different dependencies may need different timeout budgets.
- Infinite waits are forbidden.
Retries Must Be Disciplined
- Retry only where repeated attempts are safe for the caller and provider.
- Bound retry count and total retry time.
- Add jitter/backoff to avoid synchronized retry storms.
- Do not retry validation errors or permanent failures.
Circuit Breakers and Fast Failure
- Protect unstable dependencies with fast-fail mechanisms when appropriate.
- When a dependency is clearly unhealthy, stop flooding it.
- Surface fallback or degraded mode explicitly.
Bulkheads and Isolation
- Separate resource pools for unrelated workloads where failure isolation matters.
- One failing integration must not consume all threads, connections, or worker capacity.
- Isolate slow or risky work from core request paths.
Anti-patterns (MUST NOT):
- nested retries at multiple layers
- no timeout around remote calls
- one shared pool for all outbound work
- treating all failures as transient
Load and Capacity Rules
Back Pressure
- The system must have a strategy for overload.
- Reject, defer, queue, or degrade intentionally.
- Unbounded acceptance of work is forbidden.
Queues
- Queues are buffers, not infinite storage.
- Monitor queue length, age, throughput, and failure rate.
- Know what happens when producers outpace consumers.
- Define dead-letter or poison-message handling explicitly.
Demand Control
- Protect scarce resources with limits.
- Prefer early rejection over total collapse.
- Reserve capacity for critical traffic when appropriate.
Load Shedding
- Define which work is optional under stress.
- Shed low-value work first.
- Preserve core functions whenever possible.
Additional Stability Patterns
- USE Steady State design so routine operation does not require manual cleanup, unbounded growth, or periodic rescue.
- USE Fail Fast when continuing would hold scarce resources or hide an unrecoverable dependency problem.
- USE Let It Crash only when supervisors, isolation, and restart behavior make crashing safer than limping.
- USE Handshaking between instances, load balancers, and dependencies so traffic reaches only ready components.
- USE Decoupling Middleware when it reduces direct failure propagation; monitor the middleware as a dependency.
- USE Governors to cap expensive behavior before it harms the rest of the system.
Anti-patterns (MUST NOT):
- unbounded queues
- accepting work with no plan to finish it
- letting best-effort tasks crowd out critical work
Runtime State and Restart Safety Rules
- Make runtime state visible through logs, metrics, health endpoints, administrative interfaces, and diagnostic data.
- Validate external responses by status, content type, shape, and semantics before trusting them.
- Make deployment and operational automation idempotent or restartable where practical.
- Avoid partial deployment or migration steps without a rollback or roll-forward path.
- Validate operational assumptions at system boundaries.
Restartable Automation
Required when:
- deployments touch many machines
- scripts may be rerun after partial failure
- migrations run while old and new application versions coexist
- operational procedures must be repeatable under release pressure
Anti-patterns (MUST NOT):
- one-shot deployment scripts that cannot safely resume
- manual repair steps with no recorded state
- side effects before a durable release checkpoint with no recovery plan
Resource Management Rules
- Explicitly budget scarce resources:
- threads
- DB connections
- sockets
- file descriptors
- memory
- CPU-intensive worker slots
- Release resources deterministically.
- Do not hold locks or expensive connections across slow remote calls.
- Use streaming or pagination for large payloads where appropriate.
- Guard memory-heavy operations.
Anti-patterns (MUST NOT):
- one huge in-memory batch by default
- blocking worker threads on slow I/O when a better model exists
- connection pools sized by guess and then ignored
Data Boundary Rules
- Treat all external input as untrusted.
- Validate syntax, shape, and business plausibility separately where needed.
- Avoid letting malformed data poison caches, queues, or downstream systems.
- Normalize and sanitize data once at the right boundary.
- Keep parsing errors and domain rule violations distinct.
Operational Visibility Rules
Observability Is Part of the Design
- Emit meaningful logs at boundaries and failure points.
- Include identifiers needed for correlation and diagnosis.
- Measure latency, throughput, error rate, saturation, queue depth, and retry behavior.
- Expose health information that reflects real dependency state.
Logging
- Log structured context, not just prose.
- Log failures with the dependency, operation, and outcome.
- Do not log secrets.
- Avoid log spam loops under retry storms.
Metrics
At minimum, capture:
- request rate
- success/failure counts
- dependency latency
- timeout counts
- queue depth
- retry counts
- circuit-breaker state
- saturation signals
Anti-patterns (MUST NOT):
- only logging stack traces without context
- no metrics for slow dependencies
- health checks that always return green despite broken downstreams
Incidents, Capacity, and Runtime Control
- After incidents, identify the failure chain, missing defenses, detection gaps, and design changes.
- For performance or capacity incidents, inspect demand, saturation, latency distribution, queue age, dependency behavior, and traffic concentration.
- Provide administrative interfaces or operational controls only with authorization, auditability, safe defaults, and clear stop mechanisms.
- Keep process code, scripts, and automation observable enough that operators can see what changed and why.
- Treat control planes and delivery tooling as production systems when they can affect production.
Deployment and Startup Rules
- Startup must fail fast on missing critical configuration.
- Health checks must reflect actual ability to serve.
- Health checks must not mask deadlocks or stuck subsystems.
- Avoid expensive or destructive startup work in request-serving processes when possible.
- Migrations and one-time jobs must be deliberate, observable, and recoverable.
Interconnect, Routing, Security, and Chaos Rules
- Keep DNS, service discovery, routing, and load balancing health-aware and current.
- Design interconnects to avoid concentrated demand, hidden single points of failure, and uncontrolled fan-out.
- Treat hostile traffic, abusive users, and malformed requests as production load cases.
- Include security in production readiness: secrets, permissions, administrative access, dependency trust, and input handling.
- Use production tests, launch checks, capacity tests, and game days to validate operational assumptions.
- Run chaos or disaster simulations only with a hypothesis, limited blast radius, observability, stop condition, and recovery path.
- Feed findings from chaos and disaster work back into design, operations, and tests.
API and Contract Rules
- Make failure modes explicit in API contracts where they matter.
- Return clear retryable vs non-retryable outcomes.
- Prefer coarse-grained, resilient interactions over fragile chattiness.
- Use versioning and compatibility discipline for long-lived contracts.
- Document retry, timeout, version, and compatibility expectations clearly.
Cache Rules
- Cache is an optimization, not a source of truth unless explicitly designed that way.
- Plan for cache miss storms, stale data, and cache outages.
- Avoid dogpiles with request coalescing or appropriate expiry strategies.
- Define what happens when the cache is unavailable.
Anti-patterns (MUST NOT):
- assuming cache hit rate is always high
- rebuilding the whole cache synchronously on miss
- hiding correctness assumptions inside cache behavior
Scheduled and Background Work Rules
- Spread scheduled work so demand does not concentrate at the same instant.
- Do not set all periodic jobs to run on the same obvious clock boundary.
- Failure and retry policy must be explicit.
- Retried work must use increasing backoff where synchronized retry pulses would create load.
- Long-running work needs bounded waits, progress visibility, timeout, and cancellation strategy.
Review Rules
When reviewing code, actively look for:
- outbound calls with no timeout
- retries without backoff, limits, or a clear failure policy
- no backoff or jitter
- unbounded queues or buffers
- shared resource pools with no isolation
- no overload strategy
- no failure visibility
- health checks that say nothing meaningful
- scheduled jobs concentrating load at the same instant
- caches treated as always available
Forbidden Patterns
Happy-Path Design
- code that assumes dependencies are fast and correct
- no timeout, no retry discipline, no degradation path
Retry Storms
- retries at every layer
- retries with no increasing backoff or limits
- synchronized retries without jitter
Collapse by Queue
- unbounded queue growth
- taking work forever even while falling behind
- no poison-message handling
Silent Failure
- swallowed exceptions
- generic “something went wrong” without context
- missing correlation information
Blast-Radius Amplification
- one dependency outage consuming all worker threads or DB connections
- shared pools for all risk classes with no isolation
Code Generation Rules
When generating code, default to:
- explicit timeout for every remote dependency
- explicit retry policy only where safe
- restartable deployment and operational automation where practical
- bounded resources and queues
- clear failure paths
- useful diagnostic hooks
- graceful degradation or fast failure where appropriate
Avoid by default:
- infinite waits
- implicit library retries
- unbounded buffering
- best-effort logging with no metrics
- fragile startup sequences
- one-shot release automation with no restart path
Testing Rules
- Test timeout behavior.
- Test retry, backoff, and failure boundaries.
- Test degraded dependency scenarios.
- Test overload and queue saturation behavior where practical.
- Test restartable deployment or operational automation where practical.
- Test startup and health-check failure modes.
Review Checklist
Before finalizing any change, verify:
- Does every remote call have an explicit timeout?
- Are retries bounded and safe?
- Are deployment and operational scripts restartable or idempotent where practical?
- Is there an overload strategy?
- Are queues and resource pools bounded?
- Is failure isolated from unrelated work?
- Are there enough diagnostics to investigate issues?
- Are health signals meaningful?
- Are scheduled and background workloads bounded and paced safely?
- Did we preserve the core service under likely failure scenarios?
If any answer is no, revise before shipping.
Final Instruction
When uncertain, prefer the design that:
- survives partial failure
- limits blast radius
- fails fast or degrades gracefully
- exposes enough information to operate
- prevents overload from becoming collapse
Production reality outranks happy-path elegance.
1---
2name: book-release-it-full
3description: >-
4 Release It! (Michael Nygard) — Full rules — comprehensive mandatory coding standards. Use when asked to apply Release It! principles or review code against Release It! standards.
5origin: "github.com/ciembor/agent-rules-books (MIT)"
6license: MIT
7version: "1.0.0"
8compatibility: "yana-ai >= 0.14.0"
9metadata:
10 source: https://skillmd.com/skills/yanacuti1121/book-release-it-full
11---
12
13# OBEY Release It! by Michael T. Nygard
14
15## Purpose
16
17This repository follows **Release It!** in the sense of Michael Nygard:
18design and implement software that survives production reality - failures, overload, latency, partial outages, bad data, hostile traffic, and operational mistakes.
19
20All code generation, edits, and reviews must optimize for:
21- production readiness
22- failure isolation
23- graceful degradation
24- back pressure and overload protection
25- timeouts and retries with discipline
26- observability
27- survivability over ideal-path elegance
28
29This file is a binding engineering policy: `MUST` is binding, `SHOULD` is a strong default, and `MUST NOT` is forbidden.
30
31---
32
33## Primary Directive
34
35Assume production will be messy.
36
37When uncertain, prefer the design that:
381. fails visibly instead of hanging silently
392. limits blast radius instead of maximizing coupling
403. sheds load instead of collapsing
414. preserves core service under stress
425. makes diagnosis possible
43
44Do not design only for the happy path.
45
46---
47
48## Stability Mindset Rules
49
501. Every dependency can be slow, unavailable, or wrong.
512. Every queue can fill.
523. Every cache can miss or stampede.
534. Every timeout can cascade.
545. Every caller can retry badly.
556. Every “temporary” degraded state can become normal for hours.
56
57The code must assume these conditions, not merely tolerate them by accident.
58
59---
60
61## Production Readiness and Release Risk Rules
62
631. Do not treat QA success or feature completion as proof of production readiness.
642. Design deployment, operations, security, observability, and rollback as part of the system.
653. Reduce release risk through small exposure steps, compatibility discipline, and reversible changes.
664. Make version, build, configuration, dependency, and runtime state visible enough to diagnose a live instance.
675. Validate critical configuration at startup and make configuration changes auditable and reversible.
68
69---
70
71## Dependency Protection Rules
72
73### Timeouts Are Mandatory
741. Outbound calls must have explicit time limits.
752. Timeouts must be chosen intentionally, not left to library defaults.
763. Different dependencies may need different timeout budgets.
774. Infinite waits are forbidden.
78
79### Retries Must Be Disciplined
801. Retry only where repeated attempts are safe for the caller and provider.
812. Bound retry count and total retry time.
823. Add jitter/backoff to avoid synchronized retry storms.
834. Do not retry validation errors or permanent failures.
84
85### Circuit Breakers and Fast Failure
861. Protect unstable dependencies with fast-fail mechanisms when appropriate.
872. When a dependency is clearly unhealthy, stop flooding it.
883. Surface fallback or degraded mode explicitly.
89
90### Bulkheads and Isolation
911. Separate resource pools for unrelated workloads where failure isolation matters.
922. One failing integration must not consume all threads, connections, or worker capacity.
933. Isolate slow or risky work from core request paths.
94
95Anti-patterns (MUST NOT):
96- nested retries at multiple layers
97- no timeout around remote calls
98- one shared pool for all outbound work
99- treating all failures as transient
100
101---
102
103## Load and Capacity Rules
104
105### Back Pressure
1061. The system must have a strategy for overload.
1072. Reject, defer, queue, or degrade intentionally.
1083. Unbounded acceptance of work is forbidden.
109
110### Queues
1111. Queues are buffers, not infinite storage.
1122. Monitor queue length, age, throughput, and failure rate.
1133. Know what happens when producers outpace consumers.
1144. Define dead-letter or poison-message handling explicitly.
115
116### Demand Control
1171. Protect scarce resources with limits.
1182. Prefer early rejection over total collapse.
1193. Reserve capacity for critical traffic when appropriate.
120
121### Load Shedding
1221. Define which work is optional under stress.
1232. Shed low-value work first.
1243. Preserve core functions whenever possible.
125
126### Additional Stability Patterns
127- USE Steady State design so routine operation does not require manual cleanup, unbounded growth, or periodic rescue.
128- USE Fail Fast when continuing would hold scarce resources or hide an unrecoverable dependency problem.
129- USE Let It Crash only when supervisors, isolation, and restart behavior make crashing safer than limping.
130- USE Handshaking between instances, load balancers, and dependencies so traffic reaches only ready components.
131- USE Decoupling Middleware when it reduces direct failure propagation; monitor the middleware as a dependency.
132- USE Governors to cap expensive behavior before it harms the rest of the system.
133
134Anti-patterns (MUST NOT):
135- unbounded queues
136- accepting work with no plan to finish it
137- letting best-effort tasks crowd out critical work
138
139---
140
141## Runtime State and Restart Safety Rules
142
1431. Make runtime state visible through logs, metrics, health endpoints, administrative interfaces, and diagnostic data.
1442. Validate external responses by status, content type, shape, and semantics before trusting them.
1453. Make deployment and operational automation idempotent or restartable where practical.
1464. Avoid partial deployment or migration steps without a rollback or roll-forward path.
1475. Validate operational assumptions at system boundaries.
148
149### Restartable Automation
150Required when:
151- deployments touch many machines
152- scripts may be rerun after partial failure
153- migrations run while old and new application versions coexist
154- operational procedures must be repeatable under release pressure
155
156Anti-patterns (MUST NOT):
157- one-shot deployment scripts that cannot safely resume
158- manual repair steps with no recorded state
159- side effects before a durable release checkpoint with no recovery plan
160
161---
162
163## Resource Management Rules
164
1651. Explicitly budget scarce resources:
166 - threads
167 - DB connections
168 - sockets
169 - file descriptors
170 - memory
171 - CPU-intensive worker slots
1722. Release resources deterministically.
1733. Do not hold locks or expensive connections across slow remote calls.
1744. Use streaming or pagination for large payloads where appropriate.
1755. Guard memory-heavy operations.
176
177Anti-patterns (MUST NOT):
178- one huge in-memory batch by default
179- blocking worker threads on slow I/O when a better model exists
180- connection pools sized by guess and then ignored
181
182---
183
184## Data Boundary Rules
185
1861. Treat all external input as untrusted.
1872. Validate syntax, shape, and business plausibility separately where needed.
1883. Avoid letting malformed data poison caches, queues, or downstream systems.
1894. Normalize and sanitize data once at the right boundary.
1905. Keep parsing errors and domain rule violations distinct.
191
192---
193
194## Operational Visibility Rules
195
196### Observability Is Part of the Design
1971. Emit meaningful logs at boundaries and failure points.
1982. Include identifiers needed for correlation and diagnosis.
1993. Measure latency, throughput, error rate, saturation, queue depth, and retry behavior.
2004. Expose health information that reflects real dependency state.
201
202### Logging
2031. Log structured context, not just prose.
2042. Log failures with the dependency, operation, and outcome.
2053. Do not log secrets.
2064. Avoid log spam loops under retry storms.
207
208### Metrics
209At minimum, capture:
210- request rate
211- success/failure counts
212- dependency latency
213- timeout counts
214- queue depth
215- retry counts
216- circuit-breaker state
217- saturation signals
218
219Anti-patterns (MUST NOT):
220- only logging stack traces without context
221- no metrics for slow dependencies
222- health checks that always return green despite broken downstreams
223
224---
225
226## Incidents, Capacity, and Runtime Control
227
2281. After incidents, identify the failure chain, missing defenses, detection gaps, and design changes.
2292. For performance or capacity incidents, inspect demand, saturation, latency distribution, queue age, dependency behavior, and traffic concentration.
2303. Provide administrative interfaces or operational controls only with authorization, auditability, safe defaults, and clear stop mechanisms.
2314. Keep process code, scripts, and automation observable enough that operators can see what changed and why.
2325. Treat control planes and delivery tooling as production systems when they can affect production.
233
234---
235
236## Deployment and Startup Rules
237
2381. Startup must fail fast on missing critical configuration.
2392. Health checks must reflect actual ability to serve.
2403. Health checks must not mask deadlocks or stuck subsystems.
2414. Avoid expensive or destructive startup work in request-serving processes when possible.
2425. Migrations and one-time jobs must be deliberate, observable, and recoverable.
243
244---
245
246## Interconnect, Routing, Security, and Chaos Rules
247
2481. Keep DNS, service discovery, routing, and load balancing health-aware and current.
2492. Design interconnects to avoid concentrated demand, hidden single points of failure, and uncontrolled fan-out.
2503. Treat hostile traffic, abusive users, and malformed requests as production load cases.
2514. Include security in production readiness: secrets, permissions, administrative access, dependency trust, and input handling.
2525. Use production tests, launch checks, capacity tests, and game days to validate operational assumptions.
2536. Run chaos or disaster simulations only with a hypothesis, limited blast radius, observability, stop condition, and recovery path.
2547. Feed findings from chaos and disaster work back into design, operations, and tests.
255
256---
257
258## API and Contract Rules
259
2601. Make failure modes explicit in API contracts where they matter.
2612. Return clear retryable vs non-retryable outcomes.
2623. Prefer coarse-grained, resilient interactions over fragile chattiness.
2634. Use versioning and compatibility discipline for long-lived contracts.
2645. Document retry, timeout, version, and compatibility expectations clearly.
265
266---
267
268## Cache Rules
269
2701. Cache is an optimization, not a source of truth unless explicitly designed that way.
2712. Plan for cache miss storms, stale data, and cache outages.
2723. Avoid dogpiles with request coalescing or appropriate expiry strategies.
2734. Define what happens when the cache is unavailable.
274
275Anti-patterns (MUST NOT):
276- assuming cache hit rate is always high
277- rebuilding the whole cache synchronously on miss
278- hiding correctness assumptions inside cache behavior
279
280---
281
282## Scheduled and Background Work Rules
283
2841. Spread scheduled work so demand does not concentrate at the same instant.
2852. Do not set all periodic jobs to run on the same obvious clock boundary.
2863. Failure and retry policy must be explicit.
2874. Retried work must use increasing backoff where synchronized retry pulses would create load.
2885. Long-running work needs bounded waits, progress visibility, timeout, and cancellation strategy.
289
290---
291
292## Review Rules
293
294When reviewing code, actively look for:
295- outbound calls with no timeout
296- retries without backoff, limits, or a clear failure policy
297- no backoff or jitter
298- unbounded queues or buffers
299- shared resource pools with no isolation
300- no overload strategy
301- no failure visibility
302- health checks that say nothing meaningful
303- scheduled jobs concentrating load at the same instant
304- caches treated as always available
305
306---
307
308## Forbidden Patterns
309
310### Happy-Path Design
311- code that assumes dependencies are fast and correct
312- no timeout, no retry discipline, no degradation path
313
314### Retry Storms
315- retries at every layer
316- retries with no increasing backoff or limits
317- synchronized retries without jitter
318
319### Collapse by Queue
320- unbounded queue growth
321- taking work forever even while falling behind
322- no poison-message handling
323
324### Silent Failure
325- swallowed exceptions
326- generic “something went wrong” without context
327- missing correlation information
328
329### Blast-Radius Amplification
330- one dependency outage consuming all worker threads or DB connections
331- shared pools for all risk classes with no isolation
332
333---
334
335## Code Generation Rules
336
337When generating code, default to:
3381. explicit timeout for every remote dependency
3392. explicit retry policy only where safe
3403. restartable deployment and operational automation where practical
3414. bounded resources and queues
3425. clear failure paths
3436. useful diagnostic hooks
3447. graceful degradation or fast failure where appropriate
345
346Avoid by default:
347- infinite waits
348- implicit library retries
349- unbounded buffering
350- best-effort logging with no metrics
351- fragile startup sequences
352- one-shot release automation with no restart path
353
354---
355
356## Testing Rules
357
3581. Test timeout behavior.
3592. Test retry, backoff, and failure boundaries.
3603. Test degraded dependency scenarios.
3614. Test overload and queue saturation behavior where practical.
3625. Test restartable deployment or operational automation where practical.
3636. Test startup and health-check failure modes.
364
365---
366
367## Review Checklist
368
369Before finalizing any change, verify:
370- Does every remote call have an explicit timeout?
371- Are retries bounded and safe?
372- Are deployment and operational scripts restartable or idempotent where practical?
373- Is there an overload strategy?
374- Are queues and resource pools bounded?
375- Is failure isolated from unrelated work?
376- Are there enough diagnostics to investigate issues?
377- Are health signals meaningful?
378- Are scheduled and background workloads bounded and paced safely?
379- Did we preserve the core service under likely failure scenarios?
380
381If any answer is no, revise before shipping.
382
383---
384
385## Final Instruction
386
387When uncertain, prefer the design that:
3881. survives partial failure
3892. limits blast radius
3903. fails fast or degrades gracefully
3914. exposes enough information to operate
3925. prevents overload from becoming collapse
393
394Production reality outranks happy-path elegance.