---
name: restraint
description: Ships the smallest thing that does the job and deletes what nobody asked for.
title: restraint
canonical_url: https://skilld.dev/gh/raphaelsalaja/skills/restraint
last_updated: 2026-11-22T01:08:19.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [agents/openai.yaml](https://skilld.dev/api/skills-raw/raphaelsalaja/skills/restraint/agents/openai.yaml).
>
> If the user asked to install this Skill, run `npx skilld install raphaelsalaja/skills/restraint`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/restraint`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/raphaelsalaja/skills/restraint) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/restraint`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/restraint --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/restraint --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Restraint

This skill cuts a change down to the ask. It removes extra interface, options and code and treats "remove" as delete.

## Build the ask

An element, option or code path the user did not ask for is a finding unless the ask needs it to work. Work that has not shipped carries no backwards compatibility. A cut the user has not approved is a proposal, not an edit.

Label wording belongs to `copy`. Reusing an existing part, a library or a native element belongs to `reuse`. Which element a change may touch belongs to `scope`. Staging and committing belong to `ship`. Whether an animation should exist belongs to `motion`, and deleting one cleanly belongs here.

## Nothing beside the ask

Add no sections, badges, counts, captions, footers, icons inside buttons, sounds or decorative effects the user did not request. A count badge on every row is `restraint-no-unrequested-ui`.

## No feedback the screen already gives

Do not add a toast or a dialog for an action whose result is already on screen. That is `restraint-no-redundant-feedback`.

## The smallest build that works

Build at the size the ask needs: local state before a store, one app before a monorepo and a fixed value before a setting. A global store added for one panel's toggle is `restraint-smallest-build`. A preference nobody will change is `restraint-no-needless-setting`.

Write code inline until a third copy appears. A new helper, hook, wrapper or config object with one caller is `restraint-no-single-use-abstraction`. When `rg -w useRowFormatter` finds only the definition and one call, inline it.

## Only the lines the ask needs

A fix does not reformat, rename, reorder imports or upgrade packages around it. Compare `git diff --stat` with `git diff -w --stat`. A large gap between them is whitespace churn. Unasked churn is `restraint-no-drive-by-changes`.

## No files nobody asked for

Add no README, notes, summary, example page or script the task did not ask for. Delete scratch files made while working before you reply. A stray `NOTES.md` or `test-fix.js` is `restraint-no-unrequested-files`. `git status --short` marks every new file `??`, so read that list before replying. This covers only files you made. A file someone else changed stays, and `ship` asks before committing it.

## No defensive code before release

Keep no legacy branch and no compatibility shim in unshipped work. That is `restraint-no-legacy`. Do not add a fallback for a value that is always set. That is `restraint-no-fallbacks`.

Validate only where data enters: user input, the network and storage. A `try` with an empty `catch` around code that cannot throw goes too.

## Remove means delete

When the user says remove, delete the code and its styles, variables, routes and menu entries. "Deferred for review" is `restraint-delete-dont-defer`. A removed package that leaves its variables in `theme.css` is `restraint-remove-the-trail`.

Asked for a cleanup, list unused files, exports, styles, dependencies and leftover prototypes. Delete them once approved.

## A deleted animation takes its start and its waits

Deleting an animation also deletes its start state: `initial={{ opacity: 0 }}`, `animation-fill-mode: forwards` from `opacity: 0` and reveal classes waiting on an observer. A start state left behind keeps the element invisible, which is `restraint-remove-the-start-state`.

It also deletes what waited on it: `onAnimationEnd`, `transitionend`, exit-complete callbacks and timeouts sized to a duration. Focus moved in such a callback moves at once instead. A leftover `setTimeout(focusInput, 200)` is `restraint-remove-the-wait`.

## No debugging left behind

Remove every `console.log`, `debugger` and block of commented-out code you added before reporting done. `git diff -U0 | rg '^\+.*(console\.(log|debug)\(|\bdebugger\b)'` finds them. One left in the diff is `restraint-no-leftover-debug`.

## Comments state constraints or go

Delete comments that narrate the code. Keep one only when it states a constraint the code cannot show. A narrating comment is `restraint-no-narrating-comments`.

## The pair

Every check is a pair. The broken line sits beside the line that replaces it.

| Rule | Broken | Replacement |
| --- | --- | --- |
| `restraint-no-unrequested-ui` | A count badge on every row | No badge |
| `restraint-no-redundant-feedback` | A toast after a move the user can see | No toast |
| `restraint-smallest-build` | A global store added for one panel's open toggle | `useState` in the panel |
| `restraint-no-needless-setting` | A preference for a gap nobody changes | A fixed `--gap` |
| `restraint-no-single-use-abstraction` | A `useRowFormatter` hook with one caller | Its three lines inline |
| `restraint-no-drive-by-changes` | A one-line fix with 300 lines of reformatting | The one line |
| `restraint-no-unrequested-files` | `NOTES.md` and `test-fix.js` left in the tree | Neither created, or both deleted before the reply |
| `restraint-no-legacy` | A legacy branch kept "for safety" | Deleted |
| `restraint-no-fallbacks` | `value ?? defaultValue` for a value that is always set | `value` |
| `restraint-delete-dont-defer` | "Deferred for your review" | Deleted, or one question |
| `restraint-remove-the-trail` | A removed package's variables left in `theme.css` | The variables removed with it |
| `restraint-remove-the-start-state` | `animate` removed, `initial={{ opacity: 0 }}` left | Both removed, and `motion.div` back to `div` |
| `restraint-remove-the-wait` | `setTimeout(focusInput, 200)` left after the exit is gone | `focusInput()` when the panel closes |
| `restraint-no-leftover-debug` | `console.log("row", row)` in the diff | Removed |
| `restraint-no-narrating-comments` | `// Render the header` | No comment |

## Reporting

**Severity.** `HIGH` is a feature, setting or code path nobody asked for, or a "removed" item that still exists. It is also an element left invisible by a deleted animation's start state. `MEDIUM` is a fallback, a legacy branch, a leftover variable or a single-use abstraction. It is also a toast for a result already on screen, or a build bigger than the ask. So is unasked churn, a file nobody asked for or a callback or timeout still waiting on a deleted animation. `LOW` is a narrating comment or a leftover debug line.

**Format.** One finding per root cause:

```
file:line - [rule-id] what is wrong
```

Then a `Rule | Count | Severity` summary. `Block` when any `HIGH` remains, `Approve` otherwise. Never `Approve` a file you did not read. Mark every check you could not run as `Not verified`.
