cache-architect
Designs the application cache as a decorator of a port: keys, provider, expiry, invalidation and failure.
22-cache.md, block by block
bank-app has no 22-cache.md yet. These are the blocks SKILL.md says the partial contains.
## 1 · Cached reads
One row per read, every column of step 5
## 2 · Provider
The provider, the matrix row that chose it, the rejected ones in one line each, transaction awareness, and whether it was inherited
## 3 · Expiry and size
Per cache: expiry next to its tolerance, maximum size, jitter, refresh ahead
## 4 · Invalidation
Every writer of the cached data, its path, its eviction, its staleness bound
## 5 · Failure and load
Error handler, client timeout, what the source does without the cache
## 6 · Serialization
Per cache: serializer and format version (Redis); none for a local cache of immutable records
## 7 · Observability
Metric names, and the alarm each one exists for
## 8 · Declared dependencies
Coordinates, version empty when managed
## 9 · Configuration
Every property the cache reads, its value, and which partial owns the value
## 10 · Deferred
Same shape as every partial. none when nothing was deferred
## Compose services
The redis row, or none for a local cache
## Design patterns
The Decorator over each port, with its classes — step 9b
What it reads, writes and refuses
The skill's own contract, from SKILL.md, in the original wording.
Class
design — the territory is skill_classes.design in @.claude/schemas/extensions.json, and ArchHook.java guard enforces it. Writes inside the use case folder and nothing else.
Reads
docs/use-cases/UC-NNN-<slug>/00-use-case.md (mandatory), 10-domain.md (mandatory), 20-persistence.md, 28-http-client.md and 35-jobs.md (when present), the Components tables and 22-cache.md of earlier cases, pom.xml, docker-compose.yml, the active blueprint's packages.map, @.claude/rules/caching.md, @.claude/rules/architecture-ddd.md, @.claude/rules/observability.md, @.claude/rules/secrets.md, @.claude/skills/docker-architect/references/compose-service-decision.md, and this skill's references/.
Writes
docs/use-cases/UC-NNN-<slug>/22-cache.md. Nothing else.
Owns
which reads are cached and the key of each, the cache provider of the project, expiry and size per cache, the list of writers that must evict, failure and load handling of the cache, the cache serialization and format version, cache metrics, and the redis compose row.
Does not decide
the freshness tolerance (00-use-case.md), the port or the record it returns (10-domain.md), the query or the call behind the port (20-persistence.md, 28-http-client.md), the replica count when a partial already recorded it, or the tests (40-tests.md). Does not write Java, pom.xml, application.yml or docker-compose.yml — the executor and docker-architect do, from this partial. Doesn't touch .claude/rules/**.
Source: SKILL.md § Contract, at nerviz e4cae27.
What the guard does with it
design is the skill's class. ArchHook opens a phase when the skill is called and checks every write against the class's territory. The text on the right is the hook's own.
write_allow of class design
- ✓
docs/use-cases/UC-*/** - ✓
docs/use-cases/BACKLOG.md src/**: migrations and classes are the executor'sdocker-compose.yml: another class's filea use case already approved: its specs are frozen
A refusal exits with code 2 and the message goes back to the model.
PreToolUse Skill(cache-architect) audit call exit 0 guard call exit 0 # a skill of another class replaces the phase # write_allow: docs/use-cases/UC-*/**, docs/use-cases/BACKLOG.md
PreToolUse Write(docs/use-cases/UC-005-record-kyc-verdict/22-cache.md) guard write exit 0 PostToolUse audit file exit 0
PreToolUse Write(docker-compose.yml) guard write exit 2 ❌ `cache-architect` is class `design` — docker-compose.yml is outside its territory. write_allow: docs/use-cases/UC-*/**, docs/use-cases/BACKLOG.md Put the content in the spec as a code block, or finish the run and invoke the skill that owns this path. If the path is legitimately this skill's, widen skill_classes.design in .claude/schemas/extensions.json — retrying will not help.
# UC-005-record-kyc-verdict-spec.md: status: approved PreToolUse Edit(docs/use-cases/UC-005-record-kyc-verdict/22-cache.md) guard write exit 2 ❌ UC-005-record-kyc-verdict is approved — its specs are immutable. Record the change in the new use case's "Impact on approved use cases" section, and the one-line entry in UC-005-record-kyc-verdict/CHANGELOG.md, which stays writable.
Where it sits on the rail
Each card is a step of /new-feature; the arrow carries the partial one step hands to the next. Dashed steps run only when the use case needs them.
/new-feature orchestrator · opus/new-feature-implement Who reads the partial nextAfter approval, /new-feature-implement has the executor build the code. The spec is consolidated by reference and wins where it and a partial disagree; the partial is read, by section, for detail.