contract-impact
The craft of a contract change: for each consumer of a shared interface, no change, needs a change, or breaks, with its file and line; the order of shipping; the migration path of a breaking change. Use when a plan or a diff changes a proto, GraphQL, OpenAPI or event schema.
- License 许可
- MIT
- 所属仓库
- lamtran8401/nook
- 最近更新
- 2026-10-27
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- contract-impact
- description
- The craft of a contract change: for each consumer of a shared interface, no change, needs a change, or breaks, with its file and line; the order of shipping; the migration path of a breaking change. Use when a plan or a diff changes a proto, GraphQL, OpenAPI or event schema.
- user-invocable
- false
03 SKILL.md 正文
Goal: before the approve and again before the accept, each area that a contract change reaches, and whether it still works. A contract is shared by areas that deploy apart, so an unchecked consumer is a failure in production that the tests of one area cannot see.
Where the change is
- In a plan: the Approach and the Impact of
plan.md, and the contract files that they name. - In a review: the diff of the branch in each area (
nook item diff <id>). Read the real change, not the plan. - A contract file is any shared interface: a proto, a GraphQL or OpenAPI schema, an event schema. Find them with a search in the folders of
nook area status.
Order
- List each change of the contract: added, changed, removed. Mark each one additive or breaking.
- Find each consumer in every area: the generated type, the package import, the field name.
nook item impact <id>lists the importers of each changed file. - For each consumer: no change, needs a change, or breaks, with the file and the line.
- The order: the contract, then the provider, then the consumers. Name which consumers can ship before the provider.
- A breaking change needs a migration path and the owner's explicit word: expand, move each consumer, then contract.
- In a review, each consumer has evidence: a test, a build against the new types, or a line read. A consumer with none is a gap.
Contract change: ListShipmentsRequest.status (optional string, added). Additive: yes.
Consumers:
- bff `src/shipments/list.ts:42`: provider. Needs a change: reads the new field.
- frontend `src/shipments/api.ts:11`: uses the generated request type. Works unchanged; needs a change to send it.
Search terms: ListShipmentsRequest, status, @shop/contracts.
Order: contract, bff, frontend. An old frontend with a new bff works.
Review evidence: bff `list.test.ts` covers the field; frontend built against the new types.
Gotchas
- Generated code hides consumers. Search for the generated type name and the package import, not only the field name.
- "None found" needs the search terms. Write what was searched.
- A changed default value is a breaking change even when the type is the same.
- A consumer outside the areas of
nook.ymlis outside the check. Say that it can exist. - Report the impact; the lead changes the plan. Nobody edits a contract to make a check pass.
04 同仓库更多 Skills
yolo
Run an item alone from its state to the owner's accept: the lead runs the phases, records each guess, passes the plan gate with proceed, and stops at a stop rule. Use when the owner types /yolo with an id, a prompt, or nothing.
write-walkthrough
Write walkthrough.md, the explanation of finished work: what works now in plain words, the changed files, where to start reading, the key code, the met criteria, how to try it, the risks. It is the source of the Walkthrough tab of the web app. Use after /qa, or for a question about the code.
wiki-tidy
Find what is wrong in the wiki: broken links, pages with no index line, lines too near the code, stale epic pages, topics with no source, two pages on one topic, adjectives with no example. Fix the mechanical part after one yes; list the rest. Use when the owner says tidy the wiki, or after many pages changed.
wiki-merge
Merge related wiki pages into one complete page: the pages of the features of one process or epic become one page with the flow from end to end. The old pages move to the archive after the owner's yes, and their links point at the new page. Use when the owner says merge these pages, or when wiki-tidy finds pages on one topic.
wiki-ask
Answer a question from the wiki: the index first, then only the pages whose line matches, an answer in a few lines with a link to each page. Use when the owner asks what the wiki says, or asks why or how about a known topic. Not to add a page: wiki-add.
wiki-add
Keep the lesson of a source in the wiki: a page in the shelf business/ or tech/ with its main points, a real example for each, the gotchas and the link of the source; written after the owner's yes. Use when the owner says add this to the wiki, keep this, or gives a PRD, a ticket, notes or an article to keep.