write-api-clientlisted
Install: claude install-skill AndreiBanu1/playwright-suite-skills
# Skill: write-api-client
Add the reusable call a spec is missing, at the right level.
## Preconditions
1. `.claude/test-profile.md` exists. If the profile records no client layer, calls in this repo are
made directly from specs — adding a layer is an architectural change, so ask first rather than
introducing one for a single spec.
2. You know the endpoint, its method, its inputs, and the shape it returns.
## Procedure
### 1. Decide the level before writing anything
Three levels, and picking the wrong one is the mistake this skill exists to prevent:
| Level | Choose it when |
| -------------------------- | ------------------------------------------------------------------------------ |
| **Existing client method** | The endpoint's domain already has a client. Add a method. This is the common case. |
| **New domain client** | The domain has no client *and* you can name at least two endpoints it will own. |
| **Shared transport** | The need is genuinely cross-cutting: a verb wrapper, a response envelope, a retry policy. Rare. |
One endpoint does not justify a new client. Put the method on the nearest existing client and split
later when a second endpoint arrives — a client with one method is indirection with no payoff, and
premature domain boundaries are harder to undo than a later split.
Never reach for the shared transport to solve a domain problem. Anything domain-s