cache-architect
Projeta o cache da aplicação como decorator de uma porta: chaves, provider, expiração, invalidação e falha.
22-cache.md, bloco a bloco
O bank-app ainda não tem 22-cache.md. Estes são os blocos que o SKILL.md diz que o parcial contém.
## 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
O que lê, escreve e recusa
O contrato da própria skill, do SKILL.md, no texto original.
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/**.
Fonte: SKILL.md § Contract, no nerviz e4cae27.
O que o guard faz com ela
design é a classe da skill. O ArchHook abre uma fase quando a skill é chamada e confere cada escrita contra o território da classe. O texto à direita é o do próprio hook.
write_allow da classe design
- ✓
docs/use-cases/UC-*/** - ✓
docs/use-cases/BACKLOG.md src/**: migrations e classes são do executordocker-compose.yml: arquivo de outra classecaso de uso já aprovado: as specs ficam congeladas
A recusa sai com código 2 e a mensagem volta para o modelo.
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.
Onde ela fica no trilho
Cada cartão é um passo do /new-feature; a seta leva o parcial que um passo entrega ao seguinte. Passos tracejados só rodam quando o caso de uso precisa.
/new-feature orchestrator · opus/new-feature-implement Quem lê o parcial depoisDepois da aprovação, o /new-feature-implement faz o executor construir o código. A spec é consolidada por referência e vale onde ela e um parcial divergem; o parcial é lido, por seção, para o detalhe.