22-cache.md,逐块说明
bank-app 还没有 22-cache.md。以下是 SKILL.md 所述该分文件包含的块。
## 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
它读什么、写什么、拒绝什么
skill 自己的契约,取自 SKILL.md,保留原文。
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/**.
来源:SKILL.md § Contract(nerviz e4cae27)。
guard 如何处理它
design 是这个 skill 的类。ArchHook 在 skill 被调用时开启一个阶段,并按该类的领地检查每次写入。右侧文字是 hook 自己的输出。
design 类的 write_allow
- ✓
docs/use-cases/UC-*/** - ✓
docs/use-cases/BACKLOG.md src/**:迁移和类归执行器docker-compose.yml:另一个类的文件已批准的用例:其 spec 已冻结
拒绝以退出码 2 结束,消息回到模型。
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.
它在轨道上的位置
每张卡片是 /new-feature 的一步;箭头带着一步交给下一步的分文件。虚线的步骤仅在用例需要时运行。
/new-feature orchestrator · opus/new-feature-implement 之后谁读这份分文件批准之后,/new-feature-implement 让执行器构建代码。spec 按引用整合,与分文件不一致时以 spec 为准;分文件按章节读取,用于细节。